Commit 0bb37a0c by liimin

Merge branch 'v1.0.0' of http://192.168.3.233:8090/glsx/simgle_app into v1.0.0

2 parents df88315b b834d788
......@@ -71,7 +71,7 @@
</template>
</view>
<view class="component-box">
<!-- <dialogue
<dialogue
:class="['component-item',{hide: tabId != 1}]"
:batchId="pageData.batchId"
:qualityData="qualityData"
......@@ -82,7 +82,7 @@
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
/> -->
/>
<quality
:qualityData="qualityData"
:class="['component-item',{hide: tabId != 2}]"
......@@ -92,38 +92,24 @@
@onPlay="onPlay"
@onPause="onPause"
@changeOperate="isOperate = $event"
@tabClick="tabClick"
:disabled="isResponding || isRecording"
:disabledText="disabledText"
/>
</view>
</view>
</view>
<view class="reception-right-box">
<view
class="AI-window"
v-if="AIUrl"
>
<view class="AI-title flex">AI导师</view>
<web-view
:src="AIUrl"
@message="handlerMessage"
></web-view>
</view>
<template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>
<template v-else>
<view class="nothing flex">
<view class="sprite-icon icon-quality-no-data"></view>
分析中,稍等...
</view>
</template>
<!-- <template v-if="qualityData.length">
<tags :batchId="pageData.batchId" />
<quality-table :qualityData="qualityData" />
</template>-->
</view>
</view>
</template>
</view>
</template>
......@@ -144,34 +130,28 @@ export default {
data () {
return {
tab: Object.freeze([
// {
// id: 1,
// name: '对话',
// componentName: 'dialogue'
// },
{
id: 1,
name: '对话',
componentName: 'dialogue'
},
{
id: 2,
name: '质检',
componentName: 'quality'
}
]),
tabId: 2,
tabId: 1,
qualityData: [],
pageData: {},
qualityAudio: {},
currentTime: '00:00',
status: 'pause',
isOperate: true,
showPlayControl: false,
AIUrl: '',
wv: null,
disabledText: '',
isResponding: true,
isRecording: true,
showPlayControl: false
}
},
onLoad () {
onLoad (options) {
let _this = this
this.getOpenerEventChannel().on('getData', function (data) {
console.log(data)
......@@ -188,23 +168,13 @@ export default {
this.qualityAudio.stop()
},
computed: {
// dialogueRef () {
// return this.$refs.dialogueRef
// },
dialogueRef () {
return this.$refs.dialogueRef
},
qualityRef () {
return this.$refs.qualityRef
}
},
onBackPress (options) {
if (options.from === 'backbutton') {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back()
return true
}
// 其他情况允许正常返回
return false
},
methods: {
onHandle (e) {
let {
......@@ -222,7 +192,7 @@ export default {
const {
tabId
} = this
// this.dialogueRef.isPlayIng = false
this.dialogueRef.isPlayIng = false
this.qualityAudio.pause()
},
//播放
......@@ -255,7 +225,7 @@ export default {
this.qualityAudio.onEnded(() => {
this.status = 'ending'
this.currentTime = this.formatTime(this.qualityAudio.duration)
// this.dialogueRef.isPlayIng = false
this.dialogueRef.isPlayIng = false
this.isOperate = true
})
},
......@@ -263,8 +233,9 @@ export default {
const {
tabId
} = this
this.currentTime = this.formatTime(this.qualityAudio.currentTime)
// this.dialogueRef?.onTimeUpdate()
this.dialogueRef?.onTimeUpdate()
this.qualityRef?.onTimeUpdate()
},
formatTime (num) {
......@@ -280,7 +251,6 @@ export default {
this.qualityAudio.seek(time)
},
back () {
uni.$emit('refreshRecord')
if (this.qualityAudio) this.qualityAudio?.pause()
uni.navigateBack()
},
......@@ -288,6 +258,7 @@ export default {
const res = await uni.$api.receptionApi.findCheckResultByBatchId({
batchId
})
console.log(JSON.parse(JSON.stringify(res)))
res.map(item => {
item.formatScore = `${item.score || item.score === 0 ? item.score : '-'}/${item.sumScore || item.sumScore === 0 ? item.sumScore : '-'}`
let hitTextList = JSON.parse(item.hitText),
......@@ -320,7 +291,6 @@ export default {
}]
})
this.qualityData = res
this.getAiagent(res[0])
},
desensitizePhoneNumber (phoneNumber) {
return phoneNumber.replace(phoneNumber.slice(3, 7), '****')
......@@ -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>
......@@ -652,30 +539,17 @@ export default {
width: toRpx(1326);
border-radius: toRpx(32);
opacity: 1;
background: #f5f9ff;
background: #ffffff;
box-sizing: border-box;
position: relative;
.AI-window {
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;
}
}
overflow-y: auto;
padding: 0 toRpx(40);
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #808291;
font-size: toRpx(28);
font-size: 28rpx;
background: #fff;
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!