|
|
@@ -121,17 +121,6 @@
|
|
|
>
|
|
|
{{ payCountList[3] }} HB
|
|
|
</li>
|
|
|
- <!-- <li
|
|
|
- class="count_input"
|
|
|
- :class="{
|
|
|
- active: currentCount === -1,
|
|
|
- }"
|
|
|
- @click="onSelectCount(null, -1)"
|
|
|
- @keyup.enter="onConfirmCount"
|
|
|
- >
|
|
|
- <input type="number" v-model="payCount2" />
|
|
|
- <div class="confirm" @click="onConfirmCount">确认</div>
|
|
|
- </li> -->
|
|
|
<li class="count clear">
|
|
|
<div class="reduce" @click="reduce(3)">-</div>
|
|
|
<input
|
|
|
@@ -145,6 +134,17 @@
|
|
|
/>
|
|
|
<div class="add" @click="add(3)">+</div>
|
|
|
</li>
|
|
|
+ <!-- 可输入框 -->
|
|
|
+ <li class="default input_left">
|
|
|
+ <input
|
|
|
+ type="number"
|
|
|
+ placeholder="请输入鸿币数"
|
|
|
+ v-model="payCount2"
|
|
|
+ />
|
|
|
+ </li>
|
|
|
+ <li class="count clear input_right">
|
|
|
+ <div class="confirm" @click="onConfirmCount">确认</div>
|
|
|
+ </li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -214,8 +214,7 @@ export default {
|
|
|
inject: ["checkCode", "getFinance", "checkCodeHandler", "onRecharge"],
|
|
|
data() {
|
|
|
return {
|
|
|
- payCountList: ["0.01", "200", "500", "1000"], // 可选充值金额列表
|
|
|
- // payCountList: ["100", "200", "500", "1000"], // 可选充值金额列表
|
|
|
+ payCountList: ["100", "200", "500", "1000"], // 可选充值金额列表
|
|
|
currentCount: 0, // 默认选中的充值金额
|
|
|
payPlatform: "ALIPAY", // 默认支付方式
|
|
|
payCount: 0, // 应付金额
|
|
|
@@ -228,6 +227,7 @@ export default {
|
|
|
allCount: 0, // 本应付金额
|
|
|
oldHB: 0, // 原得鸿币
|
|
|
newHB: 0, // 应得鸿币
|
|
|
+ confirmInput: false, // 输入内容确定
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -243,24 +243,42 @@ export default {
|
|
|
watch: {
|
|
|
// 第一档 100
|
|
|
firstCount(firstCountNew) {
|
|
|
+ if (this.confirmInput) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.payCount2 = "";
|
|
|
this.checkInput(0);
|
|
|
this.computeMoney();
|
|
|
},
|
|
|
// 第二档 200
|
|
|
secondCount(secondCountNew) {
|
|
|
+ if (this.confirmInput) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.payCount2 = "";
|
|
|
this.checkInput(1);
|
|
|
this.computeMoney();
|
|
|
},
|
|
|
// 第三档 500
|
|
|
thirdCount(thirdCountNew) {
|
|
|
+ if (this.confirmInput) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.payCount2 = "";
|
|
|
this.checkInput(2);
|
|
|
this.computeMoney();
|
|
|
},
|
|
|
// 第四档 1000
|
|
|
fourthCount(fourthCountNew) {
|
|
|
+ if (this.confirmInput) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.payCount2 = "";
|
|
|
this.checkInput(3);
|
|
|
this.computeMoney();
|
|
|
},
|
|
|
+ // 输入鸿币数
|
|
|
+ payCount2(payCount2) {},
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
@@ -291,6 +309,7 @@ export default {
|
|
|
|
|
|
// 选中充值金额
|
|
|
select(index) {
|
|
|
+ this.confirmInput = false;
|
|
|
switch (index) {
|
|
|
// 100
|
|
|
case 0:
|
|
|
@@ -326,12 +345,19 @@ export default {
|
|
|
|
|
|
// 自定义金额
|
|
|
onConfirmCount() {
|
|
|
- if (!this.payCount2) {
|
|
|
- this.$toast.text("请输入正确的金额");
|
|
|
+ if (!parseInt(this.payCount2) || !/^[1-9]\d*$/.test(this.payCount2)) {
|
|
|
+ this.$toast.text("请输入一个正整数");
|
|
|
return;
|
|
|
}
|
|
|
- this.payCount2 = Math.ceil(parseFloat(this.payCount2 * 100)) / 100;
|
|
|
+ // 确认清空其他档位
|
|
|
+ this.confirmInput = true;
|
|
|
+ this.firstCount = 0;
|
|
|
+ this.secondCount = 0;
|
|
|
+ this.thirdCount = 0;
|
|
|
+ this.fourthCount = 0;
|
|
|
+
|
|
|
this.payCount = this.payCount2;
|
|
|
+ this.discount(this.payCount);
|
|
|
},
|
|
|
|
|
|
// 充值鸿币 立即付款
|
|
|
@@ -379,6 +405,7 @@ export default {
|
|
|
* @param index 档位下标
|
|
|
*/
|
|
|
reduce(index) {
|
|
|
+ this.confirmInput = false;
|
|
|
switch (index) {
|
|
|
// 100
|
|
|
case 0:
|
|
|
@@ -417,6 +444,7 @@ export default {
|
|
|
* @param index 档位下标
|
|
|
*/
|
|
|
add(index) {
|
|
|
+ this.confirmInput = false;
|
|
|
switch (index) {
|
|
|
// 100
|
|
|
case 0:
|
|
|
@@ -529,6 +557,9 @@ export default {
|
|
|
|
|
|
<style lang='less' scoped>
|
|
|
.menu_pay_h5 {
|
|
|
+ height: 680 / @rem;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
.pay_account,
|
|
|
.pay_money,
|
|
|
.pay_type,
|
|
|
@@ -586,6 +617,23 @@ export default {
|
|
|
margin-bottom: 10 / @rem;
|
|
|
}
|
|
|
|
|
|
+ .input_left {
|
|
|
+ input {
|
|
|
+ width: 100%;
|
|
|
+ font-size: 32 / @rem;
|
|
|
+ color: #555555;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .input_right {
|
|
|
+ border-radius: 8 / @rem;
|
|
|
+ color: #fff;
|
|
|
+ background-color: #3faeed;
|
|
|
+ border: 2px solid #3faeed;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
.count {
|
|
|
.reduce,
|
|
|
input,
|
|
|
@@ -765,6 +813,12 @@ export default {
|
|
|
margin-bottom: 8 / @rem;
|
|
|
}
|
|
|
|
|
|
+ .input_left {
|
|
|
+ input {
|
|
|
+ font-size: 16 / @rem;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.count {
|
|
|
.reduce,
|
|
|
input,
|