// pages/order/confirmOreder/confirmOreder.js const app=getApp(); Page({ /** * 页面的初始数据 */ data: { currentList: [{ tit: '塑封包膜', num: "30", id:1 }, { tit: '绒面鞋补色', num: "20", id:2 }, { tit: '防水处理', num: "20", id:3 }, { tit: '防水处理', num: "10", id:4 }], mode:true, checked:false, show1:false, show2:false, code:"" }, onLoad() { let currentList = this.data.currentList currentList.map(item => { item.active = false }) this.setData({ currentList }) }, changeClose1(e){ this.setData({ show1:!this.data.show1 }) }, changeClose2(e){ this.setData({ show2:!this.data.show2 }) }, onChange(event) { console.log(event); this.setData({ checked: event.detail, }); }, chios(e){ let {item} = e.currentTarget.dataset let currentList = this.data.currentList currentList.map((it,index)=>{ if (item.id == it.id) { it.active = !it.active } }) this.setData({ currentList }) }, changeMode(e){ let {mode} = e.currentTarget.dataset this.setData({ mode }) }, goto(){ wx.navigateTo({ url:'/pages/my/cashier/cashier' }) }, getPhoneNumber (e){ app.login(); console.log(e) var data={ 'mds':wx.getStorageSync('seisson_key'), 'encryptedData':e.detail.encryptedData, 'errMsg':e.detail.errMsg, 'iv':e.detail.iv, 'appid':wx.getAppBaseInfo().host.appId, 'token':wx.getStorageSync('token') } wx.cloud.callFunction({ name: 'getPhoneNumber', data:{ 'message':data }, success:res=>{ console.log(res) var par=res.result.original; if(par.code==200){ var phone=par.message.data.phone if(phone){ this.setData({ code: phone, }) } } }, fail:err=>{ console.log(err) } }) // console.log("fetch cloudfunction success", cloudResult.result) } })