Commit dbdce75f by 李伟康

feat(api): 新增接待 API 模块

- 新增 receptionApi 模块,包含查询对话内容、质检列表和话术标签等功能
- 更新 index.js,引入 receptionApi 模块
- 统一格式化 customerApi.js 中的函数定义
1 parent 4e5d2bd1
...@@ -3,7 +3,7 @@ import environment from '@/env' ...@@ -3,7 +3,7 @@ import environment from '@/env'
module.exports = { module.exports = {
/**查询当前门店是否有客户档案权限 */ /**查询当前门店是否有客户档案权限 */
haveCustomerAccess(data) { haveCustomerAccess (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findPermissionsMerchantList', method: 'dj.api.smartcarlife.customervisits.findPermissionsMerchantList',
projectName: 'boutique', projectName: 'boutique',
...@@ -11,7 +11,7 @@ module.exports = { ...@@ -11,7 +11,7 @@ module.exports = {
}) })
}, },
/**查询当前门店客户档案列表 */ /**查询当前门店客户档案列表 */
getCustomerFileList(data) { getCustomerFileList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoPage', method: 'dj.api.smartcarlife.customervisits.customerInfoPage',
projectName: 'boutique', projectName: 'boutique',
...@@ -19,7 +19,7 @@ module.exports = { ...@@ -19,7 +19,7 @@ module.exports = {
}) })
}, },
/* 删除客户档案*/ /* 删除客户档案*/
delCustomerFile(data) { delCustomerFile (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.deleteVisitsInfo', method: 'dj.api.smartcarlife.customervisits.deleteVisitsInfo',
projectName: 'boutique', projectName: 'boutique',
...@@ -27,7 +27,7 @@ module.exports = { ...@@ -27,7 +27,7 @@ module.exports = {
}) })
}, },
/** 根据业务查询接待场景 */ /** 根据业务查询接待场景 */
findAllSence(data) { findAllSence (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findAllSence', method: 'dj.api.smartcarlife.customervisits.findAllSence',
projectName: 'boutique', projectName: 'boutique',
...@@ -35,7 +35,7 @@ module.exports = { ...@@ -35,7 +35,7 @@ module.exports = {
}) })
}, },
/**根据业务查询客户标签 */ /**根据业务查询客户标签 */
findCustomerTags(data) { findCustomerTags (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findSenceTag', method: 'dj.api.smartcarlife.customervisits.findSenceTag',
projectName: 'boutique', projectName: 'boutique',
...@@ -45,7 +45,7 @@ module.exports = { ...@@ -45,7 +45,7 @@ module.exports = {
/** /**
* 查询客户档案详情 * 查询客户档案详情
*/ */
findVisitsInfo(data) { findVisitsInfo (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.findVisitsInfo', method: 'dj.api.smartcarlife.customervisits.findVisitsInfo',
projectName: 'boutique', projectName: 'boutique',
...@@ -55,7 +55,7 @@ module.exports = { ...@@ -55,7 +55,7 @@ module.exports = {
/* /*
* 保存客户档案 * 保存客户档案
*/ */
saveVisitsInfo(data) { saveVisitsInfo (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.saveVisitsInfo', method: 'dj.api.smartcarlife.customervisits.saveVisitsInfo',
projectName: 'boutique', projectName: 'boutique',
...@@ -65,7 +65,7 @@ module.exports = { ...@@ -65,7 +65,7 @@ module.exports = {
/** /**
* 更新客户档案 * 更新客户档案
*/ */
updateVisitsInfo(data) { updateVisitsInfo (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.updateVisitsInfo', method: 'dj.api.smartcarlife.customervisits.updateVisitsInfo',
projectName: 'boutique', projectName: 'boutique',
...@@ -73,7 +73,7 @@ module.exports = { ...@@ -73,7 +73,7 @@ module.exports = {
}) })
}, },
/**查询客户档案列表 */ /**查询客户档案列表 */
getCustomerInfoList(data) { getCustomerInfoList (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.customerInfoList', method: 'dj.api.smartcarlife.customervisits.customerInfoList',
projectName: 'boutique', projectName: 'boutique',
...@@ -83,7 +83,7 @@ module.exports = { ...@@ -83,7 +83,7 @@ module.exports = {
/**接待客户素材 /**接待客户素材
* *
*/ */
getMaterialResponsePage(data) { getMaterialResponsePage (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialResponsePage', method: 'dj.api.smartcarlife.customervisits.getMaterialResponsePage',
projectName: 'boutique', projectName: 'boutique',
...@@ -91,7 +91,7 @@ module.exports = { ...@@ -91,7 +91,7 @@ module.exports = {
}) })
}, },
/**素材详情 查询素材详情 */ /**素材详情 查询素材详情 */
getMaterialDetail(data) { getMaterialDetail (data) {
return http.post({ return http.post({
method: 'dj.api.smartcarlife.customervisits.getMaterialById', method: 'dj.api.smartcarlife.customervisits.getMaterialById',
projectName: 'boutique', projectName: 'boutique',
...@@ -99,7 +99,7 @@ module.exports = { ...@@ -99,7 +99,7 @@ module.exports = {
}) })
}, },
/**直营驻店人员 */ /**直营驻店人员 */
saleOpen(data) { saleOpen (data) {
return http.post({ return http.post({
method: 'dj.api.car.boutique.resident.direct.sale.merchant', method: 'dj.api.car.boutique.resident.direct.sale.merchant',
projectName: 'boutique', projectName: 'boutique',
......
...@@ -4,11 +4,13 @@ import userApi from './userApi' ...@@ -4,11 +4,13 @@ import userApi from './userApi'
import boutiqueApi from './boutique' import boutiqueApi from './boutique'
import customerApi from './customerApi' import customerApi from './customerApi'
import pointApi from './point' import pointApi from './point'
import receptionApi from './receptionApi'
module.exports = { module.exports = {
commonApi, commonApi,
systemApi, systemApi,
userApi, userApi,
boutiqueApi, boutiqueApi,
customerApi, customerApi,
pointApi pointApi,
receptionApi
} }
import http from '../request/http'
module.exports = {
/**
* 查询对话内容
*/
findConversationDetailByBatchIdNew(data){
return http.post({
method: 'dj.pad.api.reception.findConversationDetailByBatchIdNew',
projectName: 'pad',
...data
})
},
/**查询质检列表|侧边栏 */
findCheckResultByBatchId (data) {
return http.post({
method: 'dj.pad.api.reception.findCheckResultByBatchId',
projectName: 'pad',
...data
})
},
/**话术标签 */
findRecordingTagByBatchId(data) {
return http.post({
method: 'dj.pad.api.reception.findRecordingTagByBatchId',
projectName: 'pad',
...data
})
},
}

2.41 MB | W: | H:

2.41 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -274,9 +274,12 @@ export default { ...@@ -274,9 +274,12 @@ export default {
await this.getPreRecordFail() await this.getPreRecordFail()
}, },
jumpDetail (item) { jumpDetail (item) {
if(this.firstIndex == 0){ if (this.firstIndex == 0) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/receptionDetail/index?id=${item.id}` url: `/pages/common/receptionDetail/index`,
success (res) {
res.eventChannel.emit('getData', item)
}
}) })
return return
} }
......
<template> <template>
<view class="view"> <view class="view">
<view class="classify-wrap"> <view class="classify-wrap">
<template v-for="(item,index) in classifyList"> <template v-for="(item,index) in qualityData">
<view <view
:class="['classify-item flex',{active: index == activeIndex}]" :class="['classify-item flex',{active: index == activeIndex}]"
:key="index" :key="index"
@click="activeIndex = index" @click="activeIndex = index"
> >
<view class="title">{{item.stage}}</view> <view class="title">{{item.tagGroupName}}</view>
<view class="score"><text>{{item.totalGetScore||item.totalGetScore===0?item.totalGetScore:'-'}}</text>/{{item.totalScore||item.totalScore===0?item.totalScore:'-'}}</view> <view class="score">{{item.formatScore}}</view>
</view> </view>
</template> </template>
</view> </view>
...@@ -18,7 +18,39 @@ ...@@ -18,7 +18,39 @@
scroll-y scroll-y
scroll-with-animatio scroll-with-animatio
> >
<template v-if="qualityData[activeIndex]">
<view class="quality-block">
<view class="title flex">
{{qualityData[activeIndex].tagGroupName}}
<view :class="['matched-btn flex', qualityData[activeIndex].matchedClass]">{{qualityData[activeIndex].matchedText}}</view>
</view>
<template v-for="(item,index) in qualityData[activeIndex].conversationDetailDTOList">
<block :key="index">
<view class="quality-item flex">
<view class="avatar-box">
<view :class="['sprite-icon',`icon-role-${item.role}`]"></view>
<view class="time">{{item.time}}</view>
</view>
<view class="text flex">{{item.content}}</view>
</view>
<template v-if="item.scriptRec">
<view class="script-rec">
<view class="suggestions-box">
<view class="suggestions-title">
<view class="sprite-icon icon-suggestions-icon"></view>
话术建议
</view>
<view class="text">
<rich-text :nodes="item.scriptRec"></rich-text>
</view>
</view>
</view>
</template>
</block>
</template>
</view>
</template>
</scroll-view> </scroll-view>
</view> </view>
</template> </template>
...@@ -26,36 +58,14 @@ ...@@ -26,36 +58,14 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
export default { export default {
name: '', name: '',
props: {
qualityData: {
type: Array,
default: () => []
}
},
data () { data () {
return { return {
classifyList: [
{
stage: '接待环节',
totalScore: 4
}, {
stage: '车辆交付',
totalScore: 50
},
{
stage: '需求挖掘',
totalScore: 40
}, {
stage: '促成交',
totalScore: 6
},
{
stage: '促成交1',
totalScore: 6
},
{
stage: '促成交2',
totalScore: 6
},
{
stage: '促成交3',
totalScore: 6
}
],
activeIndex: 0 activeIndex: 0
} }
}, },
...@@ -87,7 +97,7 @@ export default { ...@@ -87,7 +97,7 @@ export default {
flex-direction: column; flex-direction: column;
line-height: toRpx(40); line-height: toRpx(40);
font-size: toRpx(28); font-size: toRpx(28);
transition: all .15s; transition: all 0.15s;
background: #f5f9ff; background: #f5f9ff;
.title { .title {
color: #757980; color: #757980;
...@@ -106,5 +116,120 @@ export default { ...@@ -106,5 +116,120 @@ export default {
} }
} }
} }
.scroll-view{
height: calc(100% - #{toRpx(112)});
}
.quality-block {
.title {
height: 80rpx;
background: linear-gradient(119.9deg, #e1f7fc 0%, #f3f7ff 27%, #f7f2ff 41%, #e8f1ff 66%, #f7f2ff 100%);
font-size: 28rpx;
font-weight: 600;
padding: 0 20rpx;
&::before {
content: '';
width: 8rpx;
height: 8rpx;
background: #000000;
border-radius: 100%;
display: block;
margin-right: 16rpx;
}
.matched-btn {
margin-left: auto;
height: 56rpx;
border-radius: 28rpx;
background: #ffffff;
padding: 0 36rpx;
color: #eb4e4e;
font-size: 24rpx;
font-weight: 600;
}
.hit {
color: #35c376;
}
}
.quality-item {
padding: toRpx(20) toRpx(24);
background: #fff;
.avatar-box {
position: relative;
width: toRpx(68);
height: toRpx(96);
flex-shrink: 0;
display: flex;
align-items: center;
flex-direction: column;
.sprite-icon {
border-radius: 100%;
overflow: hidden;
flex-shrink: 0;
}
.time {
width: toRpx(70);
height: toRpx(28);
background: #ffffff;
border: toRpx(2) solid #f0f6ff;
border-radius: toRpx(28);
font-size: toRpx(20);
color: #999ea8;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
}
.text {
width: toRpx(722);
min-height: toRpx(80);
color: #292d33;
font-size: toRpx(26);
margin-left: toRpx(16);
line-height: toRpx(44);
}
}
.script-rec {
padding: 24rpx;
.suggestions-box {
background: #ffffff;
border-radius: toRpx(16);
padding: toRpx(24) toRpx(28);
box-sizing: border-box;
.suggestions-title {
display: flex;
align-items: center;
font-weight: 500;
font-size: toRpx(28);
color: #333333;
margin-bottom: toRpx(20);
.sprite-icon {
margin-right: toRpx(12);
}
}
.text {
color: #292d33;
font-size: toRpx(26);
line-height: toRpx(44);
}
.suggestions-text {
padding-bottom: toRpx(22);
border-bottom: toRpx(2) solid #f0f6ff;
margin-bottom: toRpx(24);
}
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
}
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -17,10 +17,9 @@ ...@@ -17,10 +17,9 @@
<scroll-view <scroll-view
class="table" class="table"
scroll-y scroll-y
:scroll-top="scrollTop"
> >
<template v-if="flag"> <template v-if="flag">
<template v-for="(i,index) in qualityList"> <template v-for="(i,index) in qualityData">
<view <view
class="quality-item" class="quality-item"
:key="index" :key="index"
...@@ -30,15 +29,23 @@ ...@@ -30,15 +29,23 @@
:key="`${index}-${ind}`" :key="`${index}-${ind}`"
:class="['flex item',`row-${ind + 1}`]" :class="['flex item',`row-${ind + 1}`]"
> >
<template v-if="ind != 2"> <template v-if="key == 'hitTextList'">
{{i[key]}} <view class="text-two-line">
<template v-if="i[key] && i[key].length">
<template v-for="(k,kindex) in i[key]">
<rich-text
@click="open(i[key])"
:key="`text_${index}_${kindex}`"
:nodes="k"
></rich-text>
</template>
</template>
<template v-else>-</template>
</view>
</template> </template>
<template v-else> <template v-else>
<view class="text-two-line">
{{i[key]}} {{i[key]}}
</view>
</template> </template>
</div> </div>
</template> </template>
</view> </view>
...@@ -47,6 +54,33 @@ ...@@ -47,6 +54,33 @@
</scroll-view> </scroll-view>
</view> </view>
</div> </div>
<uni-popup
ref="popup"
type="bottom"
>
<view class="detail-box">
<view
class="close-box flex"
@click="close"
>
<uni-icons
type="clear"
:size="28"
color="#76787f"
></uni-icons>
</view>
<view class="title">命中文本</view>
<view class="content">
<template v-for="(k,kindex) in hitTextDetail">
<rich-text
:key="`text_${kindex}`"
:nodes="k"
></rich-text>
</template>
</view>
</view>
</uni-popup>
</div> </div>
</template> </template>
...@@ -58,67 +92,31 @@ export default { ...@@ -58,67 +92,31 @@ export default {
ReceptionTitle ReceptionTitle
}, },
name: '', name: '',
props: {
qualityData: {
type: Array,
default: () => []
}
},
data () { data () {
return { return {
qualityTitle: Object.freeze(['一级分类', '质检得分', '命中文本']), qualityTitle: Object.freeze(['一级分类', '质检得分', '命中文本']),
scrollTop: 0,
flag: true, flag: true,
qualityList: [ qualityList: [],
{ keyList: Object.freeze(['tagGroupName', 'formatScore', 'hitTextList']),
name: '身份介绍', hitTextDetail: []
score: '2/5',
text: '我是一个测试文本'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},{
name: '身份介绍',
score: '2/5',
text: '我是一个测试文本'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},{
name: '身份介绍',
score: '2/5',
text: '我是一个测试文本'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
{
name: '服务意识',
score: '2/5',
text: '您好,我是这边的延保经理,你可以叫我小陈,接下来是由我来给您讲解'
},
],
keyList: Object.freeze(['name', 'score', 'text'])
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
open (hitTextDetail) {
this.hitTextDetail = hitTextDetail
this.$refs.popup.open("center");
},
close () {
this.$refs.popup.close()
}
} }
} }
</script> </script>
...@@ -126,7 +124,7 @@ export default { ...@@ -126,7 +124,7 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.quality-table-box { .quality-table-box {
.quality-table { .quality-table {
height: 864rpx; height: 872rpx;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
border-radius: toRpx(16); border-radius: toRpx(16);
...@@ -154,7 +152,7 @@ export default { ...@@ -154,7 +152,7 @@ export default {
border-left: toRpx(4) solid #fff; border-left: toRpx(4) solid #fff;
} }
.row-3 { .row-3 {
width: calc(100% - #{toRpx(520)}) width: calc(100% - #{toRpx(520)});
} }
.quality-content { .quality-content {
height: calc(100% - #{toRpx(88)}); height: calc(100% - #{toRpx(88)});
...@@ -188,4 +186,63 @@ export default { ...@@ -188,4 +186,63 @@ export default {
} }
} }
} }
.detail-box {
position: relative;
width: toRpx(1020);
max-height: toRpx(640);
border-radius: toRpx(40);
padding: 0 toRpx(64) toRpx(88);
box-sizing: border-box;
overflow: hidden;
&::before {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: toRpx(240);
background-image: linear-gradient(180deg, #e5edfe 0%, #ffffff 100%);
content: '';
z-index: -1;
}
&::after {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
content: '';
background-color: #fff;
z-index: -2;
}
.icon-bao {
position: absolute;
top: toRpx(48);
right: toRpx(68);
}
.close-box {
position: absolute;
width: toRpx(136);
height: toRpx(136);
top: 0;
right: 0;
justify-content: center;
z-index: 2;
}
.title {
font-weight: 500;
font-size: toRpx(40);
color: #292d33;
line-height: toRpx(64);
padding: toRpx(24) 0;
}
.content {
max-height: toRpx(400);
font-size: toRpx(30);
color: #292d33;
line-height: toRpx(48);
overflow-y: auto;
word-break: break-all;
}
}
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -23,12 +23,33 @@ export default { ...@@ -23,12 +23,33 @@ export default {
}, },
data () { data () {
return { return {
tags: ['场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱','场景塑造-优秀', '逼单技巧-薄弱'] tags: []
}
},
props: {
batchId: [String, Number]
},
watch: {
batchId: {
handler (val) {
if (val) this.getTags(val)
},
immediate: true
} }
}, },
mounted () { mounted () {
}, },
methods: { methods: {
async getTags (batchId) {
const res = await uni.$api.receptionApi.findRecordingTagByBatchId({
batchId
})
let tags = []
res.map(e =>{
tags.push(`${e.tagGroupName}-${e.tagName}`)
})
this.tags = tags
}
} }
} }
</script> </script>
......
...@@ -13,19 +13,25 @@ ...@@ -13,19 +13,25 @@
</view> </view>
接待详情 接待详情
</view> </view>
<template v-if="pageData.customerName">
<view class="reception-content-box flex"> <view class="reception-content-box flex">
<view class="reception-left-box"> <view class="reception-left-box">
<view class="customer-info"> <view class="customer-info">
<view class="name flex">恒河猴<view class="phone">18812345678</view> <view class="name flex">{{pageData.customerName}}<view class="phone">{{pageData.phoneNumber}}</view>
</view> </view>
<view class="brand-box flex"> <view class="brand-box flex">
<view class="brand flex">AITO问界</view> <view class="brand flex">{{pageData.carModel}}</view>
<view class="brand">M8</view>
</view> </view>
<view class="tips flex"> <view class="tips flex">
<view :class="['tips-text']">成交</view> <view :class="['tips-text',{deal:pageData.receptionStatus == 1}]">
<view class="score-box"> {{
88<view class="unit">分</view> { 1: '成交',0: '战败'}[pageData.receptionStatus]
}}</view>
<view
class="score-box"
v-if="pageData.score"
>
{{pageData.score}}<view class="unit">分</view>
</view> </view>
</view> </view>
...@@ -44,33 +50,41 @@ ...@@ -44,33 +50,41 @@
</view> </view>
<view class="control-box flex"> <view class="control-box flex">
<view class="sprite-icon icon-reception-share"></view> <view class="sprite-icon icon-reception-share"></view>
<view class="play-box flex"> <view
<view class="sprite-icon icon-reception-pause"></view> class="play-box flex"
00:24 @click="onHandle"
>
<view :class="['sprite-icon', `icon-reception-${status=='pause'||status=='ending' ? 'play' :'pause'}`]"></view>
{{currentTime}}
</view> </view>
</view> </view>
<view class="component-box"> <view class="component-box">
<!-- <component
:is="tab.find(e => e.id == tabId).componentName"
:batchId="61757"
></component> -->
<dialogue <dialogue
:batchId="61769" :batchId="pageData.batchId"
:hidden="tabId != 1" :hidden="tabId != 1"
:qualityData="qualityData"
:totalDuration="pageData.totalDuration"
ref="dialogueRef"
:qualityAudio="qualityAudio"
@seek="seek"
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
/> />
<quality <quality
:batchId="61769" :qualityData="qualityData"
:hidden="tabId != 2" :hidden="tabId != 2"
ref="qualityRef"
/> />
</view> </view>
</view> </view>
</view> </view>
<view class="reception-right-box"> <view class="reception-right-box">
<tags /> <tags :batchId="pageData.batchId" />
<quality-table /> <quality-table :qualityData="qualityData" />
</view> </view>
</view> </view>
</template>
</view> </view>
</template> </template>
...@@ -101,40 +115,144 @@ export default { ...@@ -101,40 +115,144 @@ export default {
componentName: 'quality' componentName: 'quality'
} }
]), ]),
tabId: 2 tabId: 1,
qualityData: [],
pageData: {},
qualityAudio: {},
currentTime: '00:00',
status: 'pause',
isOperate: true
} }
}, },
onLoad (options) { onLoad (options) {
this.getReceptionDetail(options.id) let _this = this
this.getOpenerEventChannel().on('getData', function (data) {
console.log(data)
data.totalDuration = (data.receptionEndTime - data.receptionStartTime) / 1000
_this.pageData = data || {}
if (data.batchId) _this.findCheckResultByBatchId(data.batchId)
_this.setAudio(data.recordingUrl)
})
}, },
watch: { onHide () {
currentId (n) { this.qualityAudio.stop()
if (!n) return },
const query = uni.createSelectorQuery() onUnload () {
query.select(`#menu-${n}`).boundingClientRect((data) => { this.qualityAudio.stop()
let top = data.top - (view_padding_top + menuHeight) + this.menuScrollTop
this.blockTop = `transform:translateY(${top * 2}rpx);`
}).exec()
}
}, },
computed: { computed: {
dialogueRef () {
return this.$refs.dialogueRef
},
qualityRef () {
return this.$refs.qualityRef
}
}, },
methods: { methods: {
onHandle (e) {
let {
isOperate
} = this;
if (isOperate) {
this.onPlay()
} else {
this.onPause()
}
this.isOperate = !this.isOperate
},
//音频暂停
onPause () {
const {
tabId
} = this
if (tabId == 1) this.dialogueRef.isPlayIng = false
// if (tabId == 2) this.qualityRef.clearData()
this.qualityAudio.pause()
},
//播放
onPlay () {
const {
paused
} = this.qualityAudio
if (paused) this.qualityAudio.play()
},
setAudio (recordingUrl) {
this.qualityAudio = uni.createInnerAudioContext()
this.qualityAudio.src = recordingUrl
async getReceptionDetail (id) { this.qualityAudio.onPause(() => {
return this.status = 'pause'
try {
uni.showLoading({
mask: true
}) })
const res = await uni.$api.customerApi.getReceptionDetail({ //监听音频的播放事件
id this.qualityAudio.onPlay(() => {
this.status = 'play'
}) })
} catch (error) { this.qualityAudio.onTimeUpdate(this.onTimeUpdate)
} this.qualityAudio.onEnded(() => {
this.status = 'ending'
this.currentTime = this.formatTime(this.qualityAudio.duration)
this.dialogueRef.isPlayIng = false
})
},
onTimeUpdate () {
const {
tabId
} = this
this.currentTime = this.formatTime(this.qualityAudio.currentTime)
if (tabId == 1) this.dialogueRef?.onTimeUpdate()
if (tabId == 2) this.qualityRef?.onTimeUpdate()
},
formatTime (num) {
num = Math.round(num)
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
//跳转到指定位置
seek (time) {
this.qualityAudio.seek(time)
}, },
back () { back () {
if (this.qualityAudio) this.qualityAudio?.pause()
uni.navigateBack() uni.navigateBack()
},
async findCheckResultByBatchId (batchId) {
const res = await uni.$api.receptionApi.findCheckResultByBatchId({
batchId
})
console.log(JSON.parse(JSON.stringify(res)))
res.map(item => {
item.formatScore = `${item.score || item.score === 0 ? item.score : '-'}/${item.sumScore || item.sumScore === 0 ? item.sumScore : '-'}`
let hitTextList = JSON.parse(item.hitText),
matchedClass = 'no-hit',
matchedText = '意图不匹配'
if (hitTextList && hitTextList.length) {
item.hitTextList = hitTextList.map(e => e.replace(/\n/g, '<br>'))
matchedClass = 'hit'
matchedText = '意图匹配'
}
item.matchedClass = matchedClass
item.matchedText = matchedText
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}`
if (e.mergedOffset == item.offset && !item.matched) {
e.scriptRec = scriptRec
item.matched = true
}
})
if (item.conversationDetailDTOList.findIndex(e => e.scriptRec) == -1) {
/**时间戳都对不上时 话术推荐加到最后 */
item.conversationDetailDTOList[item.conversationDetailDTOList.length - 1].scriptRec = scriptRec
}
}
})
this.qualityData = res
} }
} }
} }
...@@ -219,6 +337,12 @@ export default { ...@@ -219,6 +337,12 @@ export default {
right: toRpx(32); right: toRpx(32);
bottom: toRpx(28); bottom: toRpx(28);
line-height: toRpx(40); line-height: toRpx(40);
.tips-text {
color: #f24724;
}
.deal {
color: #2cca74;
}
&-box { &-box {
opacity: 0.85; opacity: 0.85;
color: #2cca74; color: #2cca74;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!