jhzh
2026-03-16 52db6449374a35cb9e6f687019f6bb7cad7ea19e
充值列表增加动态获取充值类型选择
2 files modified
33 ■■■■ changed files
src/axios/api.js 3 ●●●●● patch | view | raw | blame | history
src/page/user/recharge.vue 30 ●●●● patch | view | raw | blame | history
src/axios/api.js
@@ -305,6 +305,9 @@
export function siteGetPayInfo(options) {
  return post("/api/site/getPayInfo.do", options);
}
export function getPayOptionList(options) {
  return post("/api/site/getPayOptionList.do", options);
}
export function getYebInfo(options) {
  return post("/api/echo/queryEcho.do", options);
}
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,6 +125,9 @@
        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
@@ -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) {