|
|
@@ -29,6 +29,9 @@
|
|
|
<van-dropdown-menu>
|
|
|
<van-dropdown-item @change="record" :value="time" :options="option1" />
|
|
|
</van-dropdown-menu>
|
|
|
+ <van-dropdown-menu>
|
|
|
+ <van-dropdown-item @change="names" :value="times" :options="option2" />
|
|
|
+ </van-dropdown-menu>
|
|
|
<div class="flex1"></div>
|
|
|
<span class="text"> 收入 ¥{{ count }} </span>
|
|
|
<span class="text"> 提现 ¥{{ TXCount }} </span>
|
|
|
@@ -62,6 +65,10 @@ export default {
|
|
|
return {
|
|
|
moneyInfo: {},
|
|
|
time: 0,
|
|
|
+ times: 'user',
|
|
|
+ dateList: [],
|
|
|
+ list: [],
|
|
|
+ nameList: '',
|
|
|
option1: [
|
|
|
{ text: '2021-05', value: 0 },
|
|
|
{ text: '2021-06', value: 1 },
|
|
|
@@ -72,13 +79,28 @@ export default {
|
|
|
{ text: '2021-11', value: 6 },
|
|
|
{ text: '2021-12', value: 7 }
|
|
|
],
|
|
|
+ nameOptions: [
|
|
|
+ { label: '用户', value: 'user' },
|
|
|
+ { label: '商家', value: 'store' },
|
|
|
+ { label: '用户商家', value: 'all' }
|
|
|
+ ],
|
|
|
empty: false,
|
|
|
recordList: {},
|
|
|
count: 0,
|
|
|
TXCount: 0
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ option2() {
|
|
|
+ let list = [...this.nameOptions];
|
|
|
+ return list.map(item => {
|
|
|
+ return {
|
|
|
+ text: item.label,
|
|
|
+ value: item.value
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
loginMethods() {
|
|
|
this.$http.get('/memberInfo/findByUser').then(res => {
|
|
|
@@ -91,20 +113,26 @@ export default {
|
|
|
query: {}
|
|
|
});
|
|
|
},
|
|
|
- // Withdrawal() {
|
|
|
- // this.navigateTo('/pages/walletdetails');
|
|
|
- // },
|
|
|
record(e) {
|
|
|
this.time = e.detail;
|
|
|
- let targetData = this.option1.find(item => {
|
|
|
+ let timeList = this.option1.find(item => {
|
|
|
return item.value == this.time;
|
|
|
});
|
|
|
- this.initApi(targetData.text);
|
|
|
+ this.dateList = timeList.text;
|
|
|
+ this.initApi(this.dateList, this.nameList);
|
|
|
+ },
|
|
|
+ names(e) {
|
|
|
+ this.times = e.detail;
|
|
|
+ this.nameList = this.times;
|
|
|
+ this.initApi(this.dateList, this.nameList);
|
|
|
},
|
|
|
- initApi(params) {
|
|
|
+ // Withdrawal() {
|
|
|
+ // this.navigateTo('/pages/walletdetails');
|
|
|
+ // },
|
|
|
+ initApi(params, name) {
|
|
|
this.showLoading();
|
|
|
this.$http
|
|
|
- .get('/transactionRecord/showMyTransactionRecords', { yearMonth: params })
|
|
|
+ .get('/transactionRecord/showMyTransactionRecords', { yearMonth: params, type: name })
|
|
|
.then(res => {
|
|
|
this.hideLoading();
|
|
|
this.recordList = res;
|
|
|
@@ -142,7 +170,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.initApi(this.option1[0].text);
|
|
|
+ this.record({
|
|
|
+ detail: 0
|
|
|
+ });
|
|
|
+ this.initApi(this.option1[0].text, this.option2[0].value);
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -187,7 +218,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
/deep/ .van-dropdown-menu {
|
|
|
- width: 110px;
|
|
|
+ width: 90px;
|
|
|
border-radius: 4px;
|
|
|
overflow: hidden;
|
|
|
|