Harley hace 6 años
padre
commit
f617b1d589

BIN
.DS_Store


+ 2 - 1
chat/build/utils.js

@@ -47,7 +47,8 @@ exports.cssLoaders = function (options) {
     if (options.extract) {
       return ExtractTextPlugin.extract({
         use: loaders,
-        fallback: 'vue-style-loader'
+        fallback: 'vue-style-loader',
+        publicPath: '../../'
       })
     } else {
       return ['vue-style-loader'].concat(loaders)

+ 2 - 2
chat/config/index.js

@@ -11,7 +11,7 @@ module.exports = {
     assetsPublicPath: '/',
     // proxyTable: {
     //   '/api': {
-    //     target:'https://manage.281570.com',  // 线上地址
+    //     target:'http://manage.281570.com',  // 线上地址
     //     // target:'http://192.168.2.187:8090',  // 本地地址
     //     changeOrigin: false,
     //     pathRewrite: {
@@ -22,7 +22,7 @@ module.exports = {
 
     // Various Dev Server settings
     host: 'localhost', // can be overwritten by process.env.HOST  localhost 192.168.2.195
-    port: 8006, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+    port: 8012, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,
     notifyOnErrors: true,

+ 4 - 4
chat/index.html

@@ -16,10 +16,10 @@
 	<title>智能客服系统</title>
 </head>
 <script src="./url_config.js"></script>
-<script>
-	// window.url_https_ajax = 'https://manage.281570.com';
-	// window.url_https_wss = 'link.281570.com';
-</script>
+<!-- <script>
+	window.url_https_ajax = 'https://manage.281570.com';
+	window.url_https_wss = 'link.281570.com';
+</script> -->
 <body>
 <div id="app"></div>
 <!-- built files will be auto injected -->

+ 2 - 5
chat/package-lock.json

@@ -1955,8 +1955,7 @@
       "version": "1.1.0",
       "resolved": "https://registry.npm.taobao.org/console-control-strings/download/console-control-strings-1.1.0.tgz",
       "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
-      "dev": true,
-      "optional": true
+      "dev": true
     },
     "consolidate": {
       "version": "0.14.5",
@@ -4977,7 +4976,6 @@
       "resolved": "https://registry.npm.taobao.org/minipass/download/minipass-2.9.0.tgz",
       "integrity": "sha1-5xN2Ln0+Mv7YAxFc+T4EvKn8yaY=",
       "dev": true,
-      "optional": true,
       "requires": {
         "safe-buffer": "^5.1.2",
         "yallist": "^3.0.0"
@@ -4987,8 +4985,7 @@
           "version": "3.1.1",
           "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyallist%2Fdownload%2Fyallist-3.1.1.tgz",
           "integrity": "sha1-27fa+b/YusmrRev2ArjLrQ1dCP0=",
-          "dev": true,
-          "optional": true
+          "dev": true
         }
       }
     },

+ 41 - 9
chat/src/components/index.vue

@@ -21,8 +21,11 @@
 
 				<div class="row">
 					<yd-button v-if="isExit" color="#fff" bgcolor="#1d57dd" class="exit" size="mini" type="primary"
-							   @click.native="is_exit()">结束聊天
+							   >
 					</yd-button>
+					<!-- <yd-button v-if="isExit" color="#fff" bgcolor="#1d57dd" class="exit" size="mini" type="primary"
+							   @click.native="is_exit()">结束聊天
+					</yd-button> -->
 					<img class="icon-msg" v-if="( chat.length -1 )  + hisLength >= chatNum" @click="is_show_evaluate()" src="@/assets/Service2.png">
 					<img class="icon-msg" @click="knowledge = true,flag = false" src="@/assets/leaveSwitch.png" v-if="!isExit">
 				</div>
@@ -52,8 +55,7 @@
 							<img style="width:.3rem;height:.3rem;" src="@/assets/addright.png">
 						</div>
 						<div class="row item-center" style="height:.72rem;">
-							<p>以上问题都不是</p>
-							<div style="color:#5EA0F7;padding-left:.1rem;" @click="connectionService">转人工客服</div>
+							<p>以上问题都不是  <span class="fontStyle" @click="connectionService"> 请转人工客服</span></p>
 						</div>
 					</div>
 
@@ -74,13 +76,13 @@
 									<yd-lightbox-img :src=" img_http + item.content.img"></yd-lightbox-img>
 								  </yd-lightbox> -->
 								<div v-if="item.type == 'error'" class="customerService left">{{item.content.text}}
-									<div style="color:#5EA0F7;padding-left:.1rem;cursor:pointer;" @click="connectionService">请转 人工客服 咨询</div>
+									<div class="fontStyle" @click="connectionService">请转人工客服</div>
 								</div>
 								<!-- </div> -->
 							</div>
 							<div class="HeadPortrait row center">
 								<img v-if="item.type == 'user'"
-									 :src="require('@/assets/timg.jpg') ">
+									:src="require('@/assets/timg.jpg') ">
 							</div>
 						</div>
 
@@ -93,8 +95,19 @@
 							</div>
 							<div class="messageWindow dialogueA col-w"
 								 :style="item.type == 'user'?'text-align: right;':''">
-								<div v-if="item.type == 'service'" class="customerService left"
-									 v-html="item.content.text"></div>
+								<div v-if="item.type == 'service'">
+									<div  class="customerService left">
+										<div>
+											<span v-html="item.content.text" ></span>
+											<span class="fontStyle">【机器人】</span>
+										</div>
+										<div>
+											<span  class="fontStyle1">问题没有解决</span>
+											<span  @click="connectionService"  class="fontStyle">请转人工客服</span>
+										</div>
+									</div>
+									 <!-- <div class="fontStyle" @click="connectionService">请转人工客服咨询</div> -->
+								</div>
 								<div v-if="item.type == 'user'" class="user right imgSrc">
 									<yd-lightbox v-if="item.content.img" style="display:inline-block"
 												 class="row rightAlignment box-img">
@@ -550,7 +563,7 @@
 				/*****************websockt心跳变量*******************/
 				reconnectData: null,
 				lockReconnect: false,    //避免重复连接,因为onerror之后会立即触发 onclose
-				timeout: 40000,          //5s一次心跳检测
+				timeout: 5000,          //5s一次心跳检测
 				timeoutObj: null,
 				serverTimeoutObj: null,
 				waitingMsg: false, // 是否显示等待排队
@@ -625,6 +638,17 @@
 			socket_open() {
 				console.log('我链接了');
 				this.$dialog.loading.close();
+				//
+				let group_id ;
+				if(this.$public.getQueryString("group_id")){
+					group_id = this.$public.getQueryString("group_id")
+				}else if(sessionStorage.getItem('group_id')){
+					group_id = sessionStorage.getItem('group_id');
+					//
+				}
+				if(group_id){
+					this.turnArtificial(group_id)
+				}
 			},
 
 			/*******************************************/
@@ -1090,6 +1114,7 @@
 			//转人工
 			turnArtificial(id) {
 				this.group = id;
+				sessionStorage.setItem('group_id',this.group)
 				// this.$dialog.loading.open('转接中...')
 				this.nloding('人工客服转接中');
 				
@@ -1638,7 +1663,14 @@
 		height: 0.6rem;
 		margin: 0.15rem 0.4rem;
 	}
-
+	.fontStyle{
+		color:#5EA0F7;
+		font-weight: bold;
+	}
+	.fontStyle1{
+		color:#969696;
+		font-weight: bold;
+	}
 	.dialogueA {
 		padding-left: 0.3rem;
 		padding-right: 0.3rem;

BIN
chat/static/logo.gif


BIN
chat/static/logo1.gif


+ 2 - 1
pc_chat/build/utils.js

@@ -47,7 +47,8 @@ exports.cssLoaders = function (options) {
     if (options.extract) {
       return ExtractTextPlugin.extract({
         use: loaders,
-        fallback: 'vue-style-loader'
+        fallback: 'vue-style-loader',
+        publicPath: '../../'
       })
     } else {
       return ['vue-style-loader'].concat(loaders)

+ 9 - 9
pc_chat/config/index.js

@@ -11,14 +11,14 @@ module.exports = {
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
     proxyTable: {
-      '/api': {
-        target:'https://manage.281570.com',  // 后台访问地址
-        // target:'http://192.168.2.187:8090',  // 后台访问地址
-        changeOrigin: true,
-        pathRewrite: {
-          '^/api': ''
-        }
-      }
+      // '/api': {
+      //   target:'https://manage.281570.com',  // 后台访问地址
+      //   // target:'http://192.168.2.187:8090',  // 后台访问地址
+      //   changeOrigin: true,
+      //   pathRewrite: {
+      //     '^/api': ''
+      //   }
+      // }
     },
 
     // Various Dev Server settings
@@ -52,7 +52,7 @@ module.exports = {
     // Paths
     assetsRoot: path.resolve(__dirname, '../dist'),
     assetsSubDirectory: 'static',
-    assetsPublicPath: '/',
+    assetsPublicPath: './',
 
     /**
      * Source Maps

+ 12 - 55
pc_chat/index.html

@@ -8,11 +8,11 @@
 	<!-- <link rel ="shortcut icon" type="image/x-icon" href="static/logo.gif">-->
 	<title>智能客服系统</title>
 </head>
-<script src="./url_config.js"></script>
-<!-- <script>
+<!-- <script src="./url_config.js"></script> -->
+<script>
 	window.url_https_ajax = 'https://manage.281570.com';
 	window.url_https_wss = 'link.281570.com';
-</script> -->
+</script>
 <body>
 <div id="app"></div>
 <!-- built files will be auto injected -->
@@ -20,15 +20,15 @@
 <script>
 	let name = getQueryString('pid');
 	// console.log(unescape(name))
-	if(unescape(name) == "这就是一个编码没有什么用啊"){
-		// console.log(name)
-	}else {
-		document.getElementById("app").remove();
-		var parent = document.body;
-		var div = document.createElement("div");
-		parent.appendChild(div)
-		div.innerHTML = "无效访问地址";
-	}
+	// if(unescape(name) == "这就是一个编码没有什么用啊"){
+	// 	// console.log(name)
+	// }else {
+	// 	document.getElementById("app").remove();
+	// 	var parent = document.body;
+	// 	var div = document.createElement("div");
+	// 	parent.appendChild(div)
+	// 	div.innerHTML = "无效访问地址";
+	// }
 	function getQueryString(name) {
 		var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
 		var r = window.location.search.substr(1).match(reg);
@@ -38,48 +38,5 @@
 		return null;
 	}
 
-	// !function (window) {
-	// /* 设计图文档宽度 */
-	// var docWidth = 100/1920;
-
-	// var doc = window.document,
-	//     docEl = doc.documentElement,
-	//     resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
-
-	// var recalc = (function refreshRem () {
-
-	//     let client_width   = document.body.clientWidth
-	//     console.log(client_width)
-	//     /* 8.55:小于320px不再缩小,11.73:大于440px不再放大 */
-	//     if(client_width <500){
-	//       docWidth = 10/750
-	//       //var clientWidth = docEl.getBoundingClientRect().width;
-	//       ///docEl.style.fontSize = Math.max(Math.min(20 * (clientWidth / docWidth), 11.73), 8.55) * 5 + 'px';
-	//       docEl.style.fontSize =parseInt(414/750*100) +'px';
-	//     }else{
-
-	//       docEl.style.fontSize =docWidth*1920 + 'px';//pcduan
-	//     }
-	//     console.log('11',docEl.style.fontSize)
-	//     return refreshRem;
-	// })();
-
-	// /* 添加倍屏标识,安卓为1 */
-	// docEl.setAttribute('data-dpr', window.navigator.appVersion.match(/iphone/gi) ? window.devicePixelRatio : 1);
-
-	// if (/iP(hone|od|ad)/.test(window.navigator.userAgent)) {
-	//     /* 添加IOS标识 */
-	//     doc.documentElement.classList.add('ios');
-	//     /* IOS8以上给html添加hairline样式,以便特殊处理 */
-	//     if (parseInt(window.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/)[1], 10) >= 8)
-	//         doc.documentElement.classList.add('hairline');
-	// }
-
-	// if (!doc.addEventListener) return;
-	// window.addEventListener(resizeEvt, recalc, false);
-	// doc.addEventListener('DOMContentLoaded', recalc, false);
-
-	// }(window);
-
 </script>
 </html>

+ 6 - 3
pc_chat/src/components/chat.vue

@@ -20,8 +20,11 @@
 					<el-col>
 						<div class="imgBox">
 							<!-- <el-button v-if="!service_on"  size="mini" type="primary" @click="exit" style="margin-right: 10px;">退出聊天</el-button>-->
-							<el-button v-if="machineAndAtl == 100" size="mini" type="primary" @click="exit"
+							<!-- <el-button v-if="machineAndAtl == 100" size="mini" type="primary" @click="exit"
 									   style="margin-right: 10px;">结束聊天
+							</el-button> -->
+							<el-button v-if="machineAndAtl == 100" size="mini" type="primary" 
+									  
 							</el-button>
 							<i v-if="(selNum + tokNum)  + hisLength > chatNum  && !showject" @click="ejectEvl(10)"
 							   class="sc pointer"
@@ -643,7 +646,7 @@
 				/*****************websockt心跳变量*******************/
 				reconnectData: null,
 				lockReconnect: false,    //避免重复连接,因为onerror之后会立即触发 onclose
-				timeout: 40000,          //10s一次心跳检测
+				timeout: 10000,          //10s一次心跳检测
 				timeoutObj: null,
 				serverTimeoutObj: null,
 
@@ -1623,7 +1626,7 @@
 						// console.log('------心跳检测close-------')
 						this.websock.close(); //如果 5秒之后我们没有收到 后台返回的心跳检测数据 断开socket,断开后会启动重连机制
 
-					}, 4000);
+					}, 5000);
 				}, this.timeout)
 			},
 

BIN
pc_chat/static/logo.gif


+ 1 - 2
service/config/index.js

@@ -22,7 +22,7 @@ module.exports = {
     // },
 
     // Various Dev Server settings
-    host: 'localhost', // can be overwritten by process.env.HOST //192.168.2.163 localhost
+    host: 'localhost', // can be overwritten by process.env.HOST //192.168.2.164 localhost
     port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,
@@ -41,7 +41,6 @@ module.exports = {
     // set this to false - it *may* help
     // https://vue-loader.vuejs.org/en/options.html#cachebusting
     cacheBusting: true,
-
     cssSourceMap: true
   },
 

+ 5 - 6
service/index.html

@@ -6,12 +6,11 @@
     <!-- <link rel ="shortcut icon" type="image/x-icon" href="static/logo.gif"> -->
 	  <title>智能客服系统</title>
   </head>
-  <!-- <script src="./url_config.js"></script> -->
-  <script>
-
-      window.url_https_ajax ='https://kefudabo99admin.daboserver.com';
-      window.url_https_wss = 'kefudabo99ws.daboserver.com';
-  </script>
+  <script src="./url_config.js"></script>
+  <!-- <script>
+      window.url_https_ajax = 'https://manage.281570.com';
+      window.url_https_wss = 'link.281570.com';
+  </script> -->
   <body>
     <div id="app"></div>
     <!-- built files will be auto injected -->

+ 2 - 2
service/src/App.vue

@@ -14,7 +14,7 @@
 			return{
 				reconnectData:null,
 				lockReconnect:false,    //避免重复连接,因为onerror之后会立即触发 onclose
-				timeout:50000,          //10s一次心跳检测
+				timeout:5000,          //10s一次心跳检测
 				timeoutObj:null,
 				serverTimeoutObj:null,
 				apiToken:'',
@@ -150,7 +150,7 @@
 							data.user_info.name = name;
 							_this.$store.dispatch("SET_SESSION_NAME",name);//当前会话对象名
 						}
-
+						data.user_info.page = 1; 
 						session.push(data.user_info);
 						//获取接入的用户信息
 						//_this.get_user_info(list);

+ 3 - 0
service/src/components/leftNav.vue

@@ -76,6 +76,9 @@
 				if (str != 'TheCurrentSession') {
 					path = "/" + str
 				}
+				if(this.$store.getters.get_navState == 'TheCurrentSession'){
+					this.$store.dispatch("SET_MEGNNUM",0);
+				}
 				if(str == 'TheCurrentSession'){
 					this.$store.dispatch("SET_MEG", false);
 					this.megnum = 0;

+ 5 - 1
service/src/pages/TheCurrentSession.vue

@@ -682,7 +682,8 @@
 				if(!system){
 					this.inputValue = '' // 清除会话内容
 				}
-				console.log(type, index);
+				console.log(type, index,this.sessionList);
+				this.historyPage = this.sessionList[index].page;
 				if (this.userSwitching) {
 					let data = [];
 					let order_id = '';
@@ -1248,6 +1249,7 @@
 			},
 			/****************** 获取历史数据 *******************/
 			getHistoryInfo() { // 
+			console.log(this.historyPage)
 				let visitors_id = '';
 				let conversationId = '';
 				if(this.sessionType == 1){
@@ -1315,6 +1317,8 @@
 									this.historyProcess = '没有更多历史记录'
 							    	this.historyLoading = false
 								}
+								this.sessionList[this.dataIndex].page = this.historyPage
+								console.log(this.sessionList[this.dataIndex]);
 							}
 						}
 					}

BIN
service/static/logo.gif