gang.huang vor 4 Jahren
Ursprung
Commit
933cf9a719
1 geänderte Dateien mit 11 neuen und 3 gelöschten Zeilen
  1. 11 3
      pages/postage/postage.js

+ 11 - 3
pages/postage/postage.js

@@ -116,9 +116,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    this.requestGoods();
-    let msgs = app.genMsgs();
-    this.setData({ msgList: msgs });
+   
   },
 
   requestGoods() {
@@ -129,12 +127,19 @@ Page({
     this.setData({
       fromSource: app.globalData.fromSource,
     });
+    wx.showLoading({
+      title: '数据加载中',
+      mask:true
+    })
     getReq(app, {
       act: 'index',
       op: 'card_goods',
       page_type: 'oil',
       from: fromSource
     }, (res) => {
+      setTimeout(()=>{
+        wx.hideLoading();
+      },200)
       wx.stopPullDownRefresh()
       if (res.code == 200) {
         if (res.datas && res.datas.goods) {
@@ -259,6 +264,9 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    this.requestGoods();
+    let msgs = app.genMsgs();
+    this.setData({ msgList: msgs });
     const record = app.globalData.record || {}
     const { card_no = '', card_type = '' } = record
     app.setFromSource(this.data.fromSource)