Commit 2f52dab9 by 王志慧

fixed

1 parent 52426686
// packageEquity/pages/receptionDetail/components/quality/index.js // packageEquity/pages/receptionDetail/components/quality/index.js
import api from "../../../../../carEquityApi";
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/' const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
batchId: Number list: {
type: Object,
observer: function (n) {
this.setAudio(0)
this.setData({
isShow:true
})
}
}
}, },
lifetimes: { lifetimes: {
ready() {
this.getReceptionResult()
}
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -21,23 +26,36 @@ Component({ ...@@ -21,23 +26,36 @@ Component({
IMG_URL, IMG_URL,
isShow:false, isShow:false,
activeIndex: 0, activeIndex: 0,
list: [{ qualityAudio:''
stage: '接待环节'
}, {
stage: '车辆交付'
},
{
stage: '需求挖掘'
}, {
stage: '促成交'
}
]
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
setAudio() {
this.qualityAudio = wx.createInnerAudioContext({
useWebAudioImplement: true
})
this.qualityAudio.onPause(() => {
this.setData({
status: 'pause'
})
})
//监听音频的播放事件
this.qualityAudio.onPlay(() => {
this.setData({
status: 'start'
})
})
// this.qualityAudio.onTimeUpdate(this.onTimeUpdate)
this.qualityAudio.onEnded(() => {
this.setData({
status: 'ending',
})
})
},
handleShow(e) { handleShow(e) {
let { let {
findex, findex,
...@@ -48,12 +66,10 @@ Component({ ...@@ -48,12 +66,10 @@ Component({
list list
} = this.data; } = this.data;
list[activeIndex].conversationCheckDetailDTOList[findex].conversationDetailDTOList[sindex].isdown = !list[activeIndex].conversationCheckDetailDTOList[findex].conversationDetailDTOList[sindex].isdown list[activeIndex].conversationDetailList[findex].detailList[sindex].isdown = ! list[activeIndex].conversationDetailList[findex].detailList[sindex].isdown
this.setData({ this.setData({
list list
}) })
}, },
changeClassifyType(e) { changeClassifyType(e) {
let { let {
...@@ -64,92 +80,22 @@ Component({ ...@@ -64,92 +80,22 @@ Component({
scrollTop:0 scrollTop:0
}) })
}, },
getReceptionResult() { play() {
let { console.log(this.qualityAudio)
list, const {
batchId paused
} = this.data; } = this.qualityAudio
let params = { if (paused) this.qualityAudio.play()
batchId
}
api.getReceptionResultData(params).then(res => {
res.data.forEach(first => {
first.conversationCheckDetailDTOList.forEach(second => {
second.firstClassify = second.firstClassify.slice(0, 4)
second.conversationDetailDTOList && second.conversationDetailDTOList.forEach(third => {
third.time = this.formatTime(third.mergedOffset)
if (third.id === second.inspectionConversationDetailId) {
third.hit = true
third.isdown = false
}
})
})
})
list.forEach(item => {
res.data.forEach(row => {
if (row.stage.indexOf(item.stage) != -1) {
Object.assign(item, row, {
stage: item.stage
})
} else if (row.stage === '结束环节' && item.stage === '促成交') {
Object.assign(item, row, {
stage: '促成交'
})
}
})
})
this.setData({
list: list,
isShow:true
})
console.log(list)
})
}, },
lookMore(e) { onPause() {
let thisPage = wx.$router.getPageInstance(); this.qualityAudio.pause()
let {
findex
} = e.currentTarget.dataset;
let {
activeIndex,
list
} = this.data;
let item = list[activeIndex].conversationCheckDetailDTOList[findex].conversationDetailDTOList[0];
item.text_id = `text_${item.id}`
thisPage.onPause()
thisPage.setData({
activeIndex: 0
}, () => {
thisPage.dialogueRef().setTopId(item, true)
})
}, },
seek(e) { seek(e) {
let { let {
findex url
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
let { this.qualityAudio.src = url
activeIndex, this.play()
list
} = this.data;
let time = list[activeIndex].conversationCheckDetailDTOList[findex].conversationDetailDTOList[0].mergedOffset;
let thisPage = wx.$router.getPageInstance()
thisPage.seek(time)
thisPage.play()
},
formatTime(num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
practiceHandle() {
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -151,13 +151,19 @@ color:#F24724; ...@@ -151,13 +151,19 @@ color:#F24724;
position:relative; position:relative;
background: #F0F6FF; background: #F0F6FF;
margin-bottom: 0 !important; margin-bottom: 0 !important;
.trumpet{ .trumpet-box{
width:var(--fontSize48); width:var(--fontSize48);
height: var(--fontSize40); height: var(--fontSize40);
background:#fff; background:#fff;
border-radius:50%; border-radius:50%;
position:absolute; position:absolute;
right:var(--fontSize12); right:var(--fontSize12);
margin:0 auto;
}
.trumpet{
width:var(--fontSize48);
height: var(--fontSize40);
} }
} }
......
...@@ -9,21 +9,24 @@ ...@@ -9,21 +9,24 @@
</view> </view>
</view> </view>
<scroll-view scroll-y class="quality-reception-wrap" scroll-top="{{scrollTop}}"> <scroll-view scroll-y class="quality-reception-wrap" scroll-top="{{scrollTop}}">
<block wx-if="{{list[activeIndex].conversationCheckDetailDTOList.length}}"> <block wx-if="{{list[activeIndex].conversationDetailList.length}}">
<view class="link-list" wx:for="{{list[activeIndex].conversationCheckDetailDTOList}}" wx:for-item='i' wx:for-index='ind' wx:key='ind'> <view class="link-list" wx:for="{{list[activeIndex].conversationDetailList}}" wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class="link-title"> <view class="link-title">
<view class="dot"></view>{{i.firstClassify}}-{{i.secondClassify}} <view class="score"><text class="{{(i.score/i.rawScore)<0.5?'failStage':''}}">{{i.score}}</text>/{{i.rawScore}}</view> <view class="dot"></view>{{i.firstClassify}}-{{i.secondClassify}} <view class="score"><text class="{{(i.score/i.rawScore)<0.5?'failStage':''}}">{{i.score}}</text>/{{i.rawScore}}</view>
<view class="{{i.conversationDetailDTOList?'success':'fail'}}">{{i.conversationDetailDTOList?'意图匹配':'意图不匹配'}}</view> <view class="{{i.detailList?'success':'fail'}}">{{i.detailList?'意图匹配':'意图不匹配'}}</view>
</view> </view>
<view class="quality-content"> <view class="quality-content">
<blcok wx:for="{{i.conversationDetailDTOList}}" wx:for-item="c" wx:for-index='cind' wx:key='cind'> <blcok wx:for="{{i.detailList}}" wx:for-item="c" wx:for-index='cind' wx:key='cind'>
<view class="content {{c.hit?'hit':''}}"> <view class="content {{c.hit?'hit':''}}">
<view class="left"> <view class="left">
<gl-image class="avatar" webp src="/equity/reception/role-{{c.role}}.png" /> <gl-image class="avatar" webp src="/equity/reception/role-{{c.role}}.png" />
<view class="duration">{{c.time}}</view> <view class="duration">{{c.time}}</view>
</view> </view>
<view class="text">{{c.content}}</view> <view class="text">{{c.content}}</view>
<gl-image class="trumpet" webp src="/equity/trumpet.png" data-fIndex="{{ind}}" bind:tap="seek" /> <view class="trumpet-box">
<gl-image class="trumpet" webp src="/equity/trumpet.png" data-url="{{c.voiceUrl}}" bind:tap="seek" />
</view>
</view> </view>
<view class="hit-content" wx:if="{{c.hit}}"> <view class="hit-content" wx:if="{{c.hit}}">
<view class="matching" bind:tap="handleShow" data-fIndex="{{ind}}" data-sIndex="{{cind}}"> <view class="matching" bind:tap="handleShow" data-fIndex="{{ind}}" data-sIndex="{{cind}}">
...@@ -50,7 +53,7 @@ ...@@ -50,7 +53,7 @@
</view> </view>
</blcok> </blcok>
<view class="no-hit-content" wx:if="{{!i.conversationDetailDTOList}}"> <view class="no-hit-content" wx:if="{{!i.detailList}}">
<view class="verbal-warp" wx:if="{{i.suggestions}}"> <view class="verbal-warp" wx:if="{{i.suggestions}}">
<view class="title"> <view class="title">
<gl-image class="improve" webp src="/improve.png" />话术建议 <gl-image class="improve" webp src="/improve.png" />话术建议
...@@ -65,7 +68,7 @@ ...@@ -65,7 +68,7 @@
<gl-image class="improve" webp src="/improve.png" />快速练习 <gl-image class="improve" webp src="/improve.png" />快速练习
</view> --> </view> -->
</view> </view>
<!-- <view class="more" wx:if="{{i.conversationDetailDTOList}}" bind:tap="lookMore" data-fIndex="{{ind}}">查看更多</view> --> <!-- <view class="more" wx:if="{{i.detailList}}" bind:tap="lookMore" data-fIndex="{{ind}}">查看更多</view> -->
</view> </view>
</view> </view>
</block> </block>
......
// packageEquity/pages/aiCheck/result/components/skilled/skilled.js // packageEquity/pages/aiCheck/result/components/skilled/skilled.js
import {skilledEmoji} from '../../../contant' import {
skilledEmoji
} from '../../../contant'
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
detailInfo: {
type: Object,
observer: function (n) {
this.initData(n)
}
},
}, },
/** /**
...@@ -14,14 +21,81 @@ Component({ ...@@ -14,14 +21,81 @@ Component({
*/ */
data: { data: {
emojiList: skilledEmoji, emojiList: skilledEmoji,
level:3, level: 3,
star:3, star: 3,
sort: ['接待环节', '车辆交付', '需求挖掘', '促成交'],
list: []
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
initData(n) {
let data = n.inspectionConversationCheck
data.aiSparringCheckDetailDTOList.forEach(item => {
item.stage = item.stage.slice(0, 4)
if (item.stage == '结束环节') {
item.stage = '促成交'
}
item.conversationDetailList = []
data.conversationDetailList.forEach(con => {
if (con.detailList && con.detailList.length) {
con.detailList.forEach(detail => {
detail.time = this.formatTime(detail.mergedOffset)
if (detail.id == con.detail.id) {
detail.hit = true
detail.isdown = false
}
})
}
con.firstClassify = con.firstClassify.slice(0, 4)
if (con.firstClassify == '结束环节') {
con.firstClassify = '促成交'
}
if (con.firstClassify.indexOf(item.stage) != -1) {
item.conversationDetailList.push(con)
}
})
})
this.setData({
list: data.aiSparringCheckDetailDTOList,
// isShow:true
}, () => {
this.handleSort()
})
},
handleSort() {
let {
list,
sort
} = this.data;
list.sort((a, b) => {
// 找到a和b在predefinedOrder中的索引
let indexA = sort.indexOf(a.stage);
let indexB = sort.indexOf(b.stage);
// 如果索引相同,则元素相等,返回0
if (indexA === indexB) {
return 0;
}
// 如果a的索引小于b的索引,则a应该排在b前面,返回-1
if (indexA < indexB) {
return -1;
}
// 否则,b应该排在a前面,返回1
return 1;
});
this.setData({
list
})
},
formatTime(num) {
let minutes = Math.floor(num / 60) || '0',
seconds = num % 60 || '0'
seconds = seconds < 10 ? `0${seconds}` : seconds
return `${minutes}:${seconds}`
},
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -13,4 +13,4 @@ ...@@ -13,4 +13,4 @@
</view> </view>
<view class="report-content">上党课海口市都是对的</view> <view class="report-content">上党课海口市都是对的</view>
</view> </view>
<quality batchId="{{17}}"></quality>
\ No newline at end of file \ No newline at end of file
<quality list="{{list}}"></quality>
\ No newline at end of file \ No newline at end of file
...@@ -122,7 +122,7 @@ Page({ ...@@ -122,7 +122,7 @@ Page({
* *
*/ */
onLoad(options) { onLoad(options) {
this.getDetail(95); this.getDetail(121);
return; return;
const { const {
history_message, history_message,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!