|
@@ -12,15 +12,18 @@
|
|
<div class="recharge_title">充值金额</div>
|
|
<div class="recharge_title">充值金额</div>
|
|
<div class="recharge_list">
|
|
<div class="recharge_list">
|
|
<div @click="chooseMoney(v,i)" :class="curIdx === i ? 'item item_ac' : 'item'" v-for="(v,i) in moneyList" :key="i">{{v.value}}元</div>
|
|
<div @click="chooseMoney(v,i)" :class="curIdx === i ? 'item item_ac' : 'item'" v-for="(v,i) in moneyList" :key="i">{{v.value}}元</div>
|
|
- <div @click="open()" :class="curIdx === -1 ? 'item item_ac' : 'item'">其他金额{{curIdx === -1 && money ? `(${money})` : ''}}</div>
|
|
|
|
|
|
+ <el-input type='num' @focus="open" v-model="value" clearable :class="curIdx === -1 ? 'item item_ac' : 'item'" placeholder="其他金额" />
|
|
</div>
|
|
</div>
|
|
<div class="recharge_title">支付方式</div>
|
|
<div class="recharge_title">支付方式</div>
|
|
<div class="recharge_list">
|
|
<div class="recharge_list">
|
|
<div @click="paymentType = 1" :class="paymentType === 1 ? 'item item_ac' : 'item'"><img src="../../../static/image/alipay.png" alt="" srcset=""> 支付宝支付</div>
|
|
<div @click="paymentType = 1" :class="paymentType === 1 ? 'item item_ac' : 'item'"><img src="../../../static/image/alipay.png" alt="" srcset=""> 支付宝支付</div>
|
|
<div @click="paymentType = 2" :class="paymentType === 2 ? 'item item_ac' : 'item'"><img src="../../../static/image/we-chat.png" alt="" srcset="">微信支付</div>
|
|
<div @click="paymentType = 2" :class="paymentType === 2 ? 'item item_ac' : 'item'"><img src="../../../static/image/we-chat.png" alt="" srcset="">微信支付</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-checkbox v-model="checked">我已阅读并同意 <span @click="getExplain" class="agreement">《充值协议》</span> </el-checkbox>
|
|
|
|
+ </div>
|
|
<el-button @click="recharge" class="recharge_color">去充值</el-button>
|
|
<el-button @click="recharge" class="recharge_color">去充值</el-button>
|
|
- <div class="agreement">充值即同意 <span @click="getExplain">《充值协议》</span> </div>
|
|
|
|
|
|
+ <!-- <div class="agreement">充值即同意 <span @click="getExplain">《充值协议》</span> </div> -->
|
|
</el-col>
|
|
</el-col>
|
|
<!-- 支付二维码 -->
|
|
<!-- 支付二维码 -->
|
|
<qr-code v-if="showCode" @paySuccess="paySuccess" @refreshCode="recharge" @closeCode="showCode = false" ref="code" :payAmount="payAmount" :link="link" :paymentType="paymentType" :orderSn="orderSn"></qr-code>
|
|
<qr-code v-if="showCode" @paySuccess="paySuccess" @refreshCode="recharge" @closeCode="showCode = false" ref="code" :payAmount="payAmount" :link="link" :paymentType="paymentType" :orderSn="orderSn"></qr-code>
|
|
@@ -64,6 +67,8 @@ export default {
|
|
payAmount: 0,
|
|
payAmount: 0,
|
|
centerDialogVisible: false,
|
|
centerDialogVisible: false,
|
|
text: "",
|
|
text: "",
|
|
|
|
+ value: "",
|
|
|
|
+ checked: false,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
components: {
|
|
components: {
|
|
@@ -119,47 +124,43 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
chooseMoney(v, i) {
|
|
chooseMoney(v, i) {
|
|
|
|
+ this.value = "";
|
|
this.curIdx = i;
|
|
this.curIdx = i;
|
|
this.money = v.value;
|
|
this.money = v.value;
|
|
this.id = v.id;
|
|
this.id = v.id;
|
|
},
|
|
},
|
|
open() {
|
|
open() {
|
|
this.curIdx = -1;
|
|
this.curIdx = -1;
|
|
- this.$prompt("请输入充值金额(正整数)", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- inputPattern: /^[1-9]\d*$/,
|
|
|
|
- inputErrorMessage: "输入金额格式不正确",
|
|
|
|
- })
|
|
|
|
- .then(({ value }) => {
|
|
|
|
- this.money = Number(value);
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: "info",
|
|
|
|
- message: "取消输入",
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
},
|
|
},
|
|
recharge() {
|
|
recharge() {
|
|
|
|
+ let params = {
|
|
|
|
+ money: this.value ? this.value : this.money,
|
|
|
|
+ paymentType: this.paymentType,
|
|
|
|
+ createType: 1,
|
|
|
|
+ id: this.value ? "" : this.id,
|
|
|
|
+ };
|
|
if (!this.paymentType) {
|
|
if (!this.paymentType) {
|
|
return this.$message({
|
|
return this.$message({
|
|
type: "info",
|
|
type: "info",
|
|
message: "请先选择支付方式再充值!",
|
|
message: "请先选择支付方式再充值!",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- if (!this.money) {
|
|
|
|
|
|
+ let reg = new RegExp(
|
|
|
|
+ "^[1-9]{1}[0-9]*$|^0{1}.{1}[0-9]+$|^[1-9]{1}[0-9]*.{1}[0-9]+$"
|
|
|
|
+ );
|
|
|
|
+ if (!reg.test(Number(params.money))) {
|
|
return this.$message({
|
|
return this.$message({
|
|
type: "info",
|
|
type: "info",
|
|
- message: "请先输入充值金额再充值!",
|
|
|
|
|
|
+ message: "请先输入正确充值金额再充值!",
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- let params = {
|
|
|
|
- money: this.money,
|
|
|
|
- paymentType: this.paymentType,
|
|
|
|
- createType: 1,
|
|
|
|
- id: this.id,
|
|
|
|
- };
|
|
|
|
|
|
+ if (!this.checked) {
|
|
|
|
+ return this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "请先勾选同意后再充值!",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
recharge(params).then((res) => {
|
|
recharge(params).then((res) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.link = res.data.data;
|
|
this.link = res.data.data;
|
|
@@ -253,13 +254,17 @@ export default {
|
|
.agreement {
|
|
.agreement {
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
- color: #808080;
|
|
|
|
|
|
+ color: #fc7200;
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
span {
|
|
span {
|
|
color: #3662a1;
|
|
color: #3662a1;
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.recharge_list /deep/ .el-input__inner {
|
|
|
|
+ border: none !important;
|
|
|
|
+ text-align: center;
|
|
|
|
+}
|
|
.recharge_list {
|
|
.recharge_list {
|
|
width: 100%;
|
|
width: 100%;
|
|
display: flex;
|
|
display: flex;
|