chore: 抢单端UI回退前备份当前完整工作区
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -5,8 +5,6 @@ import { reconnectForRole } from '../../utils/role-tab-bar.js';
|
||||
import { getOrderStatusText } from '../../utils/api-helper.js';
|
||||
import { STAFF_API, isStaffMode, refreshStaffContext, syncStaffUi } from '../../utils/staff-api.js';
|
||||
import { ensurePhoneAuth } from '../../utils/phone-auth.js';
|
||||
import { normalizeOrderTags } from '../../utils/order-tags.js';
|
||||
import { ICON_KEYS, resolveMiniappIcon, MERCHANT_GOLD_BANNER_FALLBACK } from '../../utils/miniapp-icons.js';
|
||||
import { fetchMerchantOrderStats } from '../../utils/merchant-order-stats.js';
|
||||
|
||||
const EMPTY_TAB = { list: [], page: 1, hasMore: true, isLoading: false };
|
||||
@@ -14,6 +12,8 @@ const EMPTY_TAB = { list: [], page: 1, hasMore: true, isLoading: false };
|
||||
function buildEmptyStatusData() {
|
||||
return {
|
||||
all: { ...EMPTY_TAB },
|
||||
daifuwu: { ...EMPTY_TAB },
|
||||
zhidingzhong: { ...EMPTY_TAB },
|
||||
jinxingzhong: { ...EMPTY_TAB },
|
||||
tuikuanzhong: { ...EMPTY_TAB },
|
||||
yituikuan: { ...EMPTY_TAB },
|
||||
@@ -23,6 +23,17 @@ function buildEmptyStatusData() {
|
||||
};
|
||||
}
|
||||
|
||||
const STATUS_TAG_STYLE = {
|
||||
1: { color: '#E65100', bg: '#FFF3E0' },
|
||||
2: { color: '#1565C0', bg: '#E3F2FD' },
|
||||
3: { color: '#2E7D32', bg: '#E8F5E9' },
|
||||
4: { color: '#EF6C00', bg: '#FFF8E1' },
|
||||
5: { color: '#616161', bg: '#F5F5F5' },
|
||||
6: { color: '#C62828', bg: '#FFEBEE' },
|
||||
7: { color: '#BF360C', bg: '#FFE0B2' },
|
||||
8: { color: '#D84315', bg: '#FBE9E7' },
|
||||
};
|
||||
|
||||
Page(createPage({
|
||||
data: {
|
||||
shangpinleixing: [],
|
||||
@@ -35,6 +46,8 @@ Page(createPage({
|
||||
|
||||
statusList: [
|
||||
{ name: '全部', key: 'all', zhuangtaiList: [1, 2, 3, 4, 5, 6, 7, 8], color: '#333333' },
|
||||
{ name: '待服务', key: 'daifuwu', zhuangtaiList: [1], color: '#E65100' },
|
||||
{ name: '指定中', key: 'zhidingzhong', zhuangtaiList: [7], color: '#BF360C' },
|
||||
{ name: '进行中', key: 'jinxingzhong', zhuangtaiList: [2], color: '#2196F3' },
|
||||
{ name: '退款中', key: 'tuikuanzhong', zhuangtaiList: [4], color: '#FF9800' },
|
||||
{ name: '已退款', key: 'yituikuan', zhuangtaiList: [5], color: '#9E9E9E' },
|
||||
@@ -56,7 +69,6 @@ Page(createPage({
|
||||
ossImageUrl: app.globalData.ossImageUrl || '',
|
||||
|
||||
pendingCount: 0,
|
||||
goldBannerUrl: '',
|
||||
staffList: [],
|
||||
selectedStaffMemberId: '',
|
||||
selectedStaffLabel: '全部客服',
|
||||
@@ -77,9 +89,6 @@ Page(createPage({
|
||||
this._listInitialized = false;
|
||||
this._savedScrollTop = 0;
|
||||
this._skipShowRefresh = false;
|
||||
this.setData({
|
||||
goldBannerUrl: resolveMiniappIcon(app, ICON_KEYS.MERCHANT_GOLD_BANNER, MERCHANT_GOLD_BANNER_FALLBACK),
|
||||
});
|
||||
wx.setNavigationBarTitle({ title: isStaffMode() ? '客服派单' : '我的派单' });
|
||||
syncStaffUi(this);
|
||||
if (isStaffMode()) {
|
||||
@@ -476,33 +485,15 @@ Page(createPage({
|
||||
},
|
||||
|
||||
processOrderItem(item, zhuangtaiColor) {
|
||||
const oss = this.data.ossImageUrl || '';
|
||||
const leixing = this.data.shangpinleixing.find((l) => l.id === item.leixing_id);
|
||||
const leixingIconUrl = leixing ? leixing.full_tupian_url : '/images/default-type.png';
|
||||
|
||||
let sjAvatarFull = '/images/default-avatar.png';
|
||||
if (item.sj_avatar) {
|
||||
sjAvatarFull = item.sj_avatar.startsWith('http') ? item.sj_avatar : oss + item.sj_avatar;
|
||||
}
|
||||
|
||||
let zhidingAvatarFull = '';
|
||||
if (item.zhiding_avatar) {
|
||||
zhidingAvatarFull = item.zhiding_avatar.startsWith('http') ? item.zhiding_avatar : oss + item.zhiding_avatar;
|
||||
}
|
||||
|
||||
const tags = normalizeOrderTags(item);
|
||||
const st = Number(item.zhuangtai);
|
||||
const tagStyle = STATUS_TAG_STYLE[st] || { color: zhuangtaiColor || '#333', bg: '#F5F5F5' };
|
||||
|
||||
return {
|
||||
...item,
|
||||
zhuangtaiZh: getOrderStatusText(item.zhuangtai),
|
||||
zhuangtaiColor: zhuangtaiColor || '#333333',
|
||||
leixing_icon_url: leixingIconUrl,
|
||||
sj_avatar_full: sjAvatarFull,
|
||||
zhiding_avatar_full: zhidingAvatarFull,
|
||||
isZhiding: item.zhuangtai === 7,
|
||||
zhuangtaiZh: getOrderStatusText(st),
|
||||
zhuangtaiColor: tagStyle.color,
|
||||
zhuangtaiBg: tagStyle.bg,
|
||||
creat_time: item.creat_time || item.create_time || '',
|
||||
...tags,
|
||||
shangjia_youzhi: !!item.shangjia_youzhi,
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user