Commit 4b047b67 by 李伟康

Merge branch 'SAAS+V5.6.0' into SAAS+V5.6.1

2 parents d193333f 3f840989
......@@ -222,6 +222,46 @@ module.exports = {
...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) {
......
......@@ -114,7 +114,8 @@ export default {
hasPerson: false,
messageType: 'study',
sopCount: 0,
activityTabVisible: true
activityTabVisible: true,
hasPopupOpen: false
}
},
watch: {
......@@ -221,11 +222,7 @@ export default {
},
},
created () {
// 监听自定义事件
uni.$on('pageBack', () => {
console.log('pageBack')
this.getMessageInfo();
});
uni.$on('ActivityCenter', this.handleActivityCenter);
// uni.$on('ActivityCenter', () => {
// console.log('ActivityCenter')
......@@ -240,9 +237,13 @@ export default {
this.changeIndex(index, this.tabs[index])
});
console.log('this.tabIndex', this.tabIndex)
//获取北森代办数量
this.getUnreadCount()
// 学习中心权限获取,场景集市权限
this.getStudyCenterPermission()
// 获取消息弹窗
this.getMessageInfo()
// 获取北森权限
this.findBeiSenSSOToken()
},
inject: ['showPage'],
......@@ -388,47 +389,75 @@ export default {
if (res.total) {
this.messageData = res
this.messageType = 'attendance'
this.openStudyPopup()
this.openPopup()
}
return Promise.resolve(res.total)
},
// 消息中心未读总数
// async getMessageCount () {
// const { sceneType } = uni.$storage.get("userInfo")
// const res = await uni.$api.commonApi.getMessageCount({
// status: 0, // 待查看,未读
// businessType: sceneType
// })
// this.messageTotal = res
// },
// 学习中心消息弹窗,优先级高于有修改话术弹窗
// 弹窗推送优先级:1)学习策略/长课程推送 2)优秀案例分享 3)优秀话术推送 4)任务通知(企业通知) 5)活动中心
async getMessagePop () {
const res = await uni.$api.commonApi.getMessagePop({})
if (res.ids && res.ids.length > 0) {
if (Array.isArray(res.moduleTypeList) && (res.moduleTypeList.includes(3) || res.moduleTypeList.includes(4))
) {
// 3, 4学习任务弹窗
this.messageType = 'study'
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()
this.hasPopupOpen = false
const {sceneType} = uni.$storage.get("userInfo")
const caseParams = {
pageNum: 1,
pageSize: 1,
businessType: sceneType,
status: 0,
createdTimeSortType: 0
}
// 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.openPopup()
return
}
// 2. 长课程推送
const longCourseRes = await uni.$api.commonApi.getLongCourseNotify()
console.log(longCourseRes, 'longCourseRes')
if(longCourseRes.count > 0) {
this.messageType = 'study'
this.messageData = longCourseRes
this.openPopup()
// 确认消息
if (longCourseRes.ids.length) {
uni.$api.commonApi.getStudyTaskConfirm({
ids: longCourseRes.ids[0]
})
}
} else {
const data = await this.getMessage()
if (!data && this.activityWindowPopStatus == 1) this.$store.dispatch('setActivityWindowPopCount', 2)
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.openPopup()
return
}
// 4. 优秀话术推送
const data = await this.getMessage()
if (data) return
// 5. 企业通知推送
const enterpriseRes = await uni.$api.commonApi.getEnterpriseNotify()
console.log(enterpriseRes, 'enterpriseRes')
if(enterpriseRes.ids || enterpriseRes.businessIds) {
this.messageType = 'system'
this.messageData = enterpriseRes
this.openPopup()
return
}
// 6. 活动中心弹窗
if (this.activityWindowPopStatus == 1) this.$store.dispatch('setActivityWindowPopCount', 2)
},
openStudyPopup () {
openPopup () {
this.$refs.kfRef.open()
this.hasPopupOpen = true
this.$store.dispatch('setActivityWindowPopCount', 0)
this.$emit('closeActivityCenter')
},
......
......@@ -10,12 +10,26 @@
<!-- 当前有 3 个学习任务待完成,请及时处理。
坚持学习助您能力提升! -->
<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 study-text">当前有{{messageData.count}}个学习任务待完成,请及时处理。</view>
<view class="text study-text">坚持学习助您能力提升!</view>
<view class="btn study-btn" @click="jumpStudyCenter">去查看</view>
</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.msgTitle}},请及时完成。</view>
<view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.msgTitle}}即将到期,抓紧时间完成哦!</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.msgTitle}},请及时完成。</view>
<view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.msgTitle}}即将到期,抓紧时间完成哦!</view>
<view class="btn study-btn" @click="jumpCaseShare">去学习</view>
</template>
<template v-else-if="type=='system'">
<image class="message-bg" :src="require('@//assets/images/common/system-bg.webp')"></image>
<view class="text text-first study-title">系统消息</view>
......@@ -52,6 +66,7 @@ export default {
},
close() {
this.$refs.popup.close()
this.$emit('close')
},
toMessage() {
const {messageData} = this
......@@ -62,9 +77,30 @@ export default {
uni.$emit('studyCenter')
this.close()
},
// 跳转具体的长课程学习任务详情
jumpCaseStudy() {
console.log(this.messageData)
// uni.$emit('caseStudy')
this.close()
uni.navigateTo({
url: `/pages/common/studyDetail/caseCourse?id=${this.messageData.id}`
})
},
// 跳转优秀案例详情
jumpCaseShare() {
console.log(this.messageData)
// uni.$emit('caseShare')
this.close()
uni.navigateTo({
url: `/pages/common/caseDetail/index?id=${this.messageData.id}`
})
},
jumpSystem() {
try {
this.getDetailById(this.messageData.businessIds[0])
if(this.messageData.businessIds) this.getDetailById(this.messageData.businessIds[0])
if(this.messageData.ids) {
this.getCaseDetailById(this.messageData.ids[0])
}
} catch (e) {
uni.showToast({
title: '系统消息跳转失败',
......@@ -75,27 +111,31 @@ export default {
}
this.close()
},
async getCaseDetailById(id) {
const res = await uni.$api.commonApi.getBoxDetail({ id })
this.handleNavigation(res.msgDetail)
},
async getDetailById(id) {
const res = await uni.$api.commonApi.getTaskById({ id })
const _row = encodeURIComponent(JSON.stringify(res))
if (res.contentType == 1) {
this.handleNavigation(res)
},
handleNavigation(data) {
const _row = encodeURIComponent(JSON.stringify(data))
const { contentType, content, title, id } = data
if (contentType == 1) {
uni.navigateTo({
url: `/pages/common/systemDetail?row=${_row}`
})
} else if (res.contentType == 2) {
console.log(JSON.parse(res.content))
const _content = res.content ? JSON.parse(res.content) : []
} else if (contentType == 2) {
const _content = content ? JSON.parse(content) : []
const url = _content[0]
const { content, title, id } = res
uni.navigateTo({
// url: `/pages/common/msgwebview?url=${url}&title=${title}&id=${id}`
url: `/pages/common/imgPreview?tabName=${title}&sourceType=2&detailUrl=${url}&row=${_row}`
})
} else if (res.contentType == 3) {
const _content = res.content ? JSON.parse(res.content) : []
console.log(_content, 'res.contentType == 3')
const url = _content[0].image
const { content, title, id } = res
} else if (contentType == 3) {
const _content = content ? JSON.parse(content) : []
const url = _content[0]?.image || ''
uni.navigateTo({
url: `/pages/common/msgwebview?fileUrl=${url}&title=${title}&id=${id}&row=${_row}`
})
......@@ -109,21 +149,26 @@ export default {
.kf-box {
position: relative;
width: toRpx(848);
height: toRpx(720);
padding-bottom: toRpx(1);
// height: toRpx(720);
background: #ffffff;
border-radius: toRpx(48);
// padding: 0 toRpx(48);
box-sizing: border-box;
&.system-height {
height: toRpx(664);
}
// &.system-height {
// height: toRpx(664);
// }
.message-bg {
width: toRpx(848);
height: toRpx(346);
border-radius: toRpx(48);
}
.study-bg{
width: toRpx(848);
height: toRpx(248);
border-radius: toRpx(48);
}
.text {
text-align: center;
color: #333333;
......@@ -131,9 +176,12 @@ export default {
line-height: toRpx(64);
&.text-first {
margin-top: toRpx(40);
margin-bottom: toRpx(16);
}
&.study-text {
line-height: toRpx(48);
padding: 0 toRpx(64);
word-break: break-all;
}
&.study-title {
font-weight: 500;
......
......@@ -260,6 +260,7 @@ export default {
// 组件销毁前移除监听
uni.$logger.local.info('levelStudyPopup 移除监听')
uni.$off('levelStudyPopup')
uni.$off('pageBack')
},
async mounted() {
uni.$logger.local.info('levelStudyPopup 开始监听mounted')
......@@ -313,6 +314,13 @@ export default {
deep: true
}
},
created() {
// 监听自定义事件
uni.$on('pageBack', () => {
this.$refs.leftBox.getMessageInfo();
this.$refs.messageRef.getMessageSummary()
});
},
methods: {
// 处理开始测评(参考 detail.vue 的实现)
async handleStartAssessment() {
......@@ -491,9 +499,9 @@ export default {
if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0
this.$emit('changeTab', index)
console.log(this.$refs.leftBox.hasPopupOpen)
// 切换到学习中心时显示弹窗
if (item.name === 'StudyCenter') {
if (item.name === 'StudyCenter' && !this.$refs.leftBox.hasPopupOpen) {
this.getLevelExamInfo()
}
},
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 2
const index = 3
/**
*
0本地
......
......@@ -2,8 +2,8 @@
"name" : "展业助手",
"appid" : "__UNI__D3BD3DF",
"description" : "",
"versionName" : "2.21.2",
"versionCode" : 2212,
"versionName" : "2.21.0",
"versionCode" : 2210,
"transformPx" : false,
"sassImplementationName" : "node-sass",
/* 5+App特有相关 */
......
......@@ -14,12 +14,16 @@ export default {
}
const { row } = options
const _row = JSON.parse(row)
console.log(_row)
this.systemInfo = _row
this.systemInfo.time = dayjs(new Date(_row.actualSendTime)).format("YYYY-MM-DD HH:mm:ss")
this.addTrack(_row)
this.timer = setInterval(() => {
this.leaveTrack(this.id)
}, 3000)
if (_row.actualSendTime) this.systemInfo.time = dayjs(new Date(_row.actualSendTime)).format("YYYY-MM-DD HH:mm:ss")
if (_row.moduleType != 8) { // 策略企业通知不需要埋点
this.addTrack(_row)
this.timer = setInterval(() => {
this.leaveTrack(this.id)
}, 3000)
}
},
methods: {
// 进入埋点事件
......
......@@ -197,6 +197,12 @@
}
},
{
"path": "pages/common/studyDetail/caseCourse",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/studyDetail/shortCourse",
"style": {
"navigationStyle": "custom"
......@@ -307,6 +313,12 @@
}
},
{
"path": "pages/common/caseDetail/index",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/wageAppeal/index",
"style": {
"navigationStyle": "custom"
......
......@@ -73,9 +73,20 @@ export default {
// }
// });
},
onBackPress(options) {
if (options.from === 'backbutton') {
// 阻止默认返回
this.back()
return true
}
return false
},
back () {
if (this.isComponents) this.$emit('previewBack')
else uni.navigateBack()
else {
uni.navigateBack()
uni.$emit('pageBack')
}
},
}
}
......
......@@ -32,6 +32,18 @@ export default {
mounted () {
},
methods: {
onBackPress(options) {
if (options.from === 'backbutton') {
// 阻止默认返回
this.back()
return true
}
return false
},
back () {
uni.navigateBack()
uni.$emit('pageBack')
},
}
}
</script>
......
......@@ -153,7 +153,7 @@ export default {
}
.message-index-box {
margin: 0 toRpx(32);
height: 100%;
// height: 100%;
&.message-out {
padding-bottom: toRpx(40);
box-sizing: content-box;
......
......@@ -4,7 +4,8 @@ const moduleTypeEnum = {
2: '违规话术',
3: '短课程学习',
4: '长课程学习',
5: '活动中心'
5: '活动中心',
7: '优秀案例学习'
}
const moduleIconEnum = {
......@@ -13,11 +14,18 @@ const moduleIconEnum = {
2: 'notice-violate',
3: 'notice-study',
4: 'notice-study',
5: 'active-msg'
5: 'active-msg',
7: 'notice-recording'
}
const moduleContentEnum = {
1: '叮咚!快来查看优秀话术,提升接待技巧吧',
2: '话术违规预警'
2: '话术违规预警',
7: '新的优秀案例学习任务'
}
export { moduleTypeEnum, moduleIconEnum, moduleContentEnum }
\ No newline at end of file
const reminderTypeEnum = {
1: '新的优秀案例学习任务',
2: '优秀案例学习提醒'
}
export { moduleTypeEnum, moduleIconEnum, moduleContentEnum, reminderTypeEnum }
......@@ -39,7 +39,7 @@ export default {
// 返回
back() {
// this.showPage('MessageList')
// uni.$emit('pageBack');
uni.$emit('pageBack');
uni.navigateBack({
delta: 1,
animationType: 'pop-out',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!