|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="mobile-pay-center vendor-pay mobile-fix-content mobile-centerfix-content" :class="{'vendor-pay-record': switchType === 'record' && recordList.length}" id="mobileFixContent">
|
|
|
- <div class="mp-head">
|
|
|
+ <div class="mp-head" v-if="!fromUserPage">
|
|
|
<span class="inline-block" :class="{'active': switchType === 'record'}" @click="setSwitchType('record')">交易记录</span>
|
|
|
<span class="inline-block" :class="{'active': switchType === 'account'}" @click="setSwitchType('account')">收款账户</span>
|
|
|
</div>
|
|
|
@@ -178,6 +178,7 @@
|
|
|
middleware: 'authenticated',
|
|
|
data () {
|
|
|
return {
|
|
|
+ fromUserPage: false,
|
|
|
remindText: '',
|
|
|
timeoutCount: '',
|
|
|
page: 1,
|
|
|
@@ -276,10 +277,15 @@
|
|
|
EmptyStatus,
|
|
|
BaseFilter
|
|
|
},
|
|
|
- fetch ({store}) {
|
|
|
- return Promise.all([
|
|
|
- store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup'})
|
|
|
- ])
|
|
|
+ fetch ({store, route}) {
|
|
|
+ return route.query.type ? Promise.all([store.dispatch('payCenter/loadVendorAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'sup'})
|
|
|
+ ]) : Promise.all([store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup'})])
|
|
|
+ },
|
|
|
+ asyncData({route}) {
|
|
|
+ return {
|
|
|
+ fromUserPage: route.query.type ? true : false,
|
|
|
+ switchType: route.query.switchType || 'record'
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
'vendorAccount': {
|
|
|
@@ -291,7 +297,8 @@
|
|
|
}
|
|
|
this.accountList = [...this.accountList, ...val.content]
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
},
|
|
|
'vendorRecord': {
|
|
|
handler: function (val) {
|
|
|
@@ -342,7 +349,7 @@
|
|
|
return this.accountData.data
|
|
|
},
|
|
|
vendorRecord () {
|
|
|
- return this.recordData.data.data.data
|
|
|
+ return this.recordData.data.data ? this.recordData.data.data.data : []
|
|
|
},
|
|
|
fetching () {
|
|
|
return this.switchType === 'account' ? this.accountData.fetching : this.recordData.fetching
|