Selaa lähdekoodia

客服+客户

xhj 2 vuotta sitten
vanhempi
commit
c73ee39330

+ 3 - 3
App.vue

@@ -375,9 +375,9 @@
 
 			//获取客服配置
 			getChatList() {
-				// req.getRequest('/api/customer/list', {}, res => {
-				// 	req.setStorage('chatService', res);
-				// });
+				req.getRequest('/api/customer/list', {}, res => {
+					req.setStorage('chatService', res);
+				});
 			},
 			appInitData() {
 				var getSysInfo = uni.getSystemInfoSync();

+ 14 - 18
card/cardFound/cardFound.vue

@@ -178,25 +178,21 @@ export default {
 				
 				for(let i=0;i<this.covers.length;i++){
 					let it = this.covers[i]
-					if(it.id==markerId){
-						let markerLogo = await this.getMarkerLogo(it.logo,it.id==markerId?2:null)
-						let obj = {
-							latitude: it.latitude,
-							longitude: it.longitude,
-							width: 80,
-							height: 92,
-							logo:it.logo,
-							id:it.id,
-							// iconPath: '/static/images/jg_map_ico.png',
-							// 'https://img.zhiqiyun.com/test/2023/07/27/ec50eeee1ab3358d9ba397c86ae8fcc6.jpeg'
-							iconPath: markerLogo//显示的图标     
-							// radius: it.column_4[0].radius,//检索的半径,单位为米
-							// joinCluster: true
-						}
-						covers.push(obj)
-					}else{
-						covers.push(it)
+					let markerLogo = await this.getMarkerLogo(it.logo,it.id==markerId?2:null)
+					let obj = {
+						latitude: it.latitude,
+						longitude: it.longitude,
+						width: 80,
+						height: 92,
+						logo:it.logo,
+						id:it.id,
+						// iconPath: '/static/images/jg_map_ico.png',
+						// 'https://img.zhiqiyun.com/test/2023/07/27/ec50eeee1ab3358d9ba397c86ae8fcc6.jpeg'
+						iconPath: markerLogo//显示的图标     
+						// radius: it.column_4[0].radius,//检索的半径,单位为米
+						// joinCluster: true
 					}
+					covers.push(obj)
 				}
 			}
 			this.covers = JSON.parse(JSON.stringify(covers))

+ 6 - 2
components/contact-button/index.vue

@@ -1,12 +1,12 @@
 <template>
 	<view>
 		<!-- :class="specClass" :style="'top:' +  contactTop + 'px;'" -->
-		<view :class="[className,classNames]" :style="styles" @click="customerServiceChat" v-if="type == 2">
+		<button hover-class="none" :class="className" @click="customerServiceChat" v-if="type == 2">
 			<image lazy-load="true" :src="imgUrl" :mode="imageMode" v-if="imgUrl"></image>
 			<view v-if="buttonText">
 				{{buttonText}}
 			</view>
-		</view>
+		</button>
 		<button open-type="contact" hover-class="none" :class="className" v-else>
 			<image lazy-load="true" :src="imgUrl" v-if="imgUrl"></image>
 			<view v-if="buttonText">{{buttonText}}</view>
@@ -64,6 +64,7 @@
 			},
 			customerServiceChat() {
 				let chatPrams = this.chatPrams;
+				console.log('chatPrams',chatPrams)
 				wx.openCustomerServiceChat({
 					extInfo: {
 						url: chatPrams.url
@@ -71,6 +72,9 @@
 					corpId: chatPrams.enterpriseId,
 					success(res) {
 						console.log('调用微信客服')
+					},
+					fail(error){
+						console.log('error',error)
 					}
 				})
 			},

+ 22 - 15
mine/clientDetail/clientDetail.vue

@@ -1,9 +1,9 @@
 <template>
 	<view>
 		<view class="user-header dflex">
-			<image class="header-pic" src="../../static/images/userimg.png"></image>
+			<image class="header-pic" :src="info.avatar?info.avatar:'../../static/images/userimg.png'"></image>
 			<view>
-				<view class="user-name">李木子</view>
+				<view class="user-name">{{info.nickName}}</view>
 				<view class="ddflex">
 					<view class="user-tag">高价值</view>
 				</view>
@@ -14,24 +14,24 @@
 			<view class="form-title">客户资料</view>
 			<view class="ddflex form-item">
 				<view class="form-label">销售员工号</view>
-				<view class="form-data fflex">1234567</view>
+				<view class="form-data fflex">{{info.manageSaleNo?info.manageSaleNo:'-'}}</view>
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">姓名</view>
-				<view class="form-data fflex">李木子</view>
+				<view class="form-data fflex">{{info.realName?info.realName:'-'}}</view>
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">性别</view>
-				<view class="form-data fflex">女</view>
+				<view class="form-data fflex">{{info.gender==1?'男':info.gender==2?'':'-'}}</view>
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">联系电话</view>
 				<view class="form-data ddflex fflex">
 					<view class="fflex ddflex">
-						<text>{{styTelTextFn('13811116006')}}</text>
-						<image style="width: 27rpx;height: 27rpx;margin-left: 10rpx;" src="../static/images/copy.png" @click="copy('13811116006')"></image>
+						<text>{{info.mobile?styTelTextFn(info.mobile):'-'}}</text>
+						<image v-if="info.mobile" style="width: 27rpx;height: 27rpx;margin-left: 10rpx;" src="../static/images/copy.png" @click="copy(info.mobile)"></image>
 					</view>
-					<view class="ddflex form-btn" @click="callPhone('13811116006')">
+					<view v-if="info.mobile" class="ddflex form-btn" @click.stop="callPhone(info.mobile)">
 						<image style="width: 22rpx;height: 22rpx;margin-right: 10rpx;" src="../../static/pages/images/phone1.png"></image>
 						联系
 					</view>
@@ -43,7 +43,7 @@
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">客户来源</view>
-				<view class="form-data fflex">公众号</view>
+				<view class="form-data fflex">小程序</view>
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">网格地址编码</view>
@@ -51,17 +51,16 @@
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">保单</view>
-				<view class="form-data fflex">2</view>
+				<view class="form-data fflex">{{info.warrantyCount?info.warrantyCount:0}}</view>
 			</view>
 			<view class="ddflex form-item">
 				<view class="form-label">共计保费</view>
-				<view class="form-data fflex">139元</view>
+				<view class="form-data fflex">{{info.warrantyMoney?info.warrantyMoney:0}}元</view>
 			</view>
-			<view class="dflex form-item">
+			<view class="dflex form-item" v-if="item.associationProduct.length>0">
 				<view class="form-label">关联产品</view>
 				<view class="form-data fflex">
-					<view>湖南爱民宝2023</view>
-					<view>湖南爱民宝2023</view>
+					<view v-for="it,idx in item.associationProduct" :key="idx">{{it}}</view>
 				</view>
 			</view>
 			<view class="form-title" style="margin-top: 50rpx;">经营服务策略</view>
@@ -82,15 +81,23 @@
 		props: {},
 		data() {
 			return {
+				id:'',
+				info:{}
 			}
 		},
 		onLoad(options) {
-
+			this.id = options.id
+			this.getDetail()
 		},
 		onShow() {
 			
 		},
 		methods: {
+			getDetail(){
+				req.getRequest('/api/user/getUserInfoBySaleNo',{userId:this.id},res=>{
+					this.info = res
+				})
+			},
 			styTelTextFn(data){
 				return utils.styTelText(data)
 			},

+ 17 - 8
mine/clientManage/clientManage.vue

@@ -65,16 +65,16 @@
 					<image class="register-title-icon" :src="item.avatar?item.avatar:'/static/images/userimg.png'"></image>
 					<view class="flex" style="min-width: 0;">
 						<view class="ddflex">
-							<view class="card-name fflex tover">{{item.realName?item.realName:''}}</view>
+							<view class="card-name fflex tover">{{item.nickName?item.nickName:''}}</view>
 						</view>
 						<view class="ddflex" style="margin-top: 4rpx;">
-							<view class="card-tag">{{ item.jobName }}</view>
-							<view class="card-tag">入司{{item.inDate?monthDayDiff(item.inDate):'1年'}}</view>
+							<view class="card-tag">客户</view>
+							<view class="card-tag">高价值</view>
 						</view>
 						<view class="ddflex" style="font-size: 24rpx;color: #999;font-weight: 400;margin: 20rpx 0;">
-							<text>保单</text><text style="color: #000000;">1</text>
+							<text>保单</text><text style="color: #000000;">{{item.warrantyCount?item.warrantyCount:0}}</text>
 							<view class="card-line" style="height: 23rpx;margin: 0 10rpx;"></view>
-							<text>共计保费</text><text style="color: #FF5700;">139元</text>
+							<text>共计保费</text><text style="color: #FF5700;">{{item.warrantyMoney?item.warrantyMoney:0}}元</text>
 						</view>
 					</view>
 				</view>
@@ -83,8 +83,8 @@
 						<view style="color: #999;margin-right: 16rpx;">服务策略</view>
 						<view style="color: #333333;">刺激消费频率</view>
 					</view>
-					<view>
-						<image style="width: 140rpx;height: 64rpx;margin-left: 20rpx;" src="/mine/static/images/lx.png"></image>
+					<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>
@@ -373,7 +373,7 @@
 						// queryParams.gender = item.option.filter(it=>{return it.isActive})[0].value
 					}
 				})
-				req.getRequest('/api/visiting/card/cardInfoList', queryParams, data => {
+				req.getRequest('/api/user/getUserBySaleNo', queryParams, data => {
 					data = data.list
 					if (data != null && data.length == this.limit) {
 						this.isLoad = true;
@@ -413,6 +413,15 @@
 			monthDayDiff(date) {
 				return util.monthDayDiff(date)
 			},
+			// 拨打电话
+			goPhone(phone) {
+				if(!phone) return false
+				uni.makePhoneCall({
+					phoneNumber: phone,
+					success(res){
+					}
+				}); // 传参带入号码即可
+			},
 		},
 		mounted() {
 			const systemInfo = uni.getSystemInfoSync();

+ 5 - 0
pages/user/user.vue

@@ -159,6 +159,11 @@
 							<view class="fflex">我的名片</view>
 							<image src="../../static/pages/images/more.png" class="rico"></image>
 						</navigator>
+						<!-- <navigator class="li ddflex" @click="jumpUrl('mine/clientManage/clientManage')" hover-class="none">
+							<image src="/static/images/wdmp.png" class="mico"></image>
+							<view class="fflex">我的客户</view>
+							<image src="../../static/pages/images/more.png" class="rico"></image>
+						</navigator> -->
 					</view>
 			
 					<view class="box mlist">