From cec1b477b48608f6e533dc1a8679305d526374a7 Mon Sep 17 00:00:00 2001 From: XingQue Date: Mon, 27 Jul 2026 05:03:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=A2=E6=9C=8D=E5=85=A5=E9=A9=BB/?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E6=8C=89=E8=BA=AB=E4=BB=BD=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=EF=BC=9B=E7=99=BB=E5=BD=95=E9=A1=B5=E5=8E=BB=E5=BA=95?= =?UTF-8?q?=E6=A0=8F=EF=BC=9B=E6=9C=AA=E7=99=BB=E5=BD=95=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E5=9B=9E=E7=99=BB=E5=BD=95=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- pages/fighter-orders/fighter-orders.js | 9 +++++++++ pages/fighter/fighter.js | 27 +++++++++++++++++++++----- pages/fighter/fighter.wxml | 2 -- pages/team-hall/team-hall.js | 9 +++++++++ 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/pages/fighter-orders/fighter-orders.js b/pages/fighter-orders/fighter-orders.js index 49a6279..fba3e26 100644 --- a/pages/fighter-orders/fighter-orders.js +++ b/pages/fighter-orders/fighter-orders.js @@ -3,6 +3,7 @@ import { createPage, request } from '../../utils/base-page.js'; import { reconnectForRole } from '../../utils/role-tab-bar.js'; import { getOrderStatusText } from '../../utils/api-helper.js'; import { attachAutoSettleFields } from '../../utils/auto-settle-display.js'; +import { isFighterOnly, canEnterAcceptOrder, getLoginPageUrl } from '../../utils/fighter-only.js'; Page(createPage({ data: { @@ -52,6 +53,10 @@ Page(createPage({ }, onLoad() { + if (isFighterOnly() && !canEnterAcceptOrder()) { + wx.reLaunch({ url: getLoginPageUrl() }); + return; + } wx.setNavigationBarTitle({ title: '我的接单' }); this.loadShangpinLeixing().then(() => { if (this.data.xuanzhongLeixingId) { @@ -65,6 +70,10 @@ Page(createPage({ }, onShow() { + if (isFighterOnly() && !canEnterAcceptOrder()) { + wx.reLaunch({ url: getLoginPageUrl() }); + return; + } this.registerNotificationComponent(); this.loadDealStat(); const app = getApp(); diff --git a/pages/fighter/fighter.js b/pages/fighter/fighter.js index 268eed6..55e8782 100644 --- a/pages/fighter/fighter.js +++ b/pages/fighter/fighter.js @@ -240,6 +240,18 @@ Page(createPage({ }, async onShow() { + this.checkRoleStatuses(); + const needLogin = isFighterOnly() && !isDashouCertified() + && !isRoleStatusActive(wx.getStorageSync('guanshistatus')) + && !isRoleStatusActive(wx.getStorageSync('zuzhangstatus')) + && !isRoleStatusActive(wx.getStorageSync('kaoheguanstatus')); + if (needLogin) { + // 登录页:强制隐藏底部导航,杜绝 Tab 露出来 + try { wx.hideTabBar({ animation: false }); } catch (e) {} + } else { + try { wx.showTabBar({ animation: false }); } catch (e) {} + } + if (!app.globalData._dashouPhoneChecked) { const phoneOk = await ensurePhoneAuth({ redirect: true, role: 'dashou' }); if (!phoneOk) return; @@ -376,12 +388,17 @@ Page(createPage({ push('goToKefu', '在线客服', img.iconKefu); push('goToComplaintCreate', '投诉反馈', img.iconComplaint || img.iconContact); push('goToComplaintList', '投诉记录', img.iconComplaint || img.iconRecord); - // 仅真实商家老板显示;客服工作台仅真实客服显示(互斥) - // 注意:后端曾错误把 shangjiastatus 恒置 1,前端这里再严格校验一次 + // 商家老板:仅有商家身份才显示进入商家端 if (isShangjiaCertified()) { push('onTapShangjiaAuth', '进入商家端', img.iconShangjia); - } else if (isStaffMode()) { - push('onTapStaffAuth', '商家客服工作台', img.iconKefu || img.iconShangjia); + } + // 商家客服:有身份进工作台,没有则显示入驻 + if (!isShangjiaCertified()) { + push( + 'onTapStaffAuth', + isStaffMode() ? '商家客服工作台' : '入驻商家客服', + img.iconKefu || img.iconShangjia + ); } if (d.showPindaoEntry) { push('openPindaoModal', '频道', img.iconPindao); @@ -1320,7 +1337,7 @@ Page(createPage({ if (isStaffMode()) { enterLockedRole('shangjia', getApp()); } else { - wx.showToast({ title: '未入驻商家客服', icon: 'none' }); + wx.navigateTo({ url: '/pages/staff-join/staff-join' }); } return; } diff --git a/pages/fighter/fighter.wxml b/pages/fighter/fighter.wxml index 0f0481f..f6d9afb 100644 --- a/pages/fighter/fighter.wxml +++ b/pages/fighter/fighter.wxml @@ -31,8 +31,6 @@ 清除缓存 - - diff --git a/pages/team-hall/team-hall.js b/pages/team-hall/team-hall.js index e9d7230..fcb2f9b 100644 --- a/pages/team-hall/team-hall.js +++ b/pages/team-hall/team-hall.js @@ -2,6 +2,7 @@ const app = getApp(); import request from '../../utils/request.js'; import { attachAutoSettleFields } from '../../utils/auto-settle-display.js'; +import { isFighterOnly, canEnterAcceptOrder, getLoginPageUrl } from '../../utils/fighter-only.js'; Page({ data: { @@ -27,11 +28,19 @@ Page({ }, onLoad() { + if (isFighterOnly() && !canEnterAcceptOrder()) { + wx.reLaunch({ url: getLoginPageUrl() }); + return; + } this.setData({ ossImageUrl: app.globalData.ossImageUrl || '' }); this.loadShangpinLeixing(true); }, onShow() { + if (isFighterOnly() && !canEnterAcceptOrder()) { + wx.reLaunch({ url: getLoginPageUrl() }); + return; + } if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().refresh && this.getTabBar().refresh(); }