diff --git a/pages/mall/fragment/index.js b/pages/mall/fragment/index.js index bc70083..7817bce 100644 --- a/pages/mall/fragment/index.js +++ b/pages/mall/fragment/index.js @@ -28,7 +28,8 @@ Component({ momentList: [], tabList: [], tabIndex: 0, - requesting: true, + loading: true, + requesting: false, form : {sortBy: 0, pageNum: 1, pageSize: 10, categoryId: '', cityId: ''}, orderList: [], popover: false, @@ -66,7 +67,13 @@ Component({ } this.data.form.categoryId = typeList[0].categoryId this.setData({ tabList }) + if(!this.data.orderList.length){ + this.fetchAgentList() + } }) + if(app.nowCity && app.nowCity.cityCode){ + this.setData({ cityName: app.nowCity.cityName, ['form.cityId']: app.nowCity.cityCode }) + } } this.initLogin() this.data.firstShow = true @@ -176,12 +183,12 @@ Component({ this.setData({ requesting: true, orderList: [] }) getMomentList(this.data.form).then(result => { if (result.data.records.length) { - this.setData({ orderList: result.data.records, requesting: false }) + this.setData({ orderList: result.data.records, requesting: false, loading: false }) } else { - this.setData({ requesting: false }) + this.setData({ requesting: false, loading: false }) } }).catch(err => { - this.setData({ requesting: false }) + this.setData({ requesting: false, loading: false }) }) } } diff --git a/pages/mall/fragment/index.wxml b/pages/mall/fragment/index.wxml index 16e93f2..06ea7df 100644 --- a/pages/mall/fragment/index.wxml +++ b/pages/mall/fragment/index.wxml @@ -82,7 +82,7 @@ - +