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

326 lines
9.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view>
<!-- 顶部操作条 -->
<cu-custom :bgColor="'bg-main-color'" :isBack="true">
<block slot="backText">返回</block>
<block slot="content">{{myOperator.level.name ? myOperator.level.name : '城市'}}运营商</block>
</cu-custom>
<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>
</view>
<!-- 团队人员统计 -->
<view class="cu-list grid no-border col-4 solid-top margin-top-sm">
<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>
</view>
</view>
</view>
<!-- 团队订单统计 -->
<view class="margin-lr-sm margin-top-sm padding bg-white margin-bottom-with-bar">
<view class="cu-list grid no-border col-4">
<view class="cu-item" v-for="(item, index) in myOperator.analyseItems" v-if="index >= 4 && item.type === 'dayAnalyse'">
<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>
</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>
</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':''">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end">
<view class="content">选品广场设置</view>
<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>
</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>
</view>
</template>
<script>
import horizontalNameCard from '@/components/common-card/horizontal-name-card.vue';
import multiselectVerticalNav from '@/components/multi-level-nav/multiselect-vertical-nav.vue';
export default {
components: {
horizontalNameCard,
multiselectVerticalNav
},
data() {
return {
myOperator: {},
operBtn: [{
code: 'ShieldSet',
name: '选品广场'
}, {
code: '',
name: '加价申请'
}, {
code: 'showTeamMembers',
name: '查看团队'
}, {
code: 'showCustomers',
name: '查看客户'
}, {
code: '',
name: '添加团队'
}, {
code: '',
name: '组建/审批区域团队'
}],
agreeShield: 0,
modalName: null,
categoryList: [],
chosenCategoryIds: []
}
},
onLoad() {
this.loadData();
this.bindEvent();
},
onUnload() {
this.offBindEvent();
},
methods: {
async loadData() {
this.curUserInfo = this.$request.getCurUserInfo();
// this.myOperator = await this.$api.data('myOperator');
this.loadMyInfo({
customerId: this.curUserInfo.customerId,
isDistributor: true
});
this.loadCategory();
},
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);
},
doSomething(e) {
const cur = e.currentTarget.dataset.cur;
switch (cur) {
case 'ShieldSet':
this.showModal('shieldSetModal')
break;
case 'showTeamMembers':
uni.navigateTo({
url: '/pages/my/my-team-member?placeStatus=2'
})
break;
case 'showCustomers':
uni.navigateTo({
url: '/pages/my/my-team-member'
})
default:
break;
}
},
changeAgreeShield(agreeShield) {
this.agreeShield = agreeShield;
},
tmpChooseCategory(chosenCategoryIds) {
this.chosenCategoryIds = chosenCategoryIds;
console.log("chosenCategoryIds=" + JSON.stringify(this.chosenCategoryIds))
},
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;
}
</style>