|
@@ -9,7 +9,14 @@
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="left_2">
|
|
|
- <el-col :span="24" class="list" v-for="(item, index) in userList" :key="index" @click.native="chatBtn(item)">
|
|
|
+ <el-col
|
|
|
+ :span="24"
|
|
|
+ class="list"
|
|
|
+ :class="`${index === activeIndex ? 'active' : ''}`"
|
|
|
+ v-for="(item, index) in userList"
|
|
|
+ :key="index"
|
|
|
+ @click.native="chatBtn(item, index)"
|
|
|
+ >
|
|
|
<el-col :span="4" class="icon">
|
|
|
<el-image :src="leftIcon"></el-image>
|
|
|
</el-col>
|
|
@@ -105,6 +112,7 @@ export default {
|
|
|
chatUserInfo: {},
|
|
|
chatList: [],
|
|
|
content: '',
|
|
|
+ activeIndex: '',
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -118,7 +126,8 @@ export default {
|
|
|
...customer(['online', 'record', 'createChat', 'chatRecord']),
|
|
|
search() {},
|
|
|
// 点击获取客户聊天列表
|
|
|
- async chatBtn(data) {
|
|
|
+ async chatBtn(data, index) {
|
|
|
+ this.$set(this, `activeIndex`, index);
|
|
|
this.$set(this, `chatUserInfo`, data);
|
|
|
let arr = await this.chatRecord({ client_id: data.client_id, customer_id: data.customer_id });
|
|
|
if (this.$checkRes(arr)) {
|
|
@@ -275,6 +284,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .active {
|
|
|
+ background-color: #f9f9f9;
|
|
|
+ .info {
|
|
|
+ .name {
|
|
|
+ color: #409eff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.right {
|