diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 0b6baa6..946594e 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -112,10 +112,33 @@ Page({ need_money = 0, cur_g_num = 0; - if(getApp().globalData.config2.is_overdue==1){ - //调用底部导航 - getApp().get_isbuy(th.setappdata); - } + getApp().getConfig2(function(config2){ + if(config2 && config2.is_overdue==1){ + getApp().promiseGet("/store/storemoduleendtime/page?store_id=" +os.stoid + "&type=5",{}).then(res=>{ + var o=res; + if (o.data.code == 0) { + var ob = { isout: 0, isbuy: 1 }; + var arr = o.data.data.pageData; + var isbuy = 0; + //----如果数组不为空---- + if (arr.length > 0) { + arr.forEach(function (val, ind) { + if (val.is_sy == 0 && val.type == 5) { + isbuy = 1; + var now = ut.gettimestamp(); + if (now > val.end_time) ob.isout = 1; + return false; + } + }) + } + ob.isbuy = isbuy; + th.setappdata(ob); + } + }) + } + }) + + setTimeout(function () { if (getApp().globalData.user_id) getApp().requestCardNum(th); },500)