From 348b3d80ac4e66eb916dbe9ea31d62e5e06ce2ef Mon Sep 17 00:00:00 2001 From: zoujing Date: Sun, 20 Sep 2026 16:27:38 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=B7=B3=E8=BD=AC=E6=9D=83?= =?UTF-8?q?=E7=9B=8A=E4=B8=AD=E5=BF=83=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constant/index.js | 6 ++++++ src/pages/index/index.vue | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/constant/index.js b/src/constant/index.js index 7a98896..fc13a5f 100644 --- a/src/constant/index.js +++ b/src/constant/index.js @@ -107,6 +107,12 @@ export const TABS = [ { key: "mine", label: "我的", icon: "user" }, ]; +/** + * 入口固定值:二维码里的 id 等于它时不打开商家详情,只切到权益 Tab。 + * 后端在 scene / query / 普通链接里传这个字符串即可(大小写不敏感)。 + */ +export const ENTRY_BENEFIT_ONLY = "benefits"; + /** 页面路径常量 */ export const ROUTES = { HOME: "/pages/index/index", diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index e77d2cf..930c8a5 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -7,7 +7,7 @@ */ import { nextTick, onMounted, ref } from "vue"; import { onLoad, onShow } from "@dcloudio/uni-app"; -import { TABS } from "@/constant"; +import { ENTRY_BENEFIT_ONLY, TABS } from "@/constant"; import { consumePendingMerchant, consumePendingTab, @@ -48,12 +48,14 @@ let shellReady = false; /** * 扫码进店:先切权益 Tab 再打开商家详情。 * 顺序不能反 —— 先切 Tab,「详情返回」才会落在权益页而不是主页。 + * 入口 id 为固定值 ENTRY_BENEFIT_ONLY 时只切 Tab,不再打开详情。 */ const runEntry = () => { if (!shellReady) return; const id = consumePendingMerchant(); if (!id) return; goTab("benefit"); + if (id.toLowerCase() === ENTRY_BENEFIT_ONLY) return; nextTick(() => setTimeout(() => goDetail(id), 0)); };