Commit b1768a23 by 李伟康

"新增接待记录质检页面及功能优化"

1 parent 29ff15c6
...@@ -177,7 +177,8 @@ ...@@ -177,7 +177,8 @@
"pages/sceneMarket/index/index", "pages/sceneMarket/index/index",
"pages/sceneMarket/clue/clue", "pages/sceneMarket/clue/clue",
"pages/sceneMarket/clueForm/clueForm", "pages/sceneMarket/clueForm/clueForm",
"pages/sceneMarket/materialPage/materialPage" "pages/sceneMarket/materialPage/materialPage",
"pages/newReceptionRecords/newReceptionRecords"
] ]
}, },
{ {
......
...@@ -161,7 +161,6 @@ ...@@ -161,7 +161,6 @@
} }
} }
} }
.time-line-box { .time-line-box {
box-sizing: border-box; box-sizing: border-box;
width: calc(100% - var(--fontSize16)); width: calc(100% - var(--fontSize16));
......
<!--packageEquity/pages/index/components/record-item/recordItem.wxml--> <!--packageEquity/pages/index/components/record-item/recordItem.wxml-->
<wxs src="../../../../index.wxs" module="filter" /> <wxs src="../../../../index.wxs" module="filter" />
<view class="content"> <view class="content">
<block wx:if="{{!hideScore && itemInfo.checkHistoryFlag == 0}}">
<view class="record-header new-record">
<view class="base-message">
<view>
<view class="record-name text-hide">
<text class="value">{{itemInfo.customerName}}</text>
<text class="order-name" wx:if="{{itemInfo.realCustomerName && itemInfo.realCustomerName != itemInfo.customerName}}">({{filter.desensitizeName(itemInfo.realCustomerName)}})</text>
</view>
<text class="record-phone" data-phone="{{itemInfo.phoneNumber}}">{{filter.desensitizePhoneNumber(itemInfo.phoneNumber)}}</text>
</view>
<view>
<view wx:if="{{itemInfo.employeeName && showEmployeeName }}" catchtap="phoneCall" data-phone="{{itemInfo.employeePhone}}" class="employee-name text-hide">{{itemInfo.employeeName}}</view>
<block wx:if="{{hideScore && itemInfo.violationStatus != null}}">
<view class="violation-status violation-{{itemInfo.violationStatus}}">
{{violationStatusText[itemInfo.violationStatus]}}
</view>
</block>
</view>
</view>
<view class="record-message">
<view>
<text class="record-label" wx:if="{{itemInfo.carModel}}">{{itemInfo.carModel}}</text>
<text class="record-label" wx:if="{{itemInfo.tag}}">{{itemInfo.tag}}</text>
<text class="record-label-error" wx:if="{{itemInfo.qualityCheckScore <= 20 && itemInfo.qualityCheckScore !== null && itemInfo.qualityCheckScore !== undefined && !hideScore}}">疑似虚假接待</text>
</view>
<view wx:if="{{!hideScore}}">
<text class="record-amount" wx:if="{{itemInfo.orderStatus == 1 && itemInfo.orderAmount}}">
<text>¥{{filter.convertCentsToYuan(itemInfo.orderAmount)}}</text>
<text class="line"></text>
</text>
<text class="record-score {{itemInfo.qualityCheckScore > 20 ? 'black': ''}}" wx:if="{{itemInfo.qualityCheckScore || itemInfo.qualityCheckScore === 0}}">
<text class="value">{{itemInfo.qualityCheckScore}}</text><text class="unit">分</text>
</text>
<text class="record-score" wx:if="{{itemInfo.qualityCheckScore !== 0 && !itemInfo.qualityCheckScore}}">
<text>分析中</text>
</text>
</view>
</view>
</view>
</block>
<block wx:else>
<block wx:if="{{hideScore && showReason && itemInfo.violationReason}}"> <block wx:if="{{hideScore && showReason && itemInfo.violationReason}}">
<view class="violation-reason" catchtap="showViolationReasonFun">处理意见</view> <view class="violation-reason" catchtap="showViolationReasonFun">处理意见</view>
</block> </block>
...@@ -84,6 +125,7 @@ ...@@ -84,6 +125,7 @@
<view class="time-bt pad-4">{{itemInfo.endTimeStr}}</view> <view class="time-bt pad-4">{{itemInfo.endTimeStr}}</view>
</view> </view>
</view> </view>
</block>
</view> </view>
......
// packageEquity/pages/receptionDetail/components/dialogue/dialogue.js
import api from "~/utils/request/request.js";
let thisPage = null
import watchScrollMixin from '../../../receptionDetail/components/watchScrollMixin'
Component({
behaviors: [watchScrollMixin],
/**
* 组件的属性列表
*/
properties: {
recordData: Object,
batchId: {
type: Number,
observer: function (n) {
const data = {
batchId: n,
};
this.findConversationDetailByBatchIdNew(data)
}
},
totalDuration: {
type: Number,
value: 0
},
qualityData: {
type: Array,
observer: function (n) {
if (n.length) this.findCbByBatchId(n)
}
}
},
lifetimes: {
ready() {},
detached() {
this.IntersectionObserver?.disconnect()
}
},
/**
* 组件的初始数据
*/
data: {
progress: 0,
dialogueList: [],
},
/**
* 组件的方法列表
*/
methods: {
findCbByBatchId(data) {
let {
totalDuration
} = this.data.recordData,
margin = 20
totalDuration = totalDuration / 1000
wx.$util.getViewInfo('.axis-bar', ({
height: containerHeight,
top: barTop
}) => {
if (containerHeight == 0) {
return setTimeout(() => {
this.findCbByBatchId()
}, 100)
}
this.barTop = barTop
this.containerHeight = containerHeight
data?.sort((a, b) => a.offset - b.offset).forEach(e => {
const {
offset: mergedOffset,
} = e
e.top = mergedOffset / totalDuration * containerHeight
e.docTop = mergedOffset / totalDuration * containerHeight
e.text_id = `text_${mergedOffset}`
e.mergedOffset = mergedOffset
})
data?.map((e, index) => {
// 检查并调整 top 值,避免重叠
for (let i = 0; i < index; i++) {
if (e.top < data[i].top + margin &&
e.top + margin > data[i].top) {
// 如果重叠,将当前元素的 top 设置为前一个元素的底部加上 margin
e.top = data[i].top + margin;
}
}
})
this.setData({
axisList: data
})
}, this)
},
getAudioObject() {
thisPage = wx.$router.getPageInstance()
if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio
else setTimeout(() => {
this.getAudioObject()
}, 100)
},
onTimeUpdate() {
const {
dialogueList
} = this.data, {
paused
} = this.innerAudioContext, {
mergedOffset
} = this.setProgress(),
item = dialogueList.find(e => e.mergedOffset == mergedOffset)
if (!paused) this.setData({
isPlayIng: true
})
if (this.data.isScrollling) return
if (item && item.id) this.setTopId(item, true)
},
setTopId(item, scroll = false) {
const {
dialogueList
} = this.data
let centerIndex = dialogueList.findIndex(e => e.text_id == item.text_id)
centerIndex -= 3
if (centerIndex < 0) centerIndex = 0
wx.nextTick(() => {
this.setData({
activeId: item.text_id,
})
})
if (scroll) this.setData({
toId: dialogueList[centerIndex].text_id
})
},
setProgress() {
const {
duration,
currentTime
} = this.innerAudioContext,
mergedOffset = Math.ceil(currentTime)
this.setData({
progress: mergedOffset / duration * 100
})
return {
currentTime,
mergedOffset
}
},
toDefenceDetail(e) {
let {
item,
} = e.currentTarget.dataset
this.setData({
toId: item.text_id
})
this.setData({
isScrollling: true
})
this.touchend()
},
seekPlay(e) {
let {
item,
click,
scroll
} = e.currentTarget.dataset, {
activeId
} = this.data
if (!item) return
thisPage.seek(item.mergedOffset)
this.setTopId(item, scroll)
if (click && item.text_id == activeId) {
const {
paused
} = this.innerAudioContext
if (paused) thisPage.play()
else thisPage.onPause()
thisPage.setData({
isOperate: !paused
})
} else {
thisPage.play()
thisPage.setData({
isOperate: false
})
}
},
formatTime(num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
relativeToViewport() {
if (this.IntersectionObserver) return
this.IntersectionObserver = this.createIntersectionObserver({
observeAll: true
})
this.IntersectionObserver.relativeToViewport({
bottom: 1000,
top: 0,
}).observe('.item', res => {
const {
index
} = res.dataset, {
dialogueList
} = this.data, {
originalList
} = this,
item = dialogueList[index]
if (!item?.visible && res.intersectionRatio > 0) {
this.setData({
[`dialogueList[${index}]`]: originalList[index]
})
}
})
},
/**对话列表 */
async findConversationDetailByBatchIdNew(params) {
const {
data: dialogueList
} = await api.post("dj.api.car.boutique.inspection.findConversationDetailByBatchIdNew", params)
this.getAudioObject()
dialogueList?.map(e => {
e.visible = true
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
if (e?.recordingCheckResultList && e.recordingCheckResultList.length) {
e.recordingCheckResultList.map(i => {
i.showCheckDetail = false
if (i.scriptRec) {
let [scriptRec] = JSON.parse(i.scriptRec)
i.scriptRec = scriptRec.replace(/\n/g, '<br>')
}
})
}
})
this.setData({
flag: true,
})
this.originalList = dialogueList
this.setDialogueData(dialogueList)
},
setDialogueData(dialogueList) {
wx.$util.showLoading('加载中...')
const batchSize = 100
let batch = []
// 遍历对话列表,累积数据
for (let i = 0; i < dialogueList.length; i++) {
batch.push({
visible: false,
text_id: dialogueList[i].text_id,
id: dialogueList[i].id,
mergedOffset: dialogueList[i].mergedOffset
});
// 当累积的数据达到批量大小时,执行 setData 更新
if ((i + 1) % batchSize === 0 || i === dialogueList.length - 1) {
this.setData({
dialogueList: [...this.data.dialogueList, ...batch]
});
batch = []; // 清空累积的数据,准备下一批
}
}
// // 确保最后不足100条的数据也被更新
if (batch.length > 0) {
this.setData({
dialogueList: [...this.data.dialogueList, ...batch]
})
}
// // 更新完成后清除加载提示
wx.$util.hideLoading();
this.relativeToViewport();
},
/** 查询质检侧边栏 (质检使用id匹配,攻防用偏移量匹配) */
switchDetail(e) {
const {
index,
value,
ind,
key
} = e.currentTarget.dataset
let target = `dialogueList[${index}]`
if (ind > -1) target = `dialogueList[${index}].recordingCheckResultList[${ind}]`
this.setData({
[`${target}.${key}`]: !value
})
},
touchstart() {
this.setData({
isScrollling: true
})
this.clearTimer()
},
touchend() {
this.touchTimer = setTimeout(() => {
this.setData({
isScrollling: false
})
this.clearTimer()
}, 3e3)
},
clearTimer() {
if (this.touchTimer) {
clearTimeout(this.touchTimer)
this.touchTimer = null
}
},
onPause() {
this.setData({
isPlayIng: false
})
},
barSeek(e) {
function findNearest(arr, target) {
let closest = arr[0];
let minDiff = Math.abs(target - arr[0]);
for (let i = 1; i < arr.length; i++) {
const diff = Math.abs(target - arr[i]);
if (diff < minDiff) {
minDiff = diff;
closest = arr[i];
}
}
return closest;
}
let [touches] = e.touches, {
barTop,
containerHeight
} = this, {
duration
} = this.innerAudioContext, {
dialogueList
} = this.data
if (touches) {
let {
clientY
} = touches,
progress = (clientY - barTop) / containerHeight * 100,
offsetList = dialogueList.map(i => i.mergedOffset),
mergedOffset = findNearest(offsetList, duration * progress / 100),
item = dialogueList.find(i => i.mergedOffset == mergedOffset)
this.seekPlay({
currentTarget: {
dataset: {
item,
scroll: true
}
}
}, false)
}
},
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<view class="view">
<block wx:if="{{flag}}">
<block wx:if="{{dialogueList.length}}">
<scroll-view class="scroll-view" enhanced scroll-y scroll-into-view="{{toId}}" show-scrollbar="{{false}}" bindtouchstart="touchstart" bindtouchend="touchend" scroll-with-animation bindscroll="watchScrollTrack" data-event-code="dialogue">
<block wx:for="{{dialogueList}}" wx:key="index">
<view class="item {{activeId == item.text_id?'active':''}}" id="{{item.text_id}}" data-click bindtap="seekPlay" data-item="{{item}}" data-index="{{index}}">
<block wx:if="{{item.visible}}">
<view class="avatar-box">
<view class="icon">
<gl-image class="icon" webp src="/equity/reception/role-{{item.role}}.png" />
</view>
<view class="time">{{item.time}}</view>
</view>
<view class="text">
{{item.content}}
</view>
</block>
<block wx:else>
<view class="loading"></view>
</block>
</view>
<!-- 意图匹配 -->
<block wx:if="{{item.recordingCheckResultList}}">
<block wx:for="{{item.recordingCheckResultList}}" wx:key="ind" wx:for-item="i" wx:for-index="ind">
<view class="detail-box {{i.showCheckDetail?'up':'down'}}">
<view class="text-box">
<view class="btn" bindtap="switchDetail" data-index="{{index}}" data-ind="{{ind}}" data-key="showCheckDetail" data-value="{{i.showCheckDetail}}">
意图匹配
<gl-image class="arrow" webp src="/equity/date-arrow.png" />
</view>
{{i.tagGroupName}}
<view class="score">{{i.score}}分</view>
</view>
<view class="content-box">
<block wx:if="{{!i.scriptRec}}">
<view class="suggestions-box no">
<gl-image class="icon" webp src="/equity/reception/no-suggestions.png" />
暂无话术推荐
</view>
</block>
<block wx:else>
<view class="suggestions-box">
<view class="title">
<gl-image class="icon" webp src="/equity/reception/suggestions-icon.png" />
话术推荐
</view>
<view class="text">
<rich-text nodes="{{i.scriptRec}}"></rich-text>
</view>
</view>
</block>
</view>
</view>
</block>
</block>
</block>
<view class="safeAreaInset">到底了!</view>
</scroll-view>
</block>
<block wx:else>
<view class="no-data">
<image class="no-data-img" src="/packageEquity/images/noData.png" />
<view class="list-not">暂无数据</view>
</view>
</block>
</block>
<view class="axis-bar-area" bindtap="barSeek" hidden="{{!qualityData.length}}">
<view class="axis-bar">
<view class="progress-bar" style="height:{{progress + '%'}}"></view>
<block wx:for="{{axisList}}" wx:key="index">
<view class="axis-item {{activeId == item.text_id?'axis-active':''}}" style="top:{{item.docTop + 'px'}};">
<view class="axis-dot {{!isPlayIng && !isScrollling?'':'radius'}}" catchtap="seekPlay" data-item="{{item}}" data-scroll></view>
</view>
<block wx:if="{{!isPlayIng && !isScrollling}}">
<view class="axis-text {{activeId == item.text_id?'axis-text-active':''}}" catchtap="seekPlay" data-item="{{item}}" data-scroll style="top:{{item.top + 'px'}};">
{{item.tagGroupName}}+{{item.score}}
</view>
</block>
</block>
<view class="hide-bar">
<block wx:for="{{axisList}}" wx:key="index">
<block wx:if="{{item.inspectionConversationDetailId}}">
<view class="axis-line {{item.colorName}}" style="height:{{item.height + 20 + 'px'}};top:{{item.docTop - 10 + 'px'}};"></view>
</block>
</block>
</view>
</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/newReceptionRecords/components/quality/quality.js
let thisPage = null
Component({
/**
* 组件的属性列表
*/
properties: {
qualityData: Array
},
lifetimes: {
ready() {
this.getAudioObject()
}
},
/**
* 组件的初始数据
*/
data: {
activeIndex: 0,
activeId: ''
},
/**
* 组件的方法列表
*/
methods: {
getAudioObject() {
thisPage = wx.$router.getPageInstance()
if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio
else setTimeout(() => {
this.getAudioObject()
}, 100)
},
changeClassifyType(e) {
let {
index
} = e.currentTarget.dataset
this.setData({
activeIndex: index
})
},
onTimeUpdate() {
const {
mergedOffset
} = this.setProgress()
this.setData({
activeId: `text_${mergedOffset}`
})
},
setProgress() {
const {
currentTime
} = this.innerAudioContext,
mergedOffset = Math.ceil(currentTime)
return {
currentTime,
mergedOffset
}
},
seekPlay(e) {
let {
activeId
} = this.data, {
item,
} = e.currentTarget.dataset
if (!item) return
thisPage.seek(item.mergedOffset)
if (item.text_id == activeId) {
const {
paused
} = this.innerAudioContext
if (paused) thisPage.play()
else thisPage.onPause()
thisPage.setData({
isOperate: !paused
})
} else {
thisPage.play()
thisPage.setData({
isOperate: false
})
}
}
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.flex {
display: flex;
align-items: center;
}
.view {
height: 100%;
width: 100%;
position: relative;
.classify-wrap {
margin: 0 28rpx;
box-sizing: border-box;
width: calc(100% - 56rpx);
height: 112rpx;
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
.classify-item {
min-width: 160rpx;
height: 100%;
padding: 0 24rpx;
flex-shrink: 0;
justify-content: center;
flex-direction: column;
line-height: 40rpx;
font-size: 28rpx;
transition: all 0.15s;
background: #f5f9ff;
.title {
color: #757980;
}
.score {
color: #347bff;
font-weight: 600;
}
}
.active {
border-radius: 16rpx 16rpx 0 0;
background: #ffffff;
.title {
color: #292d33;
font-weight: 600;
}
}
}
.scroll-view {
height: calc(100% - 112rpx);
}
.quality-block {
width: calc(100% - 56rpx);
margin: 0 28rpx;
.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: 20rpx 24rpx;
background: #fff;
.avatar-box {
position: relative;
width: 68rpx;
height: 96rpx;
flex-shrink: 0;
display: flex;
align-items: center;
flex-direction: column;
.icon {
width: 68rpx;
height: 68rpx;
border-radius: 100%;
overflow: hidden;
flex-shrink: 0;
}
.time {
width: 70rpx;
height: 28rpx;
background: #ffffff;
border: 2rpx solid #f0f6ff;
border-radius: 28rpx;
font-size: 20rpx;
color: #999ea8;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
}
.text {
width: 508rpx;
min-height: 80rpx;
color: #292d33;
font-size: 26rpx;
margin-left: 16rpx;
line-height: 44rpx;
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
.script-rec {
padding: 24rpx;
.suggestions-box {
background: #ffffff;
border-radius: 16rpx;
padding: 24rpx 28rpx;
box-sizing: border-box;
.suggestions-title {
display: flex;
align-items: center;
font-weight: 500;
font-size: 28rpx;
color: #333333;
margin-bottom: 20rpx;
.icon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-right: var(--fontSize12);
}
}
.text {
color: #292d33;
font-size: 26rpx;
line-height: 44rpx;
}
.suggestions-text {
padding-bottom: 22rpx;
border-bottom: 2rpx solid #f0f6ff;
margin-bottom: 24rpx;
}
}
}
.active {
background: #f0f6ff;
.text {
font-weight: 500;
}
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="view">
<view class="classify-wrap">
<block wx:for="{{qualityData}}" wx:key="index">
<view class="classify-item flex {{index == activeIndex?'active':''}}" bindtap="changeClassifyType" data-index="{{index}}">
<view class="title">{{item.tagGroupName}}</view>
<view class="score">{{item.formatScore}}</view>
</view>
</block>
</view>
<scroll-view class="scroll-view" enhanced scroll-y scroll-with-animation scroll-into-view="{{activeId}}">
<block wx: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>
<block wx:for="{{qualityData[activeIndex].conversationDetailDTOList}}" wx:key="index">
<block wx:if="{{item.text_id}}">
<view id="{{item.text_id}}" class="quality-item flex {{item.text_id == activeId?'active':''}}" bind:tap="seekPlay" data-item="{{item}}">
<view class="avatar-box">
<view class="icon">
<gl-image class="icon" webp src="/equity/reception/role-{{item.role}}.png" />
</view>
<view class="time">{{item.time}}</view>
</view>
<view class="text flex">{{item.content}}</view>
</view>
</block>
<block wx:if="{{item.scriptRec}}">
<view class="script-rec">
<view class="suggestions-box">
<view class="suggestions-title">
<gl-image class="icon" webp src="/equity/reception/suggestions-icon.png" />
话术推荐
</view>
<view class="text">
<rich-text nodes="{{item.scriptRec}}"></rich-text>
</view>
</view>
</view>
</block>
</block>
</view>
</block>
</scroll-view>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/receptionDetail/receptionDetail.js
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
import {
getRecordDetailList,
getShortUrl,
findCheckResultByBatchId
} from "../../receptionRecordsApi"
import dayjs from 'dayjs'
Page({
behaviors: [reportPageTrackMixin],
/**
* 页面的初始数据
*/
data: {
navBarHeight: 113.5,
typeLists: ['对话', '质检'],
qualityAudio: '',
activeIndex: 0,
status: 'pause',
currentTime: '00:00', //当前音频的播放位置
isOperate: true,
receptionStartTime: ''
},
/**
* 生命周期函数--监听页面加载
*/
async onLoad(options) {
console.log(options, 'onload')
if (Object.keys(options).length) {
// 调用接口获取详情,默认取第一条
const time = dayjs(+options.receptionStartTime).format('YYYY-MM-DD')
console.log(time)
this.setData({
receptionStartTime: options.receptionStartTime
})
const params = {
batchId: options.batchId,
merchantNo: options.merchantNo,
startDateTime: time,
endDateTime: time
}
const res = await getRecordDetailList(params)
let {
code,
data,
message
} = res
if (code == 0) {
const detailInfo = data.list[0] || {}
if (Object.keys(detailInfo).length) {
detailInfo.staticDate = new Date(detailInfo.staticDate).format('MM月dd日')
this.setData({
record: detailInfo,
}, () => {
wx.$util.getViewInfo('.reception-wrap', ({
height
}) => {
this.setData({
receptionWrapHeight: `${height * 2}rpx`
})
})
this.findCheckResultByBatchId(detailInfo.batchId)
this.setAudio()
})
}
}
}
},
async findCheckResultByBatchId(batchId) {
try {
const {
code,
data,
message
} = await findCheckResultByBatchId({
batchId
})
if (code == 0) {
data.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
let [scriptRec] = JSON.parse(item.scriptRec)
if (scriptRec) scriptRec = scriptRec.replace(/\n/g, '<br>')
if (item.conversationDetailDTOList && item.conversationDetailDTOList.length) {
item.conversationDetailDTOList.map(e => {
e.time = this.formatTime(e.mergedOffset)
e.text_id = `text_${e.mergedOffset}`
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
}
} else item.conversationDetailDTOList = [{
scriptRec: scriptRec || '暂无建议'
}]
})
this.setData({
qualityData: data
})
} else throw message
} catch (error) {
wx.$util.showToast(error)
}
},
back() {
if (this.qualityAudio) this.qualityAudio.pause()
wx.$router.back()
},
onHandle(e) {
let {
isOperate
} = this.data;
if (isOperate) {
this.play()
} else {
this.onPause()
}
this.setData({
isOperate: !isOperate
})
},
//音频暂停
onPause() {
const {
activeIndex
} = this.data
if (activeIndex == 0) this.dialogueRef().onPause()
this.qualityAudio.pause()
},
//播放
play() {
const {
paused
} = this.qualityAudio
if (paused) this.qualityAudio.play()
},
//跳转到指定位置
seek(time) {
this.qualityAudio.seek(time)
},
setAudio() {
this.qualityAudio = wx.createInnerAudioContext({
useWebAudioImplement: true
})
this.qualityAudio.src = this.data.record.fileUrl
this.qualityAudio.onPause(() => {
this.setData({
status: 'pause'
})
this.setKeepScreenOn()
})
//监听音频的播放事件
this.qualityAudio.onPlay(() => {
this.setData({
status: 'start'
})
this.setKeepScreenOn(true)
})
this.qualityAudio.onTimeUpdate(this.onTimeUpdate)
this.qualityAudio.onEnded(() => {
this.setData({
status: 'ending',
currentTime: this.formatTime(this.qualityAudio.duration)
})
this.dialogueRef().setData({
isPlayIng: false
})
this.setKeepScreenOn()
})
},
onTimeUpdate() {
const {
activeIndex
} = this.data
this.setData({
currentTime: this.formatTime(this.qualityAudio.currentTime)
})
if (activeIndex == 0) this.dialogueRef().onTimeUpdate()
if (activeIndex == 1) this.qualityRef().onTimeUpdate()
},
formatTime(seconds) {
let minutes = Math.floor(seconds / 60);
let remainingSeconds = Math.floor(seconds % 60); // 直接取整
minutes = minutes.toString().padStart(2, '0');
remainingSeconds = remainingSeconds.toString().padStart(2, '0');
return `${minutes}:${remainingSeconds}`;
},
changeType(e) {
let {
index
} = e.currentTarget.dataset
this.setData({
activeIndex: index
})
},
navbarReady(e) {
let navBarHeight = e.detail.height;
this.setData({
navBarHeight,
});
},
dialogueRef() {
return this.selectComponent('#dialogue')
},
qualityRef() {
return this.selectComponent('#quality')
},
async share(e) {
let userInfo = wx.$util.getUserInfo() || {}
const {
record
} = this.data,
receptionStatus = {
1: '成交',
2: '战败',
3: '未知'
} [record.orderStatus], {
endTime,
totalDuration,
startTime,
merchantNo,
batchId,
receptionStartTimeTamp
} = record
console.log(record, 'record')
// 获取短链地址
const res = await getShortUrl({
merchantNo,
batchId,
receptionStartTime: receptionStartTimeTamp
})
console.log(res, 'res')
if (res.code == '0') {
// 门店 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址(更换成短链)
let text = [record.merchantName, wx.$util.tsFormatTime(startTime, 'Y年M月D日 h:m:s'), wx.$util.tsFormatTime(endTime, 'Y年M月D日 h:m:s'), this.format(totalDuration), receptionStatus, res.data].join(' - ')
wx.$util.setCopyData(text)
} else {
wx.$util.showToast('获取短链失败')
}
// wx.$util.showToast('复制成功')
},
format(seconds) {
seconds = Math.floor(seconds / 1000)
let formattedTime = ''
if (seconds < 60) return seconds + '秒'
else {
let hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
remainingSeconds = seconds % 60
if (hours > 0) formattedTime += hours + '小时'
if (minutes > 0 || hours > 0) formattedTime += minutes + '分'
if (remainingSeconds > 0) formattedTime += remainingSeconds + '秒'
return formattedTime
}
},
//屏幕是否常亮
setKeepScreenOn(keepScreenOn = false) {
wx.setKeepScreenOn({
keepScreenOn
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.onPageShow()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
this.qualityAudio.stop()
this.onPageHide()
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
this.qualityAudio.stop()
this.onPageHide()
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {
"quality": "./components/quality/quality",
"record-item": "../index/components/record-item/recordItem",
"dialogue":"./components/dialogue/dialogue"
},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
page {
background-color: #FAFAFA !important;
overflow: hidden;
}
.navigation-title {
font-weight: 500;
font-size: var(--fontSize30);
color: #282829;
line-height: var(--fontSize44);
width: var(--fontSize360);
text-align: center;
}
.bg {
width: 100%;
height: var(--fontSize800);
background: url('https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/reception-nav--bg.png') no-repeat;
background-size: 100% var(--fontSize800);
position: fixed;
left: 0;
top: 0;
z-index: -1;
}
.reception-wrap {
padding: 0 var(--fontSize28);
.reception-info {
width: 100%;
height: var(--fontSize152);
background: #FFFFFF;
border-radius: var(--fontSize28);
margin: var(--fontSize12) 0 var(--fontSize28) 0;
}
.reception-nav {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 0 var(--fontSize16) 0;
}
.reception-types {
display: flex;
align-items: center;
.type {
width: var(--fontSize144);
line-height: var(--fontSize40);
padding: var(--fontSize10) 0;
background: #FFFFFF;
border-radius: var(--fontSize8);
margin-right: var(--fontSize16);
font-size: var(--fontSize28);
color: #5A5E66;
font-weight: 400;
text-align: center;
.avg {
font-size: var(--fontSize20);
font-family: 'numberNor';
}
}
.active {
font-weight: 600;
color: #fff;
background: #347bff;
}
}
.reception-operate {
display: flex;
align-items: center;
.img {
width: var(--fontSize52);
height: var(--fontSize52);
}
.share {
margin-right: var(--fontSize12)
}
.audio-wrap {
width: var(--fontSize140);
height: var(--fontSize60);
display: flex;
align-items: center;
background: #FFFFFF;
padding: var(--fontSize4);
border-radius: var(--fontSize28);
box-sizing: border-box;
.time {
font-weight: 400;
font-size: var(--fontSize26);
color: #757980;
margin-left: var(--fontSize4);
}
}
}
}
.type-wrap {
position: relative;
.component-item {
// width: calc(100% - var(--fontSize56));
width: 100%;
height:100%;
position: absolute;
top: 0;
left: 0;
// left: var(--fontSize28);
transition: all 0.15s;
}
.hide {
opacity: 0;
z-index: -1;
}
}
.violation-btn-box {
padding: 40rpx 64rpx;
.violation-btn {
color: #ffffff;
font-size: 32rpx;
font-weight: 500;
height: 88rpx;
border-radius: 12rpx;
background: #347bff;
line-height: 88rpx;
text-align: center;
}
}
\ No newline at end of file \ No newline at end of file
<!--packageEquity/pages/receptionDetail/receptionDetail.wxml-->
<glsx-privacy appletName="生意助手员工版" bind:agreeClick="agreeClick" bind:disagreeClick="disagreeClick"></glsx-privacy>
<navigation-bar class="navigation-header" bindnavbarReady="navbarReady" showBack="true" navStyle="{{'background-color: rgba(0,0,0,0);box-shadow:none;' }}" bindback="back">
<view class="navigation-title text-hide ">{{record.staticDate}}{{record.employeeName}}接待</view>
</navigation-bar>
<view class="bg"></view>
<view class="reception-wrap" style="padding-top:{{ navBarHeight }}px;position: relative;">
<view class="reception-info" wx:if="{{record}}">
<record-item record="{{record}}" hideScore="{{record.hideScore}}" showReason="{{record.violationReason}}" orderAmount="{{record.orderAmount}}"></record-item>
</view>
<view class="reception-nav">
<view class="reception-types">
<block wx:for="{{typeLists}}" wx:key="index">
<view class="type {{activeIndex==index?'active':''}}" data-index="{{index}}" bind:tap="changeType">{{item}}</view>
</block>
</view>
<view class="reception-operate">
<gl-image class="img share" webp src="/equity/share-icon.png" bind:tap="share" />
<view class="audio-wrap" bind:tap="onHandle">
<gl-image class="img" webp src="/equity/play.png" wx:if="{{status=='pause'||status=='ending'}}" />
<gl-image class="img" webp src="/equity/stop.png" wx:else />
<view class="time">{{currentTime}}</view>
</view>
</view>
</view>
</view>
<view class="type-wrap" style="height:calc(100vh - {{receptionWrapHeight}})">
<block wx:if="{{receptionWrapHeight}}">
<view class="component-item {{activeIndex != 0 ?'hide':''}}">
<dialogue id="dialogue" batchId="{{record.batchId}}" recordData="{{record}}" qualityData="{{qualityData}}"></dialogue>
</view>
<view class="component-item {{activeIndex != 1?'hide':''}}">
<quality id="quality" qualityData="{{qualityData}}"></quality>
</view>
</block>
</view>
\ No newline at end of file \ No newline at end of file
// packageEquity/pages/receptionDetail/receptionDetail.js // packageEquity/pages/receptionDetail/receptionDetail.js
import reportPageTrackMixin from '~/mixins/reportPageTrackMixin' import reportPageTrackMixin from '~/mixins/reportPageTrackMixin'
import { getRecordDetailList, getShortUrl } from "../../receptionRecordsApi" import {
getRecordDetailList,
getShortUrl
} from "../../receptionRecordsApi"
Page({ Page({
behaviors: [reportPageTrackMixin], behaviors: [reportPageTrackMixin],
...@@ -31,6 +34,7 @@ Page({ ...@@ -31,6 +34,7 @@ Page({
console.log(options, 'onload') console.log(options, 'onload')
// 若有参数,则是短链进入 // 若有参数,则是短链进入
if (Object.keys(options).length) { if (Object.keys(options).length) {
if (options.new) return wx.$router._to('/packageEquity/pages/newReceptionRecords/newReceptionRecords', options, 'redirectTo') //跳转到新质检
// 调用接口获取详情,默认取第一条 // 调用接口获取详情,默认取第一条
const time = new Date(+options.receptionStartTime).format('yyyy-MM-dd') const time = new Date(+options.receptionStartTime).format('yyyy-MM-dd')
console.log(time) console.log(time)
...@@ -210,10 +214,10 @@ Page({ ...@@ -210,10 +214,10 @@ Page({
} = this.data, } = this.data,
showViolationBtn = false, showViolationBtn = false,
autoPlayConfig = {} autoPlayConfig = {}
if(options.hideScore && options.violationStatus == 1){ if (options.hideScore && options.violationStatus == 1) {
showViolationBtn = true showViolationBtn = true
autoPlayConfig = { autoPlayConfig = {
auto:true auto: true
} }
} }
this.setData({ this.setData({
...@@ -296,7 +300,11 @@ Page({ ...@@ -296,7 +300,11 @@ Page({
} = record } = record
console.log(record, 'record') console.log(record, 'record')
// 获取短链地址 // 获取短链地址
const res = await getShortUrl({merchantNo, batchId, receptionStartTime: receptionStartTimeTamp}) const res = await getShortUrl({
merchantNo,
batchId,
receptionStartTime: receptionStartTimeTamp
})
console.log(res, 'res') console.log(res, 'res')
if (res.code == '0') { if (res.code == '0') {
// 门店 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址(更换成短链) // 门店 - 接待开始时间 - 接待时长 - 员工标记的接待结果 - 接待录音mp3地址(更换成短链)
...@@ -353,6 +361,7 @@ Page({ ...@@ -353,6 +361,7 @@ Page({
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {
if(this.options.new) return
this.qualityAudio.stop() this.qualityAudio.stop()
this.onPageHide() this.onPageHide()
}, },
...@@ -361,7 +370,8 @@ Page({ ...@@ -361,7 +370,8 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
this.qualityAudio.stop() if(this.options.new) return
this.qualityAudio?.stop()
this.onPageHide() this.onPageHide()
}, },
......
...@@ -51,8 +51,8 @@ Page({ ...@@ -51,8 +51,8 @@ Page({
} = this.data, } = this.data,
tabIndex = recordTabList.findIndex(e => e.value == options.tabValue), tabIndex = recordTabList.findIndex(e => e.value == options.tabValue),
violationStatus = 1 violationStatus = 1
if(options.tabValue != null) violationStatus = options.tabValue if (options.tabValue != null) violationStatus = options.tabValue
if(tabIndex == -1) tabIndex = 0 if (tabIndex == -1) tabIndex = 0
this.setData({ this.setData({
hideScore: true, hideScore: true,
tabIndex, tabIndex,
...@@ -124,13 +124,6 @@ Page({ ...@@ -124,13 +124,6 @@ Page({
} }
return obj return obj
}, },
// 详情页面
goReceptionDetail(e) {
let {
item
} = e.currentTarget.dataset
wx.$router.go('receptionDetail', item)
},
navbarReady(e) { navbarReady(e) {
let navBarHeight = e.detail.height; let navBarHeight = e.detail.height;
this.setData({ this.setData({
...@@ -331,10 +324,15 @@ Page({ ...@@ -331,10 +324,15 @@ Page({
} = this.data, { } = this.data, {
record record
} = e.currentTarget.dataset } = e.currentTarget.dataset
if (record.checkHistoryFlag == 0) {
wx.$router._to('/packageEquity/pages/newReceptionRecords/newReceptionRecords', record, 'navigateTo') //跳转到新质检
} else {
wx.$router.go('packageEquity.receptionDetail', { wx.$router.go('packageEquity.receptionDetail', {
...record, ...record,
hideScore hideScore
}) })
}
wx.$track.setTrackData(0, 'reception_detail', { wx.$track.setTrackData(0, 'reception_detail', {
batchId: record.batchId batchId: record.batchId
}) })
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<record-tab tabList="{{recordTabList}}" bindclick="recordTabClick" defaultIndex="{{tabIndex}}"></record-tab> <record-tab tabList="{{recordTabList}}" bindclick="recordTabClick" defaultIndex="{{tabIndex}}"></record-tab>
</view> </view>
</block> </block>
<scroll-view scroll-y class="list-box" enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshListData" bindscrolltolower="onBottomRefresh" style="height: calc(100% - var(--fontSize168));" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}"> <scroll-view scroll-y class="list-box" enable-back-to-top refresher-enabled="{{true}}" bindrefresherrefresh="refreshListData" bindscrolltolower="onBottomRefresh" style="height: calc(100% - var(--fontSize80));" scroll-top="{{scrollTop}}" refresher-threshold="104" refresher-triggered="{{triggered}}">
<view class="box-content {{!filter.isShowEmpty(listData) ? 'empty-contant' : ''}}"> <view class="box-content {{!filter.isShowEmpty(listData) ? 'empty-contant' : ''}}">
<block wx:if="{{filter.isShowEmpty(listData)}}"> <block wx:if="{{filter.isShowEmpty(listData)}}">
<block wx:for="{{listData}}" wx:key="date" wx:if="{{item.receptionStaticInfoDTOList.length}}"> <block wx:for="{{listData}}" wx:key="date" wx:if="{{item.receptionStaticInfoDTOList.length}}">
......
...@@ -16,5 +16,13 @@ module.exports = { ...@@ -16,5 +16,13 @@ module.exports = {
// 获取短链地址 // 获取短链地址
getShortUrl(data) { getShortUrl(data) {
return api.post("dj.api.car.boutique.inspection.batch.file.short.url", data) return api.post("dj.api.car.boutique.inspection.batch.file.short.url", data)
} },
/**
* 质检列表或者侧边栏(新质检)
*/
findCheckResultByBatchId(data) {
return api.post('dj.api.car.boutique.inspection.findCheckResultByBatchId', data)
},
} }
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!