1
PC-20250623MANY\Administrator
2025-08-13 0181aec558562dbe5979f2a58704c2474f070c1c
src/page/user/recharge.vue
@@ -1,21 +1,37 @@
<template>
  <div>
    <van-nav-bar :placeholder="true" :safe-area-inset-top="true" :title="$t('充值中心')" left-arrow
      @click-left="onClickLeft">
    <van-nav-bar
      :placeholder="true"
      :safe-area-inset-top="true"
      :title="$t('充值中心')"
      left-arrow
      @click-left="onClickLeft"
    >
      <template #right>
        <van-icon @click="$router.push('/rechargelist')" name="orders-o" size="20" />
        <van-icon
          @click="$router.push('/rechargelist')"
          name="orders-o"
          size="20"
        />
      </template>
    </van-nav-bar>
    <main>
      <div>
        <template>
          <!-- <div class="main-title">{{ $t("请选择充值账户") }}</div>
          <van-cell
            is-link
            :title="rechargeAccountData.name || $t('請選擇')"
            @click="rechargeAccountShow = true"
          />
          <van-action-sheet
            v-model="rechargeAccountShow"
            :actions="rechargeAccountActions"
            :cancel-text="$t('hj106')"
            close-on-click-action
            @select="rechargeAccountSelect"
          /> -->
          <!-- @click="rechargeAccountShow = true" -->
          <!-- close-on-click-action -->
          <!-- @select="rechargeAccountSelect" -->
          <div class="main-title">{{ $t("請選擇充值金額") }}</div>
          <div class="white-input">
            <input type="number" :value="value" @input="inputValue" />
@@ -26,24 +42,49 @@
            <div class="balance" style="margin-top: 10px">
              <div>{{ $t("最小充值金額") }}</div>
              <div class="balance-text" style="margin-bottom: 0px">
                <!-- {{ paymentSelectData.channelMinLimit }}
                {{ rechargeAccountData.symbolCode }} -->
                1000
              </div>
            </div>
            <div class="division"></div>
          </div>
          <!--  :disabled="butFlg" -->
          <div style="font-size: 12px;">
            If you encounter any deposit problems, please contact online customer service
            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=1" :style="paytype==1?'border: 1px solid #c4d600;':'border: 1px solid  #e5e8ed;'">Pay 1</div>
            <div class="payclass" @click="paytype=2"  :style="paytype==2?'border: 1px solid #c4d600;':'border: 1px solid  #e5e8ed;'">Pay 2</div>
          <div
            style="display: flex;justify-content: space-between;align-items: center;margin-top: 20px;"
          >
            <div
              class="payclass"
              @click="paytype = 1"
              :style="
                paytype == 1
                  ? 'border: 1px solid #c4d600;'
                  : 'border: 1px solid  #e5e8ed;'
              "
            >
              Pay 1
          </div>
          <van-button class="but" type="primary" style="margin-top: 1.04rem; margin-bottom: 1.04rem"
            @click="selCzFns">{{ $t("hj172") }}</van-button>
            <div
              class="payclass"
              @click="paytype = 2"
              :style="
                paytype == 2
                  ? 'border: 1px solid #c4d600;'
                  : 'border: 1px solid  #e5e8ed;'
              "
            >
              Pay 2
            </div>
          </div>
          <van-button
            class="but"
            type="primary"
            style="margin-top: 1.04rem; margin-bottom: 1.04rem"
            @click="selCzFns"
            >{{ $t("hj172") }}</van-button
          >
        </template>
      </div>
    </main>
@@ -51,22 +92,12 @@
</template>
<script>
  import {
    ActionSheet
  } from "vant";
import { ActionSheet } from "vant";
  import ClipboardJS from "clipboard";
  import apiUrl from "@/axios/api.url.js";
  import {
    siteGetPayInfo,
    selCzFn,
    thirdPartyRecharge
  } from "../../axios/api";
  import {
    Notify
  } from "vant";
  import {
    rechargeAccountActions
  } from "@/utils/rechargeActions";
import { siteGetPayInfo, selCzFn, thirdPartyRecharge } from "../../axios/api";
import { Notify } from "vant";
import { rechargeAccountActions } from "@/utils/rechargeActions";
  // baseURL
  export default {
    components: {
@@ -87,10 +118,12 @@
        paymentSelectData: {},
        rechargeAccountData: {},
        show: false,
        actions: [{
      actions: [
        {
          name: this.$t("銀行卡充值"),
          key: "YHK"
        }],
        }
      ],
        paymentShow: false,
        paymentActions: [],
        rechargeAccountShow: false,
@@ -99,8 +132,8 @@
        imgStatus: false,
        paytype: 1,
        form: {
          img1key: "",
        },
        img1key: ""
      }
      };
    },
    methods: {
@@ -127,29 +160,11 @@
        }else{
            Notify(res.msg);
        }
        // if (!this.value) {
        //   return Notify(this.$t("hj171"));
        // }
        // if (!this.form.img1key) {
        //   return Notify(this.$t("请上传文件"));
        // }
        // const res = await selCzFn({
        //   payTypeId: this.paymentSelectData.id,
        //   payAmt: this.value,
        //   img: this.form.img1key,
        // });
        // if (res.status === 0) {
        //   Notify({ type: "success", message: this.$t("hj182") });
        //   setTimeout(() => {
        //     this.$router.push("/rechargelist");
        //   }, 500);
        // }
        //  Notify("请上传文件");
      },
      async getPayInfos() {
        const res = await siteGetPayInfo();
        if (res.status === 0) {
          res.data.map((item) => {
        res.data.map(item => {
            item.name = item.channelAccount;
          });
          this.paymentActions = res.data;
@@ -183,7 +198,7 @@
      },
      copyText(e, data) {
        var clipboard = new ClipboardJS(".copy-button", {
          text: () => data,
        text: () => data
        });
        clipboard.on("success", () => {
@@ -203,13 +218,13 @@
      },
      paymentSelect(e) {
        this.paymentSelectData = e;
        this.rechargeAccountActions.map((item) => {
      this.rechargeAccountActions.map(item => {
          if (item.key === e.assetsType) {
            this.rechargeAccountData = item;
          }
        });
      },
    },
    }
  }
  };
</script>