// pages/tabber/news/index.js const app=getApp(); var id=''; Page({ /** * 页面的初始数据 */ data: { selectInfo: {}, nid:0, content:[], contentOne:[], contentTwo:[], contentThree:[], contentfour:[], one:'', two:'', three:'', four:'', five:'', six:'', inputValue:'', show:false, type:0, focus:false, class:'door_Collect_list', head_clas:[ {title:'上门揽收',data_class:'door_Collect_list',dat:'下单时间'}, {title:'上门送回',data_class:'door_stay_list',dat:'网点签收'}, {title:'已揽收',data_class:'collect_list',dat:'揽收时间'}, {title:'待送回',data_class:'stay_list',dat:'网点签收'} ], inpval:'', dat:'' }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { class Select { in = 1 getSelet(){ console.log(2); return 10 } } id=options&&options.id?options.id:wx.getStorageSync('nid') this.setData({ nid:id }) var b = new Select(); console.log(b.getSelet()); this.getData(this.data.class) }, onPullDownRefresh:function(){ this.getData(this.data.class) }, click(e){ var clsss=e.currentTarget.dataset.class; var dat="" var data=this.data.head_clas; for(var i=0; i=6){ if(that.data.type==1){ that.submit() }else{ that.submitValue() } } }, submitValue:function(){ var that=this if(that.data.inputValue=='') return wx.showToast({title: '存衣码不能为空',icon:'none'}) app.api.useApi(app.globalData.baseAppUrl + "api/admin/SaveCode", { logistic_code: that.data.inputValue, network_id:this.data.nid }, "post").then(function (res) { wx.hideLoading(); if (res.code== 200) { that.setData({ show:!that.data.show, inputValue:'', one:'', two:'', three:'', four:'', five:'', six:'' }) if(that.data.type==0) wx.navigateTo({ url: 'bind?id='+res.message.data.order_id+'&pointId='+id, }) }else{ wx.showToast({title: res.message.msg,icon:'none'}) } }).catch(function (err) { console.log(222); }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, submit:function(){ var that=this if(that.data.inputValue=='') return wx.showToast({title: '取衣码不能为空',icon:'none'}) app.api.useApi(app.globalData.baseAppUrl + "api/admin/TakeCode", { logistic_code: that.data.inputValue, network_id:this.data.nid }, "post").then(function (res) { wx.hideLoading(); if (res.code== 200) { that.setData({ show:!that.data.show, inputValue:'', one:'', two:'', three:'', four:'', five:'', six:'' }) wx.navigateTo({ url: 'bind?id='+res.message.data.order_id+'&logistic_code='+res.message.data.logistic_code, }) }else{ wx.showToast({title: res.message.msg,icon:'none'}) } }).catch(function (err) { console.log(222); }) }, })