123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- // 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)
-
- }
- })
|