Commit d6284b11 by 胡悦

AI导师联调

1 parent 4fa28927
...@@ -311,5 +311,29 @@ module.exports = { ...@@ -311,5 +311,29 @@ module.exports = {
projectName: 'pad', projectName: 'pad',
...data ...data
}) })
} },
// 更新所有sop- AI导师通知消息状态
updateSopAiAgentMessageStatus(data) {
return http.post({
method: 'dj.pad.api.update.script.all.sop.message.status',
projectName: 'pad',
...data
})
},
// 分页查询AI导师推送消息
getSopAiAgentMessageList(data) {
return http.post({
method: 'dj.pad.api.page.script.sop.message.box.record',
projectName: 'pad',
...data
})
},
// 根据状态查询AI导师推送消息数量
getSopAiAgentMessageCount(data) {
return http.post({
method: 'dj.pad.api.message.box.count.sop.message',
projectName: 'pad',
...data
})
},
} }
No preview for this file type

2.43 MB | W: | H:

2.48 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="item" @click="jump(i)" v-for="i in item.agentList"> <view class="item" @click="jump(i)" v-for="i in item.agentList">
<image class="item-img" :src="i.entryLogoUrl" mode="scaleToFill" /> <image class="item-img" :src="i.entryLogoUrl" mode="scaleToFill" />
<view class="text">{{ i.entryName }}</view> <view class="text">{{ i.entryName }}</view>
<view class="red-dot"></view> <view v-if="i.tipShowFlag == 1" class="red-dot"></view>
</view> </view>
</view> </view>
</view> </view>
...@@ -26,6 +26,11 @@ export default { ...@@ -26,6 +26,11 @@ export default {
list: [] list: []
} }
}, },
created() {
uni.$on('pageBack', () => {
this.getAiagentList()
})
},
mounted() { mounted() {
this.getAiagentList() this.getAiagentList()
}, },
...@@ -40,18 +45,24 @@ export default { ...@@ -40,18 +45,24 @@ export default {
console.log(res) console.log(res)
this.list = res this.list = res
}, },
jump(data) { async jump(data) {
let {agentUrl,domainName,presuppositionProblem} = data let {agentUrl,domainName,presuppositionProblem, sopTaskDetailInfoDTO} = data
if(!agentUrl) { if(!agentUrl) {
return uni.showToast({ return uni.showToast({
title: '待开放', title: '待开放',
icon: 'none' icon: 'none'
}) })
} }
uni.navigateTo({ let url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}`
url: `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}` if (sopTaskDetailInfoDTO) {
const {phone} = uni.$storage.get("userInfo")
url += `&practice_status=${sopTaskDetailInfoDTO.taskStatus}&checkDate=${sopTaskDetailInfoDTO.checkDate}`
const res = await uni.$api.commonApi.updateSopAiAgentMessageStatus({
staffPhone: phone
}) })
} }
uni.navigateTo({ url })
}
} }
} }
</script> </script>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
</view> </view>
{{ i.label }} {{ i.label }}
<view class="dot" v-if="i.icon == 'record' && perRecordNumber"></view> <view class="dot" v-if="i.icon == 'record' && perRecordNumber"></view>
<view class="dot" v-if="i.icon == 'ai' && sopCount"></view>
<view class="tip-box" v-if="i.icon == 'study' && readCount" @click.stop="readCount = 0">待办事项:{{ readCount }}</view> <view class="tip-box" v-if="i.icon == 'study' && readCount" @click.stop="readCount = 0">待办事项:{{ readCount }}</view>
</view> </view>
</template> </template>
...@@ -86,7 +87,8 @@ export default { ...@@ -86,7 +87,8 @@ export default {
trackInterval:null, trackInterval:null,
collectTrack:false, collectTrack:false,
hasPerson: false, hasPerson: false,
messageType: 'study' messageType: 'study',
sopCount: 0
} }
}, },
watch: { watch: {
...@@ -109,9 +111,11 @@ export default { ...@@ -109,9 +111,11 @@ export default {
uni.$on('pageBack', () => { uni.$on('pageBack', () => {
console.log('pageBack') console.log('pageBack')
this.getMessageInfo(); this.getMessageInfo();
this.getSopCount()
}); });
this.getMessageInfo() this.getMessageInfo()
this.getUnreadCount() this.getUnreadCount()
this.getSopCount() // 获取Ai集市未读个数
}, },
inject: ['showPage'], inject: ['showPage'],
methods: { methods: {
...@@ -160,7 +164,10 @@ export default { ...@@ -160,7 +164,10 @@ export default {
}) })
}, },
async changeIndex(index,item) { async changeIndex(index,item) {
if (this.tabIndex == index) return; console.log(index, 'changeIndex')
// if (this.tabIndex == index) return;
// 点击学习中心要跳从北森回后台配置的学习中心,学习中心为3
if (this.tabIndex == index && index !== 3) return;
let jumpUrl let jumpUrl
if(item.isTrack) { if(item.isTrack) {
this.readCount = 0 this.readCount = 0
...@@ -182,6 +189,7 @@ export default { ...@@ -182,6 +189,7 @@ export default {
this.$emit('update:tabIndex', index) this.$emit('update:tabIndex', index)
this.$emit("changeTab", index,jumpUrl) this.$emit("changeTab", index,jumpUrl)
this.getMessageInfo() this.getMessageInfo()
this.getSopCount()
}, },
async haveCustomerAccess(val) { async haveCustomerAccess(val) {
const {shopMerchantId, sceneType:scene} = val const {shopMerchantId, sceneType:scene} = val
...@@ -200,12 +208,6 @@ export default { ...@@ -200,12 +208,6 @@ export default {
}).then(result=>{ }).then(result=>{
if(result) { if(result) {
this.hasPerson = true this.hasPerson = true
// this.tabs.push({
// label: "个人中心",
// icon: "point",
// name: 'Point'
// })
// uni.$storage.set('hasPerson', true)
} }
}) })
}, },
...@@ -249,6 +251,15 @@ export default { ...@@ -249,6 +251,15 @@ export default {
this.clickHome() this.clickHome()
this.$emit('update:tabIndex', 99) this.$emit('update:tabIndex', 99)
} }
},
async getSopCount() {
const {sceneType} = uni.$storage.get("userInfo")
this.sopCount = await uni.$api.commonApi.getSopAiAgentMessageCount({
moduleType: 4, // 0-系统通知,1-优秀话术,2-话术预警,3-AI导师
businessType: sceneType,
status: 0
})
console.log(this.sopCount, 'sopCount')
} }
}, },
beforeCreate() { beforeCreate() {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<component is="Point" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" /> <component is="Point" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" />
</template> </template>
<template v-else> <template v-else>
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" /> <component :is="componentName" @handleOperation="handleOperation" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" />
</template> </template>
<view class="store-addr" v-if="footerBox"> <view class="store-addr" v-if="footerBox">
<view class="icon-addr sprite-icon icon-addr"></view> <view class="icon-addr sprite-icon icon-addr"></view>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<update-box /> <update-box />
<slot name="content" /> <slot name="content" />
<web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view> <web-view @message="handlerMessage" ref="webview" src="/hybrid/html/index.html"></web-view>
<web-view ref="studyWebview" :src="jumpUrl" v-if="jumpUrl"></web-view> <web-view ref="studyWebview" :src="jumpUrl" v-if="showBeisen"></web-view>
<image v-if="showLeadPage" @click="showLeadPage = false" class="lead-page" src="../../assets/images/noviceGuide/lead-page.png" mode="scaleToFill" /> <image v-if="showLeadPage" @click="showLeadPage = false" class="lead-page" src="../../assets/images/noviceGuide/lead-page.png" mode="scaleToFill" />
</view> </view>
</template> </template>
...@@ -106,7 +106,8 @@ export default { ...@@ -106,7 +106,8 @@ export default {
pointComponentName: 'Point', pointComponentName: 'Point',
userInfo: {}, userInfo: {},
tabIndex: 0, tabIndex: 0,
showLeadPage: false showLeadPage: false,
showBeisen: false
} }
}, },
mounted() { mounted() {
...@@ -135,8 +136,10 @@ export default { ...@@ -135,8 +136,10 @@ export default {
}, },
methods: { methods: {
async changeTab($event, jumpUrl) { async changeTab($event, jumpUrl) {
console.log($event, 'event')
this.$emit('changeTab', $event) this.$emit('changeTab', $event)
if ($event == 3) { if ($event == 3) {
this.showBeisen = false
this.jumpUrl = jumpUrl this.jumpUrl = jumpUrl
if (!this.jumpUrl) { if (!this.jumpUrl) {
uni.showToast({ uni.showToast({
...@@ -146,16 +149,6 @@ export default { ...@@ -146,16 +149,6 @@ export default {
return return
} }
setTimeout(() => {
const currentWebview = this.$parent.$scope.$getAppWebview()
const wv = currentWebview.children()[1]
console.log(wv, 1111)
if (wv) {
wv.setStyle({ left: '8%', height: '100%', top: '3%', height: '97%', width: '92%' })
} else {
this.jumpUrl = ''
}
}, 100)
} else { } else {
this.jumpUrl = '' this.jumpUrl = ''
} }
...@@ -204,6 +197,22 @@ export default { ...@@ -204,6 +197,22 @@ export default {
uni.$storage.set('leadPage', leadPage) uni.$storage.set('leadPage', leadPage)
} }
} }
},
handleOperation(val) {
if (val.type == 'openCourse') {
console.log('beisen')
this.showBeisen = true
setTimeout(() => {
const currentWebview = this.$parent.$scope.$getAppWebview()
const wv = currentWebview.children()[1]
console.log(wv, 1111)
if (wv) {
wv.setStyle({ left: '8%', height: '100%', top: '3%', height: '97%', width: '92%' })
} else {
this.jumpUrl = ''
}
}, 100)
}
} }
} }
} }
......
...@@ -54,6 +54,8 @@ export default { ...@@ -54,6 +54,8 @@ export default {
back() { back() {
console.log('back') console.log('back')
uni.navigateBack() uni.navigateBack()
uni.$emit('aiBack')
uni.$emit('pageBack')
} }
} }
} }
......
...@@ -58,16 +58,19 @@ ...@@ -58,16 +58,19 @@
<view class="message-tag">{{ item.warningTag }}</view> <view class="message-tag">{{ item.warningTag }}</view>
</view> </view>
<view class="message-content warning-content"><view>你有以下接待记录判定为话术违规</view>{{ item.warningContent }} <view class="message-content warning-content">
<view>你有以下接待记录判定为话术违规</view>{{ item.warningContent }}
</view> </view>
</template> </template>
<template v-else-if="firstIndex == 3"> <template v-else-if="firstIndex == 3">
<view class="message-header"> <view class="message-header">
<view :class="['dot', item.status == 1 ? '' : 'red']"></view> <view :class="['dot', item.status == 1 ? '' : 'red']"></view>
<view class="message-type">AI导师消息</view> <view class="message-type">AI导师消息</view>
<view class="message-time">{{ item.pushTime }}</view> <view class="message-time">{{ item.time }}</view>
</view> </view>
<view class="message-content warning-content"><view>您有新的消息【{{ item.sopTaskDetailInfoDTO ? item.sopTaskDetailInfoDTO.checkDate : '' }}+战败复盘报告】AI导师来帮你进行战败复盘了,请点击查看</view> <view class="message-content warning-content">
<view>您有新的消息【{{ item.sopTaskDetailInfoDTO ? item.sopTaskDetailInfoDTO.checkDate : ''
}}战败复盘报告】AI导师来帮你进行战败复盘了,请点击查看</view>
</view> </view>
</template> </template>
</view> </view>
...@@ -184,13 +187,18 @@ export default { ...@@ -184,13 +187,18 @@ export default {
this.pageSize = PAGE_SIZE this.pageSize = PAGE_SIZE
if (tagIndex) this.tagIndex = tagIndex if (tagIndex) this.tagIndex = tagIndex
else this.tagIndex = '' else this.tagIndex = ''
if (index == 0) { const actionMap = {
this.getSystemPage() 0: () => this.getSystemPage(),
} else if (index == 1) { 1: () => {
this.getMessagePage() this.getMessagePage();
this.getLabelList() this.getLabelList();
} else if (index == 2) { },
this.getWarningPage() 2: () => this.getWarningPage(),
3: () => this.getAiAgentPage()
};
const action = actionMap[index];
if (action) {
action();
} }
}, },
// 跳转详情 // 跳转详情
...@@ -198,6 +206,26 @@ export default { ...@@ -198,6 +206,26 @@ export default {
console.log(row); console.log(row);
const { id } = row; const { id } = row;
const actionMap = { const actionMap = {
3: async() => {
const { aiAgentInfoDTO, sopTaskDetailInfoDTO } = row;
const { agentUrl, domainName, presuppositionProblem } = aiAgentInfoDTO || {};
const { taskStatus, checkDate } = sopTaskDetailInfoDTO || {};
if (!agentUrl) {
return uni.showToast({
title: '链接无效',
icon: 'none'
});
}
const url = `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}&practice_status=${taskStatus}&checkDate=${checkDate}`;
uni.navigateTo({ url });
// 不刷新列表的更新消息状态
if (row.status == 0) this.getList.find(item => item.boxId == row.boxId).status = 1
// 调用接口更新消息状态
const res = await uni.$api.commonApi.updateMessageStatus({
idList: [row.boxId]
})
console.log(res, '===')
},
2: () => { 2: () => {
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/earlyWarnDetail?row=${encodeURIComponent(JSON.stringify(row))}`, url: `/pages/common/earlyWarnDetail?row=${encodeURIComponent(JSON.stringify(row))}`,
...@@ -342,6 +370,39 @@ export default { ...@@ -342,6 +370,39 @@ export default {
}); });
} }
}, },
// 获取AI导师消息分页列表
async getAiAgentPage() {
try {
uni.showLoading({
mask: true
})
const { sceneType } = uni.$storage.get("userInfo")
const { pageNum, pageSize } = this
const params = {
pageNum,
pageSize,
businessType: sceneType
}
const res = await uni.$api.commonApi.getSopAiAgentMessageList(params)
res.list?.length && res.list.map(e => {
e.time = dayjs(new Date(e.pushTime)).format("YYYY-MM-DD HH:mm:ss")
})
if (pageNum == 1) {
this.aiTutor = res.list
console.log(this.aiTutor, '===')
} else {
this.aiTutor = this.aiTutor.concat(res.list)
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: "none",
});
}
},
async getDetailById(id, readFlag) { async getDetailById(id, readFlag) {
const res = await uni.$api.commonApi.getTaskById({ id }) const res = await uni.$api.commonApi.getTaskById({ id })
// 不刷新列表的更新消息状态 // 不刷新列表的更新消息状态
...@@ -501,9 +562,11 @@ export default { ...@@ -501,9 +562,11 @@ export default {
.three { .three {
left: toRpx(756); left: toRpx(756);
} }
.four { .four {
left: toRpx(1162); left: toRpx(1162);
} }
.text { .text {
position: relative; position: relative;
text-align: center; text-align: center;
...@@ -630,6 +693,7 @@ export default { ...@@ -630,6 +693,7 @@ export default {
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
&.warning-content { &.warning-content {
white-space: pre-line; white-space: pre-line;
-webkit-line-clamp: 4; -webkit-line-clamp: 4;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!