|
|
@@ -2,7 +2,7 @@
|
|
|
<div class="assets" @scroll="handleScroll">
|
|
|
<div class="head">
|
|
|
<img @click="back" src="@/assets/images/back.png" class="arrow_img" />
|
|
|
- <span>{{ $t('lang42') }}</span>
|
|
|
+ <span>{{ $t('lang205') }}</span>
|
|
|
</div>
|
|
|
|
|
|
<div class="pd">
|
|
|
@@ -55,7 +55,7 @@
|
|
|
<div class="f-c">
|
|
|
<span class="num">{{ dateFormatFn(item.create_time) }}</span>
|
|
|
<span class="amount"
|
|
|
- >{{ item.change_amount >= 0 ? '+' + item.change_amount : item.change_amount }}<span class="ssm">{{ $t('lang174') }}</span></span
|
|
|
+ >{{ item.change_amount >= 0 ? '+' + Number(item.change_amount) : Number(item.change_amount) }}<span class="ssm">{{ $t('lang174') }}</span></span
|
|
|
>
|
|
|
</div>
|
|
|
<span class="key">{{ statusList[item.action] }}</span>
|
|
|
@@ -101,6 +101,7 @@ export default {
|
|
|
mounted() {
|
|
|
// this.actionGet();
|
|
|
this.getUserBalanceLog();
|
|
|
+ this.coinList();
|
|
|
},
|
|
|
methods: {
|
|
|
//返回上一页
|
|
|
@@ -126,23 +127,45 @@ export default {
|
|
|
const clientHeight = container.clientHeight; // 可视区域高度
|
|
|
// 判断是否滑动到底部
|
|
|
if (scrollTop + clientHeight >= scrollHeight - 10) {
|
|
|
- console.log('Bottom');
|
|
|
if (this.page != -1) {
|
|
|
this.page++; // 页数加 1
|
|
|
- this.getUserBalanceLog(); // 触发加载更多
|
|
|
+ this.coinList(); // 触发加载更多
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
getUserBalanceLog() {
|
|
|
homeApi.getUserBalanceLog({ page: this.page }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.statusList = res.data.statusList;
|
|
|
+ // 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,表示没有更多数据
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ } else {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ coinList() {
|
|
|
+ let params = {
|
|
|
+ page: this.page,
|
|
|
+ query: {
|
|
|
+ coin_type: 'token',
|
|
|
+ action: -1,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ homeApi.coinList(params).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.statusList = res.data.statusList;
|
|
|
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,表示没有更多数据
|
|
|
}
|
|
|
@@ -305,7 +328,7 @@ export default {
|
|
|
|
|
|
.container {
|
|
|
position: relative;
|
|
|
- margin: -30px 14px 0;
|
|
|
+ margin: 14px 14px 0;
|
|
|
border-radius: 14px;
|
|
|
background-color: #fff;
|
|
|
}
|