From 9a272c92d80fb704969d6d6b6ff78c3ac27c5449 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=98=E9=A3=8E?= Date: Mon, 11 May 2026 17:23:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=80=A7=EF=BC=9A=E6=9B=B4=E6=96=B0AP?= =?UTF-8?q?I=E5=9F=BA=E7=A1=80URL=E5=B9=B6=E5=A2=9E=E5=BC=BA=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=AF=BC=E8=88=AA=20-=20=E6=9B=B4=E6=94=B9=E4=BA=86ap?= =?UTF-8?q?p.js=E4=B8=AD=E7=9A=84API=E5=9F=BA=E7=A1=80URL=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E6=8C=87=E5=90=91=E7=94=A8=E4=BA=8E=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E7=9A=84=E7=94=9F=E4=BA=A7=E6=9C=8D=E5=8A=A1=E5=99=A8=E3=80=82?= =?UTF-8?q?=20-=20=E6=94=B9=E8=BF=9B=E4=BA=86=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E6=A0=8F=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=AE=A1=E8=AE=A1=E6=A8=A1=E5=BC=8F=E6=9C=89?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=9C=B0=E6=98=BE=E7=A4=BA=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E3=80=82=20-=20=E5=A2=9E=E5=BC=BA=E4=BA=86=E6=AF=94=E8=B5=9B?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BB=A5=E5=A4=84?= =?UTF-8?q?=E7=90=86=E5=AE=A1=E6=A0=B8=E6=A8=A1=E5=BC=8F=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E5=B9=B6=E5=8A=A8=E6=80=81=E6=9B=B4=E6=96=B0=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E5=8D=A1=E9=80=89=E6=8B=A9=E3=80=82=20-=20=E5=AF=B9=E6=88=91?= =?UTF-8?q?=E7=9A=84=E9=A1=B5=E9=9D=A2=E8=BF=9B=E8=A1=8C=E4=BA=86=E9=87=8D?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E4=BB=A5=E7=A1=AE=E4=BF=9D=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E9=A1=B5=E9=9D=A2=E6=AD=A3=E7=A1=AE=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=A0=87=E7=AD=BE=E3=80=82=20=E6=AD=A4=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A8=E5=9C=A8=E7=A1=AE=E4=BF=9DAPI?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=AD=A3=E5=B8=B8=EF=BC=8C=E5=B9=B6=E6=94=B9?= =?UTF-8?q?=E5=96=84=E7=94=A8=E6=88=B7=E5=9C=A8=E5=BA=94=E7=94=A8=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E4=B8=AD=E7=9A=84=E5=AF=BC=E8=88=AA=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniprogram/app.js | 8 ++++---- miniprogram/custom-tab-bar/index.js | 10 ++++++---- miniprogram/pages/match/match.js | 28 +++++++++++++++++++++++++--- miniprogram/pages/my/my.js | 11 +++++++++-- 4 files changed, 44 insertions(+), 13 deletions(-) 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()