chore: 抢单端UI回退前备份当前完整工作区
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// pages/dashouzhongxin/dashouzhongxin.js
|
||||
import { createPage, request, isRoleStatusActive, isCenterPageActive, syncRoleStatuses, syncProfileFields, syncGroupFields, ensureRoleOnCenterPage, clearCacheAndEnterNormal, lockPrimaryRole, migrateLegacyCenterRole, enterLockedRole, parseSceneOptions } from '../../utils/base-page.js'
|
||||
import { resolveAvatarUrl } from '../../utils/avatar.js'
|
||||
import { resolveAvatarUrl, getDefaultAvatarUrl } from '../../utils/avatar.js'
|
||||
import { fetchMyZhidingOrders, processZhidingList, filterZhidingBannerList } from '../../utils/zhiding-order.js'
|
||||
import { openPrivateChat, buildInviterPeerId } from '../../utils/im-user.js'
|
||||
import { isStaffMode, getStaffContext } from '../../utils/staff-api.js'
|
||||
import { ensurePhoneAuth } from '../../utils/phone-auth.js'
|
||||
@@ -92,6 +93,20 @@ Page(createPage({
|
||||
scrollViewRefreshing: false,
|
||||
showRechargeBanners: false,
|
||||
showPindaoEntry: true,
|
||||
|
||||
myZhidingList: [],
|
||||
myZhidingCount: 0,
|
||||
showBadgeZone: false,
|
||||
},
|
||||
|
||||
_syncBadgeZoneFlags(patch = {}) {
|
||||
const d = { ...this.data, ...patch };
|
||||
const showBadgeZone = !!(
|
||||
(d.chenghaoList && d.chenghaoList.length > 0)
|
||||
|| (d.isGuanshi && d.guanshiChenghaoList && d.guanshiChenghaoList.length > 0)
|
||||
|| (d.identityTagList && d.identityTagList.length > 0)
|
||||
);
|
||||
return { ...patch, showBadgeZone };
|
||||
},
|
||||
|
||||
_buildImgUrls(ossImageUrl) {
|
||||
@@ -246,6 +261,7 @@ Page(createPage({
|
||||
if (!this.data.isDashou) this.setData({ isDashou: true });
|
||||
ensureRoleOnCenterPage(this, 'dashou');
|
||||
this.loadExamStatus();
|
||||
this.loadMyZhidingOrders();
|
||||
} else if (isRoleStatusActive(wx.getStorageSync('guanshistatus')) ||
|
||||
isRoleStatusActive(wx.getStorageSync('zuzhangstatus')) ||
|
||||
isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'))) {
|
||||
@@ -266,6 +282,7 @@ Page(createPage({
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
if (app.startImWhenReady) app.startImWhenReady();
|
||||
},
|
||||
|
||||
checkRoleStatuses() {
|
||||
@@ -283,6 +300,7 @@ Page(createPage({
|
||||
}, () => {
|
||||
this._updateTotalAssets();
|
||||
this._updatePendingAuth();
|
||||
this.setData(this._syncBadgeZoneFlags());
|
||||
});
|
||||
if (isDashou) {
|
||||
const uid = wx.getStorageSync('uid') || '';
|
||||
@@ -361,6 +379,7 @@ Page(createPage({
|
||||
this._fetchZuzhangInfoSilent(),
|
||||
this._fetchKaoheguanInfoSilent(),
|
||||
this.loadIdentityTags(),
|
||||
this.loadMyZhidingOrders(),
|
||||
]);
|
||||
this.checkRoleStatuses();
|
||||
const dashouOk = results[0].status === 'fulfilled';
|
||||
@@ -410,7 +429,7 @@ Page(createPage({
|
||||
...(d.zuzhang || []),
|
||||
...(d.guanshi || []),
|
||||
];
|
||||
this.setData({ identityTagList: merged });
|
||||
this.setData(this._syncBadgeZoneFlags({ identityTagList: merged }));
|
||||
}
|
||||
} catch (e) {
|
||||
/* 静默 */
|
||||
@@ -548,7 +567,7 @@ Page(createPage({
|
||||
data: { role: 'guanshi' },
|
||||
});
|
||||
if (res && res.data.code === 0 && res.data.data) {
|
||||
this.setData({ guanshiChenghaoList: res.data.data.chenghao_list || [] });
|
||||
this.setData(this._syncBadgeZoneFlags({ guanshiChenghaoList: res.data.data.chenghao_list || [] }));
|
||||
}
|
||||
} catch (e) {}
|
||||
},
|
||||
@@ -752,11 +771,11 @@ Page(createPage({
|
||||
});
|
||||
if (res && res.data.code === 0 && res.data.data) {
|
||||
const list = res.data.data.chenghao_list || [];
|
||||
this.setData({ chenghaoList: list });
|
||||
this.setData(this._syncBadgeZoneFlags({ chenghaoList: list }));
|
||||
const app = getApp();
|
||||
app.globalData.chenghaoList = list;
|
||||
} else {
|
||||
this.setData({ chenghaoList: [] });
|
||||
this.setData(this._syncBadgeZoneFlags({ chenghaoList: [] }));
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
@@ -1130,7 +1149,44 @@ Page(createPage({
|
||||
}
|
||||
wx.navigateTo({ url: '/pages/verify/verify?type=shangjia' });
|
||||
},
|
||||
goToReceiveOrder() { wx.navigateTo({ url: '/pages/accept-order/accept-order' }) },
|
||||
goToReceiveOrder() {
|
||||
wx.switchTab({ url: '/pages/accept-order/accept-order' });
|
||||
},
|
||||
|
||||
async loadMyZhidingOrders() {
|
||||
if (!isCenterPageActive(this, 'isDashou', 'dashoustatus')) return;
|
||||
try {
|
||||
const raw = await fetchMyZhidingOrders();
|
||||
const uid = this.data.uid || wx.getStorageSync('uid');
|
||||
const list = filterZhidingBannerList(processZhidingList(raw, getApp(), uid));
|
||||
this.setData({ myZhidingList: list, myZhidingCount: list.length });
|
||||
} catch (e) {
|
||||
console.warn('fighter loadMyZhidingOrders', e);
|
||||
}
|
||||
},
|
||||
|
||||
goToZhidingFromMine() {
|
||||
const app = getApp();
|
||||
const first = (this.data.myZhidingList || [])[0];
|
||||
if (first && first.dingdan_id) {
|
||||
app.globalData._acceptOrderHighlight = first.dingdan_id;
|
||||
}
|
||||
wx.switchTab({
|
||||
url: '/pages/accept-order/accept-order',
|
||||
fail: () => wx.showToast({ title: '跳转失败', icon: 'none' }),
|
||||
});
|
||||
},
|
||||
|
||||
openZhidingDetailFromMine(e) {
|
||||
const item = e.currentTarget.dataset.item;
|
||||
const id = item?.dingdan_id || e.currentTarget.dataset.id;
|
||||
if (!id) return;
|
||||
getApp().globalData._acceptOrderHighlight = id;
|
||||
wx.switchTab({
|
||||
url: '/pages/accept-order/accept-order',
|
||||
fail: () => wx.showToast({ title: '跳转失败', icon: 'none' }),
|
||||
});
|
||||
},
|
||||
goToDashouExam() { wx.navigateTo({ url: '/pages/dashou-exam/dashou-exam' }) },
|
||||
|
||||
async loadExamStatus() {
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
"global-notification": "/components/global-notification/global-notification",
|
||||
"chenghao-tag": "/components/chenghao-tag/chenghao-tag",
|
||||
"tab-bar": "/tab-bar/index",
|
||||
"pindao-modal": "/components/pindao-modal/pindao-modal"
|
||||
"pindao-modal": "/components/pindao-modal/pindao-modal",
|
||||
"kefu-float": "/components/kefu-float/kefu-float"
|
||||
},
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#f5f3ff",
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<tab-bar/>
|
||||
<kefu-float bottom="200rpx" />
|
||||
</view>
|
||||
</block>
|
||||
|
||||
@@ -70,8 +71,17 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 被指定订单(紧凑条,不占满屏) -->
|
||||
<view class="my-zhiding-mine-strip" wx:if="{{myZhidingCount > 0 && isDashou}}" bindtap="goToZhidingFromMine">
|
||||
<view class="my-zhiding-mine-strip-left">
|
||||
<text class="my-zhiding-mine-badge">指定</text>
|
||||
<text class="my-zhiding-mine-count">{{myZhidingCount}}单待接待</text>
|
||||
</view>
|
||||
<text class="my-zhiding-mine-arrow">去处理 ›</text>
|
||||
</view>
|
||||
|
||||
<!-- 称号 -->
|
||||
<view class="badge-zone" wx:if="{{chenghaoList.length > 0 || (isGuanshi && guanshiChenghaoList.length > 0) || identityTagList.length > 0}}">
|
||||
<view class="badge-zone" wx:if="{{showBadgeZone}}">
|
||||
<scroll-view scroll-x class="badge-scroll" wx:if="{{chenghaoList.length > 0}}">
|
||||
<view class="badge-tag-wrap" wx:for="{{chenghaoList}}" wx:key="index">
|
||||
<chenghao-tag mingcheng="{{item.mingcheng}}" texiaoJson="{{item.texiao_json}}"/>
|
||||
@@ -253,6 +263,7 @@
|
||||
<view class="content-bottom"></view>
|
||||
</scroll-view>
|
||||
<tab-bar/>
|
||||
<kefu-float bottom="200rpx" />
|
||||
</view>
|
||||
</block>
|
||||
|
||||
|
||||
@@ -652,3 +652,39 @@ page {
|
||||
@keyframes fighterSpin {
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.my-zhiding-mine-strip {
|
||||
margin: 0 24rpx 16rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background: linear-gradient(90deg, #ff6b00, #ff4500);
|
||||
border: 2rpx solid #ff3300;
|
||||
box-shadow: 0 8rpx 24rpx rgba(255, 69, 0, 0.4);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.my-zhiding-mine-strip:active { opacity: 0.92; }
|
||||
.my-zhiding-mine-strip-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
}
|
||||
.my-zhiding-mine-badge {
|
||||
font-size: 22rpx;
|
||||
font-weight: 800;
|
||||
color: #ff4500;
|
||||
background: #fff;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 999rpx;
|
||||
}
|
||||
.my-zhiding-mine-count {
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
.my-zhiding-mine-arrow {
|
||||
font-size: 26rpx;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user