From 915424730f27445da2e8de13b62e77179cc1a15a Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期一, 18 八月 2025 17:07:39 +0800
Subject: [PATCH] fix: 关闭移动充值渠道,打开电信充值渠道
---
apps/taro/src/hooks/router.ts | 39 ++++++++++++++++++++++++---------------
1 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/apps/taro/src/hooks/router.ts b/apps/taro/src/hooks/router.ts
index 01639bb..a7400ce 100644
--- a/apps/taro/src/hooks/router.ts
+++ b/apps/taro/src/hooks/router.ts
@@ -14,7 +14,7 @@
const index = Object.values(TabBarPageRouterForCheck).findIndex((x) => option.url.includes(x));
console.log('index: ', index);
systemStore.setTabIndex(index);
- Taro.switchTab(option);
+ RouteHelper.switchTab(option);
};
return switchTab;
}
@@ -51,30 +51,39 @@
const appStore = useAppStore();
const { latestRoute } = storeToRefs(appStore);
const { blLifeRecharge } = useLifeRechargeContext();
+ const system = useSystemStore();
const router = Taro.useRouter();
const channelId = router.params?.channelId ?? '';
console.log('router: params', router, blLifeRecharge.accountModel.channlesNum);
+ Taro.useTabItemTap((item) => {
+ system.setTabIndex(item.index as any);
+ Taro.reLaunch({
+ url: pathAddExtraParam(item.pagePath, { channelId: blLifeRecharge.accountModel.channlesNum }),
+ success() {
+ appStore.setLatestRoute('');
+ },
+ });
+ });
+
Taro.useDidShow(() => {
- console.log('latestRoute.value: ', latestRoute.value);
const isTabbarPage = Object.values(TabBarPageRouterForCheck).some((x) =>
latestRoute.value.toLowerCase().includes(x.toLowerCase())
);
- const currentIsTabbarPage = Object.values(TabBarPageRouterForCheck).some((x) =>
- getRouterPath(router.path).toLowerCase().includes(x.toLowerCase())
- );
- console.log('currentIsTabbarPage: ', currentIsTabbarPage);
- if (currentIsTabbarPage && blLifeRecharge.accountModel.channlesNum && !channelId) {
- Taro.reLaunch({
- url: pathAddExtraParam(router.path, { channelId: blLifeRecharge.accountModel.channlesNum }),
- success() {
- appStore.setLatestRoute('');
- },
- });
- return;
- }
+ // const currentIsTabbarPage = Object.values(TabBarPageRouterForCheck).some((x) =>
+ // getRouterPath(router.path).toLowerCase().includes(x.toLowerCase())
+ // );
+ // if (currentIsTabbarPage && blLifeRecharge.accountModel.channlesNum && !channelId) {
+ // Taro.reLaunch({
+ // url: pathAddExtraParam(router.path, { channelId: blLifeRecharge.accountModel.channlesNum }),
+ // success() {
+ // appStore.setLatestRoute('');
+ // },
+ // });
+ // return;
+ // }
if (isTabbarPage && isInAlipay) {
Taro.reLaunch({
url: router.path,
--
Gitblit v1.9.1