|
@@ -45,12 +45,18 @@
|
|
fit="cover"
|
|
fit="cover"
|
|
></el-image>
|
|
></el-image>
|
|
</div>
|
|
</div>
|
|
- <div class="chat-records-content" v-if="(item.msg.substr(item.msg.lastIndexOf('.')+1)!='jpg') && (item.msg.substr(item.msg.lastIndexOf('.')+1)!='png')">{{item.msg}}</div>
|
|
|
|
- <div class="chat-records-content" v-else>
|
|
|
|
- <span @click="imgOpen(item.msg)" style="cursor:pointer;">
|
|
|
|
- <el-image :src="item.msg | pathPipe" style="width:100px;height:100px;">
|
|
|
|
|
|
+ <div class="chat-records-content" v-if="checkMsgType(item.msg) === 'text'">{{item.msg}}</div>
|
|
|
|
+ <div class="chat-records-content" v-if="checkMsgType(item.msg) === 'img'">
|
|
|
|
+ <!-- <span @click="imgOpen(item.msg)" style="cursor:pointer;"></span> -->
|
|
|
|
+ <el-image
|
|
|
|
+ :src="item.msg | pathPipe"
|
|
|
|
+ style="width:100px;height:100px;"
|
|
|
|
+ :preview-src-list="[item.msg]">
|
|
</el-image>
|
|
</el-image>
|
|
- </span>
|
|
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ <div class="chat-records-content" v-if="checkMsgType(item.msg) === 'sound'">
|
|
|
|
+ <im-audio :src="item.msg"></im-audio>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -184,7 +190,11 @@ import { webSocketUrl } from '../../../../../config';
|
|
import { queryLiftCasesList, queryChatHistoryList, invitationExpert, queryMsgHistoryList } from '@/apps/mobile/api/monitoring-center/index';
|
|
import { queryLiftCasesList, queryChatHistoryList, invitationExpert, queryMsgHistoryList } from '@/apps/mobile/api/monitoring-center/index';
|
|
import { queryAllExpert } from '@/apps/mobile/api/expert/index';
|
|
import { queryAllExpert } from '@/apps/mobile/api/expert/index';
|
|
import { isArray, chatUnique, chatUnique2 } from '@/apps//mobile/utils/util';
|
|
import { isArray, chatUnique, chatUnique2 } from '@/apps//mobile/utils/util';
|
|
|
|
+import ImAudio from '@/apps/mobile/components/ImAudio'
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ ImAudio
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
id: null, // 诊单id
|
|
id: null, // 诊单id
|
|
@@ -499,6 +509,19 @@ export default {
|
|
obj.sessionid = this.sessionId;
|
|
obj.sessionid = this.sessionId;
|
|
obj.userId = this.customerServiceId;
|
|
obj.userId = this.customerServiceId;
|
|
this.$ws.send(JSON.stringify(obj));
|
|
this.$ws.send(JSON.stringify(obj));
|
|
|
|
+ },
|
|
|
|
+ checkMsgType(str) {
|
|
|
|
+ let strPostfix = str.substring(str.lastIndexOf('.'))
|
|
|
|
+ strPostfix = strPostfix.toLowerCase();
|
|
|
|
+ let imgFilter = ['.jpeg', '.jpg', '.png', '.gif']
|
|
|
|
+ let soundFilter = ['.aac', '.mp3']
|
|
|
|
+ if(imgFilter.indexOf(strPostfix) !== -1) {
|
|
|
|
+ return 'img'
|
|
|
|
+ } else if(soundFilter.indexOf(strPostfix) !== -1) {
|
|
|
|
+ return 'sound'
|
|
|
|
+ } else {
|
|
|
|
+ return 'text'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
destroyed() {
|
|
destroyed() {
|
|
@@ -646,6 +669,17 @@ export default {
|
|
.reverse {
|
|
.reverse {
|
|
flex-direction: row-reverse;
|
|
flex-direction: row-reverse;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ ::v-deep .el-image{
|
|
|
|
+ img{
|
|
|
|
+ pointer-events: auto;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .el-icon-circle-close {
|
|
|
|
+ font-size: 50px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|