Commit 423a638f by 胡悦

解决网络异常话术跳转异常问题

1 parent bdc8c6fe
......@@ -99,11 +99,9 @@ export default {
mounted() {
// 开始倒计时
this.startCountdown()
console.log(this.transfer)
// 进入事件的买点
this.enterTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
const { type, row, tagIndex, classCountList, recordDetailList } = this.transfer || {}
console.log(type)
if (type == 'view') {
this.messageInfo = row
this.type = type
......@@ -130,19 +128,27 @@ export default {
let idList
if(type == 'read') idList = this.recordDetailList.map(item => item.scriptId);
else if (type == 'view') idList = [this.messageInfo.scriptId];
// 埋点
const result = await uni.$api.commonApi.extractExcellent({
scriptIdList: idList,
startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
})
try {
// 埋点
const result = await uni.$api.commonApi.extractExcellent({
scriptIdList: idList,
startTime: this.enterTime,
endTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss")
})
this.back()
} catch (error) {
console.log(error)
this.back()
}
// if (type == 'read') this.$emit("backHome")
// else if (type == 'view') this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
// this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
},
back() {
uni.navigateTo({
url: `/pages/common/messageList?type=read`
})
this.$emit("backHome")
// if (type == 'read') this.$emit("backHome")
// else if (type == 'view') this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
// this.back('MessageList', {firstIndex: 1, tagIndex: this.tagIndex})
},
// 开始倒计时
startCountdown() {
......@@ -169,15 +175,18 @@ export default {
const res = await uni.$api.commonApi.updateMessageStatus({
idList
})
if (res) {
this.backPage()
} else {
console.log('接口返回结果为空,可能存在问题')
}
this.backPage()
// if (res) {
// this.backPage()
// } else {
// console.log('接口返回结果为空,可能存在问题')
// }
} catch (error) {
this.backPage()
console.error('更新消息状态时出现错误:', error)
} finally {
this.isProcessing = false; // 处理完成,将标志位设为 false
this.backPage()
}
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!