var app = getApp(), os = app.globalData.setting; Component({ data:{ fontcolor:'#6e6d6b', fontcolor_sele:'#f23030', backgroundColor:'#ffffff', list:app.def_list, cartGoodsNum:0, active: 0, }, lifetimes: { attached: function() { var th=this; getApp().promiseGet("/api/weshop/storeDistribut/get/"+os.stoid,{}).then(rs=>{ var dis=rs.data.data; if( dis && dis.switch==0){ th.setData({is_no_distri:1}) } }) //购买的信息用全局缓存 if(getApp().globalData.dis_buy_obj){ var arr = getApp().globalData.dis_buy_obj; if (arr.length > 0) { var item=arr[0]; if(item.is_sy==0){ var now = Date.parse(new Date());now = now / 1000; if(item.end_time{ if(res.data.code==0){ var arr = res.data.data.pageData; getApp().globalData.dis_buy_obj=arr; if (arr.length > 0) { var item=arr[0]; if(item.is_sy==0){ var now = Date.parse(new Date());now = now / 1000; if(item.end_time { getApp().globalData.is_read = true; var e = res; if (e.data.code != -1 && e.data.data && e.data.data.data) { var itemList = e.data.data.data; getApp().globalData.storeFooter=itemList; itemList = JSON.parse(itemList) //-- 如果是有定义自定义导航的小程序链接 -- if (itemList[0].weappurl && itemList[0].weappurl != "") { getApp().globalData.custum_data = e.data.data; var custum_data = e.data.data; th.set_list(custum_data); } } }) } } }, }, methods: { //设置自定义页面的列表 set_list:function(data){ var itemList = data.data; itemList = JSON.parse(itemList); this.setData({ list:itemList, backgroundColor: data.bkcolor, fontcolor_sele: data.fontcolor_sele, fontcolor:data.fontcolor, is_custum:1 }) // console.log('abc=======<<<<<', this.data.list); }, nav_goto:function(e){ // const data = e.currentTarget.dataset // this.setData({ // active: data.index // }) // console.log('active***********<<<<<', this.data.active); var url=e.currentTarget.dataset.url; if(!url) return false; if(url[0]!='/') url='/'+url; //wx.switchTab({url:url,}) getApp().goto(url); }, // switchTab(e) { // const data = e.currentTarget.dataset // const url = data.path // wx.switchTab({url}) // this.setData({ // selected: data.index // }) // } } })