Commit 535c90e8 by 李伟康

refactor(HomeFrame): 优化接待中心记录列表和详情页面

- 修改记录列表刷新逻辑,提升用户体验
- 增加场景类型判断,控制绩效选择组件的显示
- 优化接待详情页面,增加 AI 导师相关功能
- 调整质检功能,增加禁用状态和相关提示
1 parent d6d1fe23
...@@ -188,8 +188,7 @@ export default { ...@@ -188,8 +188,7 @@ export default {
}, },
mounted () { mounted () {
uni.$on('refreshRecord', () => { uni.$on('refreshRecord', () => {
this.resetData() this.changeTab(0)
this.getReceptionList()
}) })
}, },
methods: { methods: {
...@@ -220,11 +219,12 @@ export default { ...@@ -220,11 +219,12 @@ export default {
jumpDetail (item) { jumpDetail (item) {
if (this.tabIndex == 0) { // 已上传 && 新质检 if (this.tabIndex == 0) { // 已上传 && 新质检
const { sceneType } = uni.$storage.get("userInfo"); const { sceneType } = uni.$storage.get("userInfo");
if (sceneType == 1 || item.checkHistoryFlag != 0) return uni.showToast({ if (sceneType == 1 || item.checkHistoryFlag != 0 || item.score == null) return uni.showToast({
title: '该接待尚不支持复盘', title: '该接待尚不支持复盘',
icon: "none" icon: "none"
}) })
uni.$track.add({ eventCode: item.orderFinishFlag ? 'app_reception_deal' : 'app_reception_defeat' }) uni.$track.add({ eventCode: item.orderFinishFlag ? 'app_reception_deal' : 'app_reception_defeat' })
this.tabIndex = -1
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/receptionDetail/index`, url: `/pages/common/receptionDetail/index`,
success (res) { success (res) {
......
...@@ -20,12 +20,14 @@ ...@@ -20,12 +20,14 @@
{{timeProgress }}% {{timeProgress }}%
</view> </view>
</view> </view>
<view class="reception-select"> <template v-if="sceneType == 0">
<select-component <view class="reception-select">
:selectList="performanceTypeList" <select-component
@chooseType="changePerformance" :selectList="performanceTypeList"
/> @chooseType="changePerformance"
</view> />
</view>
</template>
</view> </view>
<template v-if="showPageFlag"> <template v-if="showPageFlag">
<view class="customer-box box"> <view class="customer-box box">
...@@ -196,6 +198,9 @@ export default { ...@@ -196,6 +198,9 @@ export default {
{ label: '权益', value: 3 }, { label: '权益', value: 3 },
] ]
return list return list
},
sceneType () {
return uni.$storage.get('userInfo').sceneType
} }
}, },
mounted () { mounted () {
...@@ -237,11 +242,13 @@ export default { ...@@ -237,11 +242,13 @@ export default {
merchantIdList: shopMerchantId, merchantIdList: shopMerchantId,
sceneType, sceneType,
startDate: dayjs().startOf('month').format('YYYY-MM-DD'), startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
endDate: dayjs().endOf('month').format('YYYY-MM-DD'), endDate: dayjs().endOf('month').format('YYYY-MM-DD')
bussinessType }
if (sceneType == 0) {
params.bussinessType = bussinessType
if (hmzxFlag) params.hmzxFlag = hmzxFlag
if (this.isAito && !params.hmzxFlag) params.hmzxFlag = 1
} }
if (hmzxFlag) params.hmzxFlag = hmzxFlag
if (this.isAito && !params.hmzxFlag) params.hmzxFlag = 1
this.pageData = await uni.$api.receptionApi.getMerchantPerformance(params) || {} this.pageData = await uni.$api.receptionApi.getMerchantPerformance(params) || {}
}, },
changePerformance ({ item }) { changePerformance ({ item }) {
......
...@@ -80,6 +80,10 @@ export default { ...@@ -80,6 +80,10 @@ export default {
qualityAudio: { qualityAudio: {
type: Object, type: Object,
default: () => ({}) default: () => ({})
},
disabled: {
type: Boolean,
default: false
} }
}, },
data () { data () {
...@@ -123,7 +127,13 @@ export default { ...@@ -123,7 +127,13 @@ export default {
} }
}, },
tabClick (item, index) { tabClick (item, index) {
if(this.activeIndex == index) return if (this.activeIndex == index) return
if (this.disabled) return uni.showToast({
title: '请等待内容生成后再切换其他质检点',
icon: 'none',
mask: true,
duration: 500
})
this.activeIndex = index this.activeIndex = index
this.$emit('tabClick', item) this.$emit('tabClick', item)
} }
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
@onPause="onPause" @onPause="onPause"
@changeOperate="isOperate = $event" @changeOperate="isOperate = $event"
@tabClick="tabClick" @tabClick="tabClick"
:disabled="aiDisabled"
/> />
</view> </view>
</view> </view>
...@@ -103,7 +104,10 @@ ...@@ -103,7 +104,10 @@
v-if="AIUrl" v-if="AIUrl"
> >
<view class="AI-title flex">AI导师</view> <view class="AI-title flex">AI导师</view>
<web-view :src="AIUrl"></web-view> <web-view
:src="AIUrl"
@message="handlerMessage"
></web-view>
</view> </view>
<template v-else> <template v-else>
<view class="nothing flex"> <view class="nothing flex">
...@@ -160,7 +164,7 @@ export default { ...@@ -160,7 +164,7 @@ export default {
showPlayControl: false, showPlayControl: false,
AIUrl: '', AIUrl: '',
wv: null, wv: null,
loading: false aiDisabled: true
} }
}, },
onLoad () { onLoad () {
...@@ -383,9 +387,10 @@ export default { ...@@ -383,9 +387,10 @@ export default {
{ modelType } = this.pageData { modelType } = this.pageData
let title = '' let title = ''
if (item.sumScore > item.score) title = item.tagGroupName if (item.sumScore > item.score) title = item.tagGroupName
let { agentUrl, domainName, checkDate, taskStatus } = data, let { agentUrl, domainName, taskStatus } = data
url = `${agentUrl}?no_header=1&businessType=${bussinessType}&phone=${phone}&brand=${brand}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}&brandType=${modelType || 1001}` agentUrl = 'http://192.168.1.237:3000/chat/0piVRFb1xn6OBTcv'
url += `&date=${dayjs().format('YYYY-MM-DD')}` let url = `${agentUrl}?no_header=1&businessType=${bussinessType}&one_id=${uuid}&platformType=1&domain=${domainName}&presuppositionProblem=${title}&brandType=${modelType || 1001}`
url += `&phone=${phone}&brand=${brand}&date=${dayjs().format('YYYY-MM-DD')}`
if (taskStatus) url += `&practice_status=${taskStatus}` if (taskStatus) url += `&practice_status=${taskStatus}`
this.AIUrl = url this.AIUrl = url
this.setWebviewStyle() this.setWebviewStyle()
...@@ -430,20 +435,13 @@ export default { ...@@ -430,20 +435,13 @@ export default {
}, },
tabClick (item) { tabClick (item) {
if (this.wv) { if (this.wv) {
if (this.loading) return uni.showToast({
title: '请勿频繁操作',
icon: 'none',
mask: true,
duration: 500
})
this.loading = true
let message = item.sumScore > item.score ? item.tagGroupName : '' let message = item.sumScore > item.score ? item.tagGroupName : ''
this.wv.evalJS(`sendMessage({type:'reset_chat',payload:{message:'${message}'}})`) this.wv.evalJS(`sendMessage({type:'reset_chat',payload:{message:'${message}'}})`)
setTimeout(() => {
this.loading = false
}, 500)
} }
},
handlerMessage ({detail}) {
let [data] = detail.data
this.aiDisabled = data.isResponding
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!