Browse Source

修改学习录音

yun
douzhuo 2 years ago
parent
commit
af52c02ce4
3 changed files with 53 additions and 43 deletions
  1. +48
    -39
      pages/learning/Equinoctial/index.vue
  2. +3
    -2
      pages/mine/reception/consultant.vue
  3. +2
    -2
      utils/domain.js

+ 48
- 39
pages/learning/Equinoctial/index.vue View File

@@ -17,18 +17,17 @@
</view>
<zaudio :duration="duration" theme="theme4"></zaudio>
</view>
<scroll-view lower-threshold='20px' @scrolltolower="ltolower()" scroll-y="true"
class="text scroll-Y" :scroll-top="scrollTop" :scroll-into-view="scrollId">
<scroll-view lower-threshold='20px' @scrolltolower="ltolower()" scroll-y="true" class="text scroll-Y"
:scroll-top="scrollTop" :scroll-into-view="scrollId">
<!-- 音频识别模块 -->
<view>
<!-- 聊天记录-->
<view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
<view :id="'dialog'+i" class="fileName">录音文件</view>
<view class="text dingweishiy"
v-for="(item,index) in dialog.message" :key="index" :id="'dialog'+csdFileindex+'text'+item.bg"
:class="{active: Math.floor(item.bg/1000) <= playNow && Math.floor(item.ed/1000) > playNow && i==0}"
:data-speaker="item.speaker"
>
<view class="text dingweishiy" v-for="(item,index) in dialog.message" :key="index"
:id="'dialog'+csdFileindex+'text'+item.bg"
:class="{active: Math.floor(item.bg/1000) <= playNow && Math.floor(item.ed/1000) > playNow && i==0}"
:data-speaker="item.speaker">
<view class="avatar">
<text :style="[SPEAKERSTYLE(item.speaker)]">{{ item.speaker | toCapital }}</text>
</view>
@@ -208,23 +207,23 @@
startFile: '',
num: 0, //上拉 转写文件下标
Bnum: 0, //下拉 转写文件下标
ACTION: Symbol('zaudio'), // 唯一值区分每个页面的方法
isPageHide: false, // 是否息屏
duration: '',
};
},
onLoad(options) {
this.startTime=options.startTime
this.customerId=options.customerId,
this.biaoqian=options.biaoqian;
this.startFile=options.startFile;
this.startTime = options.startTime
this.customerId = options.customerId;
this.biaoqian = options.biaoqian;
this.startFile = options.startFile;
this.getdianzan()
this.getCommentList();
//注意: 不同的回调方法, 相同的业务函数方法名, 不会相互影响;
this.$zaudio.on('stop', this.ACTION, () => {
console.log('我是强制暂停或关闭小程序音频浮窗触发的')
@@ -241,14 +240,16 @@
})
},
onShow() {
//实时渲染当前的播放状态
this.$zaudio.syncRender()
this.initRecord();
!this.isPageHide && this.getluyinList();
},
onHide() {
this.isPageHide = true
},
onUnload(){
onUnload() {
//卸载不需要的业务和获取播放状态的业务,提高页面性能
this.$zaudio.off('seek', this.ACTION);
this.$zaudio.off('stop', this.ACTION);
@@ -264,11 +265,13 @@
const message = this.dialogList[0].message;
if (!message) return
for (let i = 0; i < message.length; i++) {
if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow < Math.floor(message[i].ed / 1000))) {
if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow < Math.floor(message[i].ed /
1000))) {
this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
break;
}
if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow < Math.floor(message[i + 1].bg / 1000)) {
if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow <
Math.floor(message[i + 1].bg / 1000)) {
this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
break;
}
@@ -286,8 +289,8 @@
duration: 2000
});
return
}else {
this.num=this.num+1;
} else {
this.num = this.num + 1;
uni.request({
url: config.service.getCorpusAnalysis + '?corpusId=' + this.luyinList[this.num].id +
"&customerId=" + this.customerId, //仅为示例,并非真实接口地址。
@@ -298,8 +301,7 @@
},
success: (data) => {
if (data.data.code == 10000) {
if (data.data.data.audioContent.length == 0) {
} else {
if (data.data.data.audioContent.length == 0) {} else {
const jsonInfo = JSON.parse(data.data.data.audioContent);
this.dialogList.push({
message: jsonInfo
@@ -386,9 +388,9 @@
if (cet.id == this.startFile) {
this.csdFileindex = index;
this.recordPath = res[index].recordPath
this.date=res[index].receptionTime
this.num=index;//下拉起始位置
this.Bnum=index;
this.date = res[index].receptionTime
this.num = index; //下拉起始位置
this.Bnum = index;
this.luyinList = res;
this.zyAudio();
this.getCorpusAnalysis()
@@ -455,7 +457,7 @@
uni.hideLoading();
}
},
//音频前进回退
sliderChangeComplate(currentTime) {},
// 获取转义后的对话结果
@@ -477,11 +479,11 @@
});
setTimeout(function() {
uni.hideLoading();
}, 2000);
}else{}
},
}, 2000);
} else {}
},
fail(error) {
return false;
return false;
}
});
},
@@ -490,12 +492,12 @@
},
// 文件切换播放
filechange(item, i) {
this.num=i;//下拉起始位置
this.Bnum=i;
this.csdFileindex=i;
this.num = i; //下拉起始位置
this.Bnum = i;
this.csdFileindex = i;
this.recordPath = item.recordPath;
this.date=item.receptionTime;
this.isshowFile=false;
this.date = item.receptionTime;
this.isshowFile = false;
setTimeout(() => {
this.$zaudio.operate(i)
}, 50)
@@ -663,7 +665,7 @@
})
})
},
//录音实例
zyAudio() {
let data = this.luyinList.map((item, index) => {
@@ -677,10 +679,17 @@
this.$zaudio.setAudio(data)
//渲染第一首音频
this.$zaudio.setRender(0)
if (this.startTime) {
setTimeout(() => {
this.stepPlay(parseInt(this.startTime / 1000))
})
}

},
// 跳转指定位置播放
stepPlay(t) {
console.log(t)
this.$zaudio.seek(t)
if (this.$zaudio.paused) {
this.$zaudio.operate()


+ 3
- 2
pages/mine/reception/consultant.vue View File

@@ -103,7 +103,7 @@
//
searchFunc() {
this.getFreeList();
},

async iniPage() {
@@ -130,9 +130,10 @@
// 获取空闲顾问
async getFreeList() {
try {
let deptId = this.list.length > 0 ? this.list[this.listCurrent].id : ''
// deptId 部门id
// name 顾问名称
let res = await this.$u.get(`/zkAgentPool/freeList?itemId=${this.buildingID}&name=${this.keywords||''}&deptId=${this.list[this.listCurrent].id || ''}`)
let res = await this.$u.get(`/zkAgentPool/freeList?itemId=${this.buildingID}&name=${this.keywords||''}&deptId=${deptId}`)
if (res.length == 0) {
this.freeList = []
} else {


+ 2
- 2
utils/domain.js View File

@@ -1,8 +1,8 @@
// http.js使用域名
const baseUrl = 'http://81.70.55.170:9090/autoSR/api';// 最新测试
// const baseUrl = 'http://81.70.55.170:9090/autoSR/api';// 最新测试
// const baseUrl = 'http://127.0.0.1:8080/autoSR/api'; // 本地
// const baseUrl = 'http://192.168.31.169:8080/autoSR/api'; // 长龙
// const baseUrl = 'http://192.168.31.149:9090/api'; // 盛浩
const baseUrl = 'http://192.168.31.149:9090/api'; // 盛浩
// const baseUrl = 'https://zkgj.quhouse.com/api'; // 质控正式
// const baseUrl = 'https://hfju.com/api'; // 数智正式
// const baseUrl = 'https://xitong.pachira.cn/api'; // AI营销辅助 普强使用


Loading…
Cancel
Save