From 58b0f1e9bd03a472321acf1dfc4e89fc4ce9df7a Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Mon, 29 Sep 2025 01:14:10 +0800
Subject: [PATCH] 9.28更换api

---
 src/page/user/recharge-sure.vue |  207 ++++++++++++++++++++++++---------------------------
 1 files changed, 99 insertions(+), 108 deletions(-)

diff --git a/src/page/user/recharge-sure.vue b/src/page/user/recharge-sure.vue
index f623b8d..611bdd2 100644
--- a/src/page/user/recharge-sure.vue
+++ b/src/page/user/recharge-sure.vue
@@ -1,81 +1,43 @@
 <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('/cashlist')" name="orders-o" size="20" />
+      </template>
+    </van-nav-bar>
     <main>
       <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"
-      />
+      <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" />
 
       <div class="main-title">{{ $t("支持得提款渠道") }}</div>
-      <van-cell
-        is-link
-        :title="rechargeSelect.name || $t('請選擇')"
-        @click="show = true"
-      />
-      <van-action-sheet
-        v-model="show"
-        :actions="actions"
-        :cancel-text="$t('hj106')"
-        close-on-click-action
-        @select="select"
-      />
+      <van-cell is-link :title="rechargeSelect.name || $t('請選擇')" @click="show = true" />
+      <van-action-sheet v-model="show" :actions="actions" :cancel-text="$t('hj106')" close-on-click-action
+        @select="select" />
       <div v-if="rechargeSelect.key !== undefined">
         <div class="main-title">{{ $t("請選擇銀行卡") }}</div>
-        <van-cell is-link :title="bankCard.bankNo || $t('請選擇')" />
-        <!-- @click="show = true" -->
-        <!-- <van-action-sheet
-          v-model="show"
-          :actions="actions"
-          :cancel-text="$t('hj106')"
-          close-on-click-action
-          @select="select"
-        /> -->
+        <!-- <van-cell is-link :title="bankCard.bankName || $t('請選擇')" /> -->
+        <van-cell is-link :title="yhkrechargeSelect.bankName || $t('請選擇')" @click="yhkshow = true" />
+        <van-action-sheet v-model="yhkshow" :actions="yhkactions" :cancel-text="$t('hj106')" close-on-click-action
+          @select="yhkselect" />
       </div>
-      <div class="main-title">{{ $t("請選擇充值金額") }}</div>
+      <div class="main-title">{{ $t("请选择提现金额") }}</div>
       <div class="white-input">
         <input type="number" :value="value" @input="inputValue" />
-        <span class="myr" @click="value = availableBalanceUSD">{{
-          $t("最大")
-        }}</span>
+        <span class="myr" @click="value = Math.floor(availableBalanceUSD * 100) / 100">{{ $t("最大") }}</span>
       </div>
       <div>
         <div class="dz-title" v-if="rechargeAccountData.key !== undefined">
-          <div>餘額</div>
-          <div class="balance-text">{{ availableBalanceUSD }} USD</div>
+          <div>{{ $t("可用餘額") }}</div>
+          <div class="balance-text">
+            {{ availableBalanceUSD | _toLocaleString }} {{ symbolCode }}
+            <!-- {{ symbolCode }} -->
+          </div>
         </div>
-
-        <!-- <div class="dz-title">
-          <div>實際到帳</div>
-          <div class="balance-text">0.0000</div>
-        </div> -->
-        <!-- <div class="dz-title" v-if="rechargeAccountData.key !== undefined">
-          <div>最小提款金額</div>
-          <div class="balance-text">0.0000</div>
-        </div> -->
       </div>
-      <van-button
-        class="but"
-        type="primary"
-        style="margin-top: 1.04rem; margin-bottom: 1.04rem"
-        @click="setOutMoney"
-        >{{ $t("提款") }}</van-button
-      >
+      <van-button class="but" type="primary" style="margin-top: 1.04rem; margin-bottom: 1.04rem" @click="setOutMoney"
+        :disabled="isclick">{{ $t("提款") }}</van-button>
     </main>
   </div>
 </template>
@@ -83,6 +45,7 @@
 <script>
 import { ActionSheet, Notify } from "vant";
 import ClipboardJS from "clipboard";
+import _ from "lodash";
 import { getBankCard, getMoney, outMoney } from "../../axios/api";
 
 export default {
@@ -91,36 +54,45 @@
     return {
       value: 0,
 
-      paymentSelectData: "US",
-
+      paymentSelectData: "IN",
+      isclick: false,
       show: false,
-
+      yhkshow: false,
       // 提款聚到
       rechargeSelect: {},
-      actions: [{ name: "銀行卡充值", key: "YHK" }],
+      yhkrechargeSelect: {},
+      actions: [{ name: this.$t("hj215"), key: "YHK" }],
+      yhkactions: [],
       paymentShow: false,
 
       rechargeAccountShow: false,
       //  请选择提款账户
       rechargeAccountData: {},
       rechargeAccountActions: [
+        // {
+        //   name: this.$t("IN"),
+        //   key: "IN",
+        // },
         {
           name: this.$t("US"),
-          key: "US",
-        },
-        {
-            name: this.$t("IN"),
-          key: "IN",
-        },
-        {
-          name: this.$t("MAS"),
-          key: "MAS",
-        },
+          key: "US"
+        }
+        // {
+        //   name: this.$t("MAS"),
+        //   key: "MAS",
+        // },
+        // {
+        //   name: this.$t("HK"),
+        //   key: "HK",
+        // },
       ],
-      bankCard: {},
+
+      bankCard: [],
       availableBalanceUSD: "0.0000",
       getMoneyList: [],
       assetsType: "",
+      symbolCode: "",
+      yhkid: ""
     };
   },
   mounted() {
@@ -129,16 +101,19 @@
   },
   methods: {
     async setOutMoney() {
-      console.log(this.assetsType);
+      if (this.isclick) return;
+      console.log("11111");
       const res = await outMoney({
         amt: this.value,
         assetsType: this.accectType,
+        bankId: this.yhkid
       });
+      this.isclick = false;
       if (res.status === 0) {
-        Notify({ type: "success", message: this.$t('提款成功,等待审核') });
-        setTimeout(() => {
-          this.onClickLeft();
-        }, 500);
+        Notify({ type: "success", message: this.$t("hj182") });
+        // setTimeout(() => {
+        this.$router.push("/cashlist");
+        // }, 500);
       } else {
         Notify(res.msg);
       }
@@ -151,16 +126,22 @@
       const res = await getBankCard();
       if (res.status === 0) {
         this.bankCard = res.data;
+        this.yhkactions = res.data;
+        for (var i = 0; i < this.yhkactions.length; i++) {
+          this.yhkactions[i].name = this.yhkactions[i].bankName;
+        }
       }
     },
     async getMoneys() {
       const res = await getMoney();
       if (res.status === 0) {
         this.getMoneyList = res.data;
-        res.data.map((item) => {
+        res.data.map(item => {
+          console.log(1111111, item.accectType, this.rechargeAccountData.key, item.availableBalance);
+
           if (item.accectType === this.rechargeAccountData.key) {
-            console.log(item.accectType, "assetsType1");
-            this.availableBalanceUSD = item.availableBalanceUSD;
+            this.availableBalanceUSD = item.availableBalance;
+            this.symbolCode = item.symbolCode;
             this.accectType = item.accectType;
           }
         });
@@ -172,7 +153,7 @@
     },
     copyText(e, data) {
       var clipboard = new ClipboardJS(".copy-button", {
-        text: () => data,
+        text: () => data
       });
 
       clipboard.on("success", () => {
@@ -183,7 +164,12 @@
       clipboard.onClick(e);
     },
     onClickLeft() {
-      this.$router.push("/user");
+      this.$router.go(-1);
+    },
+    yhkselect(e) {
+      this.yhkrechargeSelect = e;
+      this.yhkid = e.id;
+      console.log(e);
     },
     select(e) {
       this.rechargeSelect = e;
@@ -191,10 +177,10 @@
     },
     rechargeAccountSelect(e) {
       this.rechargeAccountData = e;
-      (this.getMoneyList || []).map((item) => {
+      (this.getMoneyList || []).map(item => {
         if (item.accectType === this.rechargeAccountData.key) {
-          console.log(item.accectType, "accectType2", item);
-          this.availableBalanceUSD = item.availableBalanceUSD;
+          this.availableBalanceUSD = item.availableBalance;
+          this.symbolCode = item.symbolCode;
           this.accectType = item.accectType;
         }
       });
@@ -202,26 +188,31 @@
     paymentSelect(e) {
       this.paymentSelectData = e.name;
       console.log(e);
-    },
-  },
+    }
+  }
 };
 </script>
 
 <style lang="less" scoped>
+@green: #287dff;
+
 .but {
   width: 100%;
   color: #ffffff;
-  background-color: #1989fa;
+  background-color: @green;
+  border: none;
   border-radius: 8px;
   height: 66px;
   font-size: 22px;
 }
+
 .bottom-text {
   width: 100%;
   background-color: #fff;
   padding: 0.26667rem 0.37333rem;
   box-sizing: border-box;
   margin-top: 0.26667rem;
+
   // margin-bottom: 80px;
   .balance {
     display: flex;
@@ -232,6 +223,7 @@
     font-style: normal;
     font-weight: 500;
     box-sizing: border-box;
+
     .balance-text {
       color: #181818;
       font-family: PingFang SC;
@@ -242,6 +234,7 @@
       margin-bottom: 0.37333rem;
     }
   }
+
   .division {
     width: 100%;
     height: 0.02667rem;
@@ -249,6 +242,7 @@
     background-color: #e5e8ed;
     margin: 0.37333rem 0;
   }
+
   .upload-text {
     color: #181818;
     font-family: PingFang SC;
@@ -257,21 +251,11 @@
     font-weight: 500;
   }
 }
+
 /deep/ .van-nav-bar__content {
   height: 65px;
 }
-/deep/ .van-nav-bar__title {
-  font-family: "DINPro";
-  width: 100%;
-  height: 1.17333rem;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  font-style: normal;
-  font-weight: 500;
-  font-size: 0.48rem;
-  color: #14181f;
-}
+
 /deep/ .van-cell {
   list-style: none;
   width: 100%;
@@ -290,10 +274,12 @@
   margin-top: 0.26667rem;
   box-shadow: 0 0.16rem 0.32rem #eaeaea99;
 }
+
 main {
   padding: 0 0.4rem 0.53333rem;
   box-sizing: border-box;
 }
+
 .main-title {
   font-style: normal;
   font-weight: 400;
@@ -303,6 +289,7 @@
 }
 
 .white-input {
+  color: #333;
   width: 100%;
   background: #fff;
   border-radius: 0.10667rem;
@@ -322,14 +309,17 @@
   display: flex;
   justify-content: space-between;
 }
+
 .fuzhi {
   font-size: 28px;
   cursor: pointer;
 }
+
 .myr {
-  color: rgb(5, 106, 239);
+  color: @green;
   cursor: pointer;
 }
+
 .dz-title {
   display: flex;
   justify-content: space-between;
@@ -340,11 +330,12 @@
   margin-top: 0.31333rem;
   padding: 0 0.13333rem;
   box-sizing: border-box;
+
   .balance-text {
     font-style: normal;
     font-weight: 500;
     font-size: 0.37333rem;
-    color: #4f5257;
+    color: #5d5f65;
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3