diff --git a/miniprogram/app.js b/miniprogram/app.js index 699897ed..092cb51f 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -11,12 +11,12 @@ const DEFAULT_APP_ID = 'wxb8bbb2b10dec74aa' const DEFAULT_MCH_ID = '1318592501' const DEFAULT_WITHDRAW_TMPL_ID = 'u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE' // 线上正式 API(真机/体验版/正式版)。永平仓库默认正式域;部署前核对见 .cursor/skills/security-server-ops/SKILL.md -// const API_BASE_URL_PROD = 'https://soulapi.quwanzhi.com' -const API_BASE_URL_PROD = 'http://127.0.0.1:9100' +const API_BASE_URL_PROD = 'https://soulapi.quwanzhi.com' +// const API_BASE_URL_PROD = 'http://127.0.0.1:9100' // 开发者工具默认与正式一致;若需连测服可改为 https://souldev.quwanzhi.com 或本机 http://127.0.0.1:9100 -// const API_BASE_URL_DEV = 'https://soulapi.quwanzhi.com' -const API_BASE_URL_DEV ='http://127.0.0.1:9100' +const API_BASE_URL_DEV = 'https://soulapi.quwanzhi.com' +// const API_BASE_URL_DEV ='http://127.0.0.1:9100' // 运行时自动判断:非开发工具(真机/体验版/正式版)强制用 PROD,避免 localhost 打进上传包导致白屏 const _isDevTools = (typeof __wxConfig !== 'undefined' && __wxConfig.platform === 'devtools') diff --git a/miniprogram/custom-tab-bar/index.js b/miniprogram/custom-tab-bar/index.js index 9c07f276..3212b5ec 100644 --- a/miniprogram/custom-tab-bar/index.js +++ b/miniprogram/custom-tab-bar/index.js @@ -1,6 +1,6 @@ /** * Soul创业实验 - 自定义 TabBar - * 支持:首页 / 目录 / [找伙伴] / [动态,审核模式隐藏] / 我的 + * 支持:首页 / 目录 / [找伙伴,审核模式隐藏] / [动态,审核模式隐藏] / 我的 */ const app = getApp() @@ -73,7 +73,7 @@ Component({ isSpecial: false, }, ] - if (matchEnabled) { + if (matchEnabled && !audit) { tabs.push({ pagePath: '/pages/match/match', text: ma, @@ -131,7 +131,8 @@ Component({ if (auditMode) { const pages = getCurrentPages() const currentPage = pages[pages.length - 1] - if (currentPage && currentPage.route === 'pages/super-moments/super-moments') { + const route = currentPage && currentPage.route + if (route === 'pages/super-moments/super-moments' || route === 'pages/match/match') { wx.switchTab({ url: '/pages/index/index' }) } } @@ -147,7 +148,8 @@ Component({ if (auditMode) { const pages = getCurrentPages() const currentPage = pages[pages.length - 1] - if (currentPage && currentPage.route === 'pages/super-moments/super-moments') { + const route = currentPage && currentPage.route + if (route === 'pages/super-moments/super-moments' || route === 'pages/match/match') { wx.switchTab({ url: '/pages/index/index' }) } } diff --git a/miniprogram/pages/match/match.js b/miniprogram/pages/match/match.js index b1274930..6fd11e62 100644 --- a/miniprogram/pages/match/match.js +++ b/miniprogram/pages/match/match.js @@ -94,9 +94,16 @@ Page({ async onLoad() { wx.showShareMenu({ withShareTimeline: true }) + try { + await app.getAuditMode() + } catch (_) {} + if (app.globalData.auditMode) { + wx.switchTab({ url: '/pages/index/index' }) + return + } this.setData({ statusBarHeight: app.globalData.statusBarHeight || 44, - auditMode: app.globalData.auditMode || false + auditMode: false, }) await this.loadMatchConfig() this.loadStoredContact() @@ -104,13 +111,28 @@ Page({ await this.refreshMatchQuotaFromServer() }, - onShow() { + async onShow() { + try { + await app.getAuditMode() + } catch (_) {} + if (app.globalData.auditMode) { + wx.switchTab({ url: '/pages/index/index' }) + return + } if (typeof this.getTabBar === 'function' && this.getTabBar()) { const tabBar = this.getTabBar() if (tabBar.updateSelected) { tabBar.updateSelected() } else { - tabBar.setData({ selected: 2 }) + const tabList = tabBar.data.tabList || [] + let sel = 0 + for (let i = 0; i < tabList.length; i++) { + if (tabList[i].pagePath.replace(/^\//, '') === 'pages/match/match') { + sel = i + break + } + } + tabBar.setData({ selected: sel }) } } this.initUserStatus() diff --git a/miniprogram/pages/my/my.js b/miniprogram/pages/my/my.js index e31a87d8..354462d1 100644 --- a/miniprogram/pages/my/my.js +++ b/miniprogram/pages/my/my.js @@ -131,8 +131,15 @@ Page({ if (tabBar.updateSelected) { tabBar.updateSelected() } else { - const selected = tabBar.data.matchEnabled ? 3 : 2 - tabBar.setData({ selected }) + const tabList = tabBar.data.tabList || [] + let sel = 0 + for (let i = 0; i < tabList.length; i++) { + if (tabList[i].pagePath.replace(/^\//, '') === 'pages/my/my') { + sel = i + break + } + } + tabBar.setData({ selected: sel }) } } this.initUserStatus()