fix: 客服入驻/工作台按身份展示;登录页去底栏;未登录强制回登录页
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e203223922
commit
cec1b477b4
4 files changed
+40
-7
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
<view class="unreg-link" bindtap="clearCache" wx:if="{{!isAutoRegistering}}"><text>清除缓存</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<tab-bar/>
|
||||
<tousu-float />
|
||||
</view>
|
||||
</block>
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user