添加:代理佣金明细查看

This commit is contained in:
wuhui_zzw 2024-02-02 17:55:40 +08:00
parent e2211cd88b
commit c3c2a87688
4 changed files with 249 additions and 0 deletions

View File

@ -28,6 +28,10 @@ export function getSingleAgentInfo(id) {
export function getAgentConfig() {
return request.get(`agent/get_config`);
}
// 佣金明细
export function commissionList(data) {
return request.get(`agent/commission_list`, data);
}

View File

@ -1347,6 +1347,12 @@
"style": {
"navigationBarTitleText": "下级管理"
}
},
{
"path": "user/commission",
"style": {
"navigationBarTitleText": "佣金明细"
}
}

View File

@ -203,6 +203,15 @@ export default {
icon: 'iconfont icon-yonghu1',
});
}
//
if(!['4'].includes(String(agentType))){
menuList.push({
title: '佣金明细',
type: 'link',
url: '/pages/agent/user/commission',
icon: 'iconfont icon-yonghu1',
});
}
return menuList;

View File

@ -0,0 +1,230 @@
<template>
<view>
<view class="main-content" v-if="Object.values(list).length > 0">
<view class="list-content">
<view class="top-content">
<view class="num">{{ total }}</view>
<view class="title">总获得佣金</view>
</view>
<view class="list">
<view class="list-box" v-for="(item,index) in list" :key="index">
<!-- 顶部信息 -->
<view class="top-info">
<view class="user-info">{{ item.source == 1 ? '邀请下级奖励' : '用户购买会员卡奖励' }}</view>
<view class="role"> + {{ item.brokerage || '0.00' }}</view>
</view>
<!--统计信息-->
<view class="statistics">
<!-- todo 统计信息 开发中-->
</view>
</view>
</view>
</view>
</view>
<emptyPage v-else title="暂无信息~"></emptyPage>
<!-- 授权登录 -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
</view>
</template>
<script>
import {mapGetters} from "vuex";
import emptyPage from '@/components/emptyPage.vue';
import authorize from '@/components/Authorize';
import {commissionList} from "@/api/agent";
export default {
components: {
authorize,
emptyPage
},
computed: {
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor'])
},
data() {
return {
total: 0,
list: [],
page: 1,
agent_id: 0,
//
isAuto: false, //
isShowAuth: false,//
}
},
onLoad(options) {
let _this = this;
_this.agent_id = options.agent_id || 0;
// agent_id <= 0
if(Number(_this.agent_id) <= 0){
_this.$util.Tips({
title: '非法访问,信息不存在!',
},{tab:5,url:'/pages/agent/center'});
return false;
}
//
if (!this.isLogin) {
//
this.isAuto = true;
this.isShowAuth = true
}else{
//
this.init();
}
},
//
onReachBottom() {
this.getList();
},
methods: {
//
onLoadFun() {
if(this.isLogin){
this.isShowAuth = false;
this.init();
}
},
//
authClose(e) {
this.isShowAuth = e
},
//
init () {
this.getList();
},
//
getList() {
let _this = this;
let params = {
page: _this.page,
agent_id: _this.agent_id
};
commissionList(params).then(res => {
let list = res.data.list || {};
_this.total = res.data.totalMoney || 0.00;
if (Object.values(list).length > 0) {
_this.list = _this.$util.SplitArray(list, _this.list);
_this.$set(_this, 'list', _this.list);
_this.page++;
}
}).catch(err => {
this.$util.Tips({title: err});
});
},
//
getAgentTypeText(info, title = '') {
switch (Number(info.agent_type)) {
case 1:
title = '发起人';
break;
case 2:
title = '省公司';
if(info.province_name) title += `(${info.province_name})`;
break;
case 3:
title = '外勤';
if(info.province_name) title += `(${info.province_name})`;
break;
case 4:
title = '内勤';
if(info.province_name) title += `(${info.province_name})`;
break;
case 5:
title = '运营商';
if(info.province_name || info.area_name || info.area_name) title += `(${info.province_name}${info.city_name}${info.area_name})`;
break;
case 6:
title = '合伙人';
if(info.province_name || info.area_name || info.area_name) title += `(${info.province_name}${info.city_name}${info.area_name})`;
break;
case 7:
title = '餐厅';
if(info.mer && info.mer.mer_name) title += `(${info.mer.mer_name})`;
break;
case 8:
title = '配送商';
break;
}
return title;
},
}
}
</script>
<style lang="scss" scoped>
.main-content {
width: 100vw;
min-height: 100vh!important;
background: #f6f6f6;
.list-content{
.top-content{
background: #82201d;
width: 100%;
height: 200rpx;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
.num{
color: #FFFFFF;
height: 70rpx;
line-height: 70rpx;
font-size: 45rpx!important;
}
.title{
color: #ffe9ea;
font-size: 26rpx!important;
height: 100rpx;
}
}
.list{
width: 100%;
padding: 0 20rpx;
position: relative;
top: -50rpx;
.list-box{
width: 100%;
background: #FFFFFF;
padding: 20rpx;
border-radius: 10rpx;
display: inline-flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.top-info{
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
width: 100%;
.user-info{
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
.user-title{
margin-left: 20rpx;
}
}
.role{
background: #f2e6e8;
color: #6c454a;
padding: 5rpx 15rpx;
font-size: 24rpx;
border-radius: 5rpx;
}
}
}
.list-box:not(:last-child){
margin-bottom: 20rpx!important;
}
}
}
}
</style>