| | |
| | | let $api = require('../../../utils/ajaxFn.js') |
| | | let validator = require('../../../utils/validator.js') |
| | | Page({ |
| | | data: { |
| | | userStyle: {}, |
| | |
| | | }, |
| | | getTaril(){ |
| | | $api.ajax( |
| | | '/sib/xcx/order/dmfTrial', |
| | | '/zic/order/dmfTrial', |
| | | 'POST', |
| | | res=>{ |
| | | this.setData({ |
| | |
| | | this.setData({ |
| | | 'info.payType': 2 |
| | | }) |
| | | for (let key in this.data.info) { |
| | | if (!this.data.info[key]) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请完整输入信息', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | // for (let key in this.data.info) { |
| | | // if (!this.data.info[key]) { |
| | | // my.showToast({ |
| | | // type: 'none', |
| | | // content: '请输入商品金额', |
| | | // duration: 2000, |
| | | // }); |
| | | // return |
| | | // } |
| | | // } |
| | | let info = this.data.info |
| | | if (!validator.checkbdMoney(info.payAmt)||info.payAmt==0) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入0.01-100000之间商品金额', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | my.scan({ |
| | | scanType: ['qrCode', 'barCode'], |
| | |
| | | console.log(res) |
| | | // authCode: res.resultStr, |
| | | $api.ajax( |
| | | '/sib/xcx/order/createDmf', |
| | | '/zic/order/createDmf', |
| | | 'POST', |
| | | (res) => { |
| | | my.reLaunch({ |
| | |
| | | true, |
| | | { |
| | | ...this.data.info, |
| | | authCode: res.resultStr |
| | | authCode: res.code |
| | | } |
| | | ) |
| | | }, |
| | |
| | | this.setData({ |
| | | 'info.payType': 1 |
| | | }) |
| | | for (let key in this.data.info) { |
| | | if (!this.data.info[key]) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请完整输入信息', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | // for (let key in this.data.info) { |
| | | // if (!this.data.info[key]) { |
| | | // my.showToast({ |
| | | // type: 'none', |
| | | // content: '请完整输入信息', |
| | | // duration: 2000, |
| | | // }); |
| | | // return |
| | | // } |
| | | // } |
| | | let info = this.data.info |
| | | if (!validator.checkbdMoney(info.payAmt)||info.payAmt==0) { |
| | | my.showToast({ |
| | | type: 'none', |
| | | content: '请输入0.01-100000之间商品金额', |
| | | duration: 2000, |
| | | }); |
| | | return |
| | | } |
| | | |
| | | let str = JSON.stringify(this.data.info) |
| | | console.log(this.data.info) |
| | | my.navigateTo({ |