You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
108 lines
2.7 KiB
108 lines
2.7 KiB
<template>
|
|
<view>
|
|
<uni-card >
|
|
<view class="content-wrapper">
|
|
<view class="content-balance">
|
|
<text class="balance-text">返佣余额(元)</text>
|
|
<view class="balance-number">
|
|
<u-count-to fontSize="48" :start-val="0" :end-val="balance" :duration="2000" :useEasing="false"></u-count-to>
|
|
</view>
|
|
</view>
|
|
<view class="content-actions">
|
|
<u-button shape="circle" @click="goToDetail">明细</u-button>
|
|
<u-button type="primary" shape="circle" @click="goToWithdrawal">提现</u-button>
|
|
</view>
|
|
</view>
|
|
</uni-card>
|
|
<uni-card title="未提现返佣记录">
|
|
<u-cell-group>
|
|
<u-cell
|
|
v-for="(item ,index) in notYetCommissionList"
|
|
:title="item.id"
|
|
:value=" item.commission.toFixed(2)"
|
|
center
|
|
:key="index"
|
|
></u-cell>
|
|
</u-cell-group>
|
|
</uni-card>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
notYetCommissionList:[],
|
|
commissionList:[]
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.getList()
|
|
this.getCommissionList()
|
|
},
|
|
computed:{
|
|
balance() {
|
|
let result = 0
|
|
this.commissionList.forEach(value => {
|
|
result += value.commission
|
|
})
|
|
return result
|
|
}
|
|
},
|
|
methods:{
|
|
onCardClick(e) {
|
|
console.log(e)
|
|
},
|
|
getList() {
|
|
console.log('this.$store',this.$store.shopId)
|
|
this.tui.request('/app/returnCommission/listWithReturned', 'get', {
|
|
shopId:'001'
|
|
}, false, false, true).then((res) => {
|
|
if (res.code !== 200) return
|
|
this.notYetCommissionList = res.result
|
|
console.log(res)
|
|
})
|
|
},
|
|
getCommissionList() {
|
|
this.tui.request('/app/returnCommission/listWithNoReturn', 'get', {
|
|
shopId:'002'
|
|
}, false, false, true).then((res) => {
|
|
if (res.code !== 200) return
|
|
this.commissionList = res.result
|
|
})
|
|
},
|
|
goToDetail() {
|
|
uni.navigateTo({
|
|
url:`/pages/rebate/detail`
|
|
})
|
|
},
|
|
goToWithdrawal() {
|
|
uni.navigateTo({
|
|
url:`/pages/rebate/withdrawal?balance=${this.balance}`
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.content-balance {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
flex-direction: column;
|
|
margin: 36upx;
|
|
.balance-text {
|
|
font-size: 32upx;
|
|
margin-bottom: 86upx;
|
|
}
|
|
}
|
|
.content-actions {
|
|
display: flex;
|
|
padding-top: 50upx;
|
|
padding-bottom:35upx ;
|
|
.u-button {
|
|
flex-basis: 40%;
|
|
}
|
|
}
|
|
</style>
|
|
|