feat:新增卡密商品类型支付

This commit is contained in:
wangsongsole 2022-10-28 11:28:30 +08:00
parent 7b45f7ec2b
commit 7578db7ac1
1 changed files with 30 additions and 23 deletions

View File

@ -52,6 +52,7 @@
</p> </p>
<p class="text">{{goodInfo.product_name}}</p> <p class="text">{{goodInfo.product_name}}</p>
</div> </div>
<template v-if="goodInfo.product_type===1">
<p v-if="acctype=='tel'"><span>账号:</span><input :type="acctype" <p v-if="acctype=='tel'"><span>账号:</span><input :type="acctype"
onkeyup="this.value=this.value.replace(/\D/g,'')" :disabled="goodsDetail.available!=1" onkeyup="this.value=this.value.replace(/\D/g,'')" :disabled="goodsDetail.available!=1"
onKeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" :maxlength="maxlen" 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" <p v-if="acctype!='tel'"><span>再次输入:</span><input :type="acctype" :maxlength="maxlen"
v-model="reAccount" :disabled="goodsDetail.available!=1" placeholder="请再次输入" v-model="reAccount" :disabled="goodsDetail.available!=1" placeholder="请再次输入"
@focus="(e)=>focusFn(e)"></p> @focus="(e)=>focusFn(e)"></p>
</template>
</div> </div>
<div class="bottom" id="bottom" :style="{borderWidth:(describe.type||detailUrl)?'0.05rem':'0'}" <div class="bottom" id="bottom" :style="{borderWidth:(describe.type||detailUrl)?'0.05rem':'0'}"
v-show="describe.type||detailUrl"> v-show="describe.type||detailUrl">
@ -156,9 +158,14 @@
{{(goodsDetail.origin_price-goodsDetail.coupon_price).toFixed(2)}}</p> {{(goodsDetail.origin_price-goodsDetail.coupon_price).toFixed(2)}}</p>
</div> </div>
</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'}" :style="{'background': exchangeOpen?bgcolor:'#D7D7D7','color':exchangeOpen?ftColor:'#333'}"
@click="exchangeGoodsFn">立即支付</button> @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}" <button class="exchange-btn" v-else :style="{'background': bgcolor,'color':ftColor}"
@click="exchangeGoodsFn">立即支付</button> @click="exchangeGoodsFn">立即支付</button>
</div> </div>
@ -435,7 +442,7 @@
//兑换商品 //兑换商品
exchangeGoodsFn () { exchangeGoodsFn () {
if (this.goodsDetail.type === 1) { /* 兑换码 */ if (this.goodsDetail.type === 1 && this.goodInfo.product_type === 1) { /* 兑换码 */
if (goodsDetail.available != 1) { if (goodsDetail.available != 1) {
this.openErrorDialog(product_status(goodsDetail.available, goodsDetail)); this.openErrorDialog(product_status(goodsDetail.available, goodsDetail));
return return
@ -549,7 +556,7 @@
"key": localStorage.getItem('key'), "key": localStorage.getItem('key'),
"code_batch_id": this.goodsDetail.code_batch_id, "code_batch_id": this.goodsDetail.code_batch_id,
"goods_id": this.goodInfo.goods_id, "goods_id": this.goodInfo.goods_id,
"account": this.account, "account": this.account || '888888', /* 卡密时默认账号 */
"pay_type": payType == 2 ? 1 : 5, "pay_type": payType == 2 ? 1 : 5,
"pay_amount": this.goodsDetail.coupon_price "pay_amount": this.goodsDetail.coupon_price
} }