Commit 1b0d7fd4 by 李伟康

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

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