Commit 17db6221b34514a1a31cd60992a208c26c2c0140
1 parent
73e5c2b9
过期的优化
Showing
1 changed file
with
24 additions
and
3 deletions
pages/index/index/index.js
... | ... | @@ -108,9 +108,30 @@ Page({ |
108 | 108 | |
109 | 109 | |
110 | 110 | var th = this; |
111 | - if(getApp().globalData.config2.is_overdue==1){ | |
112 | - await getApp().get_isbuy(); | |
113 | - this.setappdata(getApp().globalData.wxapp_buy_obj); | |
111 | + if(getApp().globalData.config2.is_overdue==1){ | |
112 | + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +stoid + "&type=5",{}).then(res=>{ | |
113 | + var o=res; | |
114 | + if (o.data.code == 0) { | |
115 | + var ob = { isout: 0, isbuy: 1 }; | |
116 | + var arr = o.data.data.pageData; | |
117 | + var isbuy = 0; | |
118 | + //----如果数组不为空---- | |
119 | + if (arr.length > 0) { | |
120 | + arr.forEach(function (val, ind) { | |
121 | + if (val.is_sy == 0 && val.type == 5) { | |
122 | + isbuy = 1; | |
123 | + var now = ut.gettimestamp(); | |
124 | + if (now > val.end_time) ob.isout = 1; | |
125 | + return false; | |
126 | + } | |
127 | + }) | |
128 | + } | |
129 | + ob.isbuy = isbuy; | |
130 | + th.setappdata(ob); | |
131 | + } | |
132 | + }) | |
133 | + | |
134 | + | |
114 | 135 | } |
115 | 136 | |
116 | 137 | ... | ... |