提交 fe202ab6 编写于 作者: guangjun.yang's avatar guangjun.yang

对接接口

上级 5ec5ba6f
......@@ -50,7 +50,7 @@
multiple
v-model="stickerIdList"
size="mini"
placeholder="请选择问题类"
placeholder="请选择问题类"
@visible-change="stickerSave"
>
<el-option
......@@ -109,6 +109,7 @@ export default {
// 保存用户问题分类
stickerSave(status) {
// 下拉框出现或者选项为空时,直接退出
if(status || !this.stickerIdList.length) return;
let params = {
stickerIdList: this.stickerIdList,
......
......@@ -231,4 +231,19 @@ html,body{
}
.el-breadcrumb__inner.is-link:hover {
color: #449284 !important;
}
\ No newline at end of file
}
.current-session-wrap {
.c-bottom .el-input__inner {
height: 44px;
line-height: 44px;
padding-right: 100px;
}
.el-input.is-active .el-input__inner,
.el-input__inner:focus {
border-color: #eff5f7;
}
.link-form .el-form-item {
margin-bottom: 10px;
}
}
\ No newline at end of file
......@@ -16,7 +16,8 @@ export const envConfig = {
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
//innerLoginUrl: 'http://localhost:8090/PICA_SSO_FE/html/pica_index.html',
innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html',
picakfAccId: 'picakf_dev',
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com',
......@@ -25,7 +26,8 @@ export const envConfig = {
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://dev-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl: 'https://dev-saas.yunqueyi.com/pica_index.html',
picakfAccId: 'picakf_dev',
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com',
......@@ -34,7 +36,8 @@ export const envConfig = {
qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://test1.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://test1-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl: 'https://test1.yunqueyi.com/pica_index.html',
picakfAccId: 'picakf_test',
},
uat: {
baseUrl: 'https://uat-sc.yunqueyi.com',
......@@ -45,7 +48,8 @@ export const envConfig = {
qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
loginUrl: 'https://uat.yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://uat-sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl: 'https://uat.yunqueyi.com/pica_index.html',
picakfAccId: 'picakf_uat',
},
pro: {
baseUrl: 'https://sc.yunqueyi.com',
......@@ -54,6 +58,7 @@ export const envConfig = {
qiniuImgUrl: "https://files.yunqueyi.com",
loginUrl: 'https://yunqueyi.com/pica-login/work_station.html',
innerLoginUrl: 'https://sso.yunqueyi.com/PICA_SSO_FE/html/pica_index.html',
yuequeyiIndexUrl: 'https://www.yunqueyi.com/pica_index.html'
yuequeyiIndexUrl: 'https://www.yunqueyi.com/pica_index.html',
picakfAccId: 'picakf',
}
}
......@@ -168,6 +168,7 @@ export function getYunQueYiUrl() {
export function uploadVideo() {
return getConfigByEnvType('qiniuResourceUrl')
}
export function uploadImg() {
return getConfigByEnvType('qiniuImgUrl')
}
......@@ -177,3 +178,7 @@ function getConfigByEnvType(urlType) {
return envConfig[process.env.BUILD_ENV][urlType]
}
// 获取客服的云信ID
export function getPicaKFAccid() {
return getConfigByEnvType('picakfAccId')
}
.current-session-wrap {
.component-content {
display: flex;
flex-direction: row;
min-height: 600px;
min-width: 1200px;
font-size: 14px;
.left {
width: 270px;
// padding: 0 25px 15px;
border-right: 2px solid #f5f5f5;
.l-header {
display: flex;
flex-direction: row;
height: 52px;
justify-content: space-between;
align-items: center;
padding: 0 25px;
& > span:first-child {
font-size: 16px;
}
& > span:last-child {
color: #0d9078;
cursor: pointer;
}
}
.c-num {
padding: 0 25px;
height: 40px;
line-height: 40px;
background: #fffbe6;
}
.session-list {
width: 100%;
height: 100%;
overflow: scroll;
& > .item {
width: 100%;
display: flex;
height: 72px;
flex-direction: row;
align-items: center;
padding: 0 25px;
cursor: pointer;
.img-wrapper {
// position: relative;
// top: 0;
// left: 0;
width: 40px;
height: 40px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 20px;
}
}
& > .desc {
flex: 1;
.top {
display: flex;
flex-direction: row;
justify-content: space-between;
.name {
}
}
.bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 12px;
color: #999999;
.num {
display: inline-block;
min-width: 16px;
padding: 2px 4px;
border-radius: 8px;
text-align: center;
color: #ffffff;
background: #ff4d4f;
}
& > img {
display: block;
width: 15px;
height: 15px;
padding: 2px 0 2px 4px;
}
}
}
&.current {
background: #f8f9fa;
}
}
}
}
.center {
flex: 1;
.c-header {
padding: 0 25px;
height: 56px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid #f5f5f5;
& > .c-header-l {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
& > img {
display: inline-block;
width: 24px;
height: 24px;
border-radius: 12px;
margin-right: 8px;
}
& > .name {
margin-right: 25px;
color: #333333;
}
& > .time-tip {
font-size: 12px;
color: #999999;
}
}
.close-btn {
width: 100px;
color: #c7c8c9;
cursor: pointer;
}
}
.msg-content {
// width: 100%;
// height: 650px;
overflow: scroll;
display: flex;
flex-direction: column;
margin: 10px 20px;
.msg-item {
display: flex;
flex-direction: row;
margin: 12px 0;
.msg-item-img {
width: 44px;
height: 44px;
margin-right: 8px;
& > img {
width: 100%;
height: 100%;
border-radius: 22px;
}
}
.msg-item-detail {
display: flex;
flex-direction: column;
text-align: left;
font-size: 13px;
& > :first-child {
color: #999999;
margin-bottom: 8px;
}
.mid-text-wrapper {
display: flex;
flex-direction: row;
align-items: center;
& > img {
width: 18px;
height: 18px;
margin-right: 8px;
cursor: pointer;
}
}
.mid-text {
padding: 12px 24px;
display: inline-block;
max-width: 520px;
border-radius: 8px;
background: #ebf5fc;
text-align: justify;
color: #333333;
&.no-support {
display: flex;
align-items: center;
& > img {
width: 14px;
height: 14px;
margin-right: 3px;
}
}
}
.link {
color: #2f86f6;
}
& > .mid-pdf {
max-width: 260px;
display: flex;
flex-direction: row;
text-align: left;
padding: 10px 15px;
background: #f0f1f2;
border-radius: 8px;
min-height: 80px;
cursor: pointer;
.midp-left {
display: flex;
flex-direction: column;
justify-content: space-around;
.name {
font-size: 13px;
color: #333333;
}
.size {
font-size: 12px;
color: #999999;
}
}
.midp-icon {
width: 36px;
height: 44px;
& > img {
width: 36px;
height: 100%;
border-radius: 3px;
}
}
}
& > .mid-img {
width: 170px;
height: 108px;
cursor: pointer;
& > img {
width: 100%;
height: 100%;
border-radius: 8px;
}
}
}
&.cr {
flex-direction: row-reverse;
.msg-item-img {
margin-right: 0;
margin-left: 8px;
}
.msg-item-detail {
text-align: right;
& > .mid-text {
background: #f0f1f2;
}
}
}
}
}
.c-bottom {
display: flex;
flex-direction: row;
margin: 16px 12px 16px 25px;
.cb-icon-wrapper {
display: flex;
align-items: center;
height: 44px;
img {
width: 20px;
height: 20px;
margin-right: 16px;
cursor: pointer;
}
}
.send-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 60px;
height: 44px;
background: #f3f6f7;
margin-left: 12px;
border-radius: 8px;
cursor: pointer;
& > img {
width: 24px;
height: 24px;
}
&.active {
background: #0d9078;
}
}
}
}
.right {
width: 240px;
border-left: 2px solid #f5f5f5;
}
background: #fff;
.time {
color: #999999;
}
.small {
font-size: 12px;
}
}
}
\ No newline at end of file
......@@ -5,15 +5,16 @@
<article class="left">
<div class="l-header">
<span>我的任务(3)</span>
<span @click="getNextSession">再来一个</span>
<span @click="fetchOneTask">再来一个</span>
</div>
<p class="c-num">当前等待会话:4个</p>
<ul class="session-list" :style="{'height': containerHeight + 'px'}">
<li
class="item" :class="{'current': currentTaskLogId == session.id}"
class="item"
:class="{'current': currentTaskLogId == session.id}"
v-for="(session, index) in sessionListData.sessionList"
:key="index"
@click="selectSession(session)"
@click="selectSession(session, index)"
>
<div class="img-wrapper">
<img :src="session.avatarImageUrl" alt />
......@@ -24,12 +25,16 @@
<span class="time small">{{session.lastMsgTime}}</span>
</div>
<div class="bottom">
<span>{{session.lastMsgContent}}</span>
<span v-show="session.status !=3 && currentTaskLogId != session.id && session.unreadCount" class="num">{{session.unreadCount}}</span>
<span>{{session.text}}</span>
<!-- <span>{{session.lastMsgContent}}</span> -->
<span
v-show="session.status !=3 && currentTaskLogId != session.id && session.unreadCount"
class="num"
>{{session.unreadCount}}</span>
<img
v-show="session.status == 3"
src="../../../assets/image/IM/icon-exit.png"
@click.stop="exitSession(session)"
@click.stop="closeOneTask(session)"
/>
</div>
</div>
......@@ -59,7 +64,7 @@
<span class="mid-time">1:16 pm</span>
<div v-if="item.bizType == 1" class="mid-text-wrapper" style="max-width: 520px;">
<img v-show="item.sendFlag" src="../../../assets/image/IM/icon-no-send.png" alt />
<div class="mid-text">不理解人,就无法理解什么是设计不理解人,就无法理解什么是设计不理解人,就无法理解什么是设计</div>
<div class="mid-text">{{item.text}}</div>
</div>
<div v-if="item.bizType == 2" class="mid-img" v-viewer>
......@@ -68,16 +73,16 @@
</div>
<div v-if="item.bizType == 3" class="mid-pdf" @click="openPDF(item)">
<div class="midp-left">
<span class="name">神奇宝贝图鉴皮卡丘杰尼龟小火龙胖丁超梦双蛋瓦斯…</span>
<span class="size">23.0 MB</span>
<span class="name">{{item.text}}</span>
<span class="size">{{item.fileSize}} MB</span>
</div>
<div class="midp-icon">
<img src="../../../assets/image/IM/icon-pdf.png" alt />
</div>
</div>
<div v-if="item.bizType == 4" class="mid-text">
请点击链接
<span class="link">五分钟首页</span>
{{item.remark}}
<span class="link">{{item.text}}</span>
</div>
<div v-if="item.bizType == 5" class="mid-text no-support">
<img src="../../../assets/image/IM/icon-warning-circle.png" alt />
......@@ -104,7 +109,7 @@
/>
</div>
</el-input>
<div class="send-btn" :class="{'active': canSend}">
<div class="send-btn" :class="{'active': canSend}" @click="sendCommonMsg">
<img v-show="canSend" src="../../../assets/image/IM/send-yes.png" alt />
<img v-show="!canSend" src="../../../assets/image/IM/send-no.png" alt />
</div>
......@@ -168,6 +173,7 @@ import { doUpload, getFilePath } from "@/utils/qiniu-util";
import { validateWord } from "@/utils/validate.js";
import { openLoading, closeLoading } from "@/utils/utils";
import * as commonUtil from "@/utils/utils";
import { getPicaKFAccid } from "@/utils";
import UserInfo from "@/components/IM/user-info.vue";
const CONTAINER_HEIGHT = 700;
......@@ -186,9 +192,11 @@ export default {
sessionList: [],
waitingTaskCount: 0
},
// currentSessionIndex: 0, // 当前会话序号
currentTaskLogId: 0, // 当前会话ID
currentToAccId: 0,
currentSessionIndex: 0, // 当前会话序号
currentSession: {},
currentTaskLogId: 0, // 当前会话ID
currentToAccId: "",
picakfAccId: "",
doctorInfo: {
name: "杨Song",
mobilePhone: "138****7261",
......@@ -369,12 +377,87 @@ export default {
},
created() {
this.picakfAccId = getPicaKFAccid();
this.getSessionList();
},
mounted: function() {},
methods: {
// 查询医生和居民的消息历史
getMSGHistory(session) {
let params = {
doctorAccId: this.currentToAccId,
includeFlag: 1, // 带本条消息
lastClientIdServer: session.lastMsgIdClient,
lastMsgIdServer: session.lastMsgIdServer,
lastMsgTimestamp: session.lastMsgTime,
limit: 20,
patientAccId: this.picakfAccId,
unionId: ""
};
this.POST("/im/msg/history", params).then(res => {
if (res.code === "000000") {
// this.convertMessageList(res.data);
this.messageList = res.data;
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 查询医生和居民的消息 - 向前查找
// 将获取消息列表插入到当前消息列表的最后
getMSGForward(session) {
let params = {
doctorAccId: this.currentToAccId,
includeFlag: 0,
lastClientIdServer: session.lastMsgIdClient,
lastMsgIdServer: session.lastMsgIdServer,
lastMsgTimestamp: session.lastMsgTime,
limit: 20,
patientAccId: this.picakfAccId,
unionId: ""
};
this.POST("/im/msg/forward", params).then(res => {
if (res.code === "000000") {
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 转换消息格式
convertMessageList(messageList) {
// bizType: 1,
// time: 1000,
// showType: 1,
// title: "测试title",
// content: "测试content",
// imgUrl: "https://file.yunqueyi.com/File/doctor_default.png",
// sendOrReceive: "send", // send receive
// displayTimeHeader: "4分20秒",
// url: "https://file.yunqueyi.com/File/doctor_default.png",
// file: "https://file.yunqueyi.com/File/doctor_default.png",
// type: 1,
// extData: "/pages/im/advisory/evalution",
// sourceId: 1,
// displayFlag: 1,
// sendFlag: true
let msg = null, cMessageList = [];
messageList.forEach((rawMsg, index) => {
msg = Object.assign({}, rawMsg);
msg.sendOrReceive = rawMsg.fromAccId == this.currentToAccId;
cMessageList.push(msg);
});
},
// 发送带链接消息
sendLinkMsg() {
this.sendCommonMsg();
......@@ -386,19 +469,49 @@ export default {
},
// 发送通用消息
sendCommonMsg() {},
sendCommonMsg() {
if (!this.canSend) return;
let params = {
fileExt: "",
fileSize: 0,
fromAccount: this.picakfAccId,
height: 0,
info: "wefwef",
md5: "",
remark: "",
toAccount: this.currentToAccId,
type: 0,
url: "",
width: 0
};
this.POST("/im/msg/sendMessage", params).then(res => {
if (res.code === "000000") {
// 校验结果:1校验通过 2校验不通过
console.log(res.data.checkFlag);
this.getSessionList();
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 打开一个会话
selectSession(session) {
selectSession(session, index) {
console.log("selectSession");
this.currentTaskLogId = session.id;
this.currentToAccId = session.toAccId;
this.getDoctorinfo(this.currentToAccId);
},
// 关闭一个会话
exitSession(session) {
console.log("exitSession");
this.currentSessionIndex = index;
// 获取当前消息列表(最新的历史消息)
// TODO
// 获取医生信息
this.getDoctorInfo(this.currentToAccId);
// 调用全部已读
if (session.unreadCount) {
this.readAllMsg(this.currentToAccId, this.picakfAccId);
}
},
// 打开PDF
......@@ -443,7 +556,7 @@ export default {
},
// 给我一个任务吧,如果当前没有任务,则要提示
getNextSession() {
fetchOneTask() {
this.GET("/im/session/kf/fetchOneTask").then(res => {
if (res.code === "000000") {
this.getSessionList();
......@@ -456,20 +569,6 @@ export default {
});
},
// 获取消息(准实时消息,历史消息等)
getMessageList() {
this.GET("/im/session/kf/msgList").then(res => {
if (res.code === "000000") {
console.log("in getMessageList", res);
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 获取会话列表
getSessionList() {
this.GET("/im/session/kf/list").then(res => {
......@@ -480,10 +579,18 @@ export default {
sessionList: [],
waitingTaskCount: 0
};
if(!this.currentTaskLogId && this.sessionListData.sessionList.length) {
this.currentTaskLogId = this.sessionListData.sessionList[0].id;
this.currentToAccId = this.sessionListData.sessionList[0].toAccId;
this.getDoctorinfo(this.currentToAccId);
if (
// !this.currentTaskLogId &&
this.sessionListData.sessionList.length
) {
this.convertSessions(this.sessionListData.sessionList);
this.currentSession = this.sessionListData.sessionList[0];
this.currentSessionIndex = 0;
this.currentTaskLogId = this.currentSession.id;
this.currentToAccId = this.currentSession.toAccId;
console.log("this.currentSession", this.currentSession);
this.getMSGHistory(this.currentSession);
this.getDoctorInfo(this.currentToAccId);
}
} else {
this.$message({
......@@ -494,11 +601,44 @@ export default {
});
},
// 将会话列表的数据进行处理,主要是显示文本(text)字段
convertSessions(sessions) {
let convertSessionList = [];
let text = "",
cc;
sessions.forEach((session, index) => {
if (session.lastMsgType.toLowerCase() == "custom") {
text = "";
cc = JSON.parse(session.lastMsgContent);
if (cc.bizType == 1) {
text = cc.title;
// } else if (cc.bizType == 18) {
} else {
text = cc.content || "";
}
// if (cc.bizType != 8) {
// text = `${text}`;
// }
} else if (
session.lastMsgType.toLowerCase() == "image" ||
session.lastMsgType.toLowerCase() == "picture"
) {
text = "[图片]";
// text = this.imagePlaceholder;
} else {
text = session.lastMsgContent;
}
session.text = text;
// s.unreadCount = sessions[0].unread;
convertSessionList.push(session);
});
this.sessionListData.sessionList = convertSessionList;
},
// 根据云信id获取医生信息
getDoctorinfo(accId) {
this.GET(`/im/account/accid/doctorinfo?accId=${accId}`).then( res => {
getDoctorInfo(accId) {
this.GET(`/im/account/accid/doctorinfo?accId=${accId}`).then(res => {
if (res.code === "000000") {
console.log("in getDoctorinfo", res.data);
this.doctorInfo = res.data || {};
} else {
this.$message({
......@@ -510,10 +650,10 @@ export default {
},
// 关闭一个任务
closeOneTask(taskLogId) {
closeOneTask(session) {
let params = {
taskLogId
}
taskLogId: session.id
};
this.POST(`/im/session/kf/closeOneTask`, params).then(res => {
if (res.code === "000000") {
console.log("in closeOneTask", res);
......@@ -525,335 +665,47 @@ export default {
}
});
},
}
};
</script>
<style lang="scss">
.current-session-wrap {
.c-bottom .el-input__inner {
height: 44px;
line-height: 44px;
padding-right: 100px;
}
.el-input.is-active .el-input__inner,
.el-input__inner:focus {
border-color: #eff5f7;
}
.link-form .el-form-item {
margin-bottom: 10px;
}
// textarea {
// border: 0px !important;
// resize: none;
// height: 100px;
// padding: 5px 25px;
// }
}
</style>
<style lang="scss" scoped>
.current-session-wrap {
.component-content {
display: flex;
flex-direction: row;
min-height: 600px;
min-width: 1200px;
font-size: 14px;
.left {
width: 270px;
// padding: 0 25px 15px;
border-right: 2px solid #f5f5f5;
.l-header {
display: flex;
flex-direction: row;
height: 52px;
justify-content: space-between;
align-items: center;
padding: 0 25px;
& > span:first-child {
font-size: 16px;
}
& > span:last-child {
color: #0d9078;
cursor: pointer;
}
}
.c-num {
padding: 0 25px;
height: 40px;
line-height: 40px;
background: #fffbe6;
}
.session-list {
width: 100%;
height: 100%;
overflow: scroll;
& > .item {
width: 100%;
display: flex;
height: 72px;
flex-direction: row;
align-items: center;
padding: 0 25px;
cursor: pointer;
.img-wrapper {
// position: relative;
// top: 0;
// left: 0;
width: 40px;
height: 40px;
margin-right: 10px;
img {
width: 100%;
height: 100%;
border-radius: 20px;
}
}
& > .desc {
flex: 1;
.top {
display: flex;
flex-direction: row;
justify-content: space-between;
.name {
}
}
.bottom {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
font-size: 12px;
color: #999999;
.num {
display: inline-block;
min-width: 16px;
padding: 2px 4px;
border-radius: 8px;
text-align: center;
color: #ffffff;
background: #ff4d4f;
}
& > img {
display: block;
width: 15px;
height: 15px;
padding: 2px 0 2px 4px;
}
}
}
&.current {
background: #f8f9fa;
}
}
}
}
.center {
flex: 1;
.c-header {
padding: 0 25px;
height: 56px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
border-bottom: 2px solid #f5f5f5;
& > .c-header-l {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
& > img {
display: inline-block;
width: 24px;
height: 24px;
border-radius: 12px;
margin-right: 8px;
}
& > .name {
margin-right: 25px;
color: #333333;
}
& > .time-tip {
font-size: 12px;
color: #999999;
}
}
.close-btn {
width: 100px;
color: #c7c8c9;
cursor: pointer;
}
}
.msg-content {
// width: 100%;
// height: 650px;
overflow: scroll;
display: flex;
flex-direction: column;
margin: 10px 20px;
.msg-item {
display: flex;
flex-direction: row;
margin: 12px 0;
.msg-item-img {
width: 44px;
height: 44px;
margin-right: 8px;
& > img {
width: 100%;
height: 100%;
border-radius: 22px;
}
}
.msg-item-detail {
display: flex;
flex-direction: column;
text-align: left;
font-size: 13px;
& > :first-child {
color: #999999;
margin-bottom: 8px;
}
.mid-text-wrapper {
display: flex;
flex-direction: row;
align-items: center;
& > img {
width: 18px;
height: 18px;
margin-right: 8px;
cursor: pointer;
}
}
.mid-text {
padding: 12px 24px;
display: inline-block;
max-width: 520px;
border-radius: 8px;
background: #ebf5fc;
text-align: justify;
color: #333333;
&.no-support {
display: flex;
align-items: center;
& > img {
width: 14px;
height: 14px;
margin-right: 3px;
}
}
}
.link {
color: #2f86f6;
}
& > .mid-pdf {
max-width: 260px;
display: flex;
flex-direction: row;
text-align: left;
padding: 10px 15px;
background: #f0f1f2;
border-radius: 8px;
min-height: 80px;
cursor: pointer;
.midp-left {
display: flex;
flex-direction: column;
justify-content: space-around;
.name {
font-size: 13px;
color: #333333;
}
.size {
font-size: 12px;
color: #999999;
}
}
.midp-icon {
width: 36px;
height: 44px;
& > img {
width: 36px;
height: 100%;
border-radius: 3px;
}
}
}
& > .mid-img {
width: 170px;
height: 108px;
cursor: pointer;
& > img {
width: 100%;
height: 100%;
border-radius: 8px;
}
}
}
&.cr {
flex-direction: row-reverse;
.msg-item-img {
margin-right: 0;
margin-left: 8px;
}
.msg-item-detail {
text-align: right;
& > .mid-text {
background: #f0f1f2;
}
}
}
}
}
.c-bottom {
display: flex;
flex-direction: row;
margin: 16px 12px 16px 25px;
.cb-icon-wrapper {
display: flex;
align-items: center;
height: 44px;
img {
width: 20px;
height: 20px;
margin-right: 16px;
cursor: pointer;
}
}
.send-btn {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 60px;
height: 44px;
background: #f3f6f7;
margin-left: 12px;
border-radius: 8px;
cursor: pointer;
& > img {
width: 24px;
height: 24px;
}
&.active {
background: #0d9078;
// 设置全部消息已读
readAllMsg(fromAccount, toAccount) {
let params = {
fromAccount,
toAccount
};
this.POST(`/im/msg/read/all`, params).then(res => {
if (res.code === "000000") {
let session = this.findItemByKeyAndVal(
this.sessionListData.sessionList,
"id",
this.currentTaskLogId
);
if (session) {
session.unreadCount = 0;
}
} else {
this.$message({
message: res.message,
type: "warning"
});
}
});
},
// 根据字段名及其值,从数组中查找对象
findItemByKeyAndVal(arr, key, value, flag = 0) {
if (flag == 0) {
return arr.find(item => {
return item[key] == value;
});
} else if (flag == 1) {
return arr.findIndex(item => {
return item[key] == value;
});
}
}
.right {
width: 240px;
border-left: 2px solid #f5f5f5;
}
background: #fff;
.time {
color: #999999;
}
.small {
font-size: 12px;
}
}
}
};
</script>
<style lang="scss" scoped>
@import "./index.scss";
</style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册