Commit d6284b11 by 胡悦

AI导师联调

1 parent 4fa28927
......@@ -311,5 +311,29 @@ module.exports = {
projectName: 'pad',
...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 @@
<view class="item" @click="jump(i)" v-for="i in item.agentList">
<image class="item-img" :src="i.entryLogoUrl" mode="scaleToFill" />
<view class="text">{{ i.entryName }}</view>
<view class="red-dot"></view>
<view v-if="i.tipShowFlag == 1" class="red-dot"></view>
</view>
</view>
</view>
......@@ -26,6 +26,11 @@ export default {
list: []
}
},
created() {
uni.$on('pageBack', () => {
this.getAiagentList()
})
},
mounted() {
this.getAiagentList()
},
......@@ -40,17 +45,23 @@ export default {
console.log(res)
this.list = res
},
jump(data) {
let {agentUrl,domainName,presuppositionProblem} = data
async jump(data) {
let {agentUrl,domainName,presuppositionProblem, sopTaskDetailInfoDTO} = data
if(!agentUrl) {
return uni.showToast({
title: '待开放',
icon: 'none'
})
}
uni.navigateTo({
url: `/pages/common/aiWebview?url=${agentUrl}&domain=${domainName}&presuppositionProblem=${presuppositionProblem}`
})
let 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 })
}
}
}
......
......@@ -17,6 +17,7 @@
</view>
{{ i.label }}
<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>
</template>
......@@ -86,7 +87,8 @@ export default {
trackInterval:null,
collectTrack:false,
hasPerson: false,
messageType: 'study'
messageType: 'study',
sopCount: 0
}
},
watch: {
......@@ -109,9 +111,11 @@ export default {
uni.$on('pageBack', () => {
console.log('pageBack')
this.getMessageInfo();
this.getSopCount()
});
this.getMessageInfo()
this.getUnreadCount()
this.getSopCount() // 获取Ai集市未读个数
},
inject: ['showPage'],
methods: {
......@@ -160,7 +164,10 @@ export default {
})
},
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
if(item.isTrack) {
this.readCount = 0
......@@ -182,6 +189,7 @@ export default {
this.$emit('update:tabIndex', index)
this.$emit("changeTab", index,jumpUrl)
this.getMessageInfo()
this.getSopCount()
},
async haveCustomerAccess(val) {
const {shopMerchantId, sceneType:scene} = val
......@@ -200,12 +208,6 @@ export default {
}).then(result=>{
if(result) {
this.hasPerson = true
// this.tabs.push({
// label: "个人中心",
// icon: "point",
// name: 'Point'
// })
// uni.$storage.set('hasPerson', true)
}
})
},
......@@ -249,6 +251,15 @@ export default {
this.clickHome()
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() {
......
......@@ -18,7 +18,7 @@
<component is="Point" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" />
</template>
<template v-else>
<component :is="componentName" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" />
<component :is="componentName" @handleOperation="handleOperation" ref="pointRef" :userInfo="userInfo" @showPage="handleShowPage" />
</template>
<view class="store-addr" v-if="footerBox">
<view class="icon-addr sprite-icon icon-addr"></view>
......@@ -58,7 +58,7 @@
<update-box />
<slot name="content" />
<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" />
</view>
</template>
......@@ -106,7 +106,8 @@ export default {
pointComponentName: 'Point',
userInfo: {},
tabIndex: 0,
showLeadPage: false
showLeadPage: false,
showBeisen: false
}
},
mounted() {
......@@ -135,8 +136,10 @@ export default {
},
methods: {
async changeTab($event, jumpUrl) {
console.log($event, 'event')
this.$emit('changeTab', $event)
if ($event == 3) {
this.showBeisen = false
this.jumpUrl = jumpUrl
if (!this.jumpUrl) {
uni.showToast({
......@@ -145,17 +148,7 @@ export default {
})
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 {
this.jumpUrl = ''
}
......@@ -204,6 +197,22 @@ export default {
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 {
back() {
console.log('back')
uni.navigateBack()
uni.$emit('aiBack')
uni.$emit('pageBack')
}
}
}
......
......@@ -57,17 +57,20 @@
<view class="message-time">{{ item.time }}</view>
<view class="message-tag">{{ item.warningTag }}</view>
</view>
<view class="message-content warning-content"><view>你有以下接待记录判定为话术违规</view>{{ item.warningContent }}
<view class="message-content warning-content">
<view>你有以下接待记录判定为话术违规</view>{{ item.warningContent }}
</view>
</template>
<template v-else-if="firstIndex == 3">
<view class="message-header">
<view :class="['dot', item.status == 1 ? '' : 'red']"></view>
<view class="message-type">AI导师消息</view>
<view class="message-time">{{ item.pushTime }}</view>
<view class="message-time">{{ item.time }}</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>
</template>
</view>
......@@ -184,13 +187,18 @@ export default {
this.pageSize = PAGE_SIZE
if (tagIndex) this.tagIndex = tagIndex
else this.tagIndex = ''
if (index == 0) {
this.getSystemPage()
} else if (index == 1) {
this.getMessagePage()
this.getLabelList()
} else if (index == 2) {
this.getWarningPage()
const actionMap = {
0: () => this.getSystemPage(),
1: () => {
this.getMessagePage();
this.getLabelList();
},
2: () => this.getWarningPage(),
3: () => this.getAiAgentPage()
};
const action = actionMap[index];
if (action) {
action();
}
},
// 跳转详情
......@@ -198,6 +206,26 @@ export default {
console.log(row);
const { id } = row;
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: () => {
uni.navigateTo({
url: `/pages/common/earlyWarnDetail?row=${encodeURIComponent(JSON.stringify(row))}`,
......@@ -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) {
const res = await uni.$api.commonApi.getTaskById({ id })
// 不刷新列表的更新消息状态
......@@ -501,9 +562,11 @@ export default {
.three {
left: toRpx(756);
}
.four {
left: toRpx(1162);
}
.text {
position: relative;
text-align: center;
......@@ -630,6 +693,7 @@ export default {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
&.warning-content {
white-space: pre-line;
-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!