Commit 229ec9e4 by qiyeqing

会话格式添加 语音添加 对话名称显示

1 parent a0600b31
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
"url": "https://gitee.com/LinkWeChat/link-wechat.git" "url": "https://gitee.com/LinkWeChat/link-wechat.git"
}, },
"dependencies": { "dependencies": {
"@liripeng/vue-audio-player": "^1.2.8",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"awesome-qr": "^2.0.1-rc.0", "awesome-qr": "^2.0.1-rc.0",
"axios": "0.18.1", "axios": "0.18.1",
......
...@@ -68,6 +68,10 @@ import { pickerOptions } from '@/utils/index' ...@@ -68,6 +68,10 @@ import { pickerOptions } from '@/utils/index'
Vue.prototype.pickerOptions = pickerOptions Vue.prototype.pickerOptions = pickerOptions
import VideoPlayer from 'vue-video-player' import VideoPlayer from 'vue-video-player'
Vue.use(VideoPlayer); Vue.use(VideoPlayer);
import AudioPlayer from '@liripeng/vue-audio-player'
import '@liripeng/vue-audio-player/lib/vue-audio-player.css'
Vue.use(AudioPlayer)
// 全局组件挂载 // 全局组件挂载
Vue.component('Pagination', Pagination) Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar) Vue.component('RightToolbar', RightToolbar)
......
...@@ -2,24 +2,27 @@ ...@@ -2,24 +2,27 @@
<div class="takecontent"> <div class="takecontent">
<ul> <ul>
<li v-for="(item,index) in allChat" :key="index"> <li v-for="(item,index) in allChat" :key="index">
<div :style="{'color':item.action=='send'?'#199ed8':'#999'}">{{item.from}} <span <!-- <span v-if="item.fromInfo.name">{{item.fromInfo.name}}</span> -->
<div :style="{'color':item.action=='send'?'#199ed8':'#999'}"><span v-if="item.fromInfo">{{item.fromInfo.name}}</span> <span
:style="{'color':item.action=='send'?'#199ed8':'#999'}">{{parseTime(item.msgtime)}}</span></div> :style="{'color':item.action=='send'?'#199ed8':'#999'}">{{parseTime(item.msgtime)}}</span></div>
<div v-if="item.msgtype=='text'" class="msgtypetext"> <div v-if="item.msgtype=='text'" class="msgtypetext">
{{item.text.content}} {{item.text.content}}
</div> </div>
<div v-else-if="item.msgtype=='image'" class="msgtypeimg"> <div v-else-if="item.msgtype=='image'" class="msgtypeimg">
<img :src="item.image.attachment"> <img :src="item.image.attachment" @click="showImg(item)">
</div> </div>
<div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)"> <div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)">
{{item.file.filename}} {{item.file.filename}}
</div> </div>
<div v-else-if="item.msgtype=='voice'" class="msgtypevoice"> <div v-else-if="item.msgtype=='voice'" class="msgtypevoice">
<i class="el-icon-video-play" @click="play(item,'voice')"></i> <i class="el-icon-microphone" style=" font-size: 40px; color: #199ed8;" @click="playVideo(item)"></i>
</div>
<div v-else-if="item.msgtype=='emotion'" class="msgtypeimg">
<img :src="item.emotion.attachment" @click="showImg(item)">
</div> </div>
<div v-else-if="item.msgtype=='video'" class="msgtypevideo"> <div v-else-if="item.msgtype=='video'" class="msgtypevideo">
<i class="el-icon-video-play" @click="play(item,'video')"></i> <i class="el-icon-video-play" style=" font-size: 40px; color: #199ed8;" @click="play(item,'video')"></i>
</div> </div>
<div v-else-if="item.msgtype=='location'" class="msgtypecard "> <div v-else-if="item.msgtype=='location'" class="msgtypecard ">
...@@ -37,7 +40,6 @@ ...@@ -37,7 +40,6 @@
</li> </li>
</ul> </ul>
<div class="shabowbox" v-show="dia" > <div class="shabowbox" v-show="dia" >
<div class="close" @click="dia=false"><i class="el-icon-circle-close"></i></div> <div class="close" @click="dia=false"><i class="el-icon-circle-close"></i></div>
<div class="shabowboxvidoe"> <div class="shabowboxvidoe">
...@@ -47,11 +49,27 @@ ...@@ -47,11 +49,27 @@
:playsinline="true" :options="playerOptions"></video-player> :playsinline="true" :options="playerOptions"></video-player>
</div> </div>
</div> </div>
<div class="shabowbox" v-show="diavioce" >
<div class="close" @click="diavioce=false"><i class="el-icon-circle-close"></i></div>
<div class="shabowboxvidoe shabowboxaudio">
<AudioPlayer :audio-list="vioceSrc"
:before-play="onBeforePlay" />
</div>
</div>
<el-dialog
:visible.sync="dialogVisible"
width="30%"
>
<img :src="imgSrc" style="width:100%;max-height:600px">
<span slot="footer" class="dialog-footer">
</span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import 'video.js/dist/video-js.css' import 'video.js/dist/video-js.css'
import 'vue-video-player/src/custom-theme.css' import 'vue-video-player/src/custom-theme.css'
...@@ -60,6 +78,7 @@ ...@@ -60,6 +78,7 @@
yearMouthDay yearMouthDay
} from '@/utils/common.js' } from '@/utils/common.js'
export default { export default {
props: { props: {
allChat: { allChat: {
type: Array, type: Array,
...@@ -70,6 +89,10 @@ ...@@ -70,6 +89,10 @@
data() { data() {
return { return {
dia: false, dia: false,
diavioce:false,
dialogVisible:false,
imgSrc:'',
vioceSrc:[],
playerOptions: { playerOptions: {
playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度 playbackRates: [0.7, 1.0, 1.5, 2.0], //播放速度
autoplay: false, //如果true,浏览器准备好时开始回放。 autoplay: false, //如果true,浏览器准备好时开始回放。
...@@ -92,6 +115,18 @@ ...@@ -92,6 +115,18 @@
} }
}, },
methods: { methods: {
playVideo(e){
this.vioceSrc=[e.voice.attachment]
this.diavioce=true;
},
onBeforePlay(next){
next() // 开始播放
},
showImg(e){
this.imgSrc=e.image.attachment;
this.dialogVisible=true
},
play(e) { play(e) {
this.dia=true this.dia=true
const player = this.$refs.videoPlayer.player const player = this.$refs.videoPlayer.player
...@@ -112,7 +147,8 @@ ...@@ -112,7 +147,8 @@
} }
#videoPlayer /deep/ .vjs-tech{ height: 450px;} #videoPlayer /deep/ .vjs-tech{ height: 450px;}
.shabowbox{ position: fixed;width:100%;height: 100%; background: rgba(0, 0, 0,0.4);left: 0;top: 0;z-index: 2000;} .shabowbox{ position: fixed;width:100%;height: 100%; background: rgba(0, 0, 0,0.4);left: 0;top: 0;z-index: 2000;}
.shabowboxvidoe{ position: fixed;width: 800px; height: 475px;left: 50%;margin-left: -400px;top:50%;margin-top: -235px;;z-index: 2001;background: floralwhite;} .shabowboxvidoe{ position: fixed;width: 800px; height: 475px;left: 50%;margin-left: -400px;top:50%;margin-top: -235px;;z-index: 2001;background: #fff;}
.shabowboxaudio{ height: 125px;padding: 12px;}
.close{ position: fixed;width: 50px; height:50px;right: 10px;z-index: 2012;top: 10px;text-align: center;line-height: 50px;font-size: 20px;color: #FFF;cursor: pointer;font-size: 43px;} .close{ position: fixed;width: 50px; height:50px;right: 10px;z-index: 2012;top: 10px;text-align: center;line-height: 50px;font-size: 20px;color: #FFF;cursor: pointer;font-size: 43px;}
.takecontent { .takecontent {
text-align: left; text-align: left;
...@@ -154,9 +190,9 @@ ...@@ -154,9 +190,9 @@
.msgtypevideo { .msgtypevideo {
margin: 10px; margin: 10px;
font-size: 40px;
cursor: pointer; cursor: pointer;
color: #199ed8;
border-radius: 8px; border-radius: 8px;
} }
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<ul> <ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)"> <li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px"> <el-row style="padding:10px">
<el-col :span="4"> <img :src="item.finalChatContext.fromInfo.avatar"></el-col> <span class="fl"> <img :src="item.finalChatContext.fromInfo.avatar"></span>
<el-col :span="20"> <span class="fl" style="margin-left:8px;">
<p>{{item.roomInfo.groupName}} <span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p> <p>{{item.roomInfo.groupName}} <span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" v-if="item.finalChatContext.text">{{item.finalChatContext.text.content}}</p> <p class="gray " v-if="item.finalChatContext.text">{{item.finalChatContext.text.content}}</p>
</el-col> </span>
</el-row> </el-row>
</li> </li>
</ul> </ul>
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
*{ padding: 0; *{ padding: 0;
margin: 0;} margin: 0;}
.fl{float: left;}
.list { .list {
overflow-y:scroll; overflow-y:scroll;
height: 652px; height: 652px;
......
...@@ -13,9 +13,6 @@ ...@@ -13,9 +13,6 @@
<div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)"> <div v-else-if="item.msgtype=='file'" class="msgtypefile" @click="down(item.file)">
{{item.file.filename}} {{item.file.filename}}
</div> </div>
<!-- <div v-else-if="item.msgtype=='link'&&item.text" class="msgtypelink">
{{item.text.content}}
</div>-->
<div v-else-if="item.msgtype=='voice'" class="msgtypevoice"> <div v-else-if="item.msgtype=='voice'" class="msgtypevoice">
<i class="el-icon-video-play" @click="play(item,'voice')"></i> <i class="el-icon-video-play" @click="play(item,'voice')"></i>
</div> </div>
......
...@@ -3,24 +3,30 @@ ...@@ -3,24 +3,30 @@
<div v-if="personList.length>=1"> <div v-if="personList.length>=1">
<ul> <ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)"> <li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='text'"> <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='text'">
<span class="fl">
<el-col :span="3"> <img v-if="item.finalChatContext.fromInfo" :src="item.finalChatContext.fromInfo.avatar"></el-col> <div class="ninebox">
<el-col :span="21"> <ul v-if="item.roomInfo">
<li v-for="(a,i) in item.roomInfo.avatar.split(',')" :key="i"><img :src="a" alt=""></li>
</ul>
</div>
</span>
<span class="fl" style="margin-left:8px;line-height:60px">
<p>{{item.finalChatContext.roomInfo.name}} <span class="fr gray">{{parseTime(item.finalChatContext.fromInfo.updateTime)}}</span></p> <p>{{item.finalChatContext.roomInfo.name}} <span class="fr gray">{{parseTime(item.finalChatContext.fromInfo.updateTime)}}</span></p>
<p class="gray padt10" v-if="item.finalChatContext.fromInfo">{{item.finalChatContext.fromInfo.name}}:{{item.finalChatContext.text.content}}</p> <p class="gray" v-if="item.finalChatContext.fromInfo">{{item.finalChatContext.fromInfo.name}}:{{item.finalChatContext.text.content}}</p>
</el-col> </span>
</el-row> </el-row>
<el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'"> <!-- <el-row style="padding:10px" v-if="item.finalChatContext.msgtype=='file'">
<el-col :span="3">&nbsp; `</el-col> <el-col :span="3">&nbsp;</el-col>
<el-col :span="21"> <el-col :span="21">
<p><span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p> <p><span class="fr gray">{{parseTime(item.finalChatContext.msgtime)}}</span></p>
<p class="gray padt10" >{{item.finalChatContext.from}}: <p class="gray padt10" >{{item.finalChatContext.from}}:
<span v-if="item.finalChatContext.file.fileext=='mp4'">[视频]</span> <span v-if="item.finalChatContext.file.fileext=='mp4'">[视频]</span>
</p> </p>
</el-col> </el-col>
</el-row> </el-row> -->
</li> </li>
</ul> </ul>
</div> </div>
...@@ -55,7 +61,16 @@ ...@@ -55,7 +61,16 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
*{ padding: 0; *{ padding: 0;
margin: 0;} .fl{float: left;}
margin: 0;}
.ninebox{ width: 62px; height: 60px; border: 1px solid #199ed8;;
ul li{
float: left;
width: 17px;
height: 17px;
padding: 0!important;
margin:1px 2px 2px 1px;
}}
.list { .list {
overflow-y:scroll; overflow-y:scroll;
......
<template>
<div class="list" v-loading="loading">
<div v-if="personList.length>=1">
<ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px">
<span class="fl"> <img :src="item.finalChatContext.fromInfo.avatarMediaid"></span>
<span class="fl" style="margin-left:8px">
<p>{{item.finalChatContext.fromInfo.name}} </p>
</span>
</el-row>
</li>
</ul>
</div>
<div v-else></div>
</div>
</template>
<script>
import {parseTime} from '@/utils/common.js'
export default {
props: {
personList: {
type: Array,
defluat: () => []
},
loading: {
type: Boolean,
defluat: false
},
},
data() {
return{
loadings:true
}
},
methods:{
liClick(e){
console.log(e)
this.$emit('chatFn',e)
}
}
}
</script>
<style lang="scss" scoped>
*{ padding: 0;
margin: 0;}
.fl{float: left;}
.list {
overflow-y:scroll;
height: 708px;
::-webkit-scrollbar {
display: none;
}
/deep/ .el-loading-spinner{margin-top: 20px;}
.fr{float:right;}
.gray{color: #999;}
.padt10{padding-top: 10px;}
ul li {
overflow: hidden;
border-bottom: 1px solid #efefef;
cursor: pointer;
p{white-space:nowrap;
overflow:hidden;
line-height: 40px;
text-overflow:ellipsis;}
:hover{ background: #efefef;}
img {
width: 40px;
height: 40px;
float: left
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -4,12 +4,10 @@ ...@@ -4,12 +4,10 @@
<ul> <ul>
<li v-for="(item,index) in personList" :key="index" @click="liClick(item)"> <li v-for="(item,index) in personList" :key="index" @click="liClick(item)">
<el-row style="padding:10px"> <el-row style="padding:10px">
<el-col :span="3"> <img :src="item.receiveWeCustomer.avatar"></el-col> <span class="fl"> <img :src="item.receiveWeCustomer.avatar"></span>
<el-col :span="21"> <span class="fl" style="margin-left:8px">
<!-- {{parseTime(item.finalChatContext.msgtime)}} <span class="fr gray"></span>-->
<p>{{item.receiveWeCustomer.name}} </p> <p>{{item.receiveWeCustomer.name}} </p>
<!-- <p class="gray padt10" v-if="item.finalChatContext.text">{{item.finalChatContext.text.content}}</p> --> </span>
</el-col>
</el-row> </el-row>
</li> </li>
</ul> </ul>
...@@ -46,6 +44,7 @@ ...@@ -46,6 +44,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
*{ padding: 0; *{ padding: 0;
margin: 0;} margin: 0;}
.fl{float: left;}
.list { .list {
overflow-y:scroll; overflow-y:scroll;
height: 708px; height: 708px;
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
<el-tabs v-model="activeName" @tab-click="tabClick(true)"> <el-tabs v-model="activeName" @tab-click="tabClick(true)">
<el-tab-pane label="内部联系人" name="0"> <el-tab-pane label="内部联系人" name="0">
<div class="ct_box"> <div class="ct_box">
<list v-if="activeName==0" :personList="personList" :loading="loading" @chatFn='chatFn'> <insideList v-if="activeName==0" :personList="personList" :loading="loading" @chatFn='chatFn'>
</list> </insideList>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="外部联系人" name="1"> <el-tab-pane label="外部联系人" name="1">
...@@ -143,6 +143,7 @@ ...@@ -143,6 +143,7 @@
<script> <script>
import list from '../component/list.vue' import list from '../component/list.vue'
import chat from '../component/chat.vue' import chat from '../component/chat.vue'
import insideList from "../component/insideList.vue";
import grouplist from '../component/groupList.vue' import grouplist from '../component/groupList.vue'
import * as api from '@/api/organization' import * as api from '@/api/organization'
import { import {
...@@ -155,6 +156,7 @@ ...@@ -155,6 +156,7 @@
components: { components: {
list, list,
grouplist, grouplist,
insideList,
chat chat
}, },
data() { data() {
...@@ -211,13 +213,15 @@ ...@@ -211,13 +213,15 @@
if (this.activeName == '2') { if (this.activeName == '2') {
return this.activeNameThreeClick(true, true) return this.activeNameThreeClick(true, true)
} }
this.activeNameThreeClick(true) this.activeNameThreeClick(true)
}, },
activeNameThreeClick(page, group) { activeNameThreeClick(page, group) {
console.log(this.activeName)
if (!!!page) { if (!!!page) {
this.currentPage = 1 this.currentPage = 1
} }
if (this.chat && this.chat.receiveWeCustomer) { if (this.chat) {
let msgType = '' let msgType = ''
if (this.activeNameThree == 0) { if (this.activeNameThree == 0) {
msgType = '' msgType = ''
...@@ -238,13 +242,12 @@ ...@@ -238,13 +242,12 @@
beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "", beginTime: this.takeTime ? yearMouthDay(this.takeTime[0]) : "",
endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '', endTime: this.takeTime ? yearMouthDay(this.takeTime[1]) : '',
} }
if (group) { if (this.activeName=='2') {
query.roomId = this.chat.roomId query.roomId = this.chat.roomId
} else { } else {
query.receiveId = this.chat.receiveId query.receiveId = this.chat.receiveId
} }
if (this.activeName=='2') {
if (group) {
content.chatGrounpList(query).then(res => { content.chatGrounpList(query).then(res => {
this.total = Number(res.total) this.total = Number(res.total)
this.resortData(res) this.resortData(res)
...@@ -276,8 +279,9 @@ ...@@ -276,8 +279,9 @@
}, },
chatFn(data) { chatFn(data) {
this.chat = data; this.chat = data;
if (data.receiveWeCustomer) { if (data) {
this.activeNameThreeClick() console.log(122132)
this.activeNameThreeClick()
} }
}, },
groupFn(data) { groupFn(data) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!