Przeglądaj źródła

fix loading data issue

tags/2.2.4
Stormeye.Wu 6 lat temu
rodzic
commit
6a74afc8aa
1 zmienionych plików z 7 dodań i 0 usunięć
  1. +7
    -0
      pages/index/index.js

+ 7
- 0
pages/index/index.js Wyświetl plik

@@ -26,6 +26,13 @@ Page({
onLoad: function (options) { onLoad: function (options) {
var that = this; var that = this;
if (app.globalData.token && app.globalData.token != null) { if (app.globalData.token && app.globalData.token != null) {
console.log("index ++ " + app.globalData.token);
if (that.couponChannelListCallback) {
that.couponChannelListCallback(res.data.token);
}
if (that.couponListCallback) {
that.couponListCallback(res.data.token);
}
} else { } else {
// 由于是网络请求,可能会在 Page.onLoad 之后才返回 // 由于是网络请求,可能会在 Page.onLoad 之后才返回
// 所以此处加入 callback 以防止这种情况 // 所以此处加入 callback 以防止这种情况


Ładowanie…
Anuluj
Zapisz