Commit 535c90e8 by 李伟康

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

- 修改记录列表刷新逻辑,提升用户体验
- 增加场景类型判断,控制绩效选择组件的显示
- 优化接待详情页面,增加 AI 导师相关功能
- 调整质检功能,增加禁用状态和相关提示
1 parent d6d1fe23
......@@ -188,8 +188,7 @@ export default {
},
mounted () {
uni.$on('refreshRecord', () => {
this.resetData()
this.getReceptionList()
this.changeTab(0)
})
},
methods: {
......@@ -220,11 +219,12 @@ export default {
jumpDetail (item) {
if (this.tabIndex == 0) { // 已上传 && 新质检
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: '该接待尚不支持复盘',
icon: "none"
})
uni.$track.add({ eventCode: item.orderFinishFlag ? 'app_reception_deal' : 'app_reception_defeat' })
this.tabIndex = -1
uni.navigateTo({
url: `/pages/common/receptionDetail/index`,
success (res) {
......
......@@ -20,12 +20,14 @@
{{timeProgress }}%
</view>
</view>
<view class="reception-select">
<select-component
:selectList="performanceTypeList"
@chooseType="changePerformance"
/>
</view>
<template v-if="sceneType == 0">
<view class="reception-select">
<select-component
:selectList="performanceTypeList"
@chooseType="changePerformance"
/>
</view>
</template>
</view>
<template v-if="showPageFlag">
<view class="customer-box box">
......@@ -196,6 +198,9 @@ export default {
{ label: '权益', value: 3 },
]
return list
},
sceneType () {
return uni.$storage.get('userInfo').sceneType
}
},
mounted () {
......@@ -237,11 +242,13 @@ export default {
merchantIdList: shopMerchantId,
sceneType,
startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
endDate: dayjs().endOf('month').format('YYYY-MM-DD'),
bussinessType
endDate: dayjs().endOf('month').format('YYYY-MM-DD')
}
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) || {}
},
changePerformance ({ item }) {
......
......@@ -80,6 +80,10 @@ export default {
qualityAudio: {
type: Object,
default: () => ({})
},
disabled: {
type: Boolean,
default: false
}
},
data () {
......@@ -123,7 +127,13 @@ export default {
}
},
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.$emit('tabClick', item)
}
......
......@@ -93,6 +93,7 @@
@onPause="onPause"
@changeOperate="isOperate = $event"
@tabClick="tabClick"
:disabled="aiDisabled"
/>
</view>
</view>
......@@ -103,7 +104,10 @@
v-if="AIUrl"
>
<view class="AI-title flex">AI导师</view>
<web-view :src="AIUrl"></web-view>
<web-view
:src="AIUrl"
@message="handlerMessage"
></web-view>
</view>
<template v-else>
<view class="nothing flex">
......@@ -160,7 +164,7 @@ export default {
showPlayControl: false,
AIUrl: '',
wv: null,
loading: false
aiDisabled: true
}
},
onLoad () {
......@@ -383,9 +387,10 @@ export default {
{ modelType } = this.pageData
let title = ''
if (item.sumScore > item.score) title = item.tagGroupName
let { agentUrl, domainName, checkDate, 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}`
url += `&date=${dayjs().format('YYYY-MM-DD')}`
let { agentUrl, domainName, taskStatus } = data
agentUrl = 'http://192.168.1.237:3000/chat/0piVRFb1xn6OBTcv'
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}`
this.AIUrl = url
this.setWebviewStyle()
......@@ -430,20 +435,13 @@ export default {
},
tabClick (item) {
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 : ''
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!