dingdong-mall/pages/my/my-operator.vue

326 lines
9.7 KiB
Vue
Raw Normal View History

2022-04-23 23:13:29 +08:00
<template>
<view>
<!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block>
2022-11-13 23:23:10 +08:00
<block slot="content">{{myOperator.level.name ? myOperator.level.name : '城市'}}运营商</block>
2022-04-23 23:13:29 +08:00
</cu-custom>
2022-11-13 23:23:10 +08:00
<view class="margin-top-sm margin-lr-sm padding bg-white name-card shadow-warp">
<!-- 个人名片 -->
<view class="flex justify-start">
<view class="cu-avatar round"
:style="'background-image:url(' + myOperator.customerLogoUrl + '); width: 130rpx; height: 130rpx;'">
</view>
<view class="margin-left-sm flex-column-around">
<view class="text-black text-xl">{{myOperator.name}}</view>
<view class="">
<text class="margin-right-xs">角色合伙人</text>
</view>
</view>
</view>
<!-- 实名及公告图标 -->
<view class="flex justify-end oper-bar">
<!-- <view class="text-center margin-right-sm" @click="showCertificationForm">
<view class="cuIcon-profilefill text-yellow"></view>
<view class="text-xs">实名认证</view>
</view> -->
<view class="text-center">
<view class="cuIcon-notice"></view>
<view class="text-xs">公告</view>
</view>
2022-04-23 23:13:29 +08:00
</view>
<!-- 团队人员统计 -->
<view class="cu-list grid no-border col-4 solid-top margin-top-sm">
2022-11-13 23:23:10 +08:00
<view class="cu-item" :class="index == 2 ? 'solid-left' : ''" v-for="(item, index) in myOperator.analyseItems" v-if="index < 4 && item.type === 'common'">
<view class="margin-bottom-xs">{{item.title}}</view>
<view class="text-red" v-if="item.unit === 'yuan'">
{{item.value}}
</view>
<view v-else class="text-red">
{{item.value}}{{item.unit}}
</view>
2022-04-23 23:13:29 +08:00
</view>
</view>
</view>
<!-- 团队订单统计 -->
2022-04-27 10:00:39 +08:00
<view class="margin-lr-sm margin-top-sm padding bg-white margin-bottom-with-bar">
2022-04-23 23:13:29 +08:00
<view class="cu-list grid no-border col-4">
2022-11-13 23:23:10 +08:00
<view class="cu-item" v-for="(item, index) in myOperator.analyseItems" v-if="index >= 4 && item.type === 'dayAnalyse'">
2022-04-23 23:13:29 +08:00
<view class="margin-bottom-xs">{{item.title}}</view>
<view class="text-red" v-if="item.unit === 'yuan'">
2022-11-13 23:23:10 +08:00
{{item.value}}
2022-04-23 23:13:29 +08:00
</view>
<view v-else class="text-red">
2022-11-13 23:23:10 +08:00
{{item.value}}{{item.unit}}
2022-04-23 23:13:29 +08:00
</view>
2022-11-13 23:23:10 +08:00
</view>
<view class="cu-item" v-for="(item, index) in myOperator.analyseItems" v-if="index >= 4 && item.type === 'common'">
<view class="margin-bottom-xs">{{item.title}}</view>
<view class="text-red" v-if="item.unit === 'yuan'">
{{item.value}}
</view>
<view v-else class="text-red">
{{item.value}}{{item.unit}}
</view>
2022-04-23 23:13:29 +08:00
</view>
</view>
</view>
<!-- 操作栏 -->
<view class="bg-white padding margin-top-sm fixed-bottom-bar">
<view class="flex flex-wrap justify-between">
<view class="basis-df margin-tb-sm" v-for="(item, index) in operBtn">
<button class="cu-btn long-btn shadow bg-main-color light" :data-cur="item.code"
@click="doSomething">{{item.name}}</button>
</view>
</view>
</view>
<!-- 屏蔽设置 模态框 -->
<view class="cu-modal" :class="modalName=='shieldSetModal'?'show':''">
2022-04-23 23:13:29 +08:00
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">选品广场设置</view>
2022-04-23 23:13:29 +08:00
<view class="action" @tap="hideModal">
<text class="cuIcon-close text-bold text-red"></text>
</view>
</view>
<view class="padding-xl">
<view class="flex align-start margin-bottom-xl padding-lr">
<view class="margin-right">选品广场</view>
<view class="margin-right">
<view class="margin-bottom-sm">
<text class="margin-right-xs">全选</text>
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 0"
@click="changeAgreeShield(0)">
</checkbox>
</view>
<view>
<text class="margin-right-xs">反选</text>
<checkbox style="transform:scale(0.9)" class="main-color" :value="agreeShield" :checked="agreeShield === 1"
@click="changeAgreeShield(1)">
</checkbox>
</view>
</view>
<view class="text-left">
<view>逐条选品</view>
<view class="text-main-color" @tap="showModal('categoryModal')">去选品</view>
</view>
</view>
<view class="padding-top-lg text-left text-sm">
<view class="margin-bottom-xs">全选全部勾选供应链的服务及商品/运营代理所有类目</view>
<view class="margin-bottom-xs">反选把与我提供的服务和商品有冲突的区域范围不勾选</view>
<view class="text-main-color">(你所提供的服务及类目以你同手机号上架或入驻为准)</view>
2022-04-23 23:13:29 +08:00
</view>
</view>
<view class="cu-bar bg-white">
<view class="action margin-0 flex-sub text-black" @tap="hideModal">取消</view>
<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
@click="confirmShield">确定</view>
</view>
</view>
</view>
<!-- 类目抽屉 -->
<view class="DrawerClose" :class="modalName=='categoryModal'?'show':''" @tap="showModal('shieldSetModal')">
<view class="cuIcon-roundcheckfill text-main-color"></view>
<view class="cuIcon-roundclosefill"></view>
</view>
<scroll-view scroll-y class="DrawerWindow bg-gray" :class="modalName=='categoryModal'?'show':''">
<multiselect-vertical-nav :list="categoryList" :containerHeight="'calc(100vh - 200rpx)'"></multiselect-vertical-nav>
</scroll-view>
2022-04-23 23:13:29 +08:00
</view>
</template>
<script>
import horizontalNameCard from '@/components/common-card/horizontal-name-card.vue';
import multiselectVerticalNav from '@/components/multi-level-nav/multiselect-vertical-nav.vue';
2022-04-23 23:13:29 +08:00
export default {
components: {
horizontalNameCard,
multiselectVerticalNav
2022-04-23 23:13:29 +08:00
},
data() {
return {
myOperator: {},
operBtn: [{
code: 'ShieldSet',
name: '选品广场'
2022-04-23 23:13:29 +08:00
}, {
code: '',
name: '加价申请'
}, {
code: 'showTeamMembers',
name: '查看团队'
}, {
code: 'showCustomers',
2022-04-23 23:13:29 +08:00
name: '查看客户'
}, {
code: '',
name: '添加团队'
}, {
code: '',
name: '组建/审批区域团队'
2022-04-23 23:13:29 +08:00
}],
agreeShield: 0,
modalName: null,
categoryList: [],
chosenCategoryIds: []
2022-04-23 23:13:29 +08:00
}
},
onLoad() {
this.loadData();
this.bindEvent();
},
onUnload() {
this.offBindEvent();
2022-04-23 23:13:29 +08:00
},
methods: {
2022-11-13 23:23:10 +08:00
async loadData() {
this.curUserInfo = this.$request.getCurUserInfo();
// this.myOperator = await this.$api.data('myOperator');
this.loadMyInfo({
2022-11-16 02:04:59 +08:00
customerId: this.curUserInfo.customerId,
isDistributor: true
});
this.loadCategory();
2022-11-13 23:23:10 +08:00
},
async loadMyInfo(params) {
let res = await this.$request.qryCustomerList(params);
if (res && res.rows && res.rows.length == 1) {
this.myOperator = res.rows[0];
this.myOperator.extraInfos = [{
name: '角色:',
desc: '合伙人'
}];
}
},
async loadCategory(params) {
let res = await this.$request.getProductCategories(params);
res = res[1].data.data;
res.forEach(firstCategory => {
if (firstCategory.child && firstCategory.child.length) {
this.categoryList = this.categoryList.concat(firstCategory.child)
}
})
},
showModal(modalName) {
this.modalName = modalName;
},
hideModal() {
this.modalName = null
},
bindEvent() {
uni.$on(this.$globalFun.VERTICAL_NAV_GET_ITEM, this.tmpChooseCategory);
},
offBindEvent() {
uni.$off(this.$globalFun.VERTICAL_NAV_GET_ITEM);
2022-04-23 23:13:29 +08:00
},
doSomething(e) {
const cur = e.currentTarget.dataset.cur;
switch (cur) {
case 'ShieldSet':
this.showModal('shieldSetModal')
2022-04-23 23:13:29 +08:00
break;
case 'showTeamMembers':
uni.navigateTo({
url: '/pages/my/my-team-member?placeStatus=2'
2022-04-23 23:13:29 +08:00
})
break;
case 'showCustomers':
uni.navigateTo({
url: '/pages/my/my-team-member'
})
2022-04-23 23:13:29 +08:00
default:
break;
}
},
changeAgreeShield(agreeShield) {
this.agreeShield = agreeShield;
},
tmpChooseCategory(chosenCategoryIds) {
this.chosenCategoryIds = chosenCategoryIds;
console.log("chosenCategoryIds=" + JSON.stringify(this.chosenCategoryIds))
2022-04-23 23:13:29 +08:00
},
confirmShield(e) {},
showCertificationForm() {
uni.navigateTo({
url: '/pages/my/Certification'
})
}
}
}
</script>
<style scoped>
.cu-list.grid.no-border>.solid-left.cu-item:after {
border-left: 1rpx solid rgba(0, 0, 0, 0.1);
border-left-width: 0.5px;
border-left-style: solid;
border-left-color: rgba(0, 0, 0, 0.1);
}
.name-card {
position: relative;
}
.name-card .oper-bar {
position: absolute;
top: 20rpx;
right: 20rpx;
font-size: 40rpx;
}
.long-btn {
width: 90%;
margin-left: 5%;
margin-right: 5%;
}
.DrawerWindow {
z-index: 9999;
position: absolute;
width: 85vw;
height: 100vh;
left: 0;
top: 0;
transform: scale(0.9, 0.9) translateX(-100%);
opacity: 0;
pointer-events: none;
transition: all 0.4s;
padding: 100upx 0;
}
.DrawerWindow.show {
transform: scale(1, 1) translateX(0%);
opacity: 1;
pointer-events: all;
}
.DrawerClose {
position: absolute;
width: 40vw;
height: 100vh;
right: 0;
top: 0;
color: transparent;
padding-bottom: 30upx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));
letter-spacing: 5px;
font-size: 60upx;
opacity: 0;
pointer-events: none;
transition: all 0.4s;
z-index: 9999;
}
.DrawerClose.show {
opacity: 1;
pointer-events: all;
width: 15vw;
color: #fff;
2022-04-23 23:13:29 +08:00
}
</style>