Harley 6 жил өмнө
parent
commit
6f90ca93b1

+ 3 - 3
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 -->

+ 13 - 0
pc_chat/src/api/http.js

@@ -50,5 +50,18 @@ export default {
 					reject(err)
 				})
 		})
+	},
+	uploadPost(url, params) {
+		return new Promise((resolve, reject) => {
+			axios.post(headerUrl(url), params)
+				.then(res => {
+					resolve(res)
+				})
+				.catch(err => {
+					reject(err)
+				})
+		})
 	}
+
+
 }

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

@@ -80,7 +80,7 @@
 								<section>
 									<div>
 										<span class="col6">上面问题都不是</span>
-										<span class="pointer ly" @click="changeService()">转人工客服</span>
+										<span class="pointer ly" @click="changeService()">转人工客服</span>
 									</div>
 								</section>
 							</div>
@@ -127,11 +127,13 @@
 												<img src="./../assets/st-img/headAdvent.png" alt="">
 											</div>
 											<div class="cont left">
-												<div>您的问题暂时无法处理</div>
 												<div>
-													<span class="col">问题没有解决?</span>
+													抱歉!您的问题《机器人》无法处理!
+												</div>
+												<div>
+													<!-- <span class="col">问题没有解决?</span> -->
 													<span class="change pointer ly"
-														  @click="changeService()">转人工客服</span>
+														  @click="changeService()"> 人工客服 咨询</span>
 												</div>
 											</div>
 										</div>
@@ -165,11 +167,14 @@
 												<img src="./../assets/st-img/headAdvent.png" alt="">
 											</div>
 											<div class="cont left">
-												<div v-html="item.robot_content"></div>
+												<div>
+													<span v-html="item.robot_content"></span>
+													<span class="change">【机器人】</span>
+												</div>
 												<div>
 													<span class="col">问题没有解决</span>
 													<span class="change pointer ly"
-														  @click="changeService()">转人工客服</span>
+														  @click="changeService()"> 人工客服 咨询</span>
 												</div>
 											</div>
 										</div>
@@ -391,7 +396,7 @@
 									</ul>
 									<el-button class="expression" slot="reference"></el-button>
 								</el-popover>
-								<el-upload class="avatar-uploader" action="/api/index/upload/uploadImg"
+								<el-upload class="avatar-uploader" :action="uploadImg_url"
 										   :on-success="handleAvatarSuccess"
 										   :before-upload="beforeAvatarUpload"
 										   :on-error='handError'
@@ -601,7 +606,7 @@
 				userConversation: {}, //用户当前会话
 				machineAndAtl: 10, //默认为机器人,100为人工
 				satisfaction: 1, //评价满意度,1为满意,2为一般,3为不满意
-				url: '', // 域名地址
+				url: window.url_https_ajax, // 域名地址
 				user_info: '', // 用户信息
 				// 人工客服信息
 				service: '',
@@ -661,6 +666,7 @@
 				hisLength: 0, // 历史数量
 				showject: false,
 				loadingobj:null,//加载特效对像
+				uploadImg_url:'',
 			}
 		},
 		filters: {
@@ -759,9 +765,10 @@
 			},
 
 			upImg(formData) {
+				this.nloding('图片发送中....');
 				let self = this;
 				// 数据结构请求
-				this.$http.post('/index/upload/uploadImg', formData).then(res => {
+				this.$http.uploadPost('/index/upload/uploadImg', formData).then(res => {
 					// console.log(res.data.data)
 					// console.log(res.data.data.src);
 					let str = this.information;
@@ -830,6 +837,8 @@
 						//高度自动向上滑动
 						this.automaticRolling();
 					}
+
+					this.closeNloading()
 				})
 			},
 
@@ -1827,7 +1836,7 @@
 		/**************页面加载中挂载**************** */
 		mounted() {
 			let self = this;
-			this.url = window.url_https_ajax;
+			this.uploadImg_url = window.url_https_ajax +"/index/upload/uploadImg"
 			this.frceArr = frce.frce;
 			this.$http.get('/index/index/systime?t=' + new Date()).then(res => {
 				if (res.data.code == 1) {

+ 6 - 1
pc_chat/src/components/leaveMsg.vue

@@ -62,7 +62,7 @@
 						</label>
 						<!-- :on-preview="handlePictureCardPreview"  :on-remove="handleRemove" -->
 						<el-upload style="margin-top:14px;"
-								   action="/api/index/upload/uploadImg"
+								   :action="uploadImg_url"
 								   ref="upload"
 								   :file-list="fileList"
 								   :on-change='uploadChange'
@@ -108,11 +108,13 @@
 				QQ: "",
 				WX: '',
 				uploadImg: [],//上传图片的数据集合
+				uploadImg_url:'',
 				imgUrl:'',
 				fileList: [],
 				isUpImg:false,
 				isSub:false,
 				imgNum:0,
+				https_url:''//
 			}
 		},
 		methods: {
@@ -263,6 +265,9 @@
 					this.fileList = fileList
 				}
 			},
+			mounted(){
+				this.uploadImg_url = window.url_https_ajax + "/index/upload/uploadImg"
+			}
 		}
 	}
 </script>