dingdong-mall/pages/my/my-team-member.vue

140 lines
4.1 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>
<block slot="content">查看团队{{totalMembers}}</block>
2022-04-23 23:13:29 +08:00
</cu-custom>
<!-- 团队成员信息 -->
2022-08-16 23:15:45 +08:00
<view class="margin-top-sm margin-lr-sm padding bg-white name-card shadow-warp"
v-for="(member, index) in members">
<!-- 个人名片 -->
<view class="flex justify-start">
<view class="cu-avatar round"
:style="'background-image:url(' + member.customerLogoUrl + '); width: 130rpx; height: 130rpx;'">
</view>
<view class="margin-left-sm flex-column-around">
<view class="text-black text-xl">{{member.name}}</view>
<view class="">
<text class="margin-right-xs">角色合伙人</text>
</view>
</view>
</view>
2022-04-23 23:13:29 +08:00
<!-- 实名及公告图标 -->
<view class="flex justify-end oper-bar">
<view class="text-center margin-right-sm text-orange" @click="makePhoneCall(member.phone)">
2022-04-23 23:13:29 +08:00
<view class="cuIcon-phone"></view>
</view>
</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 member.analyseItems" v-if="index < 4 && item.type === 'common'">
2022-08-16 23:15:45 +08:00
<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 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" v-for="(item, index) in member.analyseItems" v-if="index >= 4 && item.type === 'common'">
2022-08-16 23:15:45 +08:00
<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>
2022-08-16 23:15:45 +08:00
</view>
<load-status-bar class="margin-tb-xl" ref="loadStatusBar" @loadMore="loadMyOperaMembers"></load-status-bar>
2022-04-23 23:13:29 +08:00
</view>
</template>
<script>
2022-08-16 23:15:45 +08:00
import horizontalNameCard from '@/components/common-card/horizontal-name-card.vue';
import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
2022-04-23 23:13:29 +08:00
export default {
components: {
2022-08-16 23:15:45 +08:00
horizontalNameCard,
loadStatusBar
2022-04-23 23:13:29 +08:00
},
data() {
2022-08-16 23:15:45 +08:00
return {
totalMembers: 0,
2022-08-16 23:15:45 +08:00
members: [],
curUserInfo: {},
pageNum: 0,
pageSize: 0
2022-04-23 23:13:29 +08:00
}
},
onLoad() {
this.loadData();
},
methods: {
2022-08-16 23:15:45 +08:00
async loadData() {
this.curUserInfo = this.$request.getCurUserInfo();
this.resetData();
2022-08-16 23:15:45 +08:00
// this.myOperaMembers = await this.$api.data('myOperaMembers');
this.loadMyOperaMembers();
2022-08-16 23:15:45 +08:00
},
resetData() {
this.pageNum = this.$globalData.initPageNum;
this.pageSize = this.$globalData.initPageSize;
},
makePhoneCall(phoneNum) {
uni.makePhoneCall({
phoneNumber: phoneNum
})
},
async loadMyOperaMembers(params = {}) {
params.pageNum = this.pageNum;
params.pageSize = this.pageSize;
2022-11-16 02:04:59 +08:00
params.customerPlace = this.curUserInfo.customerId;
params.isDistributor = true;
params.placeStatus = 2;
2022-11-16 02:04:59 +08:00
params.status = 0;
2022-08-16 23:15:45 +08:00
this.$refs.loadStatusBar.showLoading();
try {
let res = await this.$request.qryCustomerList(params);
let rowsLength = res.rows.length;
if (rowsLength > 0) {
this.members = this.members.concat(res.rows);
this.totalMembers = res.total;
this.pageNum++;
if (rowsLength === this.pageSize) {
this.$refs.loadStatusBar.showLoadMore();
return;
}
}
this.$refs.loadStatusBar.showLoadOver();
} catch (e) {
console.error(e)
this.$refs.loadStatusBar.showLoadErr();
}
2022-04-23 23:13:29 +08:00
}
}
}
</script>
<style scoped>
.name-card {
position: relative;
}
.name-card .oper-bar {
position: absolute;
top: 20rpx;
right: 20rpx;
font-size: 50rpx;
2022-04-23 23:13:29 +08:00
}
2022-08-16 23:15:45 +08:00
.cu-list+.cu-list {
margin-top: unset;
}
2022-04-23 23:13:29 +08:00
</style>