feat:跳转权益中心处理

This commit is contained in:
zoujing committed 2026-09-20 16:27:38 +08:00
1 parent a4c29569bf
commit 348b3d80ac
2 files changed
+9 -1

No files matched your search

+6
View File
@@ -107,6 +107,12 @@ export const TABS = [
{ key: "mine", label: "我的", icon: "user" }, { key: "mine", label: "我的", icon: "user" },
]; ];
/**
* 入口固定值:二维码里的 id 等于它时不打开商家详情,只切到权益 Tab。
* 后端在 scene / query / 普通链接里传这个字符串即可(大小写不敏感)。
*/
export const ENTRY_BENEFIT_ONLY = "benefits";
/** 页面路径常量 */ /** 页面路径常量 */
export const ROUTES = { export const ROUTES = {
HOME: "/pages/index/index", HOME: "/pages/index/index",
+3 -1
View File
@@ -7,7 +7,7 @@
*/ */
import { nextTick, onMounted, ref } from "vue"; import { nextTick, onMounted, ref } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app"; import { onLoad, onShow } from "@dcloudio/uni-app";
import { TABS } from "@/constant"; import { ENTRY_BENEFIT_ONLY, TABS } from "@/constant";
import { import {
consumePendingMerchant, consumePendingMerchant,
consumePendingTab, consumePendingTab,
@@ -48,12 +48,14 @@ let shellReady = false;
/** /**
* 扫码进店:先切权益 Tab 再打开商家详情。 * 扫码进店:先切权益 Tab 再打开商家详情。
* 顺序不能反 —— 先切 Tab,「详情返回」才会落在权益页而不是主页。 * 顺序不能反 —— 先切 Tab,「详情返回」才会落在权益页而不是主页。
* 入口 id 为固定值 ENTRY_BENEFIT_ONLY 时只切 Tab,不再打开详情。
*/ */
const runEntry = () => { const runEntry = () => {
if (!shellReady) return; if (!shellReady) return;
const id = consumePendingMerchant(); const id = consumePendingMerchant();
if (!id) return; if (!id) return;
goTab("benefit"); goTab("benefit");
if (id.toLowerCase() === ENTRY_BENEFIT_ONLY) return;
nextTick(() => setTimeout(() => goDetail(id), 0)); nextTick(() => setTimeout(() => goDetail(id), 0));
}; };