Commit d7805813 by 胡悦

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

- 修复学习中心弹窗重复触发问题,增加弹窗状态检查
- 修复案例课程和案例详情页面数据展示,使用真实接口数据替换模拟数据
- 修复消息弹窗字段映射和跳转逻辑,统一使用msgTitle字段
- 修复优秀案例跳转链接,添加案例分享详情页跳转
- 恢复长课程和企业通知弹窗功能,优化弹窗打开状态管理
1 parent 30ab3de0
...@@ -114,7 +114,8 @@ export default { ...@@ -114,7 +114,8 @@ export default {
hasPerson: false, hasPerson: false,
messageType: 'study', messageType: 'study',
sopCount: 0, sopCount: 0,
activityTabVisible: true activityTabVisible: true,
hasPopupOpen: false
} }
}, },
watch: { watch: {
...@@ -392,12 +393,13 @@ export default { ...@@ -392,12 +393,13 @@ export default {
if (res.total) { if (res.total) {
this.messageData = res this.messageData = res
this.messageType = 'attendance' this.messageType = 'attendance'
this.openStudyPopup() this.openPopup()
} }
return Promise.resolve(res.total) return Promise.resolve(res.total)
}, },
// 弹窗推送优先级:1)学习策略/长课程推送 2)优秀案例分享 3)优秀话术推送 4)任务通知(企业通知) 5)活动中心 // 弹窗推送优先级:1)学习策略/长课程推送 2)优秀案例分享 3)优秀话术推送 4)任务通知(企业通知) 5)活动中心
async getMessagePop () { async getMessagePop () {
this.hasPopupOpen = false
const {sceneType} = uni.$storage.get("userInfo") const {sceneType} = uni.$storage.get("userInfo")
const caseParams = { const caseParams = {
pageNum: 1, pageNum: 1,
...@@ -412,24 +414,24 @@ export default { ...@@ -412,24 +414,24 @@ export default {
if(studyCaseRes.list.length) { if(studyCaseRes.list.length) {
this.messageType = 'caseStudy' this.messageType = 'caseStudy'
this.messageData = studyCaseRes.list[0] this.messageData = studyCaseRes.list[0]
this.openStudyPopup() this.openPopup()
return return
} }
// 2. 长课程推送 // 2. 长课程推送
// const longCourseRes = await uni.$api.commonApi.getLongCourseNotify() const longCourseRes = await uni.$api.commonApi.getLongCourseNotify()
// console.log(longCourseRes, 'longCourseRes') console.log(longCourseRes, 'longCourseRes')
// if(Array.isArray(longCourseRes.moduleTypeList) && (longCourseRes.moduleTypeList.includes(3) || longCourseRes.moduleTypeList.includes(4))) { if(longCourseRes.count > 0) {
// this.messageType = 'study' this.messageType = 'study'
// this.messageData = longCourseRes this.messageData = longCourseRes
// this.openStudyPopup() this.openPopup()
// // 确认消息 // 确认消息
// if (longCourseRes.ids.length) { if (longCourseRes.ids.length) {
// uni.$api.commonApi.getStudyTaskConfirm({ uni.$api.commonApi.getStudyTaskConfirm({
// ids: longCourseRes.ids[0] ids: longCourseRes.ids[0]
// }) })
// } }
// return return
// } }
// 3. 优秀案例分享 // 3. 优秀案例分享
caseParams.moduleType = 7 caseParams.moduleType = 7
const caseRes = await uni.$api.commonApi.getBoxPage(caseParams) const caseRes = await uni.$api.commonApi.getBoxPage(caseParams)
...@@ -437,7 +439,7 @@ export default { ...@@ -437,7 +439,7 @@ export default {
if(caseRes.list.length) { if(caseRes.list.length) {
this.messageType = 'caseShare' this.messageType = 'caseShare'
this.messageData = caseRes.list[0] this.messageData = caseRes.list[0]
this.openStudyPopup() this.openPopup()
return return
} }
// 4. 优秀话术推送 // 4. 优秀话术推送
...@@ -445,19 +447,20 @@ export default { ...@@ -445,19 +447,20 @@ export default {
if (data) return if (data) return
// 5. 企业通知推送 // 5. 企业通知推送
// const enterpriseRes = await uni.$api.commonApi.getEnterpriseNotify() const enterpriseRes = await uni.$api.commonApi.getEnterpriseNotify()
// console.log(enterpriseRes, 'enterpriseRes') console.log(enterpriseRes, 'enterpriseRes')
// if(Array.isArray(enterpriseRes.moduleTypeList) && (enterpriseRes.moduleTypeList.includes(0))) { if(enterpriseRes.ids || enterpriseRes.businessIds) {
// this.messageType = 'system' this.messageType = 'system'
// this.messageData = enterpriseRes this.messageData = enterpriseRes
// this.openStudyPopup() this.openPopup()
// return return
// } }
// 6. 活动中心弹窗 // 6. 活动中心弹窗
if (this.activityWindowPopStatus == 1) this.$store.dispatch('setActivityWindowPopCount', 2) if (this.activityWindowPopStatus == 1) this.$store.dispatch('setActivityWindowPopCount', 2)
}, },
openStudyPopup () { openPopup () {
this.$refs.kfRef.open() this.$refs.kfRef.open()
this.hasPopupOpen = true
this.$store.dispatch('setActivityWindowPopCount', 0) this.$store.dispatch('setActivityWindowPopCount', 0)
this.$emit('closeActivityCenter') this.$emit('closeActivityCenter')
}, },
......
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
<template v-else-if="type=='caseStudy'"> <template v-else-if="type=='caseStudy'">
<image class="study-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" v-if="messageData.reminderType == 1">您有新的长课程学习任务:{{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.title}}即将到期,抓紧时间完成哦!</view> <view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.msgTitle}}即将到期,抓紧时间完成哦!</view>
<view class="btn study-btn" @click="jumpCaseStudy">去查看</view> <view class="btn study-btn" @click="jumpCaseStudy">去查看</view>
</template> </template>
<template v-else-if="type=='caseShare'"> <template v-else-if="type=='caseShare'">
<image class="study-bg" :src="require('@//assets/images/common/case-notice.png')"></image> <image class="study-bg" :src="require('@//assets/images/common/case-notice.png')"></image>
<view class="text text-first study-title">学习提醒</view> <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 == 1">您有新的优秀案例学习任务:{{messageData.msgTitle}},请及时完成。</view>
<view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.title}}即将到期,抓紧时间完成哦!</view> <view class="text study-text" v-if="messageData.reminderType == 2">您有未完成学习任务:{{messageData.msgTitle}}即将到期,抓紧时间完成哦!</view>
<view class="btn study-btn" @click="jumpCaseStudy">去查看</view> <view class="btn study-btn" @click="jumpCaseShare">去查看</view>
</template> </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>
...@@ -66,6 +66,7 @@ export default { ...@@ -66,6 +66,7 @@ export default {
}, },
close() { close() {
this.$refs.popup.close() this.$refs.popup.close()
this.$emit('close')
}, },
toMessage() { toMessage() {
const {messageData} = this const {messageData} = this
...@@ -79,16 +80,25 @@ export default { ...@@ -79,16 +80,25 @@ export default {
// 跳转具体的长课程学习任务详情 // 跳转具体的长课程学习任务详情
jumpCaseStudy() { jumpCaseStudy() {
console.log(this.messageData) console.log(this.messageData)
// uni.$emit('caseStudy') // uni.$emit('caseStudy')
this.close() this.close()
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyDetail/caseCourse?id=${this.messageData.id}` 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() { jumpSystem() {
try { 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) { } catch (e) {
uni.showToast({ uni.showToast({
title: '系统消息跳转失败', title: '系统消息跳转失败',
......
...@@ -573,9 +573,9 @@ export default { ...@@ -573,9 +573,9 @@ export default {
if (index == 0) this.$refs.messageRef.getMessageSummary() if (index == 0) this.$refs.messageRef.getMessageSummary()
this.previewOff = index != 0 this.previewOff = index != 0
this.$emit('changeTab', index) this.$emit('changeTab', index)
console.log(this.$refs.leftBox.hasPopupOpen)
// 切换到学习中心时显示弹窗 // 切换到学习中心时显示弹窗
if (item.name === 'StudyCenter') { if (item.name === 'StudyCenter' && !this.$refs.leftBox.hasPopupOpen) {
this.getLevelExamInfo() this.getLevelExamInfo()
} }
}, },
......
...@@ -56,11 +56,11 @@ ...@@ -56,11 +56,11 @@
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="label">销售姓名</text> <text class="label">销售姓名</text>
<text class="value">{{ item.salesName || '李玉燕' }}</text> <text class="value">{{ item.employeeName }}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="label">接待时长</text> <text class="label">接待时长</text>
<text class="value">{{ item.duration }}分钟</text> <text class="value">{{ item.duration }}</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="label">开始接待</text> <text class="label">开始接待</text>
...@@ -112,69 +112,19 @@ export default { ...@@ -112,69 +112,19 @@ export default {
}, },
backPage() { backPage() {
uni.navigateBack(); uni.navigateBack();
uni.$emit('backStudyCenter') uni.$emit('pageBack')
}, },
async getBoxDetail(id) { 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') console.log(res, 'res')
// this.rowData = res.msgDetail res.msgDetail.courseList.forEach(item => {
this.rowData = { item.recordingUrl = item.fileUrl
completeStatus: 0, item.receptionStartTime = item.startTime
courseList: [{ item.receptionEndTime = item.endTime
id: 125, item.batchId = item.id
customerName: '客户1', })
receptionStatus: 1, // 接待结果 1.成交 0.战败 this.rowData = res.msgDetail
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
}
}, },
jumpDetail(item) { jumpDetail(item) {
const {uuid} = uni.$storage.get('userInfo') const {uuid} = uni.$storage.get('userInfo')
......
...@@ -127,29 +127,13 @@ export default { ...@@ -127,29 +127,13 @@ export default {
}, },
backPage() { backPage() {
uni.navigateBack(); uni.navigateBack();
uni.$emit('backStudyCenter') uni.$emit('pageBack')
}, },
async getBoxDetail(id) { 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') console.log(res, 'res')
// this.rowData = res.msgDetail 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
}]
}
}, },
startStudy(index, item) { startStudy(index, item) {
uni.$api.commonApi.findBeiSenSSOToken({}).then(res => { uni.$api.commonApi.findBeiSenSSOToken({}).then(res => {
...@@ -158,7 +142,7 @@ export default { ...@@ -158,7 +142,7 @@ export default {
if (beisenToken) { if (beisenToken) {
uni.$track.add({ eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/longCourse' }) uni.$track.add({ eventCode: 'app_long_course', businessId: item.id, pagePath: '/pages/common/studyDetail/longCourse' })
uni.navigateTo({ 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 { } else {
uni.showToast({ uni.showToast({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!