|
@@ -207,7 +207,7 @@
|
|
|
<view style='height:120rpx;'></view>
|
|
|
<view class='footer acea-row row-between-wrapper'>
|
|
|
<view>{{ $t(`合计`) }}:
|
|
|
- <text class='font-color'>{{ $t(`¥`) }}{{ totalPrice || 0 }}</text>
|
|
|
+ <text class='font-color'>{{ $t(`¥`) }}{{ parseFloat(totalPrice).toFixed(2) || 0 }}</text>
|
|
|
</view>
|
|
|
<view class='settlement' style='z-index:100' @tap.stop="goPay" v-if="totalPrice > 0">{{ $t(`提交订单`) }}
|
|
|
</view>
|
|
@@ -226,8 +226,8 @@
|
|
|
<invoice-picker :inv-show="invShow" :inv-list="invList" :inv-checked="invChecked" :is-special="special_invoice"
|
|
|
:url-query="urlQuery" @inv-close="invClose" @inv-change="invChange" @inv-cancel="invCancel">
|
|
|
</invoice-picker>
|
|
|
- <payment :payMode="cartArr" :pay_close="pay_close" :isCall="true" :totalPrice="totalPrice.toString()"
|
|
|
- @changePayType="changePayType" @onChangeFun="onChangeFun"></payment>
|
|
|
+ <payment :payMode="cartArr" :pay_close="pay_close" :isCall="false" :totalPrice="parseFloat(totalPrice).toFixed(2)"
|
|
|
+ @changePayType="changePayType" @onChangeFun="onChangeFun" :order_id="orderKey"></payment>
|
|
|
<canvas canvas-id="canvas" v-if="canvasStatus"
|
|
|
:style="{ width: canvasWidth + 'px', height: canvasHeight + 'px', position: 'absolute', left: '-100000px', top: '-100000px' }"></canvas>
|
|
|
|
|
@@ -444,6 +444,7 @@ export default {
|
|
|
tab: 3,
|
|
|
url: 1
|
|
|
});
|
|
|
+ console.log(options);
|
|
|
this.num = options.num || 0;
|
|
|
this.goodsSpecId = options.goodsSpecId || 0;
|
|
|
this.couponId = options.couponId || 0;
|
|
@@ -609,11 +610,75 @@ export default {
|
|
|
this.pay_close = false;
|
|
|
},
|
|
|
goPay() {
|
|
|
- this.pay_close = true;
|
|
|
+ let that = this
|
|
|
+ uni.showLoading({
|
|
|
+ title: that.$t(`下单中`)
|
|
|
+ });
|
|
|
+ postBeforeCheck({
|
|
|
+ goodsSpecId: this.goodsSpecId,
|
|
|
+ num: this.num,
|
|
|
+ userAddressId: this.addressId
|
|
|
+ }).then(function (res) {
|
|
|
+ //验证是否可下单
|
|
|
+ if (res.code == 200) {
|
|
|
+ that.freight = res.data.freight - 0
|
|
|
+ that.totalPrice = res.data.freight - 0
|
|
|
+ that.cartInfo.forEach(e => {
|
|
|
+ that.totalPrice += (e.salePrice - 0) * (that.num - 0)
|
|
|
+ })
|
|
|
+ that.orderCreate()
|
|
|
+ } else {
|
|
|
+ this.totalPrice = 0
|
|
|
+ that.$util.Tips({
|
|
|
+ title: that.$t(`所选商品属性不支持下单`),
|
|
|
+ success: () => {
|
|
|
+ uni.hideLoading();
|
|
|
+ // that.getCartCount(true);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ orderCreate(){
|
|
|
+ let that = this
|
|
|
+ postOrderSubmit({
|
|
|
+ distributeMode: 1,
|
|
|
+ goodsList: [{
|
|
|
+ goodsId: that.cartId,
|
|
|
+ goodsNum: that.num,
|
|
|
+ goodsSpecIds: that.goodsSpecId
|
|
|
+ }],
|
|
|
+ payType: 1,
|
|
|
+ remark: that.remark,
|
|
|
+ settleType: 1,
|
|
|
+ userAddressId: that.addressInfo.id,
|
|
|
+ wlPrice: that.freight
|
|
|
+ }).then(res => {
|
|
|
+ that.orderKey = res.data.orderNo,
|
|
|
+ uni.hideLoading();
|
|
|
+ that.pay_close = true;
|
|
|
+ }).catch(err => {
|
|
|
+ uni.hideLoading();
|
|
|
+ return that.$util.Tips({
|
|
|
+ title: err
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
payCheck(type) {
|
|
|
this.payType = type;
|
|
|
- this.SubOrder();
|
|
|
+ console.log(this.payType);
|
|
|
+ let url = '/pages/goods/order_pay_status/index?order_id=' + this.orderKey + '&msg=' + "支付成功" +
|
|
|
+ '&type=3' + '&totalPrice=' + this.totalPrice
|
|
|
+ uni.showToast({
|
|
|
+ title: that.$t(`支付成功`)
|
|
|
+ })
|
|
|
+ setTimeout(res => {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: url
|
|
|
+ })
|
|
|
+ }, 1000)
|
|
|
+ // this.SubOrder();
|
|
|
},
|
|
|
/**
|
|
|
* 获取门店列表数据
|
|
@@ -651,7 +716,7 @@ export default {
|
|
|
},
|
|
|
changePayType(type) {
|
|
|
this.payType = type
|
|
|
- this.computedPrice()
|
|
|
+ // this.computedPrice()
|
|
|
},
|
|
|
computedPrice: function () {
|
|
|
let that = this
|
|
@@ -677,23 +742,6 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
- // postOrderComputed(this.orderKey, {
|
|
|
- // addressId: this.addressId,
|
|
|
- // useIntegral: this.useIntegral ? 1 : 0,
|
|
|
- // couponId: this.couponId,
|
|
|
- // shipping_type: parseInt(shippingType) + 1,
|
|
|
- // payType: this.payType
|
|
|
- // }).then(res => {
|
|
|
- // let result = res.data.result;
|
|
|
- // if (result) {
|
|
|
- // this.totalPrice = result.pay_price;
|
|
|
- // this.integral_price = result.deduction_price;
|
|
|
- // this.coupon_price = result.coupon_price;
|
|
|
- // this.integral = this.useIntegral ? result.SurplusIntegral : this.usable_integral;
|
|
|
- // this.$set(this.priceGroup, 'storePostage', shippingType == 1 ? 0 : result.pay_postage);
|
|
|
- // this.$set(this.priceGroup, 'storePostageDiscount', result.storePostageDiscount);
|
|
|
- // }
|
|
|
- // })
|
|
|
},
|
|
|
addressType(e) {
|
|
|
let index = e;
|
|
@@ -818,7 +866,7 @@ export default {
|
|
|
});
|
|
|
getGoodsDetail({ id: that.cartId })
|
|
|
.then((res) => {
|
|
|
- this.cartInfo = []
|
|
|
+ that.cartInfo = []
|
|
|
let porject = res.data
|
|
|
//找出选择的规格
|
|
|
porject.goodsSpecList.forEach(element => {
|
|
@@ -826,10 +874,10 @@ export default {
|
|
|
porject.unit = element.spceName
|
|
|
}
|
|
|
});
|
|
|
- porject.totalSales = this.num
|
|
|
+ porject.totalSales = that.num
|
|
|
// 计算总价
|
|
|
- this.totalPrice = (this.num - 0) * (porject.salePrice - 0) + this.freight
|
|
|
- this.cartInfo.push(porject)
|
|
|
+ that.totalPrice = (that.num - 0) * (porject.salePrice - 0) + that.freight - 0
|
|
|
+ that.cartInfo.push(porject)
|
|
|
uni.hideLoading()
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -996,298 +1044,298 @@ export default {
|
|
|
},
|
|
|
payment(data) {
|
|
|
let that = this;
|
|
|
- postOrderSubmit({
|
|
|
- distributeMode: 1,
|
|
|
- goodsList: [{
|
|
|
- goodsId: that.cartId,
|
|
|
- goodsNum: that.num,
|
|
|
- goodsSpecIds: that.goodsSpecId
|
|
|
- }],
|
|
|
- payType: 1,
|
|
|
- remark: that.remark,
|
|
|
- settleType: 1,
|
|
|
- userAddressId: that.addressInfo.id,
|
|
|
- wlPrice: that.freight
|
|
|
- }).then(res => {
|
|
|
- let status = "",
|
|
|
- orderId = res.data.orderNo,
|
|
|
- jsConfig = {},
|
|
|
- goPages = '/pages/goods/order_pay_status/index?order_id=' + orderId + '&msg=' + "支付成功" +
|
|
|
- '&type=3' + '&totalPrice=' + this.totalPrice
|
|
|
- that.toPay = true;
|
|
|
- uni.requestPayment({
|
|
|
- provider: 'wxpay',
|
|
|
- orderInfo: jsConfig,
|
|
|
- success: (e) => {
|
|
|
- let url = goPages;
|
|
|
- uni.showToast({
|
|
|
- title: that.$t(`支付成功`)
|
|
|
- })
|
|
|
- setTimeout(res => {
|
|
|
- uni.redirectTo({
|
|
|
- url: url
|
|
|
- })
|
|
|
- }, 2000)
|
|
|
- },
|
|
|
- fail: (e) => {
|
|
|
- let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
- orderId +
|
|
|
- '&msg=' + that.$t(`支付失败`);
|
|
|
- uni.showModal({
|
|
|
- content: that.$t(`支付失败`),
|
|
|
- showCancel: false,
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- uni.redirectTo({
|
|
|
- url: url
|
|
|
- })
|
|
|
- } else if (res.cancel) { }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- complete: () => {
|
|
|
- uni.hideLoading();
|
|
|
- },
|
|
|
- });
|
|
|
- switch (status) {
|
|
|
- case 'ORDER_EXIST':
|
|
|
- case 'EXTEND_ORDER':
|
|
|
- case 'PAY_ERROR':
|
|
|
- uni.hideLoading();
|
|
|
- return that.$util.Tips({
|
|
|
- title: res.msg
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: goPages
|
|
|
- });
|
|
|
- break;
|
|
|
- case 'SUCCESS':
|
|
|
- uni.hideLoading();
|
|
|
- if ((that.BargainId || that.combinationId || that.pinkId || that.seckillId || that
|
|
|
- .discountId) && data.payType != 'friend')
|
|
|
- return that.$util.Tips({
|
|
|
- title: res.msg,
|
|
|
- icon: 'success'
|
|
|
- }, {
|
|
|
- tab: 4,
|
|
|
- url: goPages
|
|
|
- });
|
|
|
- return that.$util.Tips({
|
|
|
- title: res.msg,
|
|
|
- icon: 'success'
|
|
|
- }, {
|
|
|
- tab: 4,
|
|
|
- url: data.payType == 'friend' ? friendPay : goPages
|
|
|
- });
|
|
|
- break;
|
|
|
- case 'WECHAT_PAY':
|
|
|
- that.toPay = true;
|
|
|
- // #ifdef MP
|
|
|
- /* that.toPay = true; */
|
|
|
- let mp_pay_name = ''
|
|
|
- if (uni.requestOrderPayment) {
|
|
|
- mp_pay_name = 'requestOrderPayment'
|
|
|
- } else {
|
|
|
- mp_pay_name = 'requestPayment'
|
|
|
- }
|
|
|
- uni[mp_pay_name]({
|
|
|
- timeStamp: jsConfig.timestamp,
|
|
|
- nonceStr: jsConfig.nonceStr,
|
|
|
- package: jsConfig.package,
|
|
|
- signType: jsConfig.signType,
|
|
|
- paySign: jsConfig.paySign,
|
|
|
- success: function (res) {
|
|
|
- uni.hideLoading();
|
|
|
- if (that.BargainId || that.combinationId || that.pinkId || that
|
|
|
- .seckillId || that.discountId)
|
|
|
- return that.$util.Tips({
|
|
|
- title: that.$t(`支付成功`),
|
|
|
- icon: 'success'
|
|
|
- }, {
|
|
|
- tab: 4,
|
|
|
- url: goPages
|
|
|
- });
|
|
|
- return that.$util.Tips({
|
|
|
- title: that.$t(`支付成功`),
|
|
|
- icon: 'success'
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: goPages
|
|
|
- });
|
|
|
- },
|
|
|
- fail: function (e) {
|
|
|
- uni.hideLoading();
|
|
|
- return that.$util.Tips({
|
|
|
- title: that.$t(`取消支付`)
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: goPages + '&status=2'
|
|
|
- });
|
|
|
- },
|
|
|
- complete: function (e) {
|
|
|
- uni.hideLoading();
|
|
|
- //关闭当前页面跳转至订单状态
|
|
|
- if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
|
|
|
- 'requestOrderPayment:cancel') return that.$util
|
|
|
- .Tips({
|
|
|
- title: that.$t(`取消支付`)
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: goPages + '&status=2'
|
|
|
- });
|
|
|
- },
|
|
|
- })
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
- this.$wechat.pay(res.data.result.jsConfig).then(res => {
|
|
|
- return that.$util.Tips({
|
|
|
- title: that.$t(`支付成功`),
|
|
|
- icon: 'success'
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: goPages
|
|
|
- });
|
|
|
- }).catch(res => {
|
|
|
- if (!this.$wechat.isWeixin()) {
|
|
|
- uni.redirectTo({
|
|
|
- url: goPages + '&msg=' + that.$t(`支付失败`) + '&status=2'
|
|
|
- // '&msg=支付失败&status=2'
|
|
|
- })
|
|
|
- }
|
|
|
- if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
|
|
|
- title: that.$t(`取消支付`)
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: goPages + '&status=2'
|
|
|
- });
|
|
|
- })
|
|
|
- // #endif
|
|
|
- // #ifdef APP-PLUS
|
|
|
- uni.requestPayment({
|
|
|
- provider: 'wxpay',
|
|
|
- orderInfo: jsConfig,
|
|
|
- success: (e) => {
|
|
|
- let url = goPages;
|
|
|
- uni.showToast({
|
|
|
- title: that.$t(`支付成功`)
|
|
|
- })
|
|
|
- setTimeout(res => {
|
|
|
- uni.redirectTo({
|
|
|
- url: url
|
|
|
- })
|
|
|
- }, 2000)
|
|
|
- },
|
|
|
- fail: (e) => {
|
|
|
- let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
- orderId +
|
|
|
- '&msg=' + that.$t(`支付失败`);
|
|
|
- uni.showModal({
|
|
|
- content: that.$t(`支付失败`),
|
|
|
- showCancel: false,
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- uni.redirectTo({
|
|
|
- url: url
|
|
|
- })
|
|
|
- } else if (res.cancel) { }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- complete: () => {
|
|
|
- uni.hideLoading();
|
|
|
- },
|
|
|
- });
|
|
|
- // #endif
|
|
|
- break;
|
|
|
- case 'PAY_DEFICIENCY':
|
|
|
- uni.hideLoading();
|
|
|
- //余额不足
|
|
|
- return that.$util.Tips({
|
|
|
- title: res.msg
|
|
|
- }, {
|
|
|
- tab: 5,
|
|
|
- url: goPages + '&status=1'
|
|
|
- });
|
|
|
- break;
|
|
|
- case "WECHAT_H5_PAY":
|
|
|
- uni.hideLoading();
|
|
|
- that.$util.Tips({
|
|
|
- title: that.$t(`订单创建成功`)
|
|
|
- }, {
|
|
|
- tab: 4,
|
|
|
- url: goPages + '&status=0'
|
|
|
- });
|
|
|
- setTimeout(() => {
|
|
|
- location.href = res.data.result.jsConfig.mweb_url;
|
|
|
- }, 2000);
|
|
|
- break;
|
|
|
-
|
|
|
- case 'ALIPAY_PAY':
|
|
|
- //#ifdef H5
|
|
|
- if (this.from === 'weixin') {
|
|
|
- uni.redirectTo({
|
|
|
- url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
|
|
|
- });
|
|
|
- } else {
|
|
|
- uni.hideLoading();
|
|
|
- that.formContent = res.data.result.jsConfig;
|
|
|
- that.$nextTick(() => {
|
|
|
- document.getElementById('alipaysubmit').submit();
|
|
|
- })
|
|
|
- }
|
|
|
- //#endif
|
|
|
- // #ifdef MP
|
|
|
- uni.navigateTo({
|
|
|
- url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
|
|
|
- });
|
|
|
- // #endif
|
|
|
- // #ifdef APP-PLUS
|
|
|
- uni.requestPayment({
|
|
|
- provider: 'alipay',
|
|
|
- orderInfo: jsConfig,
|
|
|
- success: (e) => {
|
|
|
- uni.showToast({
|
|
|
- title: that.$t(`支付成功`)
|
|
|
- })
|
|
|
- let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
- orderId +
|
|
|
- '&msg=' + that.$t(`支付成功`);
|
|
|
- setTimeout(res => {
|
|
|
- uni.redirectTo({
|
|
|
- url: url
|
|
|
- })
|
|
|
- }, 2000)
|
|
|
-
|
|
|
- },
|
|
|
- fail: (e) => {
|
|
|
- let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
- orderId +
|
|
|
- '&msg=' + that.$t(`支付失败`);
|
|
|
- uni.showModal({
|
|
|
- content: that.$t(`支付失败`),
|
|
|
- showCancel: false,
|
|
|
- success: function (res) {
|
|
|
- if (res.confirm) {
|
|
|
- uni.redirectTo({
|
|
|
- url: url
|
|
|
- })
|
|
|
- } else if (res.cancel) { }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- complete: () => {
|
|
|
- uni.hideLoading();
|
|
|
- },
|
|
|
- });
|
|
|
- // #endif
|
|
|
- break;
|
|
|
- }
|
|
|
- }).catch(err => {
|
|
|
- uni.hideLoading();
|
|
|
- return that.$util.Tips({
|
|
|
- title: err
|
|
|
- });
|
|
|
- });
|
|
|
+ // postOrderSubmit({
|
|
|
+ // distributeMode: 1,
|
|
|
+ // goodsList: [{
|
|
|
+ // goodsId: that.cartId,
|
|
|
+ // goodsNum: that.num,
|
|
|
+ // goodsSpecIds: that.goodsSpecId
|
|
|
+ // }],
|
|
|
+ // payType: 1,
|
|
|
+ // remark: that.remark,
|
|
|
+ // settleType: 1,
|
|
|
+ // userAddressId: that.addressInfo.id,
|
|
|
+ // wlPrice: that.freight
|
|
|
+ // }).then(res => {
|
|
|
+ // let status = "",
|
|
|
+ // orderId = res.data.orderNo,
|
|
|
+ // jsConfig = {},
|
|
|
+ // goPages = '/pages/goods/order_pay_status/index?order_id=' + orderId + '&msg=' + "支付成功" +
|
|
|
+ // '&type=3' + '&totalPrice=' + this.totalPrice
|
|
|
+ // that.toPay = true;
|
|
|
+ // uni.requestPayment({
|
|
|
+ // provider: 'wxpay',
|
|
|
+ // orderInfo: jsConfig,
|
|
|
+ // success: (e) => {
|
|
|
+ // let url = goPages;
|
|
|
+ // uni.showToast({
|
|
|
+ // title: that.$t(`支付成功`)
|
|
|
+ // })
|
|
|
+ // setTimeout(res => {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: url
|
|
|
+ // })
|
|
|
+ // }, 2000)
|
|
|
+ // },
|
|
|
+ // fail: (e) => {
|
|
|
+ // let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
+ // orderId +
|
|
|
+ // '&msg=' + that.$t(`支付失败`);
|
|
|
+ // uni.showModal({
|
|
|
+ // content: that.$t(`支付失败`),
|
|
|
+ // showCancel: false,
|
|
|
+ // success: function (res) {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: url
|
|
|
+ // })
|
|
|
+ // } else if (res.cancel) { }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // complete: () => {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // switch (status) {
|
|
|
+ // case 'ORDER_EXIST':
|
|
|
+ // case 'EXTEND_ORDER':
|
|
|
+ // case 'PAY_ERROR':
|
|
|
+ // uni.hideLoading();
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: res.msg
|
|
|
+ // }, {
|
|
|
+ // tab: 5,
|
|
|
+ // url: goPages
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case 'SUCCESS':
|
|
|
+ // uni.hideLoading();
|
|
|
+ // if ((that.BargainId || that.combinationId || that.pinkId || that.seckillId || that
|
|
|
+ // .discountId) && data.payType != 'friend')
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: res.msg,
|
|
|
+ // icon: 'success'
|
|
|
+ // }, {
|
|
|
+ // tab: 4,
|
|
|
+ // url: goPages
|
|
|
+ // });
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: res.msg,
|
|
|
+ // icon: 'success'
|
|
|
+ // }, {
|
|
|
+ // tab: 4,
|
|
|
+ // url: data.payType == 'friend' ? friendPay : goPages
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case 'WECHAT_PAY':
|
|
|
+ // that.toPay = true;
|
|
|
+ // // #ifdef MP
|
|
|
+ // /* that.toPay = true; */
|
|
|
+ // let mp_pay_name = ''
|
|
|
+ // if (uni.requestOrderPayment) {
|
|
|
+ // mp_pay_name = 'requestOrderPayment'
|
|
|
+ // } else {
|
|
|
+ // mp_pay_name = 'requestPayment'
|
|
|
+ // }
|
|
|
+ // uni[mp_pay_name]({
|
|
|
+ // timeStamp: jsConfig.timestamp,
|
|
|
+ // nonceStr: jsConfig.nonceStr,
|
|
|
+ // package: jsConfig.package,
|
|
|
+ // signType: jsConfig.signType,
|
|
|
+ // paySign: jsConfig.paySign,
|
|
|
+ // success: function (res) {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // if (that.BargainId || that.combinationId || that.pinkId || that
|
|
|
+ // .seckillId || that.discountId)
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: that.$t(`支付成功`),
|
|
|
+ // icon: 'success'
|
|
|
+ // }, {
|
|
|
+ // tab: 4,
|
|
|
+ // url: goPages
|
|
|
+ // });
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: that.$t(`支付成功`),
|
|
|
+ // icon: 'success'
|
|
|
+ // }, {
|
|
|
+ // tab: 5,
|
|
|
+ // url: goPages
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // fail: function (e) {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: that.$t(`取消支付`)
|
|
|
+ // }, {
|
|
|
+ // tab: 5,
|
|
|
+ // url: goPages + '&status=2'
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // complete: function (e) {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // //关闭当前页面跳转至订单状态
|
|
|
+ // if (res.errMsg == 'requestPayment:cancel' || e.errMsg ==
|
|
|
+ // 'requestOrderPayment:cancel') return that.$util
|
|
|
+ // .Tips({
|
|
|
+ // title: that.$t(`取消支付`)
|
|
|
+ // }, {
|
|
|
+ // tab: 5,
|
|
|
+ // url: goPages + '&status=2'
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // // #endif
|
|
|
+ // // #ifdef H5
|
|
|
+ // this.$wechat.pay(res.data.result.jsConfig).then(res => {
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: that.$t(`支付成功`),
|
|
|
+ // icon: 'success'
|
|
|
+ // }, {
|
|
|
+ // tab: 5,
|
|
|
+ // url: goPages
|
|
|
+ // });
|
|
|
+ // }).catch(res => {
|
|
|
+ // if (!this.$wechat.isWeixin()) {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: goPages + '&msg=' + that.$t(`支付失败`) + '&status=2'
|
|
|
+ // // '&msg=支付失败&status=2'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // if (res.errMsg == 'chooseWXPay:cancel') return that.$util.Tips({
|
|
|
+ // title: that.$t(`取消支付`)
|
|
|
+ // }, {
|
|
|
+ // tab: 5,
|
|
|
+ // url: goPages + '&status=2'
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // // #endif
|
|
|
+ // // #ifdef APP-PLUS
|
|
|
+ // uni.requestPayment({
|
|
|
+ // provider: 'wxpay',
|
|
|
+ // orderInfo: jsConfig,
|
|
|
+ // success: (e) => {
|
|
|
+ // let url = goPages;
|
|
|
+ // uni.showToast({
|
|
|
+ // title: that.$t(`支付成功`)
|
|
|
+ // })
|
|
|
+ // setTimeout(res => {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: url
|
|
|
+ // })
|
|
|
+ // }, 2000)
|
|
|
+ // },
|
|
|
+ // fail: (e) => {
|
|
|
+ // let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
+ // orderId +
|
|
|
+ // '&msg=' + that.$t(`支付失败`);
|
|
|
+ // uni.showModal({
|
|
|
+ // content: that.$t(`支付失败`),
|
|
|
+ // showCancel: false,
|
|
|
+ // success: function (res) {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: url
|
|
|
+ // })
|
|
|
+ // } else if (res.cancel) { }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // complete: () => {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // // #endif
|
|
|
+ // break;
|
|
|
+ // case 'PAY_DEFICIENCY':
|
|
|
+ // uni.hideLoading();
|
|
|
+ // //余额不足
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: res.msg
|
|
|
+ // }, {
|
|
|
+ // tab: 5,
|
|
|
+ // url: goPages + '&status=1'
|
|
|
+ // });
|
|
|
+ // break;
|
|
|
+ // case "WECHAT_H5_PAY":
|
|
|
+ // uni.hideLoading();
|
|
|
+ // that.$util.Tips({
|
|
|
+ // title: that.$t(`订单创建成功`)
|
|
|
+ // }, {
|
|
|
+ // tab: 4,
|
|
|
+ // url: goPages + '&status=0'
|
|
|
+ // });
|
|
|
+ // setTimeout(() => {
|
|
|
+ // location.href = res.data.result.jsConfig.mweb_url;
|
|
|
+ // }, 2000);
|
|
|
+ // break;
|
|
|
+
|
|
|
+ // case 'ALIPAY_PAY':
|
|
|
+ // //#ifdef H5
|
|
|
+ // if (this.from === 'weixin') {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: `/pages/users/alipay_invoke/index?id=${orderId}&pay_key=${res.data.result.pay_key}`
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // that.formContent = res.data.result.jsConfig;
|
|
|
+ // that.$nextTick(() => {
|
|
|
+ // document.getElementById('alipaysubmit').submit();
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // //#endif
|
|
|
+ // // #ifdef MP
|
|
|
+ // uni.navigateTo({
|
|
|
+ // url: `/pages/users/alipay_invoke/index?id=${orderId}&link=${jsConfig.qrCode}`
|
|
|
+ // });
|
|
|
+ // // #endif
|
|
|
+ // // #ifdef APP-PLUS
|
|
|
+ // uni.requestPayment({
|
|
|
+ // provider: 'alipay',
|
|
|
+ // orderInfo: jsConfig,
|
|
|
+ // success: (e) => {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: that.$t(`支付成功`)
|
|
|
+ // })
|
|
|
+ // let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
+ // orderId +
|
|
|
+ // '&msg=' + that.$t(`支付成功`);
|
|
|
+ // setTimeout(res => {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: url
|
|
|
+ // })
|
|
|
+ // }, 2000)
|
|
|
+
|
|
|
+ // },
|
|
|
+ // fail: (e) => {
|
|
|
+ // let url = '/pages/goods/order_pay_status/index?order_id=' +
|
|
|
+ // orderId +
|
|
|
+ // '&msg=' + that.$t(`支付失败`);
|
|
|
+ // uni.showModal({
|
|
|
+ // content: that.$t(`支付失败`),
|
|
|
+ // showCancel: false,
|
|
|
+ // success: function (res) {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // uni.redirectTo({
|
|
|
+ // url: url
|
|
|
+ // })
|
|
|
+ // } else if (res.cancel) { }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ // complete: () => {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // // #endif
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }).catch(err => {
|
|
|
+ // uni.hideLoading();
|
|
|
+ // return that.$util.Tips({
|
|
|
+ // title: err
|
|
|
+ // });
|
|
|
+ // });
|
|
|
},
|
|
|
clickTextArea() {
|
|
|
this.$refs.textarea.focus()
|