2020-11-30 20:42:24 +08:00
|
|
|
<template>
|
|
|
|
<el-row class="wrapper">
|
|
|
|
<el-col>
|
|
|
|
<h1>账户信息</h1>
|
|
|
|
</el-col>
|
2021-06-28 11:59:22 +08:00
|
|
|
<el-col class="bank-account-item">
|
|
|
|
<span style="font-size: 24px;"> 账号:</span> <span style="color: red;">{{ bankAccount.bankAccount }}</span>
|
|
|
|
</el-col>
|
2020-11-30 20:42:24 +08:00
|
|
|
<el-col class="bank-account-item">
|
2021-12-28 22:25:54 +08:00
|
|
|
<span style="font-size: 24px;"> 余额:</span> <span style="color: red;">{{ bankAccount.accountBalance }}</span> <span
|
|
|
|
style="font-size: 24px;">巴旦木</span>
|
2020-11-30 20:42:24 +08:00
|
|
|
</el-col>
|
|
|
|
<el-col>
|
2021-12-28 23:20:30 +08:00
|
|
|
<records :records="records" :bankAccount="bankAccount.bankAccount" @currentChange="handleCurrentChange" @searchTransactionRecord="searchTransactionRecord"></records>
|
2021-12-28 22:25:54 +08:00
|
|
|
</el-col>
|
2020-11-30 20:42:24 +08:00
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {mapState} from 'vuex';
|
2021-12-28 23:20:30 +08:00
|
|
|
import Records from "../components/common/bank/account/records";
|
2020-11-30 20:42:24 +08:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: "wallet",
|
2021-12-28 23:20:30 +08:00
|
|
|
components: {Records},
|
2020-11-30 20:42:24 +08:00
|
|
|
fetch({store, error}) {
|
|
|
|
return Promise.all([
|
|
|
|
store
|
|
|
|
.dispatch('wallet/fetchDetail', {idUser: store.state.oauth.idUser})
|
2021-12-28 22:25:54 +08:00
|
|
|
.catch(err => error({statusCode: 404})),
|
|
|
|
store
|
|
|
|
.dispatch('wallet/fetchTransactionRecordList', {idUser: store.state.oauth.idUser})
|
2020-11-30 20:42:24 +08:00
|
|
|
.catch(err => error({statusCode: 404}))
|
|
|
|
])
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState({
|
|
|
|
bankAccount: state => state.wallet.detail.data,
|
2021-12-28 23:20:30 +08:00
|
|
|
records: state => state.wallet.list.data
|
2020-11-30 20:42:24 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-12-28 22:25:54 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2021-12-28 23:20:30 +08:00
|
|
|
handleCurrentChange(search) {
|
2021-12-28 22:25:54 +08:00
|
|
|
let _ts = this;
|
|
|
|
_ts.$store.dispatch('wallet/fetchTransactionRecordList', {
|
|
|
|
idUser: _ts.$store.state.oauth.idUser,
|
2021-12-28 23:20:30 +08:00
|
|
|
startDate: search.startDate,
|
|
|
|
endDate: search.endDate,
|
|
|
|
page: search.page
|
2021-12-28 22:25:54 +08:00
|
|
|
})
|
|
|
|
},
|
|
|
|
searchTransactionRecord(dates) {
|
|
|
|
let _ts = this
|
|
|
|
let startDate = dates[0]
|
|
|
|
let endDate = dates[1]
|
|
|
|
_ts.$store.dispatch('wallet/fetchTransactionRecordList', {
|
|
|
|
idUser: _ts.$store.state.oauth.idUser,
|
|
|
|
startDate: startDate,
|
|
|
|
endDate: endDate
|
|
|
|
})
|
2020-11-30 20:42:24 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.$store.commit('setActiveMenu', 'wallet');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.bank-account-item {
|
|
|
|
font-size: 32px;
|
|
|
|
padding-left: 15vw;
|
|
|
|
}
|
|
|
|
</style>
|