| | |
| | | <span>USDT</span> |
| | | </div> |
| | | <input placeholder="0.000" type="number" v-model.number="usdtAmount"/> |
| | | <span class="all">{{$t("message.WithdrawalAmount")}}</span> |
| | | <span class="all" style="color: #3D8AF2" @click="allWithdraw">{{$t("message.WithdrawalAll")}}</span> |
| | | </div> |
| | | <div class="item flex-1 flex align-end flex-v"> |
| | | <div> |
| | |
| | | <div class="list-row flex align-center justify-between" v-for="item in miningList"> |
| | | <span>{{item.createTime}}</span> |
| | | <span>{{$t("message.Mining")}}</span> |
| | | <span>{{item.amount}}</span> |
| | | <span>{{item.amount}} ETH</span> |
| | | </div> |
| | | </van-tab> |
| | | </van-tabs> |
| | |
| | | import { ref, reactive, onMounted, getCurrentInstance, defineComponent, computed} from 'vue'; |
| | | export default defineComponent({ |
| | | name: 'account', |
| | | setup() { |
| | | props: [ |
| | | 'simulateData' |
| | | ], |
| | | setup(props, context) { |
| | | console.log(props) |
| | | const activeNames = ref(['1']) |
| | | const { proxy } = getCurrentInstance(); |
| | | let exchangeList = ref([]) |
| | |
| | | } |
| | | return (ethAmount.value * proxy.info.newPrice).toFixed(4) |
| | | }) |
| | | |
| | | function initData () { |
| | | if(props.simulateData) { |
| | | const {walletInfoVo: myAccountInfo,changes: exchangeList,withdraws: withdrawList,mines: miningList} = props.simulateData || {}; |
| | | proxy.myAccountInfo = myAccountInfo || {}; |
| | | proxy.exchangeList = exchangeList || []; |
| | | proxy.withdrawList = withdrawList || []; |
| | | proxy.miningList = miningList || []; |
| | | } else { |
| | | getWalletInfo() |
| | | getRecordList(1) |
| | | getRecordList(2) |
| | | getRecordList(3) |
| | | } |
| | | } |
| | | function getWalletInfo(){ |
| | | proxy.$axios({ |
| | | url: '/dapi/member/walletInfo', |
| | |
| | | }).then((res) => { |
| | | if(res.code == 200) { |
| | | proxy.myAccountInfo = res.data; |
| | | } |
| | | }) |
| | | } |
| | | function getRecordList (type) { |
| | | proxy.$axios({ |
| | | url: '/dapi/member/recordInPage', |
| | | method: 'post', |
| | | data: { |
| | | pageNum: 1, |
| | | pageSize: 100, |
| | | type: type |
| | | } |
| | | }).then((res) => { |
| | | if(res.code == 200) { |
| | | let result = res.data; |
| | | if (type == 1) { |
| | | proxy.exchangeList = result; |
| | | } else if (type == 2) { |
| | | proxy.withdrawList = result; |
| | | } else { |
| | | proxy.miningList = result; |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | proxy.isRequesting = false; |
| | | }) |
| | | } |
| | | function allWithdraw () { |
| | | if(!proxy.myAccountInfo.availableWallet) { |
| | | return; |
| | | } |
| | | usdtAmount.value = proxy.myAccountInfo.availableWallet |
| | | } |
| | | function submitWithdraw () { |
| | | if(Number(usdtAmount.value) < 100) { |
| | | this.$toast(this.$t('message.MinWithdrawCount') + '100USDT'); |
| | |
| | | proxy.isRequesting = false; |
| | | }) |
| | | } |
| | | function getRecordList (type) { |
| | | proxy.$axios({ |
| | | url: '/dapi/member/recordInPage', |
| | | method: 'post', |
| | | data: { |
| | | pageNum: 1, |
| | | pageSize: 100, |
| | | type: type |
| | | } |
| | | }).then((res) => { |
| | | if(res.code == 200) { |
| | | let result = res.data; |
| | | if (type == 1) { |
| | | proxy.exchangeList = result; |
| | | } else if (type == 2) { |
| | | proxy.withdrawList = result; |
| | | } else { |
| | | proxy.miningList = result; |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function onClickTab (item) { |
| | | if(item.name === 2) { |
| | | getRecordList(1) |
| | |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | getWalletInfo() |
| | | proxy.initData() |
| | | getRecordList(1) |
| | | getRecordList(2) |
| | | getRecordList(3) |
| | | proxy.initglobalSetData() |
| | | initData() |
| | | }) |
| | | return { |
| | | activeNames, |
| | |
| | | getWalletInfo, |
| | | allExchange, |
| | | submitExchange, |
| | | allWithdraw, |
| | | submitWithdraw, |
| | | onClickTab, |
| | | isRequesting |
| | | }; |
| | | }, |
| | | methods: { |
| | | initData () { |
| | | initglobalSetData () { |
| | | this.$axios({ |
| | | url: '/dapi/common/globalSetting', |
| | | method: 'get' |
| | |
| | | this.info = res.data; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | } |
| | | } |
| | | }) |
| | | </script> |