1
jhzh
2025-08-18 401c2caeedb8952ca5f792381fff9fc9b83f663d
src/views/cryptos/Withdraw/withdrawPage.vue
@@ -21,18 +21,19 @@
        </div>
        <p class="font-35 mt-44 textColor">{{ $t('区块链网络') }}</p>
        <ul class="flex mt-22  flex-wrap">
          <li
            class="w-210 h-96 mb-20 mr-40 rounded rounded-lg border border-solid flex justify-center items-center textColor"
            :class="blockchainIndex == index ? 'active' : ''" v-for="(item, index) in blockList" :key="item.id"
            @click="changeBlockchain(item, index)">{{ item.blockchain_name }}</li>
               <li class="w-210 h-96 mb-20 mr-40 rounded rounded-lg border border-solid flex justify-center items-center textColor"
                  :class="blockchainIndex == index ? 'active' : ''" v-for="(item, index) in blockList"
                  :key="item.id" @click="changeBlockchain(item, index)">{{ item.blockchain_name }}</li>
        </ul>
        <p class="font-35 mt-22 textColor">{{ $t('地址') }}</p>
        <div class="inputBackground flex items-center justify-between h-96 rounded mt-22">
          <input :placeholder="$t('长按粘贴')" class="h-full flex-1 border-none bg-none px-16 textColor" v-model="address" />
               <input :placeholder="$t('长按粘贴')" class="h-full flex-1 border-none bg-none px-16 textColor"
                  v-model="address" />
          <div class="flex items-center">
            <span class="colorMain" @click="pastCont">{{ $t('粘贴') }}</span>
            <div>
              <img @click="clickCode()" src="@/assets/image/public/scan.png" alt="logo" class="w-65 h-65 ml-20 mr-30" />
                     <img @click="clickCode()" src="@/assets/image/public/scan.png" alt="logo"
                        class="w-65 h-65 ml-20 mr-30" />
            </div>
          </div>
        </div>
@@ -62,14 +63,16 @@
        <p class="text-white mt-46 textColor font-28">{{ $t('提币说明') }}:
        </p>
        <div class="text-grey mt-10 font-28" v-html="tip"></div>
        <van-button class="w-768 h-100 rounded flex justify-center items-center mt-56  text-white btnMain border-none"
            <van-button
               class="w-768 h-100 rounded flex justify-center items-center mt-56  text-white btnMain border-none"
          @click="showDetail">
          {{ $t('提现') }}</van-button>
      </div>
      <van-popup v-model:show="show" position="bottom">
        <div class="pop-box relative font-28">
          <img src="@/assets/image/icon-close.png" class="w-38 h-38 absolute right-20 top-20" @click="show = false" />
               <img src="@/assets/image/icon-close.png" class="w-38 h-38 absolute right-20 top-20"
                  @click="show = false" />
          <p class="font-38 text-center pt-60 textColor">{{ $t('确认订单') }}</p>
          <p class="font-35 mt-49 text-grey text-center">{{ $t('实际到账') }}</p>
          <p class="font-50 mt-23 text-center textColor">{{ volume_last }} <span class="text-grey font-35">
@@ -108,7 +111,8 @@
          <p class="px-32 mt-40 font-30 textColor">2. {{ $t('提币订单创建后不可取消。') }}</p>
          <p class="w-768 h-100 rounded flex justify-center items-center mt-56 mb-48 btnMain text-white ml-32"
            @click="onConfirm">
            {{ $t('确定') }}</p>
                  {{ $t('确定') }}
               </p>
        </div>
      </van-popup>
      <!-- 币种 -->
@@ -120,12 +124,21 @@
</template>
<script>
import { Popup, ActionSheet, showToast } from "vant"
   import {
      Popup,
      ActionSheet,
      showToast
   } from "vant"
import Axios from "@/service/recharge.js"
import { _withdrawFee,_withdrawApply } from "@/service/withdraw.api.js"
   import {
      _withdrawFee,
      _withdrawApply
   } from "@/service/withdraw.api.js"
import assetsHead from "@/components/Transform/assets-head/index.vue";
import BarScan from '@/components/Transform/scan/scan.vue';
import { _getAllWallet } from "@/service/fund.api";
   import {
      _getAllWallet
   } from "@/service/fund.api";
export default {
  name: "withdrawPage",
  components: {
@@ -140,7 +153,15 @@
      value: 'USDT', //选中的币种
      show: false,
      showSymbol: false,
      actions: [{ name: 'USDT' }, { name: 'BTC' }, { name: 'ETH' }, { name: 'USDC' }],
            actions: [{
               name: 'USDT'
            }, {
               name: 'BTC'
            }, {
               name: 'ETH'
            }, {
               name: 'USDC'
            }],
      blockList: [],
      blockchainIndex: "",
      usdtBalance: "", //余额
@@ -167,8 +188,11 @@
    }).then(res => {
      this.tip = res.content
    }).catch(err => {
      if (err.code === 'ECONNABORTED') { showToast(this.$t('网络超时!')); }
      else if (err.msg !== undefined) { showToast(this.$t(err.msg)); }
            if (err.code === 'ECONNABORTED') {
               showToast(this.$t('网络超时!'));
            } else if (err.msg !== undefined) {
               showToast(this.$t(err.msg));
            }
    })
    _withdrawFee({
      amount: 1,
@@ -349,22 +373,44 @@
        //     channel: this.value + '_' + this.blockName
        //   }
        // })
               //       _withdrawApply({
               //         session_token:this.sessionToken,
               //         amount:this.amount,
               //         from:this.address,
               //         channel:this.value+'_'+ this.blockName
               //     }).then((res)=> {
               //         if(res.code==0) {
               //             this.$router.push({
               //                 path:"/withdraw/withdrawSumbit"
               //             });
               //         }else{
               // showToast(this.$t(res.msg));
               //         }
               //     });
        _withdrawApply({
            session_token:this.sessionToken,
            amount:this.amount,
            from:this.address,
            channel:this.value+'_'+ this.blockName
        }).then((res)=> {
         console.log('123123123123123',res);
            if(res.code==0) {
                this.$router.push({
                    path:"/withdraw/withdrawSumbit"
                     path: "/cryptos/withdraw/withdrawSumbit"
                });
            }else{
              this.$toast(this.$t(res.msg));
               }).catch(err => {
                  //console.log(err)
                  if (err.code == 105) {
                     showToast(this.$t('当前还需交易%s,才可提币', {
                        'MONEY': err.msg
                     }));
                  } else if (err.code === 'ECONNABORTED') {
                     showToast(this.$t('网络超时!'))
                  } else if (err.msg !== undefined) {
                     showToast(this.$t(err.msg))
            }
            this.getToken();
        });
                  // this.getToken()
               })
      } else {
        showToast(this.$t('请输入提币数量'));
      }