|
@@ -51,23 +51,20 @@
|
|
<div class="diamond-icon">
|
|
<div class="diamond-icon">
|
|
<img src="@/assets/images/recharge_zuanshi.png" alt="钻石" class="diamond-img" />
|
|
<img src="@/assets/images/recharge_zuanshi.png" alt="钻石" class="diamond-img" />
|
|
</div>
|
|
</div>
|
|
- <!-- 注释掉自定义金额相关显示 -->
|
|
|
|
- <!-- <template v-if="!item.isCustom"> -->
|
|
|
|
|
|
+ <template v-if="!item.isCustom">
|
|
<div class="recharge-amount">{{ item.amount }}</div>
|
|
<div class="recharge-amount">{{ item.amount }}</div>
|
|
<div class="recharge-price">¥{{ item.price }}</div>
|
|
<div class="recharge-price">¥{{ item.price }}</div>
|
|
- <!-- </template>
|
|
|
|
|
|
+ </template>
|
|
<template v-else>
|
|
<template v-else>
|
|
<div class="recharge-amount">自定义金额</div>
|
|
<div class="recharge-amount">自定义金额</div>
|
|
<div class="recharge-price">点击输入</div>
|
|
<div class="recharge-price">点击输入</div>
|
|
- </template> -->
|
|
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <!-- 注释掉自定义金额输入框
|
|
|
|
<div v-if="isCustomSelected" class="custom-input">
|
|
<div v-if="isCustomSelected" class="custom-input">
|
|
<van-field v-model="customAmount" type="number" input-align="center" placeholder="请输入自定义金额(元)" clearable />
|
|
<van-field v-model="customAmount" type="number" input-align="center" placeholder="请输入自定义金额(元)" clearable />
|
|
</div>
|
|
</div>
|
|
- -->
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 支付方式 -->
|
|
<!-- 支付方式 -->
|
|
@@ -155,8 +152,8 @@ export default {
|
|
isLoading: false,
|
|
isLoading: false,
|
|
agreementChecked: false,
|
|
agreementChecked: false,
|
|
agreementVisible: false,
|
|
agreementVisible: false,
|
|
- // 自定义金额 - 已注释功能
|
|
|
|
- // customAmount: '',
|
|
|
|
|
|
+ // 自定义金额
|
|
|
|
+ customAmount: '',
|
|
// 支付方式类型
|
|
// 支付方式类型
|
|
paymentType: PAYMENT_TYPE,
|
|
paymentType: PAYMENT_TYPE,
|
|
// 金币兑换权限
|
|
// 金币兑换权限
|
|
@@ -169,18 +166,15 @@ export default {
|
|
},
|
|
},
|
|
// 显示列表 = 产品列表 + 自定义
|
|
// 显示列表 = 产品列表 + 自定义
|
|
rechargeOptionsWithCustom() {
|
|
rechargeOptionsWithCustom() {
|
|
- // 注释掉自定义金额功能
|
|
|
|
- /* if (ALI_CUSTOM && this.paymentType === 'alipay') {
|
|
|
|
|
|
+ if (ALI_CUSTOM && this.paymentType === 'alipay') {
|
|
return [...(this.rechargeOptions || []), { isCustom: true }]
|
|
return [...(this.rechargeOptions || []), { isCustom: true }]
|
|
- } else { */
|
|
|
|
|
|
+ } else {
|
|
return [...(this.rechargeOptions || [])]
|
|
return [...(this.rechargeOptions || [])]
|
|
- // }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 是否选择了自定义
|
|
// 是否选择了自定义
|
|
isCustomSelected() {
|
|
isCustomSelected() {
|
|
- // 注释掉自定义金额功能
|
|
|
|
- // return this.selectedRecharge === this.rechargeOptionsWithCustom.length - 1
|
|
|
|
- return false
|
|
|
|
|
|
+ return this.selectedRecharge === this.rechargeOptionsWithCustom.length - 1
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -303,13 +297,13 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
// 自定义金额校验
|
|
// 自定义金额校验
|
|
- /* if (this.isCustomSelected) {
|
|
|
|
|
|
+ if (this.isCustomSelected) {
|
|
const amountNumber = Number(this.customAmount)
|
|
const amountNumber = Number(this.customAmount)
|
|
if (!this.customAmount || Number.isNaN(amountNumber) || amountNumber <= 0) {
|
|
if (!this.customAmount || Number.isNaN(amountNumber) || amountNumber <= 0) {
|
|
this.$toast('请输入有效的自定义金额')
|
|
this.$toast('请输入有效的自定义金额')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- } */
|
|
|
|
|
|
+ }
|
|
|
|
|
|
const selectedOption = this.selectedRechargeOption
|
|
const selectedOption = this.selectedRechargeOption
|
|
|
|
|
|
@@ -362,13 +356,13 @@ export default {
|
|
// 构建支付参数
|
|
// 构建支付参数
|
|
const payData = {
|
|
const payData = {
|
|
userId: this.userInfo.id,
|
|
userId: this.userInfo.id,
|
|
- productId: product ? product.id : null
|
|
|
|
|
|
+ productId: product && product.isCustom ? 1018 : product.id
|
|
}
|
|
}
|
|
|
|
|
|
- // 自定义金额时追加 amount - 注释掉自定义金额功能
|
|
|
|
- /* if (product && product.isCustom) {
|
|
|
|
|
|
+ // 自定义金额时追加 amount
|
|
|
|
+ if (product && product.isCustom) {
|
|
payData.amount = Number(this.customAmount)
|
|
payData.amount = Number(this.customAmount)
|
|
- } */
|
|
|
|
|
|
+ }
|
|
|
|
|
|
// 调用支付宝H5支付接口
|
|
// 调用支付宝H5支付接口
|
|
const res = await aliPayH5(payData, platform)
|
|
const res = await aliPayH5(payData, platform)
|