|
|
@@ -3,7 +3,7 @@
|
|
|
<ion-header>
|
|
|
<ion-toolbar>
|
|
|
<ion-buttons slot="start">
|
|
|
- <ion-back-button default-href="#" @click="$router.back()"></ion-back-button>
|
|
|
+ <ion-back-button text="" default-href="#" @click="$router.back()"></ion-back-button>
|
|
|
</ion-buttons>
|
|
|
<ion-title>{{ $t('title.distribution') }}</ion-title>
|
|
|
</ion-toolbar>
|
|
|
@@ -11,7 +11,7 @@
|
|
|
<ion-content>
|
|
|
<div class="head">
|
|
|
<div class="title">{{ $t('title.distribution') }}</div>
|
|
|
- <div class="desc">{{ $t('distribution.myInvitor') }}:</div>
|
|
|
+ <div class="desc" v-if="superior">{{ $t('distribution.myInvitor') }}: {{ superior.nickname }}</div>
|
|
|
<div class="qr-wrapper" @click="showQR = true">
|
|
|
<img src="@/assets/icon_qr.png" class="qr" />
|
|
|
<div class="desc">
|
|
|
@@ -25,7 +25,7 @@
|
|
|
<div class="col">
|
|
|
<div class="content">
|
|
|
<div class="value profit">
|
|
|
- 123<span class="unit">{{ $t('balance.unit') }}</span>
|
|
|
+ {{ stat.commissionSum }}<span class="unit">{{ $t('balance.unit') }}</span>
|
|
|
</div>
|
|
|
<div class="title">{{ $t('distribution.myProfit') }}</div>
|
|
|
<div class="btn-detail" @click="$router.push({ name: 'commissionList' })">
|
|
|
@@ -36,7 +36,7 @@
|
|
|
<div class="divider"></div>
|
|
|
<div class="col">
|
|
|
<div class="content">
|
|
|
- <div class="value">123</div>
|
|
|
+ <div class="value">{{ stat.inviteNum }}</div>
|
|
|
<div class="title">{{ $t('distribution.teamNum') }}</div>
|
|
|
<div class="btn-team" @click="$router.push({ name: 'myTeam' })">
|
|
|
{{ $t('distribution.viewTeam') }}
|
|
|
@@ -47,12 +47,12 @@
|
|
|
</div>
|
|
|
<div class="list-header">
|
|
|
<div class="title">{{ $t('distribution.profitDetails') }}</div>
|
|
|
- <div class="more">
|
|
|
+ <div class="more" @click="$router.push({ name: 'commissionList' })">
|
|
|
<div>{{ $t('common.more') }}</div>
|
|
|
<ion-icon :icon="chevronForwardOutline"></ion-icon>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <CommissionItem></CommissionItem>
|
|
|
+ <CommissionItem v-for="item in records" :key="item.id" :detail="item"></CommissionItem>
|
|
|
<ion-modal class="qr-modal dialog" :is-open="showQR" @didDismiss="showQR = false">
|
|
|
<ion-content>
|
|
|
<vue-qrcode value="Hello, World!" :options="{ width: 250, margin: 2 }"></vue-qrcode>
|
|
|
@@ -74,40 +74,40 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- commission: {},
|
|
|
+ stat: {},
|
|
|
show: false,
|
|
|
url: '',
|
|
|
caretForwardCircleOutline,
|
|
|
chevronForwardOutline,
|
|
|
- showQR: false
|
|
|
+ showQR: false,
|
|
|
+ records: [],
|
|
|
+ superior: null
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(useUserStore, ['user'])
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.getInfo()
|
|
|
- },
|
|
|
- methods: {
|
|
|
- withdrawApply() {
|
|
|
+ created() {
|
|
|
+ this.getStat()
|
|
|
+ this.getLatestRecords()
|
|
|
+ if (this.user.superiorId) {
|
|
|
this.$http
|
|
|
- .post('/withdrawApply/apply')
|
|
|
+ .get('/user/mySuperior')
|
|
|
.then(res => {
|
|
|
- this.$dialog
|
|
|
- .alert({
|
|
|
- message: '提现申请提交成功'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.getInfo()
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- return this.$toast(e.error)
|
|
|
+ this.superior = res
|
|
|
})
|
|
|
+ .catch(() => {})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getStat() {
|
|
|
+ this.$http.get('/commission/myStat').then(res => {
|
|
|
+ this.stat = res
|
|
|
+ })
|
|
|
},
|
|
|
- getInfo() {
|
|
|
- this.$http.get('/commission/overview').then(res => {
|
|
|
- this.commission = res
|
|
|
+ getLatestRecords() {
|
|
|
+ this.$http.get('/commission/records').then(res => {
|
|
|
+ this.records = res.content
|
|
|
})
|
|
|
}
|
|
|
}
|