按照生命周期,onLoad应该只放initial data

master
Ge Hao 8 years ago
parent ec5fcab5c8
commit 8a4dcaa4da
  1. 13
      pages/index/index.js

@ -57,9 +57,7 @@ Page({
}) })
}, },
fail: function() {}, fail: function() {},
complete: function() { complete: function() {}
that.getProductsFromServer()
}
}) })
wx.getStorage({ wx.getStorage({
@ -68,12 +66,15 @@ Page({
that.setData({'slides': res.data}) that.setData({'slides': res.data})
}, },
fail: function() {}, fail: function() {},
complete: function() { complete: function() {}
that.getSlidesFromServer()
}
}) })
}, },
onReady: function() {
this.getProductsFromServer()
this.getSlidesFromServer()
},
getSlidesFromServer: function() { getSlidesFromServer: function() {
var that = this var that = this
productUtil.getSlides(function(result) { productUtil.getSlides(function(result) {

Loading…
Cancel
Save