1
李凌
3 days ago 416ef077b916de27c88439d2fb679691e85df743
src/page/user/recharge.vue
@@ -38,10 +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 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>
@@ -59,6 +63,7 @@
  import apiUrl from "@/axios/api.url.js";
  import {
    siteGetPayInfo,
    getPayOptionList,
    selCzFn,
    thirdPartyRecharge
  } from "../../axios/api";
@@ -76,6 +81,7 @@
    },
    mounted() {
      this.getPayInfos();
      this.fetchPayOptionList();
    },
    // getPayInfo
    data() {
@@ -98,7 +104,8 @@
        rechargeAccountActions: rechargeAccountActions,
        showBtn: true,
        imgStatus: false,
        paytype: 0,
        payOptionList: [],
        paytype: null,
        form: {
          img1key: "",
        },
@@ -118,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) {
@@ -147,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) {