From 416ef077b916de27c88439d2fb679691e85df743 Mon Sep 17 00:00:00 2001
From: 李凌 <344137771@qq.com>
Date: Fri, 12 Jun 2026 16:40:53 +0800
Subject: [PATCH] 1
---
src/page/user/recharge.vue | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/src/page/user/recharge.vue b/src/page/user/recharge.vue
index 6fbf787..728a68d 100644
--- a/src/page/user/recharge.vue
+++ b/src/page/user/recharge.vue
@@ -38,11 +38,14 @@
<div style="font-size: 12px;">
If you encounter any deposit problems, please contact online customer service
</div>
- <div style="display: flex;justify-content: space-between;align-items: center;margin-top: 20px;">
- <div class="payclass" @click="paytype=0" :style="paytype==0?'border: 1px solid #1989FA;':'border: 1px solid #e5e8ed;'">Pay</div>
- <div class="payclass" @click="paytype=2" :style="paytype==2?'border: 1px solid #1989FA;':'border: 1px solid #e5e8ed;'">Pay 1</div>
- <div class="payclass" @click="paytype=1" :style="paytype==1?'border: 1px solid #1989FA;':'border: 1px solid #e5e8ed;'">Pay 2</div>
- <!-- <div class="payclass" @click="paytype=3" :style="paytype==3?'border: 1px solid #1989FA;':'border: 1px solid #e5e8ed;'">Pay 3</div> -->
+ <div style="display: flex;justify-content: space-between;align-items: center;margin-top: 20px;flex-wrap: wrap;gap: 10px;">
+ <div
+ v-for="(item, index) in payOptionList"
+ :key="index"
+ class="payclass"
+ @click="paytype = item.param"
+ :style="paytype === item.param ? 'border: 1px solid #1989FA;' : 'border: 1px solid #e5e8ed;'"
+ >{{ item.name }}</div>
</div>
<van-button class="but" type="primary" style="margin-top: 1.04rem; margin-bottom: 1.04rem"
@click="selCzFns">{{ $t("hj172") }}</van-button>
@@ -60,6 +63,7 @@
import apiUrl from "@/axios/api.url.js";
import {
siteGetPayInfo,
+ getPayOptionList,
selCzFn,
thirdPartyRecharge
} from "../../axios/api";
@@ -77,6 +81,7 @@
},
mounted() {
this.getPayInfos();
+ this.fetchPayOptionList();
},
// getPayInfo
data() {
@@ -99,7 +104,8 @@
rechargeAccountActions: rechargeAccountActions,
showBtn: true,
imgStatus: false,
- paytype: 0,
+ payOptionList: [],
+ paytype: null,
form: {
img1key: "",
},
@@ -119,9 +125,12 @@
this.judgeValue();
},
async selCzFns() {
+ if (this.paytype === null || this.paytype === undefined) {
+ return Notify(this.$t("請選擇充值金額") || "Please select a payment method");
+ }
const res = await thirdPartyRecharge({
tradeAmoun: this.value,
- type:this.paytype
+ type: this.paytype
});
console.log(res);
if (res.status == 0) {
@@ -148,6 +157,15 @@
// }
// Notify("请上传文件");
},
+ async fetchPayOptionList() {
+ const res = await getPayOptionList();
+ if (res.status === 0 && res.data && Array.isArray(res.data)) {
+ this.payOptionList = res.data;
+ if (this.payOptionList.length > 0 && this.paytype === null) {
+ this.paytype = this.payOptionList[0].param;
+ }
+ }
+ },
async getPayInfos() {
const res = await siteGetPayInfo();
if (res.status === 0) {
--
Gitblit v1.9.3