luke 6 anni fa
parent
commit
5a2030a74c
2 ha cambiato i file con 67 aggiunte e 55 eliminazioni
  1. 7 12
      pc_chat/src/components/leaveMsg.vue
  2. 60 43
      pc_chat/src/components/ledgeBase.vue

+ 7 - 12
pc_chat/src/components/leaveMsg.vue

@@ -9,7 +9,6 @@
 			</el-row>
 		</el-header>
 		<div class="cationer">
-
 			<el-main>
 				<form action="">
 					<div class="call">
@@ -22,10 +21,8 @@
 					<div class="phone">
 						<label for="">
 							<span>您的手机号</span>
-							<span class="star"> *</span>
-							<span class="tips" v-if="error">(请输入正确的手机号)</span>
 						</label>
-						<el-input v-model="phone" @blur='sureinfor(1)' placeholder="请输入手机号"
+						<el-input v-model="phone" placeholder="请输入手机号"
 								  style="paddiing:0 9px;"></el-input>
 					</div>
 					<div class="qq">
@@ -121,8 +118,6 @@
 			sub() {
 				if (this.call == '') {
 					this.$message.error('请填写称呼!');
-				} else if (this.phone == '') {
-					this.$message.error('请填写手机号!');
 				} else if (this.leaveInfor == '') {
 					this.$message.error('请填写留言信息!');
 				} else {
@@ -164,12 +159,12 @@
 			// 失去焦点时验证
 			sureinfor(type) {
 				if (type == 1) {
-					if (!/^1[34578]\d{9}$/.test(this.phone)) {
-						this.error = true;
-						this.phone = '';
-					} else {
-						this.error = false;
-					}
+					// if (!/^1[34578]\d{9}$/.test(this.phone)) {
+					// 	this.error = true;
+					// 	this.phone = '';
+					// } else {
+					// 	this.error = false;
+					// }
 				}
 				else if (type == 10) {
 					if (!/^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(this.eMail)) {

+ 60 - 43
pc_chat/src/components/ledgeBase.vue

@@ -46,46 +46,22 @@
 							<el-collapse-item class="list" v-for="item in knowLedgeBase" :key="item.id">
 								<template slot="title">
 									<div style="width:100%;" class="quesTit">
-										<span>{{item.content}}</span>
-										<span>{{item.add_time}}</span>
+										<span class="title">{{item.content}}</span>
+										<span style="float: right">{{item.add_time}}</span>
 									</div>
 								</template>
-								<div>
-									<div class="conversationBox">
-										<div class="timer">
-											{{item.add_time}}
-										</div>
-										<div class="customer row allAlignment">
-											<div></div>
-											<div class="row">
-												<div class="cont right">
-													<div>{{item.content}}</div>
-												</div>
-												<div class="headImg" style="margin-right:0">
-													<img src="./../assets/st-img/user.png" alt="">
-												</div>
-											</div>
-										</div>
-									</div>
-									<div class="conversationBox">
-										<div class="timer">
-											{{item.dealWith_time}}
-										</div>
-										<div class=" row">
-											<div class="conversation row">
-												<div class="headImg">
-													<img src="./../assets/st-img/headAdvent.png" alt="">
-												</div>
-												<div class="cont left">
-													<div>{{item.reply_content}}</div>
-												</div>
-
-											</div>
-											<div style="width:66px;"></div>
-										</div>
-									</div>
+								<div class="text">
+									{{item.content}}
+								</div>
+								<ul class="imgs" v-for="i in imgs">
+									<li v-for="child in i">
+										<img :src="url + child" alt="">
+									</li>
+								</ul>
+								<p>回复的留言</p>
+								<div class="text">
+									{{item.reply_content ? item.reply_content : "暂无"}}
 								</div>
-
 							</el-collapse-item>
 						</el-collapse>
 					</div>
@@ -128,7 +104,10 @@
 				problemType: '', //类
 				knowLedgeBase: '', //知识库问答数据
 				problemName: '账号',//类名
-				noBase: true  //无数据状态
+				noBase: true , //无数据状态
+				imgs:[],
+				url: 'http://kfadmin.bocai186.com', // 域名地址
+				// url: 'http://192.168.2.187:8090', // 域名地址
 			}
 		},
 		methods: {
@@ -154,14 +133,23 @@
 			getLeave(data) {
 				this.$axios.post('/api/index/Message/index', data).then(res => {
 					if (res.data.status === 1) {
+						console.log('======获取数据=========', res.data.data);
+						let _img;
+						for (let i = 0; i < res.data.data.length; i++) {
+							_img = res.data.data[i].images.split(",");
+							this.imgs.push(_img)
+						}
+						console.log(this.imgs,'123123');
+
 						this.knowLedgeBase = res.data.data;
-						if (this.knowLedgeBase.length > 0) {
+
+						if(this.knowLedgeBase.length > 0) {
 							this.noBase = true;
 						} else {
 							this.noBase = false;
 						}
 					}
-					console.log('======获取数据=========', res);
+
 				})
 			},
 			// 查询数据
@@ -205,6 +193,38 @@
 	}
 </script>
 <style scoped>
+	.title {
+		float: left; width: 300px;
+		overflow-y: hidden;
+		word-break: keep-all;
+		white-space:nowrap;
+		text-overflow:ellipsis;
+	}
+	.imgs {
+		margin: 20px 0;
+		display: flex;
+		justify-content: flex-start;
+	}
+
+	.imgs li {
+		margin-right: 10px;
+		width: 100px;
+		height: 100px;
+	}
+	.imgs li img {
+		width: 100px;
+		height: 100px;
+	}
+	.text {
+		background: #f5f5f5;
+		border: 1px solid #eee;
+		padding: 20px;
+		font-size: 14px;
+		color: #666;
+		line-height: 1.8;
+		margin-right: 15px;
+		margin-top: 15px;
+	}
 	.chatBox {
 		width: 700px;
 	}
@@ -325,7 +345,6 @@
 
 	.el-main .leaveCont {
 		box-sizing: border-box;
-		height: 510px;
 		padding: 20px 20px 13px;
 	}
 
@@ -439,8 +458,6 @@
 
 	.list .quesTit {
 		height: 40px;;
-		display: flex;
-		justify-content: space-between;
 		align-items: center;
 	}