From 289948f53b5e0b00a656d60c08efbff0eb05fa90 Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Thu, 16 May 2024 15:37:05 +0800
Subject: [PATCH] 提款更改

---
 src/page/user/recharge-sure.vue |  233 ++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 168 insertions(+), 65 deletions(-)

diff --git a/src/page/user/recharge-sure.vue b/src/page/user/recharge-sure.vue
index 3bd1f42..55c5887 100644
--- a/src/page/user/recharge-sure.vue
+++ b/src/page/user/recharge-sure.vue
@@ -3,99 +3,156 @@
     <van-nav-bar
       :placeholder="true"
       :safe-area-inset-top="true"
-      title="提款"
+      :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">請選擇提款账户</div>
+      <div class="main-title">IFSC</div>
+      <div class="white-input">
+        <input type="number" :disabled="true" :placeholder="$t('请设置ifsc')" :value="bankCard.bankAddress" @input="ifscInputValue" />
+<!--        <van-icon class="myr" name="arrow" />-->
+      </div>
+<!--      <van-cell-->
+<!--        is-link-->
+<!--        :title="paymentSelectData.channelAccount || $t('请设置ifsc')"-->
+<!--        @click="paymentShow = true"-->
+<!--      />-->
+<!--      <van-action-sheet-->
+<!--        v-model="paymentShow"-->
+<!--        :actions="paymentActions"-->
+<!--        :cancel-text="$t('qx')"-->
+<!--        close-on-click-action-->
+<!--        @select="paymentSelect"-->
+<!--      />-->
+      <div class="main-title">{{ $t("提款帐户") }}</div>
       <van-cell
         is-link
-        :title="rechargeAccountData.name || '請選擇'"
+        :title="rechargeAccountData.name || $t('請選擇')"
         @click="rechargeAccountShow = true"
       />
       <van-action-sheet
         v-model="rechargeAccountShow"
         :actions="rechargeAccountActions"
-        cancel-text="取消"
+        :cancel-text="$t('hj106')"
         close-on-click-action
         @select="rechargeAccountSelect"
       />
-
-      <div class="main-title">支持得提款渠道</div>
-      <van-cell
-        is-link
-        :title="rechargeSelect.name || '請選擇'"
-        @click="show = true"
-      />
-      <van-action-sheet
-        v-model="show"
-        :actions="actions"
-        cancel-text="取消"
-        close-on-click-action
-        @select="select"
-      />
-      <div v-if="rechargeSelect.key !== undefined">
-        <div class="main-title">請選擇銀行卡</div>
-        <van-cell is-link :title="bankCard.bankNo || '請選擇'" />
-        <!-- @click="show = true" -->
-        <!-- <van-action-sheet
-          v-model="show"
-          :actions="actions"
-          cancel-text="取消"
-          close-on-click-action
-          @select="select"
-        /> -->
+      <div class="main-title">{{ $t("银行帐号") }}</div>
+      <div class="white-input">
+        <input type="number" :disabled="true" :placeholder="$t('请将银行账户设置为')" :value="bankCard.bankNo" @input="bankNoInputValue" />
+<!--        <van-icon class="myr" name="arrow" />-->
       </div>
-      <div class="main-title">請選擇充值金額</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"-->
+<!--      />-->
+      <div class="main-title">{{ $t("hj213") }}</div>
+      <div class="white-input">
+        <input type="text" :disabled="true" :placeholder="$t('请设置银行名称')" :value="bankCard.bankName" @input="bankNameInputValue" />
+<!--        <van-icon class="myr" name="arrow" />-->
+      </div>
+<!--      <van-cell is-link :title="bankCard.bankName || $t('请设置银行名称')" />-->
+      <div class="main-title">{{ $t("姓名") }}</div>
+      <div class="white-input">
+        <input type="text" :disabled="true" :placeholder="$t('请将姓名设置为')" :value="actualName" @input="actualNameInputValue" />
+<!--        <van-icon class="myr" name="arrow" />-->
+      </div>
+<!--      <van-cell is-link :title="paymentSelectData.channelName || $t('请将姓名设置为')" />-->
+<!--      <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"-->
+<!--      />-->
+<!--      <div v-if="rechargeSelect.key !== undefined">-->
+<!--        <div class="main-title">{{ $t("請選擇銀行卡") }}</div>-->
+<!--        <van-cell is-link :title="bankCard.bankNo || $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">最大</span>
+        <span class="myr" @click="value = availableBalanceUSD">{{
+          $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 }} {{ 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>
+      <div>
+        <div class="dz-title" v-if="rechargeAccountData.key !== undefined">
+          <div>{{ $t("最低取款金额") }}</div>
+          <div class="balance-text">
+            {{ withMinAmt }} {{ symbolCode }}
+          </div>
+        </div>
+      </div>
+<!--      <van-cell-group v-if="rechargeAccountData.key !== undefined">-->
+<!--        <van-cell :title="$t('最低取款金额')" :value="withMinAmt + symbolCode" />-->
+<!--      </van-cell-group>-->
       <van-button
         class="but"
         type="primary"
         style="margin-top: 1.04rem; margin-bottom: 1.04rem"
         @click="setOutMoney"
-        >提款</van-button
+        >{{ $t("提款") }}</van-button
       >
     </main>
   </div>
 </template>
 
 <script>
-import { ActionSheet, Notify } from "vant";
+import { ActionSheet, Notify,Cell, CellGroup } from "vant";
 import ClipboardJS from "clipboard";
-import { getBankCard, getMoney, outMoney } from "../../axios/api";
+import {getBankCard, getMoney, getSetting, outMoney, siteGetPayInfo} from "../../axios/api";
 
 export default {
-  components: { ActionSheet, [Notify.Component.name]: Notify.Component },
+  components: {
+    ActionSheet,
+    [Notify.Component.name]: Notify.Component,
+    Cell,
+    CellGroup
+  },
   data() {
     return {
       value: 0,
-
+      paymentActions: [],
       paymentSelectData: "US",
-
+      actualName: this.$store.state.userInfo.realName,
       show: false,
 
       // 提款聚到
       rechargeSelect: {},
-      actions: [{ name: "銀行卡充值", key: "YHK" }],
+      actions: [{ name: this.$t("hj215"), key: "YHK" }],
       paymentShow: false,
 
       rechargeAccountShow: false,
@@ -103,39 +160,64 @@
       rechargeAccountData: {},
       rechargeAccountActions: [
         {
-          name: "美股賬戶",
+          name: this.$t("US"),
           key: "US",
         },
         {
-          name: "印股帳戶",
+          name: this.$t("IN"),
           key: "IN",
         },
-        {
-          name: "馬股賬戶",
-          key: "MAS",
-        },
+        // {
+        //   name: this.$t("MAS"),
+        //   key: "MAS",
+        // },
+        // {
+        //   name: this.$t("HK"),
+        //   key: "HK",
+        // },
       ],
+
       bankCard: {},
       availableBalanceUSD: "0.0000",
       getMoneyList: [],
       assetsType: "",
+      symbolCode: "",
+      withMinAmt:''
     };
   },
   mounted() {
     this.getykh();
     this.getMoneys();
+    this.getPayInfos();
+    this.setSetting()
   },
   methods: {
+    async setSetting(){
+      const res = await getSetting();
+      if (res.status === 0) {
+        this.withMinAmt = res.data.withMinAmt
+      }
+    },
+    async getPayInfos() {
+      const res = await siteGetPayInfo();
+      if (res.status === 0) {
+        res.data.map((item) => {
+          item.name = item.channelType;
+        });
+        this.paymentActions = res.data;
+        console.log(this.paymentActions)
+      }
+      console.log(res);
+    },
     async setOutMoney() {
-      console.log(this.assetsType);
       const res = await outMoney({
         amt: this.value,
         assetsType: this.accectType,
       });
       if (res.status === 0) {
-        Notify({ type: "success", message: "提款成功,等待审核" });
+        Notify({ type: "success", message: this.$t("hj182") });
         setTimeout(() => {
-          this.onClickLeft();
+          this.$router.push("/cashlist");
         }, 500);
       } else {
         Notify(res.msg);
@@ -144,6 +226,18 @@
     },
     inputValue(e) {
       this.value = e.target.value;
+    },
+    ifscInputValue(e){
+      this.bankCard.bankAddress = e.target.value;
+    },
+    bankNoInputValue(e){
+      this.bankCard.bankNo = e.target.value;
+    },
+    bankNameInputValue(e){
+      this.bankCard.bankName = e.target.value;
+    },
+    actualNameInputValue(e){
+      this.actualName = e.target.value;
     },
     async getykh() {
       const res = await getBankCard();
@@ -157,8 +251,8 @@
         this.getMoneyList = res.data;
         res.data.map((item) => {
           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;
           }
         });
@@ -188,18 +282,27 @@
       console.log(e);
     },
     rechargeAccountSelect(e) {
+      console.log(e)
       this.rechargeAccountData = e;
       (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;
         }
       });
     },
     paymentSelect(e) {
-      this.paymentSelectData = e.name;
+      this.paymentSelectData = e;
+      this.accectType = e.assetsType;
       console.log(e);
+      this.rechargeAccountActions.map((item) => {
+        if (item.key === e.assetsType) {
+          console.log(item)
+          this.rechargeAccountData = item;
+          this.rechargeAccountSelect(item)
+        }
+      });
     },
   },
 };
@@ -345,4 +448,4 @@
     color: #4f5257;
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3