luke преди 6 години
родител
ревизия
b3efe1e7a1
променени са 1 файла, в които са добавени 10 реда и са изтрити 4 реда
  1. 10 4
      pc_chat/src/components/chat.vue

+ 10 - 4
pc_chat/src/components/chat.vue

@@ -17,6 +17,7 @@
 					</el-col>
 					<el-col>
 						<div class="imgBox">
+							<el-button v-if="!service_on"  size="mini" type="primary" @click="exit" style="margin-right: 10px;">退出聊天</el-button>
 							<i v-if="(selNum + tokNum) > 2" @click="ejectEvl(10)" class="sc pointer" :class="selType?'scActy':''">
 							</i>
 							<div v-if="showleaveIcon" style="float: right" class="pointer" @click="leaveMsg()">
@@ -552,6 +553,10 @@
 			}
 		},
 		methods: {
+			// 退出聊天
+			exit(){
+				this.goBack();
+			},
 			// 关闭评价框按钮
 			closeEvl(){
 				this.evlShow = false;
@@ -709,6 +714,7 @@
 					this.waitingMsg = false;
 					this.time = '';
 					this.returnTimer = '';
+					this.service_on = true;
 					// this.automaticRolling();
 					this.customerSviceChat = [];
 					this.reconnect();
@@ -1051,6 +1057,7 @@
 				}
 				// 客服掉线.
 				if (redata.message_type == 'serviceoffline') {
+					this.service_on = false;
 					this.serverNotOnlin = true;
 					this.closeByServer = true;
 					this.automaticRolling();
@@ -1075,18 +1082,17 @@
 					this.automaticRolling();
 					this.waitingText = redata.content;
 				}
-				// 掉线
+				// 客服不在线请稍后再试
 				if (redata.message_type == 'kfNotOnlin'){
-					console.log(redata);
+					console.log(redata, "客服不在线请稍后再试");
 					this.service_on = false;
 				}
 				// 评价返回
 				if(redata.message_type == "evaluate"){
-					console.log(redata,"评价返回");
+					// console.log(redata,"评价返回");
 					if(redata.data.status == 1){
 						this.comtSuccess = true;
 					}
-
 				}
 			},