|
|
@@ -22,7 +22,8 @@
|
|
|
|
|
|
</div>
|
|
|
<ul class="message-list" v-if="switchMessageType == 'unread'">
|
|
|
- <li class="list-item" :class="{active:markupCode == index}" v-for="(item,index) in unreadList" :key="item.id" @click="toReading(item,index)">
|
|
|
+ <li class="list-item" :class="{active:markupCode == index}" v-for="(item,index) in unreadList"
|
|
|
+ :key="item.id" @click="toReading(item,index)">
|
|
|
<p class="item-info">
|
|
|
<span class="name">{{item.title}}</span>
|
|
|
<span class="time">{{item.sendtime}}</span>
|
|
|
@@ -32,7 +33,8 @@
|
|
|
</ul>
|
|
|
|
|
|
<ul class="message-list" v-if="switchMessageType == 'read'">
|
|
|
- <li class="list-item" :class="{active:markupCode == index}" v-for="(item,index) in readList" :key="item.id" @click="toReading(item,index)">
|
|
|
+ <li class="list-item" :class="{active:markupCode == index}" v-for="(item,index) in readList"
|
|
|
+ :key="item.id" @click="toReading(item,index)">
|
|
|
<p class="item-info">
|
|
|
<span class="name">{{item.title}}</span>
|
|
|
<span class="time">{{item.sendtime}}</span>
|
|
|
@@ -46,12 +48,13 @@
|
|
|
|
|
|
<el-col :span="18">
|
|
|
<el-row class="title">
|
|
|
- <strong>客服满意度调查!</strong>
|
|
|
+ <strong v-if="switchMessageType == 'unread'">客服满意度调查!</strong>
|
|
|
+ <strong v-if="switchMessageType == 'read'" v-html="messageBox.title"></strong>
|
|
|
<i @click="handleClose" class="el-icon-close"></i>
|
|
|
</el-row>
|
|
|
<el-row class="messageBox" v-if="switchMessageType == 'unread'">
|
|
|
<div v-if="unreadList.length > 0">
|
|
|
- <ul >
|
|
|
+ <ul>
|
|
|
<li><p>发件人:{{unreadListOne.admin_name}}</p></li>
|
|
|
<li><p>收件人:{{userName}}</p></li>
|
|
|
<li><p>时 间:{{unreadListOne.sendtime}}</p></li>
|
|
|
@@ -60,7 +63,7 @@
|
|
|
</div>
|
|
|
</el-row>
|
|
|
<el-row class="messageBox" v-if="switchMessageType == 'read'">
|
|
|
- <div v-if="readList.length > 0">
|
|
|
+ <div v-if="readList.length > 0">
|
|
|
<ul>
|
|
|
<li><p>发件人:{{messageBox.admin_name}}</p></li>
|
|
|
<li><p>收件人:{{userName}}</p></li>
|
|
|
@@ -83,22 +86,22 @@
|
|
|
drawer: false,
|
|
|
switchMessageType: "unread",
|
|
|
|
|
|
- nomessage:true,
|
|
|
+ nomessage: true,
|
|
|
|
|
|
- userID:null,
|
|
|
- userName:null,
|
|
|
+ userID: null,
|
|
|
+ userName: null,
|
|
|
//已读列表
|
|
|
- readList:[],
|
|
|
+ readList: [],
|
|
|
//未读列表
|
|
|
- unreadList:[],
|
|
|
+ unreadList: [],
|
|
|
//未读第一个
|
|
|
- unreadListOne:{},
|
|
|
+ unreadListOne: {},
|
|
|
//未读数量
|
|
|
- unreadNum:null,
|
|
|
+ unreadNum: null,
|
|
|
// 详情
|
|
|
- messageBox:{},
|
|
|
+ messageBox: {},
|
|
|
//标记代码
|
|
|
- markupCode:0,
|
|
|
+ markupCode: 0,
|
|
|
|
|
|
}
|
|
|
},
|
|
|
@@ -114,7 +117,7 @@
|
|
|
this.drawer = data;
|
|
|
this.userID = this.$store.getters.get_user_info.id;
|
|
|
this.userName = this.$store.getters.get_user_info.user_name;
|
|
|
- if(data){
|
|
|
+ if (data) {
|
|
|
this.readnotice();
|
|
|
this.unreadnotice();
|
|
|
}
|
|
|
@@ -126,15 +129,15 @@
|
|
|
},
|
|
|
switchMessage(num) {
|
|
|
this.switchMessageType = num;
|
|
|
- this.markupCode = 0 ;
|
|
|
- if(this.switchMessageType == 'unread'){
|
|
|
+ this.markupCode = 0;
|
|
|
+ if (this.switchMessageType == 'unread') {
|
|
|
this.unreadnotice();
|
|
|
- }else if(this.switchMessageType=='read'){
|
|
|
- this.readnotice();
|
|
|
+ } else if (this.switchMessageType == 'read') {
|
|
|
+ this.readnotice();
|
|
|
}
|
|
|
},
|
|
|
// 已读信息
|
|
|
- readnotice(){
|
|
|
+ readnotice() {
|
|
|
let str = "readnotice" + "customer-service" + "index" + this.time + "service";
|
|
|
let obj = {
|
|
|
headers: {
|
|
|
@@ -146,17 +149,17 @@
|
|
|
};
|
|
|
this.post("api/service/index/readnotice", obj).then(res => {
|
|
|
// console.log(res)
|
|
|
- if(res.data.code === 1){
|
|
|
- console.log("已读",res.data.data)
|
|
|
- this.readList = res.data.data;
|
|
|
- if(res.data.data.length > 0){
|
|
|
+ if (res.data.code === 1) {
|
|
|
+ console.log("已读", res.data.data)
|
|
|
+ this.readList = res.data.data;
|
|
|
+ if (res.data.data.length > 0) {
|
|
|
this.messageBox = res.data.data[0];
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 未读信息
|
|
|
- unreadnotice(){
|
|
|
+ unreadnotice() {
|
|
|
let str = "unreadnotice" + "customer-service" + "index" + this.time + "service";
|
|
|
let obj = {
|
|
|
headers: {
|
|
|
@@ -168,12 +171,12 @@
|
|
|
};
|
|
|
this.post("api/service/index/unreadnotice", obj).then(res => {
|
|
|
console.log(res)
|
|
|
- if(res.data.code === 1){
|
|
|
- console.log("未读",res.data.data)
|
|
|
+ if (res.data.code === 1) {
|
|
|
+ console.log("未读", res.data.data)
|
|
|
this.unreadList = res.data.data;
|
|
|
// console.log(this.unreadListOne,'第一个')
|
|
|
- this.unreadNum =res.data.data.length >0 ? res.data.data.length-1 : 0;
|
|
|
- if(res.data.data.length > 0){
|
|
|
+ this.unreadNum = res.data.data.length > 0 ? res.data.data.length - 1 : 0;
|
|
|
+ if (res.data.data.length > 0) {
|
|
|
this.unreadListOne = res.data.data[0];
|
|
|
this.readInfo(res.data.data[0].id)
|
|
|
}
|
|
|
@@ -183,7 +186,7 @@
|
|
|
},
|
|
|
|
|
|
//读取信息
|
|
|
- readInfo(id){
|
|
|
+ readInfo(id) {
|
|
|
//this.messageBox.id
|
|
|
let str = "updatenotice" + "customer-service" + "index" + this.time + "service";
|
|
|
let obj = {
|
|
|
@@ -196,8 +199,8 @@
|
|
|
};
|
|
|
this.post("api/service/index/updatenotice", obj).then(res => {
|
|
|
console.log(res)
|
|
|
- if(res.data.code === 1){
|
|
|
- console.log("已读",res.data.data)
|
|
|
+ if (res.data.code === 1) {
|
|
|
+ console.log("已读", res.data.data)
|
|
|
// this.unreadList = res.data.data;
|
|
|
// this.unreadListOne = res.data.data[0];
|
|
|
// // console.log(this.unreadListOne,'第一个')
|
|
|
@@ -206,16 +209,16 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
|
|
|
// 点击显示当前详细内容
|
|
|
- toReading(item,index){
|
|
|
- // console.log(item,index);
|
|
|
- if( this.markupCode == index) return
|
|
|
+ toReading(item, index) {
|
|
|
+ // console.log(item,'击显示当前详细内容');
|
|
|
+ if (this.markupCode == index) return
|
|
|
this.markupCode = index;
|
|
|
this.nomessage = false;
|
|
|
this.messageBox = item;
|
|
|
- if(this.switchMessageType == 'unread'){
|
|
|
+ if (this.switchMessageType == 'unread') {
|
|
|
this.readInfo(item.id)
|
|
|
}
|
|
|
}
|
|
|
@@ -258,9 +261,10 @@
|
|
|
// .list-item:nth-of-type(even) {
|
|
|
// background: #fff;
|
|
|
// }
|
|
|
- .active{
|
|
|
+ .active {
|
|
|
background: #F6F8FF;
|
|
|
}
|
|
|
+
|
|
|
.list-item {
|
|
|
padding: 10px 20px;
|
|
|
|
|
|
@@ -268,7 +272,7 @@
|
|
|
color: #666;
|
|
|
font-size: 14px;
|
|
|
overflow: hidden;
|
|
|
- text-overflow:ellipsis;
|
|
|
+ text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
}
|
|
|
@@ -305,8 +309,10 @@
|
|
|
|
|
|
.messageBox {
|
|
|
padding: 15px 20px;
|
|
|
+
|
|
|
li {
|
|
|
margin: 10px 0;
|
|
|
+
|
|
|
p {
|
|
|
font-size: 14px;
|
|
|
color: #999999;
|
|
|
@@ -331,6 +337,7 @@
|
|
|
top: 12px !important;
|
|
|
right: 10px !important;
|
|
|
}
|
|
|
+
|
|
|
.el-drawer__container {
|
|
|
outline: none !important;
|
|
|
}
|