Commit 9cd457b4 by 胡悦

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

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