Commit 9cd457b4 by 胡悦

修复bug、修复话术消息返回的问题

1 parent 82f7cd99
<template> <template>
<view class="detail-box"> <view class="detail-box">
<view class="nav-bar"> <view class="nav-bar">
<view v-if="messageInfo.status == 1" class="back" @click="backPage(null)"> <view v-if="messageInfo.status == 1" class="back" @click="backArrow">
<uni-icons type="left" :size="20" color="#000"></uni-icons> <uni-icons type="left" :size="20" color="#000"></uni-icons>
</view> </view>
<view class="title">优秀话术-{{ messageInfo.sceneLabelName }}</view> <view class="title">优秀话术-{{ messageInfo.sceneLabelName }}</view>
...@@ -81,33 +81,49 @@ export default { ...@@ -81,33 +81,49 @@ export default {
}, },
// inject: ['showPage'], // inject: ['showPage'],
methods: { methods: {
// 返回 async backArrow() {
back(idList = null) { const idList = [this.messageInfo.scriptId]
console.log(idList) // 埋点
// this.showPage(name, obj) await uni.$api.commonApi.extractExcellent({
if (idList) uni.$emit('pageList', idList[0]); scriptIdList: idList,
startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
})
uni.navigateBack({ uni.navigateBack({
delta: 1, delta: 1,
animationType: 'pop-out', animationType: 'pop-out',
animationDuration: 100 animationDuration: 100
}) })
}, },
// 返回
// back(idList = null) {
// console.log(idList)
// // this.showPage(name, obj)
// // if (idList) uni.$emit('pageList', idList[0]);
// uni.navigateBack({
// delta: 1,
// animationType: 'pop-out',
// animationDuration: 100
// })
// },
async backPage(scriptId = null, ids = null) { async backPage(scriptId = null, ids = null) {
let idList = scriptId let idList = scriptId
if (!idList) { if (!idList) {
idList = [this.messageInfo.scriptId]; idList = [this.messageInfo.scriptId];
} }
// 埋点 // 埋点
const result = await uni.$api.commonApi.extractExcellent({ await uni.$api.commonApi.extractExcellent({
scriptIdList: idList, scriptIdList: idList,
startTime: this.enterTime, startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss") endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
}) })
if (ids) { // if (ids) {
this.back(ids) // this.back(ids)
} else { // } else {
this.handleMoreScript() uni.redirectTo({
} url: '/pages/common/messageList'
});
// }
// if (type == 'read') this.$emit("backHome") // if (type == 'read') this.$emit("backHome")
// else if (type == 'view') this.back('MessageList', {firstIndex: 1}) // else if (type == 'view') this.back('MessageList', {firstIndex: 1})
// this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex}) // this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
...@@ -146,11 +162,6 @@ export default { ...@@ -146,11 +162,6 @@ export default {
this.backPage(scriptId) this.backPage(scriptId)
} }
} }
},
handleMoreScript() {
uni.redirectTo({
url: '/pages/common/messageList'
});
} }
} }
} }
...@@ -316,6 +327,7 @@ export default { ...@@ -316,6 +327,7 @@ export default {
opacity: 1; opacity: 1;
} }
} }
.more-script { .more-script {
margin-bottom: toRpx(48); margin-bottom: toRpx(48);
} }
......
...@@ -64,14 +64,14 @@ export default { ...@@ -64,14 +64,14 @@ export default {
} }
}, },
created() { created() {
uni.$on('pageList', (data) => { // uni.$on('pageList', (data) => {
console.log('接收到上一个页面返回的数据:', data); // console.log('接收到上一个页面返回的数据:', data);
// 可以在这里添加处理数据的逻辑 // // 可以在这里添加处理数据的逻辑
if (data) { // if (data) {
const message = this.getList.find(item => item.id == data) // const message = this.getList.find(item => item.id == data)
if (message) message.status = 1 // if (message) message.status = 1
} // }
}); // });
this.init() this.init()
}, },
onLoad(options) { onLoad(options) {
......
...@@ -109,7 +109,8 @@ export default { ...@@ -109,7 +109,8 @@ export default {
isLoading: false, isLoading: false,
userInfo: {}, userInfo: {},
noticeTips: false, noticeTips: false,
messageList: [] messageList: [],
isfirst: true
} }
}, },
computed: { computed: {
...@@ -141,11 +142,14 @@ export default { ...@@ -141,11 +142,14 @@ export default {
this.userInfo = uni.$storage.get('userInfo') this.userInfo = uni.$storage.get('userInfo')
this.getTopInfo() this.getTopInfo()
this.moduleType = Number(options.moduleType) this.moduleType = Number(options.moduleType)
this.isfirst = false
}, },
onShow() { onShow() {
if (!this.isfirst) {
this.getMessageSummary(this.userInfo.sceneType) this.getMessageSummary(this.userInfo.sceneType)
console.log(this.moduleType, 'moduleType') console.log(this.moduleType, 'moduleType')
this.getRightList(this.moduleType) this.getRightList(this.moduleType)
}
}, },
methods: { methods: {
formatTime(time, formatStr) { formatTime(time, formatStr) {
...@@ -169,7 +173,6 @@ export default { ...@@ -169,7 +173,6 @@ export default {
this.getWarningPage() this.getWarningPage()
break break
case 3: case 3:
console.log(111)
this.getCourseList(3) this.getCourseList(3)
break break
case 4: case 4:
...@@ -430,7 +433,7 @@ export default { ...@@ -430,7 +433,7 @@ export default {
case 4: case 4:
console.log('长课程学习跳转') console.log('长课程学习跳转')
uni.navigateTo({ uni.navigateTo({
url: `/pages/common/studyDetail/longCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}`, url: `/pages/common/studyDetail/longCourse?row=${encodeURIComponent(JSON.stringify(item))}&completeStatus=${item.completeStatus}&from=service`,
fail: (err) => { fail: (err) => {
console.error('页面跳转失败:', err); console.error('页面跳转失败:', err);
} }
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
}, },
isTimeout: false, isTimeout: false,
timer: null, timer: null,
statusMap statusMap,
} }
}, },
onLoad(options) { onLoad(options) {
...@@ -131,15 +131,15 @@ export default { ...@@ -131,15 +131,15 @@ export default {
if (!this.rowData.taskDeadline) this.rowData.taskDeadline = rowData.finishTime if (!this.rowData.taskDeadline) this.rowData.taskDeadline = rowData.finishTime
this.completeStatus = options.completeStatus this.completeStatus = options.completeStatus
this.punishType = options.punishType this.punishType = options.punishType
if (options.from === 'service') {
this.getLongCourseDetail(rowData.detailId, rowData.id)
} else {
this.getLongCourseDetail(rowData.id) this.getLongCourseDetail(rowData.id)
}
if (this.completeStatus == 0) { if (this.completeStatus == 0) {
this.initCountdown() this.initCountdown()
} }
}, },
onShow() {
console.log('onShow')
this.getLongCourseDetail(this.rowData.id)
},
watch: { watch: {
// 监听rowData变化,重新初始化倒计时 // 监听rowData变化,重新初始化倒计时
'rowData.taskDeadline'(val) { 'rowData.taskDeadline'(val) {
...@@ -156,10 +156,12 @@ export default { ...@@ -156,10 +156,12 @@ export default {
uni.navigateBack(); uni.navigateBack();
uni.$emit('backStudyCenter') uni.$emit('backStudyCenter')
}, },
async getLongCourseDetail(id) { async getLongCourseDetail(id, boxId) {
const res = await uni.$api.commonApi.getLongCourseDetail({ const params = { id }
id if (boxId) {
}) params.boxId = boxId
}
const res = await uni.$api.commonApi.getLongCourseDetail(params)
console.log(res, 'res') console.log(res, 'res')
this.courseList = res.courseList this.courseList = res.courseList
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!