From 62182435b56667e086619b85ae57e9c1406d8134 Mon Sep 17 00:00:00 2001
From: queenwuli <942534046@qq.com>
Date: Fri, 15 Apr 2022 16:34:34 +0800
Subject: [PATCH] gx
---
src/pages/index/account.vue | 110 +++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 75 insertions(+), 35 deletions(-)
diff --git a/src/pages/index/account.vue b/src/pages/index/account.vue
index 4d679c5..4e4af7e 100644
--- a/src/pages/index/account.vue
+++ b/src/pages/index/account.vue
@@ -108,15 +108,27 @@
</div>
</van-tab>
<van-tab :title='$t("message.Mining")'>
- <div class="list-row flex align-center justify-between">
+ <div class="list-row list-row2 flex align-center justify-between">
<span class="name">{{$t("message.Time")}}</span>
<span class="name">{{$t("message.Type")}}</span>
<span class="name">{{$t("message.Output")}}</span>
</div>
- <div class="list-row flex align-center justify-between" v-for="item in miningList">
+ <div class="list-row list-row2 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-tab :title='$t("message.Reward")'>
+ <div class="list-row list-row2 flex align-center justify-between">
+ <span class="name">{{$t("message.Time")}}</span>
+ <span class="name">{{$t("message.Type")}}</span>
+ <span class="name">{{$t("message.Output")}}</span>
+ </div>
+ <div class="list-row list-row2 flex align-center justify-between" v-for="item in rewardList">
+ <span>{{item.createTime}}</span>
+ <span>{{$t("message.Reward")}}</span>
+ <span>{{item.amount}} ETH</span>
</div>
</van-tab>
</van-tabs>
@@ -132,12 +144,17 @@
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([])
let withdrawList = ref([])
let miningList = ref([])
+ let rewardList = ref([]);
let myAccountInfo = ref({});
let info = ref({});
let ethAmount = ref();
@@ -149,6 +166,22 @@
}
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)
+ getRecordList(4)
+ }
+ }
function getWalletInfo(){
proxy.$axios({
url: '/dapi/member/walletInfo',
@@ -156,6 +189,30 @@
}).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 if (type == 3) {
+ proxy.miningList = result;
+ } else {
+ proxy.rewardList = result;
+ }
}
})
}
@@ -232,41 +289,18 @@
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)
getRecordList(2)
getRecordList(3)
+ getRecordList(4)
}
}
onMounted(() => {
- getWalletInfo()
- proxy.initData()
- getRecordList(1)
- getRecordList(2)
- getRecordList(3)
+ proxy.initglobalSetData()
+ initData()
})
return {
activeNames,
@@ -274,6 +308,7 @@
exchangeList,
withdrawList,
miningList,
+ rewardList,
info,
ethAmount,
ethToUsdtAmount,
@@ -288,7 +323,7 @@
};
},
methods: {
- initData () {
+ initglobalSetData () {
this.$axios({
url: '/dapi/common/globalSetting',
method: 'get'
@@ -297,8 +332,7 @@
this.info = res.data;
}
})
- },
-
+ }
}
})
</script>
@@ -427,7 +461,7 @@
width: 45%
}
.list-row span:nth-child(3){
- text-align: center;
+ text-align: right;
width: 15%
}
.list-row:not(:last-child){
@@ -436,4 +470,10 @@
.list-row:nth-child(1){
margin: 30px 0;
}
+ .list-row2 span:nth-child(2){
+ width: 22%
+ }
+ .list-row2 span:nth-child(3){
+ width: 38%
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.1