From 1f4d91995003653c58975a0269d539b0416dfdb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E9=A3=9E=E6=B4=8B?= <15778543+xufeiyang6017@user.noreply.gitee.com> Date: Fri, 30 Jan 2026 10:24:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BC=B0=E4=BB=B7=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=85=A5=E9=A9=BB=E6=A3=80=E6=9F=A5=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E5=85=A5=E9=A9=BB=E7=94=A8=E6=88=B7=E7=82=B9=E5=87=BB=E6=97=B6?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=B9=B6=E8=B7=B3=E8=BD=AC=E5=88=B0=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom-tab-bar/index.js | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js index 353428f..5d85d1a 100644 --- a/custom-tab-bar/index.js +++ b/custom-tab-bar/index.js @@ -42,6 +42,33 @@ Component({ console.log('修正后路径:', url) + // 当点击"估"字时,判断partnerstatus是否为approved + if (key === 'evaluate') { + const app = getApp() + const userInfo = app.globalData.userInfo || wx.getStorageSync('userInfo') || {} + const partnerstatus = userInfo.partnerstatus + + console.log('用户partnerstatus:', partnerstatus) + + // 如果partnerstatus不是approved,提示用户并跳转到入驻页面 + if (partnerstatus !== 'approved') { + wx.showToast({ + title: '该功能需要入驻之后才能使用', + icon: 'none', + duration: 5000 + }) + + // 5秒后自动跳转到入驻页面 + setTimeout(() => { + wx.navigateTo({ + url: '/pages/settlement/index' + }) + }, 5000) + + return + } + } + // 更新全局数据 - 先更新全局状态,确保状态一致性 const app = getApp() if (app && app.globalData) { @@ -179,6 +206,32 @@ Component({ // 跳转到估价页面 goToEvaluatePage() { console.log('点击了估价按钮,跳转到evaluate2/one页面') + + // 判断partnerstatus是否为approved + const app = getApp() + const userInfo = app.globalData.userInfo || wx.getStorageSync('userInfo') || {} + const partnerstatus = userInfo.partnerstatus + + console.log('用户partnerstatus:', partnerstatus) + + // 如果partnerstatus不是approved,提示用户并跳转到入驻页面 + if (partnerstatus !== 'approved') { + wx.showToast({ + title: '该功能需要入驻之后才能使用', + icon: 'none', + duration: 5000 + }) + + // 5秒后自动跳转到入驻页面 + setTimeout(() => { + wx.navigateTo({ + url: '/pages/settlement/index' + }) + }, 5000) + + return + } + wx.switchTab({ url: '/pages/evaluate2/one', success: (res) => {