Commit 8ce5ee6d8fc7d7f65c4e0c60e5683021168f22a0
1 parent
7df29860
user index的报错
Showing
1 changed file
with
27 additions
and
4 deletions
pages/user/index/index.js
@@ -112,10 +112,33 @@ Page({ | @@ -112,10 +112,33 @@ Page({ | ||
112 | need_money = 0, | 112 | need_money = 0, |
113 | cur_g_num = 0; | 113 | cur_g_num = 0; |
114 | 114 | ||
115 | - if(getApp().globalData.config2.is_overdue==1){ | ||
116 | - //调用底部导航 | ||
117 | - getApp().get_isbuy(th.setappdata); | ||
118 | - } | 115 | + getApp().getConfig2(function(config2){ |
116 | + if(config2 && config2.is_overdue==1){ | ||
117 | + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{ | ||
118 | + var o=res; | ||
119 | + if (o.data.code == 0) { | ||
120 | + var ob = { isout: 0, isbuy: 1 }; | ||
121 | + var arr = o.data.data.pageData; | ||
122 | + var isbuy = 0; | ||
123 | + //----如果数组不为空---- | ||
124 | + if (arr.length > 0) { | ||
125 | + arr.forEach(function (val, ind) { | ||
126 | + if (val.is_sy == 0 && val.type == 5) { | ||
127 | + isbuy = 1; | ||
128 | + var now = ut.gettimestamp(); | ||
129 | + if (now > val.end_time) ob.isout = 1; | ||
130 | + return false; | ||
131 | + } | ||
132 | + }) | ||
133 | + } | ||
134 | + ob.isbuy = isbuy; | ||
135 | + th.setappdata(ob); | ||
136 | + } | ||
137 | + }) | ||
138 | + } | ||
139 | + }) | ||
140 | + | ||
141 | + | ||
119 | setTimeout(function () { | 142 | setTimeout(function () { |
120 | if (getApp().globalData.user_id) getApp().requestCardNum(th); | 143 | if (getApp().globalData.user_id) getApp().requestCardNum(th); |
121 | },500) | 144 | },500) |