xhj hace 2 años
padre
commit
f30521d162

+ 8 - 0
mine/clientDetail/clientDetail.css

@@ -30,7 +30,15 @@ page{
 	opacity: 1;
 	font-size: 22rpx;
 	font-weight: 400;
+	color: #A1A1A1;
+	border: 2rpx solid #DEDEDE;
+	margin-bottom: 6rpx;
+	margin-right: 10rpx;
+}
+.user-tag-t{
+	background: #FFE6E8;
 	color: #E95A64;
+	border: 2rpx solid #FFE6E8;
 }
 .form{
 	padding: 30rpx;

+ 12 - 8
mine/clientDetail/clientDetail.vue

@@ -5,7 +5,9 @@
 			<view>
 				<view class="user-name">{{info.nickName}}</view>
 				<view class="ddflex">
-					<view class="user-tag">高价值</view>
+					<block v-if="info.labelName&&info.labelName.length>0">
+						<view class="user-tag user-tag-t" v-for="it,idx in info.labelName" :key="idx+'l'">{{it}}</view>
+					</block>
 				</view>
 			</view>
 		</view>
@@ -39,16 +41,18 @@
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">客户类别</view>
-				<view class="form-data fflex">客户</view>
+				<view class="form-data fflex">
+					<block v-if="info.customTypeName&&info.customTypeName.length>0">{{info.customTypeName.join(',')}}</block>
+				</view>
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">客户来源</view>
 				<view class="form-data fflex">小程序</view>
 			</view>
-			<view class="ddflex form-item">
+			<!-- <view class="ddflex form-item">
 				<view class="form-label">网格地址编码</view>
 				<view class="form-data fflex">-</view>
-			</view>
+			</view> -->
 			<view class="ddflex form-item">
 				<view class="form-label">保单</view>
 				<view class="form-data fflex">{{info.warrantyCount?info.warrantyCount:0}}</view>
@@ -57,16 +61,16 @@
 				<view class="form-label">共计保费</view>
 				<view class="form-data fflex">{{info.warrantyMoney?info.warrantyMoney:0}}元</view>
 			</view>
-			<view class="dflex form-item" v-if="item.associationProduct.length>0">
+			<view class="dflex form-item" v-if="info.associationProduct&&info.associationProduct.length>0">
 				<view class="form-label">关联产品</view>
 				<view class="form-data fflex">
-					<view v-for="it,idx in item.associationProduct" :key="idx">{{it}}</view>
+					<view style="margin-bottom: 8rpx;" v-for="it,idx in info.associationProduct" :key="idx">{{it}}</view>
 				</view>
 			</view>
-			<view class="form-title" style="margin-top: 50rpx;">经营服务策略</view>
+			<!-- <view class="form-title" style="margin-top: 50rpx;">经营服务策略</view>
 			<view class="c-info">
 				刺激消费频率
-			</view>
+			</view> -->
 		</view>
 
 	</view>

+ 5 - 4
mine/clientManage/clientManage.css

@@ -91,7 +91,7 @@ page{
 	background: #FFFFFF;
 	border-radius:10rpx;
 	position: relative;
-	padding: 0 0rpx 30rpx;
+	/* padding: 0 0rpx 30rpx; */
 	margin: 30rpx;
 	overflow: hidden;
 }
@@ -100,9 +100,9 @@ page{
 	font-weight: bold;
 	color: #999999;
 	margin: 30rpx 30rpx;
-	padding-bottom: 21rpx;
+	/* padding-bottom: 21rpx; */
 	flex-wrap: nowrap;
-	border-bottom: 1rpx solid #EAEAEA;
+	/* border-bottom: 1rpx solid #EAEAEA; */
 }
 .card-name{
 	line-height: 45rpx;
@@ -121,8 +121,9 @@ page{
 	font-weight: 400;
 	text-align: center;
 	margin-right: 10rpx;
+	margin-bottom: 6rpx;
 }
-.card-tag:nth-child(2){
+.card-tag-t{
 	background: #FFE6E8;
 	color: #E95A64;
 	border: 2rpx solid #FFE6E8;

+ 84 - 132
mine/clientManage/clientManage.vue

@@ -5,7 +5,7 @@
 				<view class="search-input ddflex fflex">
 					<image src="/static/images/ssico.png"></image>
 					<input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
-						placeholder="请输入关键词" />
+						placeholder="请输入客户昵称" />
 				</view>
 			</view>
 			<view class="filter ddflex">
@@ -13,14 +13,6 @@
 					<text style="max-width: 150rpx;" class="tover">{{stateIndex!=-1?stateList[stateIndex].label:'智能筛选'}}</text>
 					<image class="filter-item-icon" :style="filterType==2&&isShowPop?'transform: rotate(180deg);':''" src="../static/images/down.png"></image>
 				</view>
-				<view class="fflex">
-					<picker mode="region" v-model="regionIndex" @change="regionChange">
-						<view :class="'filter-item fflex ddflex '+(areaIndex!=-1?'f-active':'')" @click="changeFilterType(3)">
-							<text style="max-width: 150rpx;" class="tover">{{regionText?regionText:'地区'}}</text>
-							<image class="filter-item-icon" :style="filterType==1&&isShowPop?'transform: rotate(180deg);':''" src="../static/images/down.png"></image>
-						</view>
-					</picker>
-				</view>
 				<view :class="'filter-item fflex ddflex '+(filterType==1&&isShowPop?'f-active':'')" @click="changeFilterType(1)">
 					筛选
 					<image class="filter-item-icon" :style="filterType==1&&isShowPop?'transform: rotate(180deg);':''" src="../static/images/down.png"></image>
@@ -66,10 +58,17 @@
 					<view class="flex" style="min-width: 0;">
 						<view class="ddflex">
 							<view class="card-name fflex tover">{{item.nickName?item.nickName:''}}</view>
+							<view v-if="item.mobile">
+								<image style="width: 140rpx;height: 64rpx;margin-left: 20rpx;" src="/mine/static/images/lx.png" @click.stop="goPhone(item.mobile)"></image>
+							</view>
 						</view>
 						<view class="ddflex" style="margin-top: 4rpx;">
-							<view class="card-tag">客户</view>
-							<view class="card-tag">高价值</view>
+							<block v-if="item.customTypeName&&item.customTypeName.length>0">
+								<view class="card-tag" v-for="it,idx in item.customTypeName" :key="idx+'s'">{{it}}</view>
+							</block>
+							<block v-if="item.labelName&&item.labelName.length>0">
+								<view class="card-tag card-tag-t" v-for="it,idx in item.labelName" :key="idx+'l'">{{it}}</view>
+							</block>
 						</view>
 						<view class="ddflex" style="font-size: 24rpx;color: #999;font-weight: 400;margin: 20rpx 0;">
 							<text>保单</text><text style="color: #000000;">{{item.warrantyCount?item.warrantyCount:0}}</text>
@@ -78,7 +77,7 @@
 						</view>
 					</view>
 				</view>
-				<view class="ddflex" style="margin-top: 41rpx;font-size: 24rpx;padding: 0 30rpx;">
+				<!-- <view class="ddflex" style="margin-top: 41rpx;font-size: 24rpx;padding: 0 30rpx;">
 					<view class="ddflex fflex">
 						<view style="color: #999;margin-right: 16rpx;">服务策略</view>
 						<view style="color: #333333;">刺激消费频率</view>
@@ -86,7 +85,7 @@
 					<view v-if="item.mobile">
 						<image style="width: 140rpx;height: 64rpx;margin-left: 20rpx;" src="/mine/static/images/lx.png" @click.stop="goPhone(item.mobile)"></image>
 					</view>
-				</view>
+				</view> -->
 			</view>
 		</view>
 		<view v-else class="nodata">
@@ -100,14 +99,12 @@
 	const app = getApp();
 	const req = require("../../utils/request.js");
 	const util = require('../../utils/util.js');
-	const QQMapWX = require("../../utils/qqmap.js");
 
 	export default {
 		components: {},
 		props: {},
 		data() {
 			return {
-				statusBarHeight:0,
 				
 				filterType:null,
 				
@@ -130,26 +127,12 @@
 							},
 						]
 					},{
-						title:'入司时间',
-						key:'inDate',
-						option:[
-							{
-								label: '1~2年',
-								value: 1
-							},{
-								label: '2~3年',
-								value: 2
-							},{
-								label: '3~4年',
-								value: 3
-							},{
-								label: '4年以上',
-								value: 4
-							}
-						]
+						title:'客户类型',
+						key:'custom_type',
+						option:[]
 					},{
-						title:'职务',
-						key:'job',
+						title:'客户标签',
+						key:'custom_label',
 						option:[
 							{
 								label: '经理',
@@ -165,30 +148,29 @@
 					}
 					
 				],
-				startTime: '',
-				endTime: '',
-				
-				regionText:'',
-				regionCode:[],
-				areaIndex:-1,
 				
 				stateIndex: 0,
 				stateList:[{
 						label: '智能推荐',
 						value: null
 					},{
-						label: '评价分从高到低',
-						value: 'avage'
+						label: '保费从高到低',
+						value: 'warranty_money',
+						behavior:'desc'
 					},
 					{
-						label: '浏览量从高到低',
-						value: 'bCount',
-						behavior:4
+						label: '保费从低到高',
+						value: 'warranty_money',
+						behavior:'asc'
 					},
 					{
-						label: '点赞量从高到低',
-						value: 'bCount',
-						behavior:3
+						label: '保单从高到低',
+						value: 'warranty_count',
+						behavior:'desc'
+					},{
+						label: '保单从低到高',
+						value: 'warranty_count',
+						behavior:'asc'
 					}],
 				page: 1,
 				limit: 10,
@@ -196,22 +178,12 @@
 				searchVal: '',
 				dataList: [],
 				isReference:false,
-				latitude: '23.027923',
-				longitude: '113.753815',
 			}
 		},
-		onLoad(options) {
-			QQMapWX.initMap();
-			req.getLocation(async res => {
-				const to = {
-					latitude: res.latitude,
-					longitude: res.longitude
-				};
-				this.latitude = res.latitude;
-				this.longitude = res.longitude;
-				await this.getDict()
-				this.getDataList()
-			});
+		async onLoad(options) {
+			await this.getDict()
+			await this.getDictCustomType()
+			this.getDataList()
 		},
 		onShow() {
 			if(this.isReference){
@@ -231,11 +203,31 @@
 					url: url
 				})
 			},
+			// 客户标签字典
 			getDict(){
 				return new Promise((r,j)=>{
-					req.getRequest('/api/other/dict/info',{dictType:'job'},res=>{
+					req.getRequest('/api/other/dict/info',{dictType:'custom_label'},res=>{
 						this.dateList.map(item=>{
-							if(item.key=='job'){
+							if(item.key=='custom_label'){
+								item.option = []
+								res.map(it=>{
+									item.option.push({
+										label:it.dictName,
+										value:it.dictValue
+									})
+								})
+							}
+						})
+						r(res)
+					})
+				})
+			},
+			// 客户类型字典
+			getDictCustomType(){
+				return new Promise((r,j)=>{
+					req.getRequest('/api/other/dict/info',{dictType:'custom_type'},res=>{
+						this.dateList.map(item=>{
+							if(item.key=='custom_type'){
 								item.option = []
 								res.map(it=>{
 									item.option.push({
@@ -277,24 +269,30 @@
 				this.confirm()
 			},
 			switchFilterType(index,idx) {
-				if(!this.dateList[index].option[idx].isActive){
-					this.dateList[index].option.map(item=>{
-						item.isActive = false
-					})
-					this.dateList[index].option[idx].isActive = true
+				// 可多选
+				if(this.dateList[index].key=='custom_label' || this.dateList[index].key=='custom_type'){
+					if(!this.dateList[index].option[idx].isActive){
+						this.dateList[index].option[idx].isActive = true
+					}else{
+						this.dateList[index].option[idx].isActive = false
+					}
 				}else{
-					this.dateList[index].option[idx].isActive = false
+					if(!this.dateList[index].option[idx].isActive){
+						this.dateList[index].option.map(item=>{
+							item.isActive = false
+						})
+						this.dateList[index].option[idx].isActive = true
+					}else{
+						this.dateList[index].option[idx].isActive = false
+					}
 				}
 				this.dateList = JSON.parse(JSON.stringify(this.dateList))
 			},
-			regionChange(e){
-				this.regionText = e.detail.value.join('')
-				this.regionCode = e.detail.code
-				this.confirm()
-			},
 			confirm() {
 				this.hidePop();
 				this.isLoad = true;
+				this.page=1;
+				this.isLoad = true
 				this.getDataList();
 			},
 			reset() {
@@ -306,8 +304,6 @@
 					})
 				})
 				this.dateList = JSON.parse(JSON.stringify(this.dateList))
-				this.regionText=''
-				this.regionCode=[]
 			},
 			// 分页查询
 			getDataList() {
@@ -320,28 +316,16 @@
 					longitude: this.longitude,
 				}
 				if (this.searchVal) {
-					queryParams.realName = this.searchVal
-				}
-				// 时间筛选
-				if (this.dateIndex != -1) {
-					queryParams.dateType = this.dateList[this.dateIndex].value;
-				}else if (this.dateIndex == -1) {
-				} else {
-					queryParams.dateType = 8
-					queryParams.end = this.endTime?this.endTime:null;
-					queryParams.start = this.startTime?this.startTime:null;
+					queryParams.nickName = this.searchVal
 				}
 				
 				// 状态筛选
 				if (this.stateIndex != -1) {
-					queryParams.orderFiled = this.stateList[this.stateIndex].value;
+					queryParams.orderField = this.stateList[this.stateIndex].value;
 					if(this.stateList[this.stateIndex].behavior){
-						queryParams.behavior = this.stateList[this.stateIndex].behavior;
+						queryParams.order = this.stateList[this.stateIndex].behavior;
 					}
 				}
-				if(this.regionCode.length>0){
-					queryParams.areaCode = this.regionCode[2]
-				}
 				this.dateList.map(item=>{
 					if(item.key=="sex"){
 						let sl = item.option.filter(it=>{return it.isActive})
@@ -349,29 +333,19 @@
 							queryParams.gender = sl[0].value
 						}
 					}
-					if(item.key=="job"){
+					if(item.key=="custom_label"){
 						let jl = item.option.filter(it=>{return it.isActive})
 						if(jl.length>0){
-							queryParams.job = jl[0].value
+							// queryParams.label = jl[0].value
+							queryParams.label = jl.map(item => {return item.value}).join(',')
 						}
 					}
-					if(item.key=="inDate"){
-						console.log('indate')
-						let il = item.option.filter(it=>{return it.isActive})
-						console.log(il)
-						if(il.length>0){
-							let d = il[0].value
-							if(d==4){
-								queryParams.endTime = this.getYear(d+1)
-							}else{
-								queryParams.startTime = this.getYear(d)
-								queryParams.endTime = this.getYear(d+1)
-							}
+					if(item.key=="custom_type"){
+						let tl = item.option.filter(it=>{return it.isActive})
+						if(tl.length>0){
+							queryParams.type = tl.map(item => {return item.value}).join(',')
 						}
 					}
-					if(item.key=="job"){
-						// queryParams.gender = item.option.filter(it=>{return it.isActive})[0].value
-					}
 				})
 				req.getRequest('/api/user/getUserBySaleNo', queryParams, data => {
 					data = data.list
@@ -388,31 +362,13 @@
 					console.log('列表数据>>>', this.dataList);
 				})
 			},
-			getYear(index){
-				let dateTime = new Date().getFullYear(); /* 获取现在的年份 */
-			    dateTime = new Date(new Date().setFullYear(dateTime-index))
-				let y = dateTime.getFullYear()
-				let m = dateTime.getMonth()+1<10?('0'+(dateTime.getMonth()+1)):dateTime.getMonth()+1
-				let d = dateTime.getDate()<10?('0'+(dateTime.getDate())):dateTime.getDate()
-			    return y+'-'+m+'-'+d
-			},
 			// 搜索
 			searchFn() {
 				this.page = 1;
 				this.isLoad = true;
+				this.page=1;
 				this.getDataList();
 			},
-			formatTimeFn(data) {
-				if (data) {
-					return utils.formatTimeCommStr(data, 'Y-M-D')
-				} else {
-					return '';
-				}
-			
-			},
-			monthDayDiff(date) {
-				return util.monthDayDiff(date)
-			},
 			// 拨打电话
 			goPhone(phone) {
 				if(!phone) return false
@@ -424,10 +380,6 @@
 			},
 		},
 		mounted() {
-			const systemInfo = uni.getSystemInfoSync();
-			// px转换到rpx的比例
-			let pxToRpxScale = 750 / systemInfo.windowWidth;
-			this.statusBarHeight = uni.getSystemInfoSync().windowTop*pxToRpxScale
 		}
 	}
 </script>