feat:新增卡密商品类型支付
This commit is contained in:
parent
7b45f7ec2b
commit
7578db7ac1
|
@ -52,6 +52,7 @@
|
|||
</p>
|
||||
<p class="text">{{goodInfo.product_name}}</p>
|
||||
</div>
|
||||
<template v-if="goodInfo.product_type===1">
|
||||
<p v-if="acctype=='tel'"><span>账号:</span><input :type="acctype"
|
||||
onkeyup="this.value=this.value.replace(/\D/g,'')" :disabled="goodsDetail.available!=1"
|
||||
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" :maxlength="maxlen"
|
||||
|
@ -66,6 +67,7 @@
|
|||
<p v-if="acctype!='tel'"><span>再次输入:</span><input :type="acctype" :maxlength="maxlen"
|
||||
v-model="reAccount" :disabled="goodsDetail.available!=1" placeholder="请再次输入"
|
||||
@focus="(e)=>focusFn(e)"></p>
|
||||
</template>
|
||||
</div>
|
||||
<div class="bottom" id="bottom" :style="{borderWidth:(describe.type||detailUrl)?'0.05rem':'0'}"
|
||||
v-show="describe.type||detailUrl">
|
||||
|
@ -156,9 +158,14 @@
|
|||
{{(goodsDetail.origin_price-goodsDetail.coupon_price).toFixed(2)}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<button class="exchange-btn" v-if="goodsDetail.type===1"
|
||||
<template v-if="goodsDetail.type===1">
|
||||
<button class="exchange-btn" v-if="goodInfo.product_type===1"
|
||||
:style="{'background': exchangeOpen?bgcolor:'#D7D7D7','color':exchangeOpen?ftColor:'#333'}"
|
||||
@click="exchangeGoodsFn">立即支付</button>
|
||||
|
||||
<button v-else class="exchange-btn" v-else :style="{'background': bgcolor,'color':ftColor}"
|
||||
@click="exchangeGoodsFn">立即支付</button>
|
||||
</template>
|
||||
<button class="exchange-btn" v-else :style="{'background': bgcolor,'color':ftColor}"
|
||||
@click="exchangeGoodsFn">立即支付</button>
|
||||
</div>
|
||||
|
@ -435,7 +442,7 @@
|
|||
|
||||
//兑换商品
|
||||
exchangeGoodsFn () {
|
||||
if (this.goodsDetail.type === 1) { /* 兑换码 */
|
||||
if (this.goodsDetail.type === 1 && this.goodInfo.product_type === 1) { /* 兑换码 */
|
||||
if (goodsDetail.available != 1) {
|
||||
this.openErrorDialog(product_status(goodsDetail.available, goodsDetail));
|
||||
return
|
||||
|
@ -533,8 +540,8 @@
|
|||
this.payType = payType
|
||||
this.show = false
|
||||
let orderInfo = await this.createdOrder(payType);
|
||||
if (orderInfo.pay_status == 2||[1,2].includes(orderInfo.channel)) {//pay_status 2已支付 channel 1 支付宝 2微信
|
||||
let orderNumber=orderInfo.pay_status == 2?orderInfo.order_number:orderInfo.original_order_number;
|
||||
if (orderInfo.pay_status == 2 || [1, 2].includes(orderInfo.channel)) {//pay_status 2已支付 channel 1 支付宝 2微信
|
||||
let orderNumber = orderInfo.pay_status == 2 ? orderInfo.order_number : orderInfo.original_order_number;
|
||||
window.location.replace('http://test.86885.cn/paysuccess.html?order_number=' + orderNumber);
|
||||
} else {
|
||||
this.createdPay(orderInfo.order_number);
|
||||
|
@ -549,9 +556,9 @@
|
|||
"key": localStorage.getItem('key'),
|
||||
"code_batch_id": this.goodsDetail.code_batch_id,
|
||||
"goods_id": this.goodInfo.goods_id,
|
||||
"account": this.account,
|
||||
"account": this.account || '888888', /* 卡密时默认账号 */
|
||||
"pay_type": payType == 2 ? 1 : 5,
|
||||
"pay_amount":this.goodsDetail.coupon_price
|
||||
"pay_amount": this.goodsDetail.coupon_price
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
req.axiosPost('/key/createCouponOrder', data).then(res => {
|
||||
|
@ -571,7 +578,7 @@
|
|||
|
||||
//优惠券订单支付
|
||||
createdPay (orderNumber) {
|
||||
req.axiosGet('/key/coupon/createPay/' + orderNumber,{token:localStorage.getItem('token')}).then(res => {
|
||||
req.axiosGet('/key/coupon/createPay/' + orderNumber, { token: localStorage.getItem('token') }).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.payWayRun(res.data);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue