Commit d7805813 by 胡悦

fix(弹窗): 修复弹窗逻辑和页面数据展示问题

- 修复学习中心弹窗重复触发问题,增加弹窗状态检查
- 修复案例课程和案例详情页面数据展示,使用真实接口数据替换模拟数据
- 修复消息弹窗字段映射和跳转逻辑,统一使用msgTitle字段
- 修复优秀案例跳转链接,添加案例分享详情页跳转
- 恢复长课程和企业通知弹窗功能,优化弹窗打开状态管理
1 parent 30ab3de0
......@@ -114,7 +114,8 @@ export default {
hasPerson: false,
messageType: 'study',
sopCount: 0,
activityTabVisible: true
activityTabVisible: true,
hasPopupOpen: false
}
},
watch: {
......@@ -392,12 +393,13 @@ export default {
if (res.total) {
this.messageData = res
this.messageType = 'attendance'
this.openStudyPopup()
this.openPopup()
}
return Promise.resolve(res.total)
},
// 弹窗推送优先级:1)学习策略/长课程推送 2)优秀案例分享 3)优秀话术推送 4)任务通知(企业通知) 5)活动中心
async getMessagePop () {
this.hasPopupOpen = false
const {sceneType} = uni.$storage.get("userInfo")
const caseParams = {
pageNum: 1,
......@@ -412,24 +414,24 @@ export default {
if(studyCaseRes.list.length) {
this.messageType = 'caseStudy'
this.messageData = studyCaseRes.list[0]
this.openStudyPopup()
this.openPopup()
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
// }
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]
})
}
return
}
// 3. 优秀案例分享
caseParams.moduleType = 7
const caseRes = await uni.$api.commonApi.getBoxPage(caseParams)
......@@ -437,7 +439,7 @@ export default {
if(caseRes.list.length) {
this.messageType = 'caseShare'
this.messageData = caseRes.list[0]
this.openStudyPopup()
this.openPopup()
return
}
// 4. 优秀话术推送
......@@ -445,19 +447,20 @@ export default {
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
// }
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')
},
......
......@@ -19,16 +19,16 @@
<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="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.title}},请及时完成。</view>
<view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.title}}即将到期,抓紧时间完成哦!</view>
<view class="btn study-btn" @click="jumpCaseStudy">去查看</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>
......@@ -66,6 +66,7 @@ export default {
},
close() {
this.$refs.popup.close()
this.$emit('close')
},
toMessage() {
const {messageData} = this
......@@ -79,16 +80,25 @@ export default {
// 跳转具体的长课程学习任务详情
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.getDetailById(this.messageData.ids[0])
} catch (e) {
uni.showToast({
title: '系统消息跳转失败',
......
......@@ -573,9 +573,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()
}
},
......
......@@ -56,11 +56,11 @@
</view>
<view class="info-row">
<text class="label">销售姓名</text>
<text class="value">{{ item.salesName || '李玉燕' }}</text>
<text class="value">{{ item.employeeName }}</text>
</view>
<view class="info-row">
<text class="label">接待时长</text>
<text class="value">{{ item.duration }}分钟</text>
<text class="value">{{ item.duration }}</text>
</view>
<view class="info-row">
<text class="label">开始接待</text>
......@@ -112,69 +112,19 @@ export default {
},
backPage() {
uni.navigateBack();
uni.$emit('backStudyCenter')
uni.$emit('pageBack')
},
async getBoxDetail(id) {
const res = await uni.$api.commonApi.getBoxDetail({ id })
// 10451
const res = await uni.$api.commonApi.getBoxDetail({ id: 10451 })
console.log(res, 'res')
// this.rowData = res.msgDetail
this.rowData = {
completeStatus: 0,
courseList: [{
id: 125,
customerName: '客户1',
receptionStatus: 1, // 接待结果 1.成交 0.战败
carModel: 'AITO M9',
phoneNumber: '1544645646',
salesName: '李玉燕',
duration: 45,
startTime: '2026-01-25 10:00:00',
endTime: '2026-01-25 10:45:00',
receptionEndTime: '2026-01-25 10:45:00',
receptionStartTime: '2026-01-25 10:00:00',
batchId: 93819,
isOrderFinishFlag: true,
orderFinishFlag: true,
fileurl: '',
score: 75
},{
id: 2,
customerName: '客户2',
receptionStatus: 1, // 接待结果 1.成交 0.战败
carModel: 'AITO M9',
phoneNumber: '1544645646',
salesName: '李玉燕',
duration: 45,
startTime: '2026-01-25 10:00:00',
endTime: '2026-01-25 10:45:00',
},{
id: 3,
customerName: '客户3',
receptionStatus: 1, // 接待结果 1.成交 0.战败
carModel: 'AITO M9',
phoneNumber: '1544645646',
salesName: '李玉燕',
duration: 45,
startTime: '2026-01-25 10:00:00',
endTime: '2026-01-25 10:45:00',
},{
id: 4,
customerName: '客户4',
receptionStatus: 1, // 接待结果 1.成交 0.战败
carModel: 'AITO M9',
phoneNumber: '1544645646',
salesName: '李玉燕',
duration: 45,
startTime: '2026-01-25 10:00:00',
endTime: '2026-01-25 10:45:00',
}],
courseTotalCount:23,
taskDeadline: '2026-01-25',
taskId: 12,
taskProgress: 23,
taskTitle: 'jkj',
totalDuration: 11
}
res.msgDetail.courseList.forEach(item => {
item.recordingUrl = item.fileUrl
item.receptionStartTime = item.startTime
item.receptionEndTime = item.endTime
item.batchId = item.id
})
this.rowData = res.msgDetail
},
jumpDetail(item) {
const {uuid} = uni.$storage.get('userInfo')
......
......@@ -127,29 +127,13 @@ export default {
},
backPage() {
uni.navigateBack();
uni.$emit('backStudyCenter')
uni.$emit('pageBack')
},
async getBoxDetail(id) {
const res = await uni.$api.commonApi.getBoxDetail({ id })
// 11220
const res = await uni.$api.commonApi.getBoxDetail({ id: 10195 })
console.log(res, 'res')
// this.rowData = res.msgDetail
this.rowData = {
completeStatus: 0,
courseTotalCount:23,
taskDeadline: '2026-01-25',
finishDate: '2026-01-24',
taskId: 12,
taskProgress: 23,
taskTitle: 'jkj',
totalDuration: 11,
courseList: [{
courseName: 'jkj',
learnDuration: 11,
progress: 23,
status: 1,
totalScore: 100
}]
}
this.rowData = res.msgDetail
},
startStudy(index, item) {
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
......@@ -158,7 +142,7 @@ export default {
if (beisenToken) {
uni.$track.add({ eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/longCourse' })
uni.navigateTo({
url: `/pages/common/studyDetail/detail?type=long&index=${index}&courseList=${encodeURIComponent(JSON.stringify(this.courseList))}`
url: `/pages/common/studyDetail/detail?type=long&index=${index}&courseList=${encodeURIComponent(JSON.stringify(this.rowData.courseList))}`
})
} else {
uni.showToast({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!