| | |
| | | queryUseSweepPayCoupon, |
| | | getWechatConfigInfo, |
| | | saveWxOrder, |
| | | saveOrder, |
| | | tlPay |
| | | } from '@/common/api/index' |
| | | import wx from 'weixin-js-sdk'; // 使用js-sdk |
| | |
| | | onLoad(opt) { |
| | | this.isNew = uni.getStorageSync('IS_NEW') |
| | | this.cid = uni.getStorageSync('CID') |
| | | this.discountInfo = uni.getStorageSync('DISCOUNT_INFO') |
| | | if(uni.getStorageSync('DISCOUNT_INFO')){ |
| | | this.discountInfo = uni.getStorageSync('DISCOUNT_INFO') |
| | | } |
| | | |
| | | const token = uni.getStorageSync(ACCESSTOKEN) || null |
| | | if (opt.shopInfo) { |
| | | this.shopInfo = JSON.parse(decodeURIComponent(opt.shopInfo)) |
| | |
| | | if (opt.money) { |
| | | this.money = parseFloat(opt.money).toFixed(2) |
| | | let dis = this.money * 100 * (1 - this.discountInfo.shopDiscount) |
| | | console.log('dis',dis) |
| | | let money = parseInt((this.money * 100 * this.discountInfo.shopDiscount)) |
| | | if (dis < 1) { |
| | | money = parseInt((this.money * 100)) |
| | |
| | | if (this.payWay == 3) { |
| | | params.bankCardId = this.bankCardId |
| | | } |
| | | saveWxOrder(params).then(res => { |
| | | saveOrder(params).then(res => { |
| | | uni.hideLoading() |
| | | try { |
| | | this.orderId = res.orderId |