From 7aee11322a2cbd804c15506bf095843b769f108a Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Wed, 22 Apr 2026 15:18:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home.ts | 4 +- src/api/tea-room.ts | 2 +- src/bundle/tea-room/room.vue | 14 +++++- src/main.ts | 4 +- src/pages/index/index.vue | 87 +++++++++++++++++++++++++++++++----- src/pages/my/my.vue | 4 +- 6 files changed, 97 insertions(+), 18 deletions(-) diff --git a/src/api/home.ts b/src/api/home.ts index 67f3de3..763ed90 100644 --- a/src/api/home.ts +++ b/src/api/home.ts @@ -21,8 +21,8 @@ export function getHomeCouponPopup() { /** * 首页领取88元优惠券 */ -export function claimIndexCoupon() { - return http.Post('/api/UserCoupon/shouyeCoupon', {}) +export function claimIndexCoupon(id: number) { + return http.Post('/api/UserCoupon/shouyeCoupon', {id}) } export function getWxacode() { diff --git a/src/api/tea-room.ts b/src/api/tea-room.ts index cc840fb..ec523bf 100644 --- a/src/api/tea-room.ts +++ b/src/api/tea-room.ts @@ -100,7 +100,7 @@ export interface IRoomDetailParams { } export function getTeaRoomDetail(data: IRoomDetailParams) { - return http.Post('/api/teaStore/teaStoreDetails', data, { + return http.Post('/api/teaStore/teaStoreDetails', data, { meta: { ignoreAuth: true } }) } diff --git a/src/bundle/tea-room/room.vue b/src/bundle/tea-room/room.vue index 37e69db..a47120e 100644 --- a/src/bundle/tea-room/room.vue +++ b/src/bundle/tea-room/room.vue @@ -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 diff --git a/src/main.ts b/src/main.ts index fc538d5..cbf2e0c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -10,7 +10,7 @@ import '@/style/index.scss' import 'virtual:uno.css' import { getNavBarHeight, getCapsuleOffset } from '@/utils/index' -import uma from './uma'; +// import uma from './uma'; export function createApp() { const app = createSSRApp(App) @@ -20,7 +20,7 @@ export function createApp() { app.use(store) app.use(routeInterceptor) app.use(requestInterceptor) - app.use(uma) + // app.use(uma) app.use(VueQueryPlugin) app.provide('OSS', 'https://chaz.oss-cn-shanghai.aliyuncs.com/fronted/') diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index e09b704..ba808ea 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -11,21 +11,49 @@