Commit b834d788 by 胡悦

feat(receptionDetail): 恢复对话组件并移除AI导师功能

- 重新启用对话组件及相关功能
- 移除AI导师窗口及相关逻辑
- 调整右侧面板样式和布局
1 parent dcdf2bdd
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</template> </template>
</view> </view>
<view class="component-box"> <view class="component-box">
<!-- <dialogue <dialogue
:class="['component-item',{hide: tabId != 1}]" :class="['component-item',{hide: tabId != 1}]"
:batchId="pageData.batchId" :batchId="pageData.batchId"
:qualityData="qualityData" :qualityData="qualityData"
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
@onPlay="onPlay" @onPlay="onPlay"
@onPause="onPause" @onPause="onPause"
@changeOperate="isOperate = $event" @changeOperate="isOperate = $event"
/> --> />
<quality <quality
:qualityData="qualityData" :qualityData="qualityData"
:class="['component-item',{hide: tabId != 2}]" :class="['component-item',{hide: tabId != 2}]"
...@@ -92,38 +92,24 @@ ...@@ -92,38 +92,24 @@
@onPlay="onPlay" @onPlay="onPlay"
@onPause="onPause" @onPause="onPause"
@changeOperate="isOperate = $event" @changeOperate="isOperate = $event"
@tabClick="tabClick"
:disabled="isResponding || isRecording"
:disabledText="disabledText"
/> />
</view> </view>
</view> </view>
</view> </view>
<view class="reception-right-box"> <view class="reception-right-box">
<view <template v-if="qualityData.length">
class="AI-window" <tags :batchId="pageData.batchId" />
v-if="AIUrl" <quality-table :qualityData="qualityData" />
> </template>
<view class="AI-title flex">AI导师</view>
<web-view
:src="AIUrl"
@message="handlerMessage"
></web-view>
</view>
<template v-else> <template v-else>
<view class="nothing flex"> <view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view> <view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等... 分析中,稍等...
</view> </view>
</template> </template>
<!-- <template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>-->
</view> </view>
</view> </view>
</template> </template>
</view> </view>
</template> </template>
...@@ -144,34 +130,28 @@ export default { ...@@ -144,34 +130,28 @@ export default {
data () { data () {
return { return {
tab: Object.freeze([ tab: Object.freeze([
// { {
// id: 1, id: 1,
// name: '对话', name: '对话',
// componentName: 'dialogue' componentName: 'dialogue'
// }, },
{ {
id: 2, id: 2,
name: '质检', name: '质检',
componentName: 'quality' componentName: 'quality'
} }
]), ]),
tabId: 2, tabId: 1,
qualityData: [], qualityData: [],
pageData: {}, pageData: {},
qualityAudio: {}, qualityAudio: {},
currentTime: '00:00', currentTime: '00:00',
status: 'pause', status: 'pause',
isOperate: true, isOperate: true,
showPlayControl: false, showPlayControl: false
AIUrl: '',
wv: null,
disabledText: '',
isResponding: true,
isRecording: true,
} }
}, },
onLoad () { onLoad (options) {
let _this = this let _this = this
this.getOpenerEventChannel().on('getData', function (data) { this.getOpenerEventChannel().on('getData', function (data) {
console.log(data) console.log(data)
...@@ -188,23 +168,13 @@ export default { ...@@ -188,23 +168,13 @@ export default {
this.qualityAudio.stop() this.qualityAudio.stop()
}, },
computed: { computed: {
// dialogueRef () { dialogueRef () {
// return this.$refs.dialogueRef return this.$refs.dialogueRef
// }, },
qualityRef () { qualityRef () {
return this.$refs.qualityRef return this.$refs.qualityRef
} }
}, },
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back()
return true
}
// 其他情况允许正常返回
return false
},
methods: { methods: {
onHandle (e) { onHandle (e) {
let { let {
...@@ -222,7 +192,7 @@ export default { ...@@ -222,7 +192,7 @@ export default {
const { const {
tabId tabId
} = this } = this
// this.dialogueRef.isPlayIng = false this.dialogueRef.isPlayIng = false
this.qualityAudio.pause() this.qualityAudio.pause()
}, },
//播放 //播放
...@@ -255,7 +225,7 @@ export default { ...@@ -255,7 +225,7 @@ export default {
this.qualityAudio.onEnded(() => { this.qualityAudio.onEnded(() => {
this.status = 'ending' this.status = 'ending'
this.currentTime = this.formatTime(this.qualityAudio.duration) this.currentTime = this.formatTime(this.qualityAudio.duration)
// this.dialogueRef.isPlayIng = false this.dialogueRef.isPlayIng = false
this.isOperate = true this.isOperate = true
}) })
}, },
...@@ -263,8 +233,9 @@ export default { ...@@ -263,8 +233,9 @@ export default {
const { const {
tabId tabId
} = this } = this
this.currentTime = this.formatTime(this.qualityAudio.currentTime) this.currentTime = this.formatTime(this.qualityAudio.currentTime)
// this.dialogueRef?.onTimeUpdate() this.dialogueRef?.onTimeUpdate()
this.qualityRef?.onTimeUpdate() this.qualityRef?.onTimeUpdate()
}, },
formatTime (num) { formatTime (num) {
...@@ -280,7 +251,6 @@ export default { ...@@ -280,7 +251,6 @@ export default {
this.qualityAudio.seek(time) this.qualityAudio.seek(time)
}, },
back () { back () {
uni.$emit('refreshRecord')
if (this.qualityAudio) this.qualityAudio?.pause() if (this.qualityAudio) this.qualityAudio?.pause()
uni.navigateBack() uni.navigateBack()
}, },
...@@ -288,6 +258,7 @@ export default { ...@@ -288,6 +258,7 @@ export default {
const res = await uni.$api.receptionApi.findCheckResultByBatchId({ const res = await uni.$api.receptionApi.findCheckResultByBatchId({
batchId batchId
}) })
console.log(JSON.parse(JSON.stringify(res)))
res.map(item => { res.map(item => {
item.formatScore = `${item.score || item.score === 0 ? item.score : '-'}/${item.sumScore || item.sumScore === 0 ? item.sumScore : '-'}` item.formatScore = `${item.score || item.score === 0 ? item.score : '-'}/${item.sumScore || item.sumScore === 0 ? item.sumScore : '-'}`
let hitTextList = JSON.parse(item.hitText), let hitTextList = JSON.parse(item.hitText),
...@@ -320,7 +291,6 @@ export default { ...@@ -320,7 +291,6 @@ export default {
}] }]
}) })
this.qualityData = res this.qualityData = res
this.getAiagent(res[0])
}, },
desensitizePhoneNumber (phoneNumber) { desensitizePhoneNumber (phoneNumber) {
return phoneNumber.replace(phoneNumber.slice(3, 7), '****') return phoneNumber.replace(phoneNumber.slice(3, 7), '****')
...@@ -372,89 +342,6 @@ export default { ...@@ -372,89 +342,6 @@ export default {
}) })
} }
}, },
async getAiagent (item) {
if (item) {
uni.showLoading({
mask: true
})
const { phone } = uni.$storage.get('userInfo'),
[data] = await uni.$api.sceneMarketApi.getAiagent({
ownerShipType: 1,
accountPhone: phone,
agentCode: 'AI7'
})
if (data) {
const { sceneType, uuid, phone, channelType = 1 } = uni.$storage.get('userInfo'),
bussinessType = sceneType == 0 ? 1 : 2,// sceneType 0延保 1精品。 bussinessType 1.延保 2.轻改
brand = {
1: '问界',
2: '比亚迪',
3: '其他'
}[channelType],
{ modelType } = this.pageData
let title = ''
if (item.sumScore > item.score) title = item.tagGroupName
let { agentUrl, domainName, taskStatus } = data
// agentUrl = 'https://scrm.dev.glsx.com.cn/dj-scrm-wx-work-main-zhangls/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()
} else uni.showToast({
title: '获取智能体失败',
icon: 'error'
})
}
},
setWebviewStyle () {
//修改UA为PC端
const setWebviewStyleWithRetry = () => {
const currentWebview = this.$scope.$getAppWebview()
const [wv] = currentWebview.children()
if (wv) {
this.wv = wv
wv.setStyle({
left: '40.85%',
top: '16.65%',
height: '78.17%',
width: '56.52%'
});
// wv.setCssText( '.chat-panel-bg{background:#f5f9ff !important;}' )
return true; // 成功设置样式
} else {
return false; // 未找到wv
}
};
const retrySetWebviewStyle = () => {
if (!setWebviewStyleWithRetry()) {
// 如果未成功,继续重试
setTimeout(retrySetWebviewStyle, 50);
} else {
// 成功设置样式,结束循环
console.log('Webview样式设置成功');
}
};
setTimeout(retrySetWebviewStyle, 100);
},
tabClick (item) {
if (this.wv) {
let message = item.sumScore > item.score ? item.tagGroupName : ''
this.wv.evalJS(`sendMessage({type:'reset_chat',payload:{message:'${message}'}})`)
}
},
handlerMessage ({ detail }) {
uni.hideLoading()
let [data] = detail.data
if (typeof data.isResponding == 'boolean') this.isResponding = data.isResponding
if (typeof data.isRecording == 'boolean') this.isRecording = data.isRecording
if (data.isResponding || data.isRecording) {
this.disabledText = data.isResponding ? '请等待内容生成后再切换其他质检点' : '请等待录音结束后再切换其他质检点'
}
}
} }
} }
</script> </script>
...@@ -652,30 +539,17 @@ export default { ...@@ -652,30 +539,17 @@ export default {
width: toRpx(1326); width: toRpx(1326);
border-radius: toRpx(32); border-radius: toRpx(32);
opacity: 1; opacity: 1;
background: #f5f9ff; background: #ffffff;
box-sizing: border-box; box-sizing: border-box;
position: relative; overflow-y: auto;
.AI-window { padding: 0 toRpx(40);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
.AI-title {
height: toRpx(96);
font-size: toRpx(36);
font-weight: 500;
justify-content: center;
color: #333333;
}
}
.nothing { .nothing {
width: 100%; width: 100%;
height: 100%; height: 100%;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
color: #808291; color: #808291;
font-size: toRpx(28); font-size: 28rpx;
background: #fff; background: #fff;
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!