1
jhzh
2025-08-12 e88c67ddf91ce593785f565912837c9a3ffe3930
src/components/Transform/mining-account/index.vue
@@ -18,13 +18,16 @@
        </div>
        <div class="account_card">
          <mining-exchange-input :title="$t('至')" :value="form.volume ? (form.volume * form.rate).toFixed(5) : ''"
            :actions="actions" @select="onSelect('symbol_to', $event)" :disabled="true" :type="2" :coin="form.symbol"
            :coin1="form.symbol_to" :tips="[]" :showMax="false" :iconImg1="form.iconImg1" :iconImg2="form.iconImg2" />
               <mining-exchange-input :title="$t('至')"
                  :value="form.volume ? (form.volume * form.rate).toFixed(5) : ''" :actions="actions"
                  @select="onSelect('symbol_to', $event)" :disabled="true" :type="2" :coin="form.symbol"
                  :coin1="form.symbol_to" :tips="[]" :showMax="false" :iconImg1="form.iconImg1"
                  :iconImg2="form.iconImg2" />
        </div>
        <div class="exchange-btn w-full flex justify-center mt-116">
          <p class="h-100 btnMain mx-auto flex justify-center items-center text-white w-768" @click="onConfirm">
               <p class="h-100 btnMain mx-auto flex justify-center items-center text-white w-768"
                  @click="onConfirm">
            {{ $t('询价') }}
          </p>
        </div>
@@ -35,12 +38,31 @@
<script>
import MiningExchangeInput from "../mining-exchange-input/index.vue";
import { Grid, GridItem, Popup, Icon, showToast } from "vant";
   import {
      Grid,
      GridItem,
      Popup,
      Icon,
      showToast
   } from "vant";
// import { mapState } from "vuex";
import { _exchangeRage, _getAllWallet, _initWidthdrawl, _widthdrawl, _records } from "@/service/fund.api";
import { mapGetters } from "vuex";
import { List, PullRefresh } from 'vant';
import { debounce } from '@/utils'
   import {
      _exchangeRage,
      _getAllWallet,
      _initWidthdrawl,
      _widthdrawl,
      _records
   } from "@/service/fund.api";
   import {
      mapGetters
   } from "vuex";
   import {
      List,
      PullRefresh
   } from 'vant';
   import {
      debounce
   } from '@/utils'
export default {
  name: "MiningAcccount",
  components: {
@@ -61,9 +83,14 @@
  computed: {
    ...mapGetters('user', ['userInfo']),
    tabList() {
      return [
        { id: 1, text: this.$t('提幣') },
        { id: 2, text: this.$t('交易記錄') }
            return [{
                  id: 1,
                  text: this.$t('提幣')
               },
               {
                  id: 2,
                  text: this.$t('交易記錄')
               }
      ]
    },
    addr() {
@@ -91,7 +118,7 @@
      valueTwo: 0,
      rate: 0,
      form: { // 闪兑
        symbol: 'ETH',
               symbol: 'USDC',
        symbol_to: 'USDT',
        volume: '',
        rate: 0,
@@ -119,17 +146,23 @@
    _getAllWallet(obj).then(data => {
      this.actions = []
      data.extends.map(item => {
        this.actions.push({ symbol: item.symbol, name: item.symbol, symbol_data: item.symbol, usable: item.usable, usdt: item.usdt, symbol_data: item.symbol_data })
               this.actions.push({
                  symbol: item.symbol,
                  name: item.symbol,
                  symbol_data: item.symbol,
                  usable: item.usable,
                  usdt: item.usdt,
                  symbol_data: item.symbol_data
               })
      })
      this.wallets = data.extends
      this.form.symbol_to = this.actions[2].symbol_data
            console.log("this.actions",this.actions[0].symbol_data);
      this.form.symbol = this.actions[0].symbol_data
            this.form.symbol_to = this.actions[1].symbol_data
      this.form.iconImg1 = this.actions[0].symbol_data
      this.form.iconImg2 = this.actions[2].symbol_data
            this.form.iconImg2 = this.actions[1].symbol_data
      this.form.symbol_ex = this.actions[0].symbol
      this.form.symbol_to_ex = this.actions[2].symbol
            this.form.symbol_to_ex = this.actions[1].symbol
    })
  },
@@ -162,7 +195,9 @@
        volume: this.form.volume
      }
      _exchangeRage(obj).then(data => {
        const { get_rate } = data
               const {
                  get_rate
               } = data
        this.form.rate = get_rate
        this.clearInterval()
        if (callback && typeof callback === 'function') {
@@ -177,8 +212,12 @@
      const tempImg = this.form.iconImg1
      this.form.iconImg1 = this.form.iconImg2
      this.form.iconImg2 = tempImg
            const tempsymbol = this.form.symbol_ex
            this.form.symbol_ex = this.form.symbol_to_ex
            this.form.symbol_to_ex = tempsymbol
      this.form.volume = ''
            console.log("this.form",this.form);
      this.clearInterval()
    },
    onSelect(type, evt) { // 选择
@@ -268,6 +307,7 @@
    width: 6rem;
    height: 6rem;
    position: relative;
    img{
      width: 50%;
      height: 50%;