|
|
@@ -7,15 +7,15 @@
|
|
|
|
|
|
<div class="pd">
|
|
|
<div class="">
|
|
|
- <div class="total_box">
|
|
|
+ <!-- <div class="total_box">
|
|
|
<div>
|
|
|
<span class="text">{{ $t('lang112') }}</span>
|
|
|
</div>
|
|
|
<div class="f-sa">
|
|
|
- <!-- <div class="item">
|
|
|
+ <div class="item">
|
|
|
<span class="total">{{ Math.floor(assets * 100) / 100 || 0 }}</span>
|
|
|
<span>USDT</span>
|
|
|
- </div> -->
|
|
|
+ </div>
|
|
|
<div class="item">
|
|
|
<span class="total">{{ Math.floor(totalReward * 100) / 100 || 0 }}</span>
|
|
|
<span>{{ $t('lang174') }}</span>
|
|
|
@@ -33,6 +33,62 @@
|
|
|
{{ $t('lang113') }}
|
|
|
</van-button>
|
|
|
</div>
|
|
|
+ </div> -->
|
|
|
+ <div class="bg">
|
|
|
+ <div class="total_box" v-if="coin_type == 'token'">
|
|
|
+ <div>
|
|
|
+ <span class="text">{{ $t('lang80') }}({{ $t('lang174') }})</span>
|
|
|
+ </div>
|
|
|
+ <div class="total">
|
|
|
+ <span>{{ Math.floor(balance * 100) / 100 || 0 }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="buy_box f-sb">
|
|
|
+ <div class="buy" @click="navigation('recharge')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang138') }}</van-button>
|
|
|
+ </div>
|
|
|
+ <div class="buy" @click="navigation('sendChaBao')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang278') }}</van-button>
|
|
|
+ </div>
|
|
|
+ <div class="buy" @click="navigation('withdraw')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang113') }}</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="total_box" v-else-if="coin_type == 'teac'">
|
|
|
+ <div>
|
|
|
+ <span class="text">{{ $t('lang80') }}(TeaC)</span>
|
|
|
+ </div>
|
|
|
+ <div class="total">
|
|
|
+ <span>{{ Math.floor(teac * 100) / 100 || 0 }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="buy_box f-sb">
|
|
|
+ <div class="buy" @click="navigation('')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang278') }}</van-button>
|
|
|
+ </div>
|
|
|
+ <div class="buy" @click="navigation('')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang113') }}</van-button>
|
|
|
+ </div>
|
|
|
+ <div class="buy" @click="navigation('')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang337') }}</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="total_box" v-else-if="coin_type == 'frozen'">
|
|
|
+ <div>
|
|
|
+ <span class="text">{{ $t('lang80') }}({{ $t('lang339') }})</span>
|
|
|
+ </div>
|
|
|
+ <div class="total">
|
|
|
+ <span>{{ Math.floor(frozen * 100) / 100 || 0 }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="buy_box f-sa">
|
|
|
+ <div class="buy" @click="navigation('')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang138') }}</van-button>
|
|
|
+ </div>
|
|
|
+ <div class="buy" @click="navigation('frozenTransfer')">
|
|
|
+ <van-button class="buy_btn" type="primary">{{ $t('lang278') }}</van-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="bare" v-if="total <= 0">
|
|
|
@@ -58,9 +114,19 @@
|
|
|
{{ item.change_amount >= 0 ? '+' + Number(item.change_amount) : Number(item.change_amount) }}
|
|
|
<span class="ssm" v-if="coin_type == 'token'">{{ $t('lang174') }}</span>
|
|
|
<span class="ssm" v-else-if="coin_type == 'teac'">TeaC</span>
|
|
|
+ <span class="ssm" v-else-if="coin_type == 'frozen'">{{ $t('lang339') }}</span>
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div class="f-c">
|
|
|
+ <div class="f-c" v-if="coin_type == 'token'">
|
|
|
+ <span class="key">{{ statusList[item.action] }}</span>
|
|
|
+ <span class="key" v-if="item.action == 10 && item.address">
|
|
|
+ {{ $t('lang295') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
|
|
|
+ </span>
|
|
|
+ <span class="key" v-if="item.action == 11 && item.address">
|
|
|
+ {{ $t('lang294') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="f-c" v-else-if="coin_type == 'teac'">
|
|
|
<span class="key">{{ statusList[item.action] }}</span>
|
|
|
<span class="key" v-if="item.action == 10 && item.address">
|
|
|
{{ $t('lang295') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
|
|
|
@@ -69,6 +135,15 @@
|
|
|
{{ $t('lang294') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
|
|
|
</span>
|
|
|
</div>
|
|
|
+ <div class="f-c" v-else-if="coin_type == 'frozen'">
|
|
|
+ <span class="key">{{ statusList[item.action] }}</span>
|
|
|
+ <span class="key" v-if="item.action == 3 && item.address">
|
|
|
+ {{ $t('lang295') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
|
|
|
+ </span>
|
|
|
+ <span class="key" v-if="item.action == 4 && item.address">
|
|
|
+ {{ $t('lang294') + (item.address.substring(0, 5) + '****' + item.address.substring(item.address.length - 5, item.address.length)) }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -90,7 +165,6 @@ export default {
|
|
|
finished: false,
|
|
|
total: 1,
|
|
|
nickname: '',
|
|
|
- assets: 0,
|
|
|
list: [],
|
|
|
navIndex: 0,
|
|
|
navList: [
|
|
|
@@ -105,14 +179,16 @@ export default {
|
|
|
],
|
|
|
nft_list: [],
|
|
|
statusList: [],
|
|
|
- totalReward: 0,
|
|
|
+ balance: 0, //茶宝资产
|
|
|
+ teac: 0, // teac资产
|
|
|
+ frozen: 0, // 标记茶宝资产
|
|
|
coin_type: '',
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.coin_type = this.$route.query.coin_type;
|
|
|
// this.actionGet();
|
|
|
- this.getUserBalanceLog();
|
|
|
+ this.assets();
|
|
|
this.coinList();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -124,7 +200,11 @@ export default {
|
|
|
return dateFormat(new Date(date * 1000), 'yyyy-MM-dd hh:mm:ss');
|
|
|
},
|
|
|
navigation(name) {
|
|
|
- this.$router.push({ name });
|
|
|
+ if (name != '') {
|
|
|
+ this.$router.push({ name });
|
|
|
+ } else {
|
|
|
+ this.$toast(this.$t('lang2'));
|
|
|
+ }
|
|
|
},
|
|
|
changeNav(item, index) {
|
|
|
this.navIndex = index;
|
|
|
@@ -145,20 +225,13 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- getUserBalanceLog() {
|
|
|
- homeApi.getUserBalanceLog({ page: this.page }).then(res => {
|
|
|
+ assets() {
|
|
|
+ homeApi.assets({}).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- // this.statusList = res.data.statusList;
|
|
|
- this.totalReward = res.data.total;
|
|
|
- // if (this.list.length >= res.data.data.total) {
|
|
|
- // this.page = -1; // 重置为 -1,表示没有更多数据
|
|
|
- // } else {
|
|
|
- // this.list = [...this.list, ...res.data.data.data];
|
|
|
- // console.log(this.list.length);
|
|
|
- // if (this.list.length >= res.data.data.total) {
|
|
|
- // this.page = -1; // 重置为 -1,表示没有更多数据
|
|
|
- // }
|
|
|
- // }
|
|
|
+ let data = res.data.coin_list;
|
|
|
+ this.balance = data.filter(i => i.coin_key == 'token')[0].amount;
|
|
|
+ this.teac = data.filter(i => i.coin_key == 'teac')[0].amount;
|
|
|
+ this.frozen = data.filter(i => i.coin_key == 'frozen')[0].amount;
|
|
|
} else {
|
|
|
}
|
|
|
});
|
|
|
@@ -186,14 +259,14 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- actionGet() {
|
|
|
- homeApi.assets().then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.assets = res.data.assets;
|
|
|
- this.coinList = res.data.coin_list;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+ // actionGet() {
|
|
|
+ // homeApi.assets().then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.assets = res.data.assets;
|
|
|
+ // this.coinList = res.data.coin_list;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -273,61 +346,53 @@ export default {
|
|
|
border-bottom: 1px solid #ffffff;
|
|
|
}
|
|
|
}
|
|
|
+ .bg {
|
|
|
+ padding: 14px 14px 8px;
|
|
|
+ background-color: #fff;
|
|
|
|
|
|
- .total_box {
|
|
|
- position: relative;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: center;
|
|
|
- width: 100%;
|
|
|
- font-size: 12px;
|
|
|
- color: #fff;
|
|
|
- height: 180px;
|
|
|
- padding: 30px 0 60px;
|
|
|
- background: linear-gradient(to right, #1ab986, #25d7bb);
|
|
|
- .f-sa {
|
|
|
- width: 100%;
|
|
|
- }
|
|
|
- .total {
|
|
|
- font-size: 28px;
|
|
|
- text-align: center;
|
|
|
- padding: 16px 0 6px;
|
|
|
- color: rgba(#fff, 1);
|
|
|
- }
|
|
|
- .text {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: bold;
|
|
|
- color: rgba(#fff, 1);
|
|
|
- }
|
|
|
- .item {
|
|
|
- color: rgba(#fff, 0.8);
|
|
|
- width: 50%;
|
|
|
- text-align: center;
|
|
|
+ .total_box {
|
|
|
+ position: relative;
|
|
|
display: flex;
|
|
|
+ align-items: center;
|
|
|
flex-direction: column;
|
|
|
- }
|
|
|
- .buy {
|
|
|
- position: absolute;
|
|
|
- right: 14px;
|
|
|
- bottom: 14px;
|
|
|
+ justify-content: center;
|
|
|
+ // position: relative;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #fff;
|
|
|
+ height: 150px;
|
|
|
+ // border-radius: 16px;
|
|
|
+ padding: 20px 20px 40px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 10px;
|
|
|
+ background: linear-gradient(to right, #1bb986, #23d4b7);
|
|
|
|
|
|
- &_btn {
|
|
|
- color: #29b286;
|
|
|
- height: 30px;
|
|
|
- line-height: 30px;
|
|
|
- font-size: 14px;
|
|
|
- background-color: #ffffff;
|
|
|
- border: none;
|
|
|
- padding: 0 16px;
|
|
|
- white-space: nowrap;
|
|
|
- border-radius: 30px;
|
|
|
- display: flex;
|
|
|
- align-items: flex-start;
|
|
|
+ .total {
|
|
|
+ font-size: 28px;
|
|
|
+ text-align: center;
|
|
|
+ padding-top: 10px;
|
|
|
+ }
|
|
|
+ .text {
|
|
|
+ color: rgba(#fff, 0.8);
|
|
|
+ }
|
|
|
+ .buy_box {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 14px;
|
|
|
+ width: 100%;
|
|
|
+ padding: 0 14px;
|
|
|
+ }
|
|
|
+ .buy {
|
|
|
+ &_btn {
|
|
|
+ color: #29b286;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #ffffff;
|
|
|
+ border: none;
|
|
|
+ padding: 0 16px;
|
|
|
+ white-space: nowrap;
|
|
|
+ border-radius: 30px;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- .buy1 {
|
|
|
- left: 14px;
|
|
|
}
|
|
|
}
|
|
|
|