|
|
@@ -66,6 +66,7 @@ import wexinPay from "@/utils/pay/wxPay";
|
|
|
import { getShopUser } from "@/utils/auth";
|
|
|
import { balancePay, wxPay } from "@/api/order";
|
|
|
import { postWxCode } from '@/api/mini';
|
|
|
+import { ORDER_PAY_AMOUNT_ZERO } from '@/constant/errCode'
|
|
|
import { getHdInfo } from '@/api/hd';
|
|
|
export default {
|
|
|
name: "index",
|
|
|
@@ -151,6 +152,11 @@ export default {
|
|
|
if(subRes.data.miniOpenId){
|
|
|
let miniOpenId = subRes.data.miniOpenId
|
|
|
wxPay({ orderSn: that.orderSn, couponId: that.option.couponId,miniOpenId:miniOpenId }).then(res => {
|
|
|
+ if (res.code === ORDER_PAY_AMOUNT_ZERO) {
|
|
|
+ that.orderSn = (res.data && res.data.orderSn) ? res.data.orderSn : that.orderSn
|
|
|
+ that.paySuccess()
|
|
|
+ return
|
|
|
+ }
|
|
|
this.payCallData = res.data
|
|
|
wexinPay(res.data, that.paySuccess, that.payFail)
|
|
|
that.orderSn = res.data.orderSn ? res.data.orderSn : ''
|
|
|
@@ -163,6 +169,11 @@ export default {
|
|
|
wxPayFnOld() {
|
|
|
let miniOpenId = uni.getStorageSync('miniOpenId')
|
|
|
wxPay({ orderSn: this.orderSn, couponId: this.option.couponId,miniOpenId:miniOpenId }).then(res => {
|
|
|
+ if (res.code === ORDER_PAY_AMOUNT_ZERO) {
|
|
|
+ this.orderSn = (res.data && res.data.orderSn) ? res.data.orderSn : this.orderSn
|
|
|
+ this.paySuccess()
|
|
|
+ return
|
|
|
+ }
|
|
|
this.payCallData = res.data
|
|
|
wexinPay(res.data, this.paySuccess, this.payFail)
|
|
|
this.orderSn = res.data.orderSn ? res.data.orderSn : ''
|