会话存档

This commit is contained in:
liuye
2023-06-07 16:45:37 +08:00
parent 9b6725a77a
commit 6f2713af4a
2 changed files with 18 additions and 16 deletions

View File

@@ -113,7 +113,7 @@ export default {
areaId: this.areaId,
toUserName: this.currentTabs == 1 ? this.keyword : '',
roomName: this.currentTabs == 1 ? '' : this.keyword,
departId: this.deptUserList[0].id
departmentId: this.deptUserList[0].id
}
}).then(res=> {
if(res?.data) {

View File

@@ -56,10 +56,10 @@ export default {
data() {
return {
tabList: [
{name: '全部'},
{name: '图片'},
{name: '语音'},
{name: '文本'}
{name: '全部', value: ''},
{name: '文本', value: 'text'},
{name: '图片', value: 'image'},
{name: '语音', value: 'voice'},
],
currentTabs: 0,
barStyle: {
@@ -140,20 +140,22 @@ export default {
toUserId: this.toUserId,
roomId: this.roomId,
type: this.type,
content: this.keyword
content: this.keyword,
startTime: this.dateList.length ? this.dateList[0] : '',
endTime: this.dateList.length ? '' : this.dateList[1]
}
}).then(res=> {
if(res?.data) {
res.data.records.map((item) => {
if(item.msgType == 'voice'){
//amr对象不能共用所以要为每条语音消息初始化一个amr对象
var amr = new BenzAMRRecoder();
amr.initWithUrl(`请求的amr地址`).then(() => {
item.amrTime = Math.ceil(amr.getDuration()); //获取音频总时长
});
item.amr = amr; //将初始化好的amr赋值到当前消息对象data中
}
})
// res.data.records.map((item) => {
// if(item.msgType == 'voice'){
// //amr对象不能共用所以要为每条语音消息初始化一个amr对象
// var amr = new BenzAMRRecoder();
// amr.initWithUrl(`请求的amr地址`).then(() => {
// item.amrTime = Math.ceil(amr.getDuration()); //获取音频总时长
// });
// item.amr = amr; //将初始化好的amr赋值到当前消息对象data中
// }
// })
this.list = this.current > 1 ? [...this.list, ...res.data.records]: res.data.records
this.pages = res.data.pages
}