Commit 423a638f by 胡悦

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

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