Commit 30ab3de0 by 胡悦

feat(消息中心): 新增优秀案例学习模块

- 新增优秀案例学习任务类型(模块类型7),支持消息弹窗、服务中心列表展示和任务详情查看
- 新增消息盒子相关接口,包括分页查询、详情查询和学习记录管理
- 新增案例学习详情页(caseDetail)和案例课程详情页(caseCourse)
- 更新消息弹窗优先级逻辑,支持优秀案例学习任务提醒
- 新增相关图片资源(案例通知背景图、默认背景图等)
- 在pages.json中注册新增页面路由
1 parent a7498519
...@@ -222,6 +222,46 @@ module.exports = { ...@@ -222,6 +222,46 @@ module.exports = {
...data ...data
}) })
}, },
// 消息盒子消息分页列表-新
getBoxPage(data) {
return http.post({
method: 'dj.pad.api.new.pad.message.box.page',
projectName: 'pad',
...data
})
},
// 查询消息盒子消息详情 - 新
getBoxDetail(data) {
return http.post({
method: 'dj.pad.api.new.pad.message.box.detail',
projectName: 'pad',
...data
})
},
// 长课程消息提醒 - 旧接口拆的新接口
getLongCourseNotify(data = {}) {
return http.post({
method: 'dj.pad.api.staff.long.course.message.notify',
projectName: 'pad',
...data
})
},
// 企业通知消息提醒 - 旧接口拆的新接口
getEnterpriseNotify(data = {}) {
return http.post({
method: 'dj.pad.api.staff.enterprise.message.notify',
projectName: 'pad',
...data
})
},
// 录音学习记录管理
insertLearningRecord(data) {
return http.post({
method: 'dj.api.strategy.monitor.insertOrUpdateLearningRecord',
projectName: 'pad',
...data
})
},
/** 系统消息接口 */ /** 系统消息接口 */
// 分页查询系统消息 // 分页查询系统消息
getTaskInfo(data) { getTaskInfo(data) {
......

2.99 MB | W: | H:

2.99 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -240,9 +240,13 @@ export default { ...@@ -240,9 +240,13 @@ export default {
this.changeIndex(index, this.tabs[index]) this.changeIndex(index, this.tabs[index])
}); });
console.log('this.tabIndex', this.tabIndex) console.log('this.tabIndex', this.tabIndex)
//获取北森代办数量
this.getUnreadCount() this.getUnreadCount()
// 学习中心权限获取,场景集市权限
this.getStudyCenterPermission() this.getStudyCenterPermission()
// 获取消息弹窗
this.getMessageInfo() this.getMessageInfo()
// 获取北森权限
this.findBeiSenSSOToken() this.findBeiSenSSOToken()
}, },
inject: ['showPage'], inject: ['showPage'],
...@@ -392,40 +396,65 @@ export default { ...@@ -392,40 +396,65 @@ export default {
} }
return Promise.resolve(res.total) return Promise.resolve(res.total)
}, },
// 消息中心未读总数 // 弹窗推送优先级:1)学习策略/长课程推送 2)优秀案例分享 3)优秀话术推送 4)任务通知(企业通知) 5)活动中心
// async getMessageCount () {
// const { sceneType } = uni.$storage.get("userInfo")
// const res = await uni.$api.commonApi.getMessageCount({
// status: 0, // 待查看,未读
// businessType: sceneType
// })
// this.messageTotal = res
// },
// 学习中心消息弹窗,优先级高于有修改话术弹窗
async getMessagePop () { async getMessagePop () {
const res = await uni.$api.commonApi.getMessagePop({}) const {sceneType} = uni.$storage.get("userInfo")
if (res.ids && res.ids.length > 0) { const caseParams = {
if (Array.isArray(res.moduleTypeList) && (res.moduleTypeList.includes(3) || res.moduleTypeList.includes(4)) pageNum: 1,
) { pageSize: 1,
// 3, 4学习任务弹窗 businessType: sceneType,
this.messageType = 'study' status: 0
this.messageData = res
this.openStudyPopup()
// 确认消息
if (res.ids.length) {
uni.$api.commonApi.getStudyTaskConfirm({
ids: res.ids[0]
})
}
} else {
this.messageType = 'system'
this.messageData = res
this.openStudyPopup()
}
} else {
const data = await this.getMessage()
if (!data && this.activityWindowPopStatus == 1) this.$store.dispatch('setActivityWindowPopCount', 2)
} }
// 1. 学习策略弹窗
caseParams.moduleType = 6
const studyCaseRes = await uni.$api.commonApi.getBoxPage(caseParams)
console.log(studyCaseRes, 'studyCaseRes')
if(studyCaseRes.list.length) {
this.messageType = 'caseStudy'
this.messageData = studyCaseRes.list[0]
this.openStudyPopup()
return
}
// 2. 长课程推送
// const longCourseRes = await uni.$api.commonApi.getLongCourseNotify()
// console.log(longCourseRes, 'longCourseRes')
// if(Array.isArray(longCourseRes.moduleTypeList) && (longCourseRes.moduleTypeList.includes(3) || longCourseRes.moduleTypeList.includes(4))) {
// this.messageType = 'study'
// this.messageData = longCourseRes
// this.openStudyPopup()
// // 确认消息
// if (longCourseRes.ids.length) {
// uni.$api.commonApi.getStudyTaskConfirm({
// ids: longCourseRes.ids[0]
// })
// }
// return
// }
// 3. 优秀案例分享
caseParams.moduleType = 7
const caseRes = await uni.$api.commonApi.getBoxPage(caseParams)
console.log(caseRes, 'caseRes')
if(caseRes.list.length) {
this.messageType = 'caseShare'
this.messageData = caseRes.list[0]
this.openStudyPopup()
return
}
// 4. 优秀话术推送
const data = await this.getMessage()
if (data) return
// 5. 企业通知推送
// const enterpriseRes = await uni.$api.commonApi.getEnterpriseNotify()
// console.log(enterpriseRes, 'enterpriseRes')
// if(Array.isArray(enterpriseRes.moduleTypeList) && (enterpriseRes.moduleTypeList.includes(0))) {
// this.messageType = 'system'
// this.messageData = enterpriseRes
// this.openStudyPopup()
// return
// }
// 6. 活动中心弹窗
if (this.activityWindowPopStatus == 1) this.$store.dispatch('setActivityWindowPopCount', 2)
}, },
openStudyPopup () { openStudyPopup () {
this.$refs.kfRef.open() this.$refs.kfRef.open()
......
...@@ -10,12 +10,26 @@ ...@@ -10,12 +10,26 @@
<!-- 当前有 3 个学习任务待完成,请及时处理。 <!-- 当前有 3 个学习任务待完成,请及时处理。
坚持学习助您能力提升! --> 坚持学习助您能力提升! -->
<template v-else-if="type=='study'"> <template v-else-if="type=='study'">
<image class="message-bg" :src="require('@//assets/images/common/study-center-bg.png')"></image> <image class="study-bg" :src="require('@//assets/images/common/study-center-bg.png')"></image>
<view class="text text-first study-title">学习提醒</view> <view class="text text-first study-title">学习提醒</view>
<view class="text study-text">当前有{{messageData.count}}个学习任务待完成,请及时处理。</view> <view class="text study-text">当前有{{messageData.count}}个学习任务待完成,请及时处理。</view>
<view class="text study-text">坚持学习助您能力提升!</view> <view class="text study-text">坚持学习助您能力提升!</view>
<view class="btn study-btn" @click="jumpStudyCenter">去查看</view> <view class="btn study-btn" @click="jumpStudyCenter">去查看</view>
</template> </template>
<template v-else-if="type=='caseStudy'">
<image class="study-bg" :src="require('@//assets/images/common/study-center-bg.png')"></image>
<view class="text text-first study-title">学习提醒</view>
<view class="text study-text" v-if="messageData.reminderType == 1">您有新的长课程学习任务:{{messageData.title}},请及时完成。</view>
<view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.title}}即将到期,抓紧时间完成哦!</view>
<view class="btn study-btn" @click="jumpCaseStudy">去查看</view>
</template>
<template v-else-if="type=='caseShare'">
<image class="study-bg" :src="require('@//assets/images/common/case-notice.png')"></image>
<view class="text text-first study-title">学习提醒</view>
<view class="text study-text" v-if="messageData.reminderType == 1">您有新的优秀案例学习任务:{{messageData.title}},请及时完成。</view>
<view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.title}}即将到期,抓紧时间完成哦!</view>
<view class="btn study-btn" @click="jumpCaseStudy">去查看</view>
</template>
<template v-else-if="type=='system'"> <template v-else-if="type=='system'">
<image class="message-bg" :src="require('@//assets/images/common/system-bg.webp')"></image> <image class="message-bg" :src="require('@//assets/images/common/system-bg.webp')"></image>
<view class="text text-first study-title">系统消息</view> <view class="text text-first study-title">系统消息</view>
...@@ -62,6 +76,16 @@ export default { ...@@ -62,6 +76,16 @@ export default {
uni.$emit('studyCenter') uni.$emit('studyCenter')
this.close() this.close()
}, },
// 跳转具体的长课程学习任务详情
jumpCaseStudy() {
console.log(this.messageData)
// uni.$emit('caseStudy')
this.close()
uni.navigateTo({
url: `/pages/common/studyDetail/caseCourse?id=${this.messageData.id}`
})
},
jumpSystem() { jumpSystem() {
try { try {
this.getDetailById(this.messageData.businessIds[0]) this.getDetailById(this.messageData.businessIds[0])
...@@ -109,21 +133,26 @@ export default { ...@@ -109,21 +133,26 @@ export default {
.kf-box { .kf-box {
position: relative; position: relative;
width: toRpx(848); width: toRpx(848);
height: toRpx(720); padding-bottom: toRpx(1);
// height: toRpx(720);
background: #ffffff; background: #ffffff;
border-radius: toRpx(48); border-radius: toRpx(48);
// padding: 0 toRpx(48); // padding: 0 toRpx(48);
box-sizing: border-box; box-sizing: border-box;
&.system-height { // &.system-height {
height: toRpx(664); // height: toRpx(664);
} // }
.message-bg { .message-bg {
width: toRpx(848); width: toRpx(848);
height: toRpx(346); height: toRpx(346);
border-radius: toRpx(48); border-radius: toRpx(48);
} }
.study-bg{
width: toRpx(848);
height: toRpx(248);
border-radius: toRpx(48);
}
.text { .text {
text-align: center; text-align: center;
color: #333333; color: #333333;
...@@ -131,9 +160,12 @@ export default { ...@@ -131,9 +160,12 @@ export default {
line-height: toRpx(64); line-height: toRpx(64);
&.text-first { &.text-first {
margin-top: toRpx(40); margin-top: toRpx(40);
margin-bottom: toRpx(16);
} }
&.study-text { &.study-text {
line-height: toRpx(48); line-height: toRpx(48);
padding: 0 toRpx(64);
word-break: break-all;
} }
&.study-title { &.study-title {
font-weight: 500; font-weight: 500;
......
...@@ -197,6 +197,12 @@ ...@@ -197,6 +197,12 @@
} }
}, },
{ {
"path": "pages/common/studyDetail/caseCourse",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/studyDetail/shortCourse", "path": "pages/common/studyDetail/shortCourse",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
...@@ -305,6 +311,12 @@ ...@@ -305,6 +311,12 @@
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path": "pages/common/caseDetail/index",
"style": {
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -4,7 +4,8 @@ const moduleTypeEnum = { ...@@ -4,7 +4,8 @@ const moduleTypeEnum = {
2: '违规话术', 2: '违规话术',
3: '短课程学习', 3: '短课程学习',
4: '长课程学习', 4: '长课程学习',
5: '活动中心' 5: '活动中心',
7: '优秀案例学习'
} }
const moduleIconEnum = { const moduleIconEnum = {
...@@ -13,11 +14,18 @@ const moduleIconEnum = { ...@@ -13,11 +14,18 @@ const moduleIconEnum = {
2: 'notice-violate', 2: 'notice-violate',
3: 'notice-study', 3: 'notice-study',
4: 'notice-study', 4: 'notice-study',
5: 'active-msg' 5: 'active-msg',
7: 'notice-recording'
} }
const moduleContentEnum = { const moduleContentEnum = {
1: '叮咚!快来查看优秀话术,提升接待技巧吧', 1: '叮咚!快来查看优秀话术,提升接待技巧吧',
2: '话术违规预警' 2: '话术违规预警',
7: '新的优秀案例学习任务'
} }
export { moduleTypeEnum, moduleIconEnum, moduleContentEnum }
\ No newline at end of file \ No newline at end of file
const reminderTypeEnum = {
1: '新的优秀案例学习任务',
2: '优秀案例学习提醒'
}
export { moduleTypeEnum, moduleIconEnum, moduleContentEnum, reminderTypeEnum }
...@@ -22,10 +22,13 @@ ...@@ -22,10 +22,13 @@
<view class="service-item" v-for="(item, index) in list" :key="index" @click="handleDetail(item)"> <view class="service-item" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
<view class="service-item-title"> <view class="service-item-title">
<view class="service-item-title-left"> <view class="service-item-title-left">
<view class="dot-value" v-if="(moduleType == 0 && !item.readFlag) || (moduleType == 1 && item.status == 0) || (moduleType == 2 && item.status == 0) || (moduleType == 3 && item.status == 0) || (moduleType == 4 && item.status == 0) || (moduleType == 5 && item.status == 0)"></view> <view class="dot-value" v-if="showDot(item)"></view>
<template v-if="moduleType == 3 || moduleType == 4"> <template v-if="moduleType == 3 || moduleType == 4">
{{ item.title }} {{ item.title }}
</template> </template>
<template v-else-if="moduleType == 7">
{{ reminderTypeEnum[item.reminderType] }}
</template>
<template v-else> <template v-else>
{{ moduleTypeEnum[moduleType] }} {{ moduleTypeEnum[moduleType] }}
</template> </template>
...@@ -46,6 +49,10 @@ ...@@ -46,6 +49,10 @@
<!-- <view class="service-item-text">学习任务名称:{{ item.taskName }}</view> --> <!-- <view class="service-item-text">学习任务名称:{{ item.taskName }}</view> -->
</template> </template>
</template> </template>
<template v-else-if="moduleType == 7">
<view class="service-item-text">学习任务名称:{{ item.msgTitle }}</view>
<view class="service-item-text">任务完成时间:小伙伴,请于{{ formatTime(item.taskEndTime, 'YYYY-MM-DD HH:mm') }}完成哦~</view>
</template>
<view class="service-item-text">提醒时间:{{ item.time || formatTime(item.createdTime, 'YYYY-MM-DD HH:mm') }}</view> <view class="service-item-text">提醒时间:{{ item.time || formatTime(item.createdTime, 'YYYY-MM-DD HH:mm') }}</view>
<template v-if="moduleType == 1 || moduleType == 2"> <template v-if="moduleType == 1 || moduleType == 2">
<view class="service-item-text">提醒内容:{{ moduleContentEnum[moduleType] }}</view> <view class="service-item-text">提醒内容:{{ moduleContentEnum[moduleType] }}</view>
...@@ -76,7 +83,7 @@ const PAGE_SIZE = 10 ...@@ -76,7 +83,7 @@ const PAGE_SIZE = 10
const PAGE_NUM = 1 const PAGE_NUM = 1
let timer = null let timer = null
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { moduleTypeEnum, moduleContentEnum } from './components/contant' import { moduleTypeEnum, moduleContentEnum, reminderTypeEnum } from './components/contant'
import ServiceList from './components/ServiceList.vue' import ServiceList from './components/ServiceList.vue'
import { getMessageSummary } from '../../../api/module/common' import { getMessageSummary } from '../../../api/module/common'
export default { export default {
...@@ -88,6 +95,7 @@ export default { ...@@ -88,6 +95,7 @@ export default {
return { return {
moduleTypeEnum, moduleTypeEnum,
moduleContentEnum, moduleContentEnum,
reminderTypeEnum,
moduleType: null, moduleType: null,
topList: [], topList: [],
scriptList: [], scriptList: [],
...@@ -96,6 +104,7 @@ export default { ...@@ -96,6 +104,7 @@ export default {
shortCourseList: [], shortCourseList: [],
longCourseList: [], longCourseList: [],
activityList: [], activityList: [],
caseList: [],
total: 0, total: 0,
nothing: false, nothing: false,
pageNum: 1, pageNum: 1,
...@@ -123,6 +132,8 @@ export default { ...@@ -123,6 +132,8 @@ export default {
return this.longCourseList return this.longCourseList
case 5: case 5:
return this.activityList return this.activityList
case 7:
return this.caseList
default: default:
return [] return []
} }
...@@ -150,8 +161,19 @@ export default { ...@@ -150,8 +161,19 @@ export default {
}, },
methods: { methods: {
formatTime(time, formatStr) { formatTime(time, formatStr) {
if (!time) return '-'
return dayjs(time).format(formatStr) return dayjs(time).format(formatStr)
}, },
showDot(item) {
const moduleType = Number(this.moduleType)
if (moduleType === 0) {
return !item.readFlag
}
if ([1, 2, 3, 4, 5, 6].includes(moduleType)) {
return item.status == 0
}
return false
},
// 获取服务中心列表 // 获取服务中心列表
async getMessageSummary(sceneType) { async getMessageSummary(sceneType) {
// const userInfo = uni.$storage.get('userInfo') // const userInfo = uni.$storage.get('userInfo')
...@@ -174,8 +196,13 @@ export default { ...@@ -174,8 +196,13 @@ export default {
break break
case 4: case 4:
this.getCourseList(4) this.getCourseList(4)
break
case 5: case 5:
this.getActivityList() this.getActivityList()
break
case 7:
this.getBoxList(7)
break
default: default:
break break
} }
...@@ -441,12 +468,23 @@ export default { ...@@ -441,12 +468,23 @@ export default {
break break
case 4: case 4:
console.log('长课程学习跳转') console.log('长课程学习跳转')
uni.navigateTo({ if (item.moduleType == 4) {
url: `/pages/common/studyDetail/longCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}&from=service`, // 长课程配置的任务
fail: err => { uni.navigateTo({
console.error('页面跳转失败:', err) url: `/pages/common/studyDetail/longCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}&from=service`,
} fail: err => {
}) console.error('页面跳转失败:', err)
}
})
} else if (item.moduleType == 6) {
// 策略中心配置的长课程任务
uni.navigateTo({
url: `/pages/common/studyDetail/caseCourse?id=${item.id}`,
fail: err => {
console.error('页面跳转失败:', err)
}
})
}
break break
case 5: case 5:
console.log('活动消息跳转') console.log('活动消息跳转')
...@@ -460,6 +498,15 @@ export default { ...@@ -460,6 +498,15 @@ export default {
}) })
uni.$emit('ActivityCenter') uni.$emit('ActivityCenter')
break break
case 7:
console.log('优秀案例学习跳转')
uni.navigateTo({
url: `/pages/common/caseDetail/index?id=${item.id}`,
fail: err => {
console.error('页面跳转失败:', err)
}
})
break
default: default:
break break
} }
...@@ -527,6 +574,39 @@ export default { ...@@ -527,6 +574,39 @@ export default {
}) })
} }
}, },
// 优秀案例学习列表
async getBoxList(moduleType) {
try {
uni.showLoading({
mask: true
})
const { sceneType } = uni.$storage.get('userInfo')
const { pageNum, pageSize } = this
const res = await uni.$api.commonApi.getBoxPage({
pageNum,
pageSize,
moduleType: moduleType, // 7-优秀案例分享策略
businessType: sceneType
})
res.list?.length &&
res.list.map(e => {
e.time = e.createTime
})
if (pageNum == 1) {
this.caseList = res.list || []
} else {
this.caseList = this.caseList.concat(res.list || [])
}
uni.hideLoading()
this.total = res.total
this.nothing = res.length ? true : false
} catch (error) {
uni.showToast({
title: error,
icon: 'none'
})
}
},
// 置顶,取消置顶 // 置顶,取消置顶
handleStickTop() { handleStickTop() {
clearTimeout(timer) clearTimeout(timer)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!