Commit 1b0d7fd4 by 李伟康

feat(receptionDetail): 优化对话详情页面功能

- 添加音频播放时文本高亮功能
- 修复音频播放进度同步问题
- 优化命中脚本展示样式
- 调整时间格式化逻辑
- 修复一些小的 UI 问题
1 parent dbdce75f
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
> >
<view :class="['axis-dot', `${!isPlayIng && !isScrolllIng?'':'radius'}`]"></view> <view :class="['axis-dot', `${!isPlayIng && !isScrolllIng?'':'radius'}`]"></view>
</view> </view>
<template v-if="!isPlayIng && !isScrolllIng"> <!-- <template v-if="!isPlayIng && !isScrolllIng"> -->
<view <view
:class="['axis-text',{'axis-text-active':activeId == item.text_id}]" :class="['axis-text',{'axis-text-active':activeId == item.text_id}]"
:style="[{top:`${item.top + 'px'}`}]" :style="[{top:`${item.top + 'px'}`}]"
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
> >
{{item.tagGroupName}}+{{item.score}} {{item.tagGroupName}}+{{item.score}}
</view> </view>
</template> <!-- </template> -->
</block> </block>
</template> </template>
<view class="hide-bar"> <view class="hide-bar">
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
class="scroll-view" class="scroll-view"
enhanced enhanced
scroll-y scroll-y
scroll-with-animatio scroll-with-animation
:scroll-into-view="activeId"
> >
<template v-if="qualityData[activeIndex]"> <template v-if="qualityData[activeIndex]">
<view class="quality-block"> <view class="quality-block">
...@@ -26,7 +27,11 @@ ...@@ -26,7 +27,11 @@
</view> </view>
<template v-for="(item,index) in qualityData[activeIndex].conversationDetailDTOList"> <template v-for="(item,index) in qualityData[activeIndex].conversationDetailDTOList">
<block :key="index"> <block :key="index">
<view class="quality-item flex"> <view
v-if="item.text_id"
:id="item.text_id"
:class="['quality-item flex',{active:item.text_id == activeId}]"
>
<view class="avatar-box"> <view class="avatar-box">
<view :class="['sprite-icon',`icon-role-${item.role}`]"></view> <view :class="['sprite-icon',`icon-role-${item.role}`]"></view>
<view class="time">{{item.time}}</view> <view class="time">{{item.time}}</view>
...@@ -62,16 +67,37 @@ export default { ...@@ -62,16 +67,37 @@ export default {
qualityData: { qualityData: {
type: Array, type: Array,
default: () => [] default: () => []
},
qualityAudio: {
type: Object,
default: () => ({})
} }
}, },
data () { data () {
return { return {
activeIndex: 0 activeIndex: 0,
activeId: ''
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
onTimeUpdate () {
const {
mergedOffset
} = this.setProgress()
this.activeId = `text_${mergedOffset}`
},
setProgress () {
const {
currentTime
} = this.qualityAudio,
mergedOffset = Math.ceil(currentTime)
return {
currentTime,
mergedOffset
}
},
} }
} }
</script> </script>
...@@ -116,7 +142,7 @@ export default { ...@@ -116,7 +142,7 @@ export default {
} }
} }
} }
.scroll-view{ .scroll-view {
height: calc(100% - #{toRpx(112)}); height: calc(100% - #{toRpx(112)});
} }
.quality-block { .quality-block {
...@@ -190,6 +216,12 @@ export default { ...@@ -190,6 +216,12 @@ export default {
line-height: toRpx(44); line-height: toRpx(44);
} }
} }
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
.script-rec { .script-rec {
padding: 24rpx; padding: 24rpx;
.suggestions-box { .suggestions-box {
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<template v-if="i[key] && i[key].length"> <template v-if="i[key] && i[key].length">
<template v-for="(k,kindex) in i[key]"> <template v-for="(k,kindex) in i[key]">
<rich-text <rich-text
@click="open(i[key])" @click="open(i)"
:key="`text_${index}_${kindex}`" :key="`text_${index}_${kindex}`"
:nodes="k" :nodes="k"
></rich-text> ></rich-text>
...@@ -70,9 +70,9 @@ ...@@ -70,9 +70,9 @@
color="#76787f" color="#76787f"
></uni-icons> ></uni-icons>
</view> </view>
<view class="title">命中文本</view> <view class="title">{{hitTextDetail.tagGroupName}} {{hitTextDetail.formatScore}}</view>
<view class="content"> <view class="content">
<template v-for="(k,kindex) in hitTextDetail"> <template v-for="(k,kindex) in hitTextDetail.hitTextList">
<rich-text <rich-text
:key="`text_${kindex}`" :key="`text_${kindex}`"
:nodes="k" :nodes="k"
......
...@@ -60,21 +60,22 @@ ...@@ -60,21 +60,22 @@
</view> </view>
<view class="component-box"> <view class="component-box">
<dialogue <dialogue
:class="['component-item',{hide: tabId != 1}]"
:batchId="pageData.batchId" :batchId="pageData.batchId"
:hidden="tabId != 1"
:qualityData="qualityData" :qualityData="qualityData"
:totalDuration="pageData.totalDuration" :totalDuration="pageData.totalDuration"
ref="dialogueRef" ref="dialogueRef"
:qualityAudio="qualityAudio" :qualityAudio="qualityAudio"
@seek="seek" @seek="seek"
@onPlay="onPlay" @onPlay="onPlay"
@onPause="onPause" @onPause="onPause"
@changeOperate="isOperate = $event" @changeOperate="isOperate = $event"
/> />
<quality <quality
:qualityData="qualityData" :qualityData="qualityData"
:hidden="tabId != 2" :class="['component-item',{hide: tabId != 2}]"
ref="qualityRef" ref="qualityRef"
:qualityAudio="qualityAudio"
/> />
</view> </view>
</view> </view>
...@@ -208,6 +209,7 @@ export default { ...@@ -208,6 +209,7 @@ export default {
let minutes = Math.floor(num / 60) || '0', let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0' seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds seconds = seconds < 10 ? `0${seconds}` : seconds
minutes = minutes < 10 ? `0${minutes}` : minutes
return `${minutes}:${seconds}` return `${minutes}:${seconds}`
}, },
//跳转到指定位置 //跳转到指定位置
...@@ -235,12 +237,12 @@ export default { ...@@ -235,12 +237,12 @@ export default {
} }
item.matchedClass = matchedClass item.matchedClass = matchedClass
item.matchedText = matchedText item.matchedText = matchedText
let [scriptRec] = JSON.parse(item.scriptRec)
if (scriptRec) scriptRec = scriptRec.replace(/\n/g, '<br>')
if (item.conversationDetailDTOList && item.conversationDetailDTOList.length) { if (item.conversationDetailDTOList && item.conversationDetailDTOList.length) {
let [scriptRec] = JSON.parse(item.scriptRec)
scriptRec = scriptRec.replace(/\n/g, '<br>')
item.conversationDetailDTOList.map(e => { item.conversationDetailDTOList.map(e => {
e.time = this.formatTime(e.mergedOffset) e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.id}` e.text_id = `text_${e.mergedOffset}`
if (e.mergedOffset == item.offset && !item.matched) { if (e.mergedOffset == item.offset && !item.matched) {
e.scriptRec = scriptRec e.scriptRec = scriptRec
item.matched = true item.matched = true
...@@ -250,7 +252,9 @@ export default { ...@@ -250,7 +252,9 @@ export default {
/**时间戳都对不上时 话术推荐加到最后 */ /**时间戳都对不上时 话术推荐加到最后 */
item.conversationDetailDTOList[item.conversationDetailDTOList.length - 1].scriptRec = scriptRec item.conversationDetailDTOList[item.conversationDetailDTOList.length - 1].scriptRec = scriptRec
} }
} } else item.conversationDetailDTOList = [{
scriptRec: scriptRec || '暂无建议'
}]
}) })
this.qualityData = res this.qualityData = res
} }
...@@ -430,6 +434,17 @@ export default { ...@@ -430,6 +434,17 @@ export default {
.component-box { .component-box {
width: 100%; width: 100%;
height: calc(100% - #{toRpx(112)}); height: calc(100% - #{toRpx(112)});
position: relative;
.component-item {
position: absolute;
top: 0;
left: 0;
transition: all 0.15s;
}
.hide {
opacity: 0;
z-index: -1;
}
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!