|
|
@@ -4,26 +4,26 @@
|
|
|
<img @click="back" src="@/assets/images/back.png" class="arrow_img" />
|
|
|
<span>{{ coinName }}</span>
|
|
|
</div>
|
|
|
- <van-popover v-model="showPopover" :border="false" trigger="click" :actions="actions" @select="onSelect" id="popover">
|
|
|
+ <!-- <van-popover v-model="showPopover" :border="false" trigger="click" :actions="actions" @select="onSelect" id="popover">
|
|
|
<template #reference>
|
|
|
<div class="picker">
|
|
|
- <span class="text">{{ typeText || '全部订单' }}</span>
|
|
|
+ <span class="text">{{ typeText || $t('lang204') }}</span>
|
|
|
<img class="down" referrerpolicy="no-referrer" src="@/assets/images/order/down.png" />
|
|
|
</div>
|
|
|
</template>
|
|
|
- </van-popover>
|
|
|
+ </van-popover> -->
|
|
|
<div class="table">
|
|
|
<div class="th flex">
|
|
|
- <span class="text"> 类型 </span>
|
|
|
- <span class="text"> 变动金额 </span>
|
|
|
- <span class="text"> 余额 </span>
|
|
|
- <span class="text"> 时间 </span>
|
|
|
+ <span class="text"> {{ $t('lang197') }} </span>
|
|
|
+ <span class="text"> {{ $t('lang198') }} </span>
|
|
|
+ <span class="text"> {{ $t('lang161') }} </span>
|
|
|
+ <span class="text"> {{ $t('lang199') }} </span>
|
|
|
</div>
|
|
|
<div class="tbody">
|
|
|
<template v-if="total > 0">
|
|
|
<van-list v-model="loading" :finished="finished" :finished-text="finishText" @load="onLoad">
|
|
|
<div class="flex item" v-for="(item, index) in list" :key="index">
|
|
|
- <span class="text"> {{ item.action_name }} </span>
|
|
|
+ <span class="text"> {{ statusList[item.action] }} </span>
|
|
|
<span class="text" :class="item.change_amount > 0 ? 'green' : 'red'">
|
|
|
{{ item.change_amount > 0 ? '+' + item.change_amount : item.change_amount }}
|
|
|
</span>
|
|
|
@@ -34,7 +34,7 @@
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<div class="nodata item">
|
|
|
- <span> 暂无数据 </span>
|
|
|
+ <span>{{ $t('lang60') }} </span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
@@ -51,22 +51,23 @@ export default {
|
|
|
actions: [],
|
|
|
list: [],
|
|
|
showPopover: false,
|
|
|
- typeText: '全部',
|
|
|
+ typeText: this.$t('lang201'),
|
|
|
coin_type: '',
|
|
|
action: -1,
|
|
|
- coinName: 'USDT',
|
|
|
+ coinName: 'ChaBao',
|
|
|
page: 0,
|
|
|
total: 1,
|
|
|
loading: true,
|
|
|
finished: false,
|
|
|
typeList: [],
|
|
|
- finishText: '加载更多',
|
|
|
+ finishText: this.$t('lang200'),
|
|
|
+ statusList: [],
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.coin_type = this.$route.query.coin_type;
|
|
|
this.coinName = this.$route.query.coin_name || 'USDT';
|
|
|
- this.coinAction();
|
|
|
+ // this.coinAction();
|
|
|
this.onLoad();
|
|
|
window.addEventListener('scroll', this.scrollBottom);
|
|
|
},
|
|
|
@@ -88,11 +89,11 @@ export default {
|
|
|
console.log(scrollHeight, 'scrollHeight');
|
|
|
if (scrollTop + windowHeight >= scrollHeight && scrollTop > 0) {
|
|
|
//写后台加载数据的函数
|
|
|
- console.log('滚动到底部啦');
|
|
|
+ // console.log('滚动到底部啦');
|
|
|
if (this.finished) {
|
|
|
this.loading = true; // 关闭加载状态
|
|
|
this.finished = false; // 加载开始
|
|
|
- this.finishText = '加载更多';
|
|
|
+ this.finishText = this.$t('lang200');
|
|
|
this.onLoad();
|
|
|
}
|
|
|
} else {
|
|
|
@@ -111,23 +112,23 @@ export default {
|
|
|
this.list = [];
|
|
|
this.onLoad();
|
|
|
},
|
|
|
- coinAction() {
|
|
|
- let params = {
|
|
|
- coin_type: this.coin_type,
|
|
|
- };
|
|
|
- homeApi.coinAction(params).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.typeList = res.data;
|
|
|
- let actionList = res.data;
|
|
|
- let keys = Object.keys(actionList);
|
|
|
- let values = Object.values(actionList);
|
|
|
- this.actions.push({ text: '全部', id: -1 });
|
|
|
- for (let index = 0; index < keys.length; index++) {
|
|
|
- this.actions.push({ text: values[index], id: keys[index] });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+ // coinAction() {
|
|
|
+ // let params = {
|
|
|
+ // token: this.coin_type,
|
|
|
+ // };
|
|
|
+ // homeApi.coinAction(params).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // this.typeList = res.data;
|
|
|
+ // let actionList = res.data;
|
|
|
+ // let keys = Object.keys(actionList);
|
|
|
+ // let values = Object.values(actionList);
|
|
|
+ // this.actions.push({ text: this.$t('lang201'), id: -1 });
|
|
|
+ // for (let index = 0; index < keys.length; index++) {
|
|
|
+ // this.actions.push({ text: values[index], id: keys[index] });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
coinList(coin_type, action) {
|
|
|
let params = {
|
|
|
page: this.page,
|
|
|
@@ -138,35 +139,36 @@ export default {
|
|
|
};
|
|
|
homeApi.coinList(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- let rows = res.data.rows;
|
|
|
+ let rows = res.data.data.data;
|
|
|
+ this.statusList = res.data.statusList;
|
|
|
|
|
|
// 如果返回的数组是空或数组长度是0
|
|
|
if (rows == null || rows.length === 0) {
|
|
|
this.loading = false; // 关闭加载状态
|
|
|
this.finished = true; // 加载结束
|
|
|
- this.finishText = '没有更多了';
|
|
|
+ this.finishText = this.$t('lang202');
|
|
|
if (this.list.length <= 0) {
|
|
|
this.total = 0;
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
this.loading = false; // 关闭加载状态
|
|
|
- this.finishText = '上滑加载更多';
|
|
|
+ this.finishText = this.$t('lang203');
|
|
|
this.finished = true;
|
|
|
- this.total = res.data.total; //数据总条数
|
|
|
+ this.total = res.data.data.total; //数据总条数
|
|
|
|
|
|
this.list = this.list.concat(rows); //合并数组
|
|
|
|
|
|
// 如果合并之后的数组长度大于返回的数据总条数
|
|
|
if (this.list.length >= this.total) {
|
|
|
this.finished = true; // 加载结束
|
|
|
- this.finishText = '没有更多了';
|
|
|
+ this.finishText = this.$t('lang202');
|
|
|
}
|
|
|
} else {
|
|
|
this.total = 0;
|
|
|
this.loading = false; // 关闭加载状态
|
|
|
this.finished = true; // 加载结束
|
|
|
- this.finishText = '没有更多了';
|
|
|
+ this.finishText = this.$t('lang202');
|
|
|
}
|
|
|
});
|
|
|
},
|