From 85fc392860c128c204fc2a2c3731bcc352914d99 Mon Sep 17 00:00:00 2001 From: liangjin <liangjin@finlean.com> Date: Wed, 17 Mar 2021 14:11:40 +0800 Subject: [PATCH] Merge branch 'dev' into xcx-rebuild --- pages/shskPage/orderInfo/orderInfo.js | 62 ++++++++++++++++++++----------- 1 files changed, 40 insertions(+), 22 deletions(-) diff --git a/pages/shskPage/orderInfo/orderInfo.js b/pages/shskPage/orderInfo/orderInfo.js index 67da88b..c8464e8 100644 --- a/pages/shskPage/orderInfo/orderInfo.js +++ b/pages/shskPage/orderInfo/orderInfo.js @@ -1,4 +1,5 @@ let $api = require('../../../utils/ajaxFn.js') +let validator = require('../../../utils/validator.js') Page({ data: { userStyle: {}, @@ -46,7 +47,7 @@ }, getTaril(){ $api.ajax( - '/sib/xcx/order/dmfTrial', + '/zic/order/dmfTrial', 'POST', res=>{ this.setData({ @@ -67,15 +68,24 @@ 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'], @@ -83,7 +93,7 @@ console.log(res) // authCode: res.resultStr, $api.ajax( - '/sib/xcx/order/createDmf', + '/zic/order/createDmf', 'POST', (res) => { my.reLaunch({ @@ -94,7 +104,7 @@ true, { ...this.data.info, - authCode: res.resultStr + authCode: res.code } ) }, @@ -104,17 +114,25 @@ 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({ -- Gitblit v1.8.0