完善功能

This commit is contained in:
wangxiaowei
2026-04-22 15:18:37 +08:00
parent f30cd438e0
commit 7aee11322a
6 changed files with 97 additions and 18 deletions

View File

@ -161,7 +161,7 @@
import type { ITeaRoomDetailResult } from '@/api/types/tea-room'
import type {IUserInfoVo } from '@/api/types/login'
import { useUserStore } from '@/store'
import { router, previewImage } from '@/utils/tools'
import { router, previewImage, strToParams } from '@/utils/tools'
import { StoreType } from '@/utils/tea'
import DouYinExcharge from '@/bundle/components/DouYinExcharge.vue'
@ -206,6 +206,13 @@
onLoad((args) => {
console.log("🚀 ~ args:", args)
// 处理小程序码扫码进入时的 scene 参数
if (!args.id && args.scene) {
const scene = decodeURIComponent(args.scene)
const params = strToParams(scene)
Object.assign(args, params)
}
if (args.id) {
teaRoomId.value = Number(args.id)
storeType.value = Number(args.type) || StoreType.Direct
@ -297,6 +304,11 @@
longitude: uni.getStorageSync('longitude') || import.meta.env.VITE_DEFAULT_LONGITUDE,
user_id: userInfo.value.id || 0
})
if (res && res.status == 0) {
router.switchTab('/pages/index/index')
return
}
teaRoom.value = res.details
storeType.value = teaRoom.value.operation_type