|
|
@@ -129,23 +129,7 @@ |
|
|
|
<view class="bottombox"> |
|
|
|
<!-- 播放块 --> |
|
|
|
<template v-if="current == 1"> |
|
|
|
<view class="bottomhead"> |
|
|
|
<view class="audio-play" @tap="changePlayState"> |
|
|
|
<image class="image" mode="widthFix" |
|
|
|
:src="audioPlay ? 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/pause.png' : 'https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/play.png'"> |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
<view class="audio-slider"> |
|
|
|
<view class="audio-time"> |
|
|
|
<text>{{currentTimeStr}}</text> |
|
|
|
</view> |
|
|
|
<slider class="slider" min="0" :max="sliderMax" @change="sliderChangeComplate" block-size="14" |
|
|
|
:value="sliderValue" activeColor="blue"></slider> |
|
|
|
<view class="audio-time"> |
|
|
|
<text>{{timeStr}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<zaudio :duration="duration" theme="theme4"></zaudio> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-if="userlistobj.invalidViolatedCause"> |
|
|
@@ -210,7 +194,12 @@ |
|
|
|
<script> |
|
|
|
var util = require("@/utils/util.js"); |
|
|
|
var config = require("@/config"); |
|
|
|
|
|
|
|
import zaudio from '@/components/uniapp-zaudio/zaudio'; |
|
|
|
export default { |
|
|
|
components: { |
|
|
|
zaudio |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
Aimg: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAACqVBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////9/f3////9/f39/f3////////9/f3////////////9/f3////9/f39/f3////9/f3////////9/f3////9/f3////////////////9/f39/f3////////9/f39/f3////9/f39/f3////////9/f39/f3////////9/f39/f39/f3////////////////+/v7+/v7////+/v7////+/v7////+/v7+/v7////////+/v7+/v7////+/v7////+/v7////////////////////////////+/v7////+/v7////+/v7+/v7////////////+/v7////+/v7////+/v7+/v7////////+/v7////+/v7////////+/v7////////+/v7////+/v7+/v7+/v7////////+/v7+/v7////+/v7+/v7////+/v7////+/v7////+/v7////+/v7+/v7////+/v7+/v7////+/v7////+/v7////+/v7+/v7////+/v5jdC9iAAAA4nRSTlMAAQIDBAUGBwgLDA0ODxARExQVFhgbHB4fICEiIyQmJygpKy4wMTIzNDY3ODk6Oz0+P0BBQkRGR0lKTE5PUFFTVFVXWFlcXV9gYWJjZWZnaGlqa2xtbm9wcXJzdHV2d3h6e319foGBgoODh4mKiouMjI2QkZKSk5OUlpeYmZmam5ycnZ+foKGio6SmqKmpq6yur7CwsbGytba5uru8wMDBwcLCw8XGx8jJysrLzM7P0dLT1dXW1tfY2drc3N7f4OHh5Obm5+jp6uvs7vDx8vLz8/T09fX29/f4+fn6+vz8/f7+RVDt+wAAA55JREFUGBntwf9/1HMAB/DX7XYbuXWV1cyMoixfugrRGNXytW33pbVdJ83XkiMLSb4LJd/zZUi0SKT5FmGS77HUVaixnHP2+kt8vt3Zbp/3+7P3XR5+8XziP1E4uiYcrh1bjMNi6NzXumnoeX3eSOSrpHUv+zi0ogJ5qd3JLN1XuJGzwqW0sW4oclT0Im19XIqcuNdQ4D0vcnEDhdYgB2f+SbFZUHbEdkrsLYeqFko9CEVH7qJUohxqLqODO6BmLR18XwAVRQfpZDxUnExHjVBRR0eroGIZHX0AFe10tA8qdtNZIRR00VEPVLxLRzuh4jk62gIVy+joSaiI0tECqPDT0blQ4f6RDpI+KHmYDjZBzWQ6aIaibZSK+6BoOqViUOXqoER8BJSdlqJYFDm4h0LveJAD7+cUiFciJ1U/01aiGjk65zfaSF6EnE3azQEO1iAPFZuZZes45MUT3cM+emLFyNfwK3fQ8k1sFA6L0cElTzx9d1OVC/8bNG/gzY+GQaKk461gCQZr8iMHSNZD4nySv6wYj0EYFv2UhqcgcTsN70ePhtzER3+lJe6BxXP9jTctvrl1yS1jkLaNlkTbBR6IlF3dyT78sHh+oqkSlrJe/uOH1jGw4apem2I/1yLtGRo6kRZiP73t57mQxb+Z2dqRdikNtyLtBWb78Cz05bomyQH+KIGljIYaWNxxDtC72ouMgsdpZzosHhqqYDmFdraOQNpttHUfLKU0TITlKtra6IZpCu3tgMVPQx0sG2ivDqaVFDgOppk0LIbJm6C9DTB1UCAMU4SGZ2GqocAumL6jQBtMMRq2wLScAik3dMV/UWB/EQwrafgSpk6KlEJ3LIXOgGE9DQdgqKDQSdBNoNAiGL6i6SjowhSaAt1UCm2CzpOk6QTonqfQJdBdSKGkD5pKWqZCU7iHQtdB10KxWmjOpqUJmtMp9gB091LsIWiCtCyFZiHFXoZuHcW+hiZGy0vQvE2xT6DbTolKAI/R8hmA4SmKdUG3jxIhAG/QkigAZlAi6QJQTJk2AF1MGwXcRRkfgJGU2V8EHzP8wBeUqQQwllKTcCozpuFESk0AMJNSC3AxM8KYT6lpAFootRGLmLEQ6ynVCCBAqcSQ1cy4f8ghSs0HcMzvlKp+lRmvVFMqNQ6aaIoyd3Yy49vllOmuh+H4WZFIpFnTpJmjadTM1oQ1oVAgFNQENA0N9f01BIKh8OzGOU3NkbmXzwuV41/wNztgHKhu7WKTAAAAAElFTkSuQmCC", |
|
|
@@ -244,13 +233,7 @@ |
|
|
|
csdFileindex: 0, // 当前使用录音转写的下标 |
|
|
|
|
|
|
|
// 录音信息 |
|
|
|
innerAudioContext: null, // 音频对象 |
|
|
|
currentTimeStr: "00:00", //当前进度的时间 |
|
|
|
timeStr: "00:00", //总的时间 |
|
|
|
recordPath: "", // 录音地址 |
|
|
|
audioPlay: false, //当前的播放状态控制 |
|
|
|
sliderValue: 0, //进度条最小值 |
|
|
|
sliderMax: 0, //进度条最大值 |
|
|
|
playNow: 0, // 当前播放时间 |
|
|
|
audioType: false, // 音频是否自动播放状态 |
|
|
|
scrollId: "", // 当前播放滚动到的位置 |
|
|
@@ -261,6 +244,10 @@ |
|
|
|
nextPageObj: JSON.parse(uni.getStorageSync('nextPageObj')), // 当前页面筛选内容 |
|
|
|
isMerge: 0, // 默认合并 |
|
|
|
isSw:false, |
|
|
|
|
|
|
|
ACTION: Symbol('zaudio'), // 唯一值区分每个页面的方法 |
|
|
|
isPageHide: false, // 是否息屏 |
|
|
|
duration: '', // 总时长 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@@ -280,9 +267,34 @@ |
|
|
|
this.stateisshow = option.stateisshow; |
|
|
|
this.itemobj = uni.getStorageSync('searchobj'); |
|
|
|
if (option.isMerge) this.isMerge = option.isMerge |
|
|
|
|
|
|
|
|
|
|
|
//注意: 不同的回调方法, 相同的业务函数方法名, 不会相互影响; |
|
|
|
this.$zaudio.on('stop', this.ACTION, () => { |
|
|
|
console.log('我是强制暂停或关闭小程序音频浮窗触发的') |
|
|
|
}) |
|
|
|
this.$zaudio.on('seek', this.ACTION, (time) => { |
|
|
|
this.sliderChangeComplate(this.TIMEEVENT(time)) |
|
|
|
}) |
|
|
|
this.$zaudio.on('playing', this.ACTION, (obj) => { |
|
|
|
this.duration = obj.duration |
|
|
|
this.TimeUpdate(this.TIMEEVENT(obj.current)) |
|
|
|
}) |
|
|
|
this.$zaudio.on('error', this.ACTION, e => { |
|
|
|
console.log(e, '加载失败') |
|
|
|
}) |
|
|
|
this.$zaudio.on('ended', this.ACTION, e => { |
|
|
|
this.$zaudio.stop() |
|
|
|
this.init({ |
|
|
|
bg: 0, |
|
|
|
customerId: this.customerId |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
onShow() { |
|
|
|
//实时渲染当前的播放状态 |
|
|
|
this.$zaudio.syncRender() |
|
|
|
this.permissions = uni.getStorageSync('weapp_session_Menu_data') // 权限 |
|
|
|
|
|
|
|
this.roleindex = 0; |
|
|
@@ -293,51 +305,22 @@ |
|
|
|
var currPage = pages[pages.length - 1]; //当前页面 |
|
|
|
this.infos = currPage.data.info; |
|
|
|
} |
|
|
|
this.initAudioFnc() |
|
|
|
!this.isPageHide && this.init(this.infos); |
|
|
|
this.gituserlist() |
|
|
|
this.findTabooWords() |
|
|
|
}, |
|
|
|
|
|
|
|
onHide() { |
|
|
|
this.isPageHide = true |
|
|
|
}, |
|
|
|
onUnload() { |
|
|
|
//暂停 |
|
|
|
this.innerAudioContext.pause() |
|
|
|
// 销毁 |
|
|
|
this.innerAudioContext.stop(); |
|
|
|
//卸载不需要的业务和获取播放状态的业务,提高页面性能 |
|
|
|
this.$zaudio.off('seek', this.ACTION); |
|
|
|
this.$zaudio.off('stop', this.ACTION); |
|
|
|
this.$zaudio.off('playing', this.ACTION); |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
SPEAKERSTYLE(index) { |
|
|
|
let obj = { |
|
|
|
color: '', |
|
|
|
} |
|
|
|
switch (index) { |
|
|
|
case 1: |
|
|
|
obj.color = '#60CBEC'; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
obj.color = '#EC8B47'; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
obj.color = '#4F861E'; |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
obj.color = '#4980C8'; |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
obj.color = '#60CBEC'; |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
obj.color = '#EC8B47'; |
|
|
|
break; |
|
|
|
case 8: |
|
|
|
obj.color = '#4F861E'; |
|
|
|
break; |
|
|
|
default: |
|
|
|
obj.color = '#9F61C8'; |
|
|
|
break; |
|
|
|
} |
|
|
|
return obj |
|
|
|
}, |
|
|
|
// 获取违禁词 |
|
|
|
findTabooWords() { |
|
|
|
this.$u.get('/customer/findTabooWords', { |
|
|
@@ -370,8 +353,9 @@ |
|
|
|
|
|
|
|
// 下一条 |
|
|
|
nextValid() { |
|
|
|
console.log(this.$zaudio) |
|
|
|
if (this.nextPageObj.pageSize < this.nextPageObj.num) { |
|
|
|
this.innerAudioContext.pause() |
|
|
|
this.$zaudio.stop() |
|
|
|
this.nextPageObj.pageSize++ |
|
|
|
this.keyWordsMatching(this.nextPageObj) |
|
|
|
} else { |
|
|
@@ -389,7 +373,7 @@ |
|
|
|
title: '没有更早的了~' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.innerAudioContext.pause() |
|
|
|
this.$zaudio.stop() |
|
|
|
this.nextPageObj.pageSize-- |
|
|
|
this.keyWordsMatching(this.nextPageObj) |
|
|
|
} |
|
|
@@ -401,6 +385,7 @@ |
|
|
|
this.customerId = res.results[0].id; |
|
|
|
this.current = 0 |
|
|
|
uni.setStorageSync('nextPageObj', JSON.stringify(this.nextPageObj)) |
|
|
|
this.$zaudio.resetDatas() |
|
|
|
this.resetAudioParams() |
|
|
|
this.prohibitedMatch() |
|
|
|
}).catch(e => { |
|
|
@@ -444,12 +429,12 @@ |
|
|
|
if (res[0].merge == 0) { |
|
|
|
this.infos = item |
|
|
|
this.itemobj = item |
|
|
|
this.recordPath = res[0].recordPath |
|
|
|
uni.setStorageSync("searchobj", item); //写入缓存 |
|
|
|
this.roleindex = 0; |
|
|
|
this.innerAudioContext.destroy() |
|
|
|
this.initAudioFnc() |
|
|
|
this.gituserlist() |
|
|
|
this.findTabooWords() |
|
|
|
this.zyAudio() |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
icon: "none", |
|
|
@@ -476,7 +461,6 @@ |
|
|
|
title: '标记成功', |
|
|
|
duration: 2000 |
|
|
|
}); |
|
|
|
this.initAudioFnc() |
|
|
|
this.gituserlist() |
|
|
|
setTimeout(() => { |
|
|
|
this.reasonSrc = '' |
|
|
@@ -564,7 +548,6 @@ |
|
|
|
} else { |
|
|
|
this.kehuyixiangcenterindex = 1; |
|
|
|
} |
|
|
|
this.alltimeStr = this.getTime(alltime) |
|
|
|
if (info.bg != 0) { |
|
|
|
this.luyinList = res; |
|
|
|
this.recordPath = res[0].recordPath |
|
|
@@ -572,7 +555,7 @@ |
|
|
|
this.timeStr = this.getTime(res[0].recordDuration) |
|
|
|
this.date = res[0].receptionTime; |
|
|
|
this.getCorpusAnalysis(info); |
|
|
|
this.creatAudio() |
|
|
|
this.zyAudio() |
|
|
|
} else { |
|
|
|
this.luyinList = res; |
|
|
|
this.recordPath = res[0].recordPath |
|
|
@@ -580,7 +563,7 @@ |
|
|
|
this.timeStr = this.getTime(res[0].recordDuration) |
|
|
|
this.date = res[0].receptionTime; |
|
|
|
this.getCorpusAnalysis(info); |
|
|
|
this.creatAudio() |
|
|
|
this.zyAudio() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
@@ -588,13 +571,6 @@ |
|
|
|
|
|
|
|
// 重置进度条 |
|
|
|
resetAudioParams() { |
|
|
|
this.timeStr = "00:00"; //总的时间 |
|
|
|
this.currentTimeStr = "00:00" //当前进度的时间 |
|
|
|
this.recordPath = "", // 录音地址 |
|
|
|
this.audioPlay = false //当前的播放状态控制 |
|
|
|
this.sliderValue = 0 //进度条最小值 |
|
|
|
this.sliderMax = 0 //进度条最大值 |
|
|
|
this.playNow = 0 // 当前播放时间 |
|
|
|
this.scrollId = "" // 当前播放滚动到的位置 |
|
|
|
}, |
|
|
|
|
|
|
@@ -668,7 +644,8 @@ |
|
|
|
}) |
|
|
|
this.newluyinList = jsonInfo; |
|
|
|
this.dialogList.push(jsonInfo[this.textindex]); |
|
|
|
this.adasdasdasd(info) |
|
|
|
var itc = parseInt(info.bg / 1000) |
|
|
|
this.adasdasdasd(itc) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@@ -711,15 +688,7 @@ |
|
|
|
|
|
|
|
//搜索跳转 |
|
|
|
adasdasdasd(e) { |
|
|
|
const currTimeStr = this.formatTime(parseInt(e.bg / 1000)) |
|
|
|
this.currentTimeStr = currTimeStr |
|
|
|
this.innerAudioContext.seek(parseInt(e.bg / 1000)); |
|
|
|
console.log('我在这里哦') |
|
|
|
if (this.current == 1) { |
|
|
|
// this.innerAudioContext.play(); |
|
|
|
} else { |
|
|
|
this.scrollId = "dialog" + this.csdFileindex + "text" + e.bg |
|
|
|
} |
|
|
|
this.stepPlay(e) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@@ -748,7 +717,7 @@ |
|
|
|
|
|
|
|
uni.request({ |
|
|
|
url: config.service.getCorpusAnal + '?corpusId=' + this.luyinList[this.csdFileindex].id + |
|
|
|
"&bg=" + bgcd + "&speaker=" + tempRoleIndex + "&voFlag=" + voFlagValue, //仅为示例,并非真实接口地址。 |
|
|
|
"&bg=" + bgcd + "&speaker=" + tempRoleIndex + "&voFlag=" + voFlagValue + '&num=50', //仅为示例,并非真实接口地址。 |
|
|
|
method: "GET", |
|
|
|
header: { |
|
|
|
'content-type': 'application/json', |
|
|
@@ -821,34 +790,11 @@ |
|
|
|
change(index) { |
|
|
|
console.log(index) |
|
|
|
this.current = index; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 录音暂停播放 |
|
|
|
changePlayState() { |
|
|
|
if (this.audioPlay == false) { |
|
|
|
this.innerAudioContext.play(); |
|
|
|
} else { |
|
|
|
this.innerAudioContext.pause() |
|
|
|
if (index == 1) { |
|
|
|
this.zyAudio() |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 初始化音频方法 |
|
|
|
initAudioFnc(inits) { |
|
|
|
this.innerAudioContext = uni.createInnerAudioContext(); |
|
|
|
this.innerAudioContext.autoplay = false; |
|
|
|
this.innerAudioContext.title = '音频'; |
|
|
|
|
|
|
|
this.onPlay() |
|
|
|
this.onPause() |
|
|
|
this.onCanplay() |
|
|
|
this.onEnded() |
|
|
|
this.onSeeking() |
|
|
|
this.onSeeked() |
|
|
|
this.TimeUpdate() |
|
|
|
this.init(this.infos) |
|
|
|
}, |
|
|
|
|
|
|
|
//长按点击播放 |
|
|
|
clickbofang(dialog, item, type) { |
|
|
|
if (type == 'show') { |
|
|
@@ -860,7 +806,6 @@ |
|
|
|
} else { |
|
|
|
this.audioType = false |
|
|
|
} |
|
|
|
this.innerAudioContext.pause() |
|
|
|
this.dialogList.forEach(res => { |
|
|
|
res.message.forEach(asd => { |
|
|
|
asd.isshow = false; |
|
|
@@ -885,131 +830,58 @@ |
|
|
|
this.dialogList.push(this.newluyinList[data.data.data.index]) |
|
|
|
const currTimeStr = this.formatTime(newtime) |
|
|
|
console.log(currTimeStr, 'currTimeStr') |
|
|
|
this.currentTimeStr = currTimeStr |
|
|
|
this.innerAudioContext.seek(newtime); |
|
|
|
this.innerAudioContext.play(); |
|
|
|
this.stepPlay(newtime); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//录音实例 |
|
|
|
creatAudio() { |
|
|
|
this.innerAudioContext = uni.createInnerAudioContext(); |
|
|
|
this.innerAudioContext.autoplay = false; |
|
|
|
this.innerAudioContext.src = this.recordPath; |
|
|
|
this.innerAudioContext.title = '音频'; |
|
|
|
this.onPlay() |
|
|
|
this.onPause() |
|
|
|
this.onCanplay() |
|
|
|
this.onEnded() |
|
|
|
this.onSeeking() |
|
|
|
this.onSeeked() |
|
|
|
this.TimeUpdate() |
|
|
|
}, |
|
|
|
|
|
|
|
onPlay() { |
|
|
|
this.innerAudioContext.onPlay(() => { |
|
|
|
// 播放监听 |
|
|
|
console.log('播放!'); |
|
|
|
this.audioPlay = true; |
|
|
|
wx.enableAlertBeforeUnload({ |
|
|
|
message: "是否确认退出详情页面?", |
|
|
|
success: function(res) { |
|
|
|
console.log("方法注册成功:", res); |
|
|
|
}, |
|
|
|
fail: function(errMsg) { |
|
|
|
console.log("方法注册失败:", errMsg); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
onPause() { |
|
|
|
this.innerAudioContext.onPause(() => { |
|
|
|
wx.disableAlertBeforeUnload({ |
|
|
|
success: function(res) { |
|
|
|
console.log(res) |
|
|
|
}, |
|
|
|
fail: function(e) { |
|
|
|
console.log(e) |
|
|
|
TimeUpdate(currentTime) { |
|
|
|
this.playNow = Math.ceil(currentTime) |
|
|
|
if (this.dialogList.length == 0) { |
|
|
|
return |
|
|
|
} else { |
|
|
|
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)) { |
|
|
|
console.log(message[i].bg, '我是active', message[i].ed, '我是currentTime', this.playNow) |
|
|
|
console.log(message[i].onebest) |
|
|
|
this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; |
|
|
|
break; |
|
|
|
} |
|
|
|
}); |
|
|
|
// 暂停监听 |
|
|
|
console.log('暂停播放!'); |
|
|
|
this.audioPlay = false |
|
|
|
}); |
|
|
|
}, |
|
|
|
onCanplay() { |
|
|
|
this.innerAudioContext.onCanplay((callback) => { |
|
|
|
console.log("缓冲回调", this.innerAudioContext.duration); |
|
|
|
}) |
|
|
|
}, |
|
|
|
onEnded() { |
|
|
|
this.innerAudioContext.onEnded(() => { |
|
|
|
// 结束播放监听 |
|
|
|
console.log('播放结束!'); |
|
|
|
this.audioPlay = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
onSeeking() { |
|
|
|
this.innerAudioContext.onSeeking((res) => { |
|
|
|
console.log("进行跳转", res); |
|
|
|
}) |
|
|
|
}, |
|
|
|
onSeeked() { |
|
|
|
this.innerAudioContext.onSeeked((res) => { |
|
|
|
console.log("结束跳转", res); |
|
|
|
this.$forceUpdate() |
|
|
|
}); |
|
|
|
}, |
|
|
|
TimeUpdate() { |
|
|
|
this.innerAudioContext.onTimeUpdate(() => { |
|
|
|
const { |
|
|
|
currentTime, |
|
|
|
duration |
|
|
|
} = this.innerAudioContext; |
|
|
|
this.playNow = parseInt(currentTime * 1000) |
|
|
|
if (this.dialogList.length == 0) { |
|
|
|
return |
|
|
|
} else { |
|
|
|
const message = this.dialogList[0].message; |
|
|
|
for (let i = 0; i < message.length; i++) { |
|
|
|
if (Number(message[i].bg) < this.playNow && Number(message[i].ed) > this.playNow) { |
|
|
|
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)) { |
|
|
|
this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
const currTimeStr = this.formatTime(currentTime); |
|
|
|
this.sliderValue = parseInt(currentTime); |
|
|
|
// 变动的时间 |
|
|
|
this.currentTimeStr = currTimeStr; |
|
|
|
//进度条最大值 |
|
|
|
this.sliderMax = this.luyinList[this.csdFileindex].recordDuration; |
|
|
|
this.$forceUpdate() |
|
|
|
}); |
|
|
|
} |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//音频前进回退 |
|
|
|
sliderChangeComplate(e) { |
|
|
|
this.innerAudioContext.pause() |
|
|
|
sliderChangeComplate(currentTime) { |
|
|
|
let platetime = (currentTime * 1000) || 0; |
|
|
|
this.dialogList = [] |
|
|
|
let platetime = e.detail.value * 1000; |
|
|
|
this.newluyinList.map((item, index) => { |
|
|
|
if (item.bg < platetime && platetime < item.ed ) { |
|
|
|
this.textindex = index; |
|
|
|
this.toptextindex = index; |
|
|
|
if (index > this.newluyinList.length) { |
|
|
|
uni.request({ |
|
|
|
url: config.service.fastForward + '?corpusId=' + this.luyinList[this.csdFileindex].id + |
|
|
|
"&bg=" + platetime, //仅为示例,并非真实接口地址。 |
|
|
|
method: "GET", |
|
|
|
header: { |
|
|
|
'content-type': 'application/json', |
|
|
|
'Access-Token': uni.getStorageSync('weapp_session_login_data').token |
|
|
|
}, |
|
|
|
success: (data) => { |
|
|
|
this.textindex = data.data.data.index; |
|
|
|
this.toptextindex = data.data.data.index; |
|
|
|
if (data.data.data.index > this.newluyinList.length) { |
|
|
|
this.dialogList.push(this.newluyinList[0]) |
|
|
|
} else { |
|
|
|
this.dialogList.push(this.newluyinList[index]) |
|
|
|
this.dialogList.push(this.newluyinList[data.data.data.index]) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.adasdasdasd({bg: e.detail.value*1000}) |
|
|
|
setTimeout(() => { |
|
|
|
this.innerAudioContext.play() |
|
|
|
}, 1000) |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@@ -1028,6 +900,34 @@ |
|
|
|
if (min < 10) min = '0' + min; |
|
|
|
return min + ":" + second; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//录音实例 |
|
|
|
zyAudio() { |
|
|
|
let data = [{ |
|
|
|
src: this.recordPath, |
|
|
|
title: '录音音频', |
|
|
|
singer: '', |
|
|
|
coverImgUrl: '' |
|
|
|
}] |
|
|
|
if (this.current == 1) { |
|
|
|
this.$zaudio.setAudio(data) |
|
|
|
//渲染第一首音频 |
|
|
|
this.$zaudio.setRender(0) |
|
|
|
console.log(this.$zaudio) |
|
|
|
setTimeout(() => { |
|
|
|
this.$zaudio.operate() |
|
|
|
}, 150) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 跳转指定位置播放 |
|
|
|
stepPlay(t) { |
|
|
|
this.$zaudio.seek(t) |
|
|
|
if (this.$zaudio.paused) { |
|
|
|
this.$zaudio.operate() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
filters: { |
|
|
|
// violatedStatus |
|
|
|