平板端快衣店
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.
 
 
 
 
 

177 lines
4.8 KiB

<template>
<view>
<uni-card>
<view class="content-wrapper">
<view style="display: flex;">
<view class="content-balance">
<text class="balance-text">返佣余额(元)</text>
<view class="balance-number">
<text style="font-size: 40px;">{{rebateAmount}}</text>
</view>
</view>
<view class="content-balance">
<text class="balance-text">累计返佣(元)</text>
<view class="balance-number">
<text style="font-size: 40px;">{{allrebateAmount}}</text>
</view>
</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-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button"
activeColor="#0072E3"></uni-segmented-control>
<view class="content">
<uni-card title="返佣记录" v-show="current === 0">
<ul class="inventoryList">
<li v-for="(item ,index) in commissionList" :key="index" style="margin-bottom:20rpx;">
<!-- <li> -->
<uni-card :title="'返佣日期:'+ item.createTime" :sub-title="'返佣后账户余额:'+ item.shopAfterDepoBal" @tap="">
<view class="uni-body" style="margin-bottom: 5px;padding-bottom: 10rpx;border-bottom:1px solid #eee;">
<view class="cardText">物流返佣:{{item.companyName}}</view>
<view class="cardText">返佣金额:{{item.companyRebateAmount}}元</view>
</view>
<view class="uni-body">
<view class="cardText">拉包返佣:{{item.workerName}}</view>
<view class="cardText">返佣金额:{{item.workerRebateAmount}}元</view>
</view>
<!-- <view class="uni-body">返佣后余额:200元</view> -->
</uni-card>
</li>
</ul>
</uni-card>
<uni-card title="返佣记录" v-show="current === 1">
<ul class="inventoryList">
<!-- <li v-for="(item ,index) in commissionList" :key="index" style="margin-bottom:20rpx;"> -->
<li>
<uni-card :title="'返佣类型:邀请返佣'" :sub-title="'返佣日期:2023-10-15'" :extra="'返佣金额:50'" @tap="">
<view class="uni-body">返佣主体:平台</view>
<view class="uni-body">
<text class="cardText">对应订单:4165481316546</text>
</view>
<view class="uni-body">返佣后余额:200元</view>
</uni-card>
</li>
</ul>
</uni-card>
</view>
<u-loadmore :status="status" />
</view>
</template>
<script>
export default {
data() {
return {
commissionList: [],
pages: 1,
pageNum: 1,
status: 'loadmore',
shopId: '',
items: ['订单返佣', '邀请返佣'],
current: 0,
allrebateAmount:0,
rebateAmount:0
};
},
onLoad() {
this.shopId = uni.getStorageSync('shopId')
this.type = uni.getStorageSync('type')
},
onShow(){
this.getList()
this.getBalance()
},
onReachBottom() {
if (this.inStorageStatus != 0) {
if (this.pageNum >= this.pages) return;
this.status = 'loading';
this.pageNum += 1;
this.getList();
}
},
methods: {
onClickItem(e) {
if (this.current != e.currentIndex) {
this.current = e.currentIndex;
}
this.getList();
},
getBalance() {
this.tui.request('/app/shop/getShopRebateBalance', 'post', {}, false, false, true).then((res) => {
if (res.code == 200){
this.rebateAmount = res.result.rebateAmount
this.allrebateAmount = res.result.allrebateAmount
}
})
},
getList() {
if(this.current == 0){
this.tui.request('/app/deductlog/getShopLogById', 'post', {
shopId: this.shopId,
pageNum: this.pageNum,
pageSize: 10
}, false, false, true).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
this.commissionList = res.result.records
}
})
}
},
goToDetail() {
uni.navigateTo({
url: `/pages/rebate/detail`
})
},
goToWithdrawal() {
if(this.type != 0){
this.tui.toast("您暂无提现权限!")
}else{
uni.navigateTo({
url: `/pages/rebate/withdrawal?balance=${this.rebateAmount}`
})
}
}
}
}
</script>
<style lang="scss">
.content-balance {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
flex: 1;
.balance-text {
font-size: 32upx;
margin-bottom: 35upx;
}
}
.segmented-control{
width: 93% !important;
margin: 0 auto;
}
.content-actions {
display: flex;
padding-top: 30upx;
padding-bottom: 30upx;
.u-button {
flex-basis: 40%;
}
}
.inventoryList {
.uni-card {
margin: 0 !important;
padding: 0 !important;
}
}
</style>