xhj 2 роки тому
батько
коміт
e8039fe16b

+ 59 - 1
chat/components/chat/msglist/msglist.css

@@ -163,4 +163,62 @@
 }
 
 .lixian{font-size: 24rpx;color: #888;justify-content: center;margin-top: 50rpx;}
-.lixian button{color: #367BD7;font-size: 24rpx;}
+.lixian button{color: #367BD7;font-size: 24rpx;}
+
+
+/* 邀请码弹窗 */
+	.ceng2{position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.5);z-index: 99;}
+	.code-pop{
+		position: fixed;
+		top:50%;
+		left:50%;
+		transform: translate(-50%,-50%);
+		width: 574rpx;
+		background: #FFFFFF;
+		border-radius: 20rpx 20rpx 20rpx 20rpx;
+		z-index: 100;
+	}
+	.code-text{
+		line-height: 41rpx;
+		color: #151515;
+		font-size: 28rpx;
+		margin: 51rpx 47rpx 50rpx;
+		text-align: center;
+	}
+	.code-content image{
+		width: 365rpx;
+		height: 365rpx;
+		margin: 0rpx auto 30rpx;
+	}
+	.code-btn{
+		padding: 25rpx;
+		text-align: center;
+		font-size: 28rpx;
+		color: #2A82FD;
+		border-top: 1px solid #E9E9E9;
+	}
+	
+	.pop-scroll{
+		max-height: 750rpx;
+		overflow: scroll;
+		padding: 30rpx;
+	}
+	.pop-scroll::-webkit-scrollbar {
+		display: none;
+	}
+	
+	.bottom-text{
+		font-size: 28rpx;
+		color: #999;
+		text-align: center;
+		line-height: 48rpx;
+		padding: 30rpx;
+	}
+	.tag{
+		padding: 4rpx 10rpx;
+		font-size: 24rpx;
+		color: #4b95f6;
+		background-color: #ecf0fd;
+		margin-right: 10rpx;
+		margin-top: 10rpx;
+	}

+ 62 - 3
chat/components/chat/msglist/msglist.vue

@@ -70,6 +70,26 @@
 		<!-- <view class="lixian ddflex">会话已结束,用时 05:30</view>
 		<view class="lixian ddflex">当前顾问处于离线状态,<button open-type="contact">点此联系智能客服</button></view>
 	 -->
+	 
+	 <!-- 引导添加官方企微 -->
+		<view class="ceng2" v-if="isShowCodePop" @click="isShowCodePop = false" @touchmove.stop.prevent="moveHandle">
+		</view>
+		<view class="code-pop" v-if="isShowCodePop">
+			<view class="code-text">
+				<view>专属顾问长时间未回复</view>
+				<view>您可添加官方企微咨询</view>
+			</view>
+			<view class="ddflex" style="justify-content: center;">
+				<view class="code-content">
+					<image :src="about.index_post"
+						show-menu-by-longpress="true" mode="aspectFit"></image>
+					<view style="text-align: center;font-size: 24rpx;color: #999;margin-bottom: 50rpx;">长按识别二维码</view>
+				</view>
+			</view>
+			<view class="code-btn" @click="isShowCodePop = false">
+				知道了
+			</view>
+		</view>
 	</view>
 	<!-- <view style="height: 1px;"></view> -->
 </template>
@@ -133,7 +153,9 @@
 				defaultAvatar: "../../../static/theme2x.png",
 				defaultGroupAvatar: "../../..//static/groupTheme.png",
 				recommendCard: '',
-				isShowCodePop: false,
+				
+				about:{},
+				isShowCodePop:false
 			};
 		},
 
@@ -164,8 +186,8 @@
 			msgStorage.off("newChatMsg", this.dispMsg)
 		},
 
-		mounted(event) {
-
+		async mounted(event) {
+			await this.getConfig().then(res => {});
 			let me = this;
 			if (getApp().globalData.isIPX) {
 				this.setData({
@@ -207,6 +229,7 @@
 			});
 			msgStorage.on("newChatMsg", this.dispMsg);
 			this.getUserInfo();
+			this.getCodeShow()
 		},
 		computed: {
 
@@ -229,6 +252,21 @@
 					url:"/pages/index/index"
 				})
 			},
+			
+			getConfig() {
+				var _this = this;
+				return new Promise((res, rej) => {
+					req.g(
+						'/api/other/config',
+						data => {
+							req.setStorage('configRes', JSON.stringify(data));
+							this.about = data;
+							res(data);
+						},
+						true
+					);
+				});
+			},
 
 			showWeChatCodePop() {
 				this.$emit("showWeChatCodePop", true, this.recommendCard);
@@ -493,6 +531,27 @@
 					event.target.dataset.msg.msg.ext.msg_extension) {
 					this.$emit("clickMsg", event.target.dataset.msg.msg.ext)
 				}
+			},
+			
+			// 引导企微添加
+			getCodeShow(){
+				console.log('getCodeShow')
+				// 是销售员则直接返回
+				if(req.getStorage('userInfo') && req.getStorage('userInfo').userType!=1){}
+				else return false
+				// 如果有消息记录
+				if(this.chatMsg && this.chatMsg.length){
+					let lastMsg = this.chatMsg[this.chatMsg.length-1]
+					// 如果最后一条记录是销售员的
+					if(lastMsg.style=="self") {
+						let ot =new Date(timeFormats.timeFormat(lastMsg.time, 'yyyy/mm/dd hh:MM:ss')).getTime()
+						let nt = new Date().getTime()
+						//如果配置了超时时间且销售员最后一条消息超时未回复
+						if(this.about.IM_COMPANY_WECHAT_NO_ANSWER_TIMES && ((nt-ot)/1000/60) > Number(this.about.IM_COMPANY_WECHAT_NO_ANSWER_TIMES)){
+							this.isShowCodePop = true
+						}
+					}
+				}
 			}
 
 		}