本地备份:商家UI调整前当前完整版本(未推送)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -49,14 +49,7 @@ Page(createPage({
|
||||
|
||||
onLoad() {
|
||||
wx.setNavigationBarTitle({ title: '我的接单' });
|
||||
this.loadShangpinLeixing().then(() => {
|
||||
if (this.data.xuanzhongLeixingId) {
|
||||
return this.loadCurrentStatusOrders(true);
|
||||
}
|
||||
}).finally(() => {
|
||||
this._ordersSessionReady = true;
|
||||
this._skipShowRefresh = true;
|
||||
});
|
||||
this.loadShangpinLeixing();
|
||||
this.registerNotificationComponent();
|
||||
},
|
||||
|
||||
@@ -66,15 +59,8 @@ Page(createPage({
|
||||
reconnectForRole('dashou');
|
||||
if (app.startImWhenReady) app.startImWhenReady();
|
||||
}
|
||||
if (this._skipShowRefresh) {
|
||||
this._skipShowRefresh = false;
|
||||
return;
|
||||
}
|
||||
if (this._ordersSessionReady && this.data.xuanzhongLeixingId && !this._silentRefreshRunning) {
|
||||
this._silentRefreshRunning = true;
|
||||
this.loadCurrentStatusOrders(true, true).finally(() => {
|
||||
this._silentRefreshRunning = false;
|
||||
});
|
||||
if (this.data.currentStatusKey && this.data.xuanzhongLeixingId) {
|
||||
this.loadCurrentStatusOrders(true);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -155,21 +141,17 @@ Page(createPage({
|
||||
},
|
||||
|
||||
// 加载订单(核心)
|
||||
async loadCurrentStatusOrders(isRefresh = false, silent = false) {
|
||||
async loadCurrentStatusOrders(isRefresh = false) {
|
||||
const key = this.data.currentStatusKey;
|
||||
const tabData = this.data.dsDingdanShuju[key];
|
||||
if (tabData.isLoading && !silent) return;
|
||||
if (silent && this._listRequesting) return;
|
||||
if (tabData.isLoading) return;
|
||||
const page = isRefresh ? 1 : tabData.page;
|
||||
|
||||
if (!silent) {
|
||||
this.setData({
|
||||
[`dsDingdanShuju.${key}.isLoading`]: true,
|
||||
isLoading: true,
|
||||
isLoadingMore: !isRefresh,
|
||||
});
|
||||
}
|
||||
this._listRequesting = true;
|
||||
this.setData({
|
||||
[`dsDingdanShuju.${key}.isLoading`]: true,
|
||||
isLoading: true,
|
||||
isLoadingMore: !isRefresh
|
||||
});
|
||||
|
||||
try {
|
||||
const apiUrl = this.data.orderType === 'peihu'
|
||||
@@ -226,20 +208,14 @@ Page(createPage({
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('加载订单失败', err);
|
||||
if (!silent) {
|
||||
wx.showToast({ title: err.message || '加载失败', icon: 'none' });
|
||||
}
|
||||
if (!silent) {
|
||||
this.setData({
|
||||
[`dsDingdanShuju.${key}.isLoading`]: false,
|
||||
isLoading: false,
|
||||
isLoadingMore: false,
|
||||
scrollViewRefreshing: false
|
||||
});
|
||||
this.refreshCurrentListView();
|
||||
}
|
||||
} finally {
|
||||
this._listRequesting = false;
|
||||
wx.showToast({ title: err.message || '加载失败', icon: 'none' });
|
||||
this.setData({
|
||||
[`dsDingdanShuju.${key}.isLoading`]: false,
|
||||
isLoading: false,
|
||||
isLoadingMore: false,
|
||||
scrollViewRefreshing: false
|
||||
});
|
||||
this.refreshCurrentListView();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"global-notification": "/components/global-notification/global-notification",
|
||||
"tab-bar": "/tab-bar/index"
|
||||
"global-notification": "/components/global-notification/global-notification"
|
||||
},
|
||||
"navigationBarTitleText": "我的接单",
|
||||
"enablePullDownRefresh": false,
|
||||
|
||||
Reference in New Issue
Block a user