Commit 7257ef82 by 胡悦

修改埋点和修改状态的id

1 parent 5e26af77
...@@ -175,14 +175,14 @@ export default { ...@@ -175,14 +175,14 @@ export default {
const res = await uni.$api.commonApi.updateMessageStatus({ const res = await uni.$api.commonApi.updateMessageStatus({
idList idList
}) })
this.backPage() // this.backPage()
// if (res) { // if (res) {
// this.backPage() // this.backPage()
// } else { // } else {
// console.log('接口返回结果为空,可能存在问题') // console.log('接口返回结果为空,可能存在问题')
// } // }
} catch (error) { } catch (error) {
this.backPage() // this.backPage()
console.error('更新消息状态时出现错误:', error) console.error('更新消息状态时出现错误:', error)
} finally { } finally {
this.isProcessing = false; // 处理完成,将标志位设为 false this.isProcessing = false; // 处理完成,将标志位设为 false
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</template> </template>
<script> <script>
let timer = null let timer = null
let countTimer = 3 let countTimer = 1
import dayjs from 'dayjs' import dayjs from 'dayjs'
export default { export default {
name: 'MessageDetail', name: 'MessageDetail',
...@@ -84,8 +84,8 @@ export default { ...@@ -84,8 +84,8 @@ export default {
animationDuration: 100 animationDuration: 100
}) })
}, },
async backPage(ids) { async backPage(scriptId = null, ids = null) {
let idList = ids let idList = scriptId
if (!idList) { if (!idList) {
idList = [this.messageInfo.scriptId]; idList = [this.messageInfo.scriptId];
} }
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
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(idList) this.back(ids)
// 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})
...@@ -115,25 +115,29 @@ export default { ...@@ -115,25 +115,29 @@ export default {
async handleCompleted() { async handleCompleted() {
if (this.isProcessing) return; if (this.isProcessing) return;
console.log(this.countFlag) console.log(this.countFlag)
let scriptId = null
if (this.countFlag) { if (this.countFlag) {
try { try {
this.isProcessing = true; this.isProcessing = true;
let idList let idList
idList = [this.messageInfo.scriptId]; idList = [this.messageInfo.id];
scriptId = [this.messageInfo.scriptId]
// this.back(idList) // this.back(idList)
// 接口调用 // 接口调用
const res = await uni.$api.commonApi.updateMessageStatus({ const res = await uni.$api.commonApi.updateMessageStatus({
idList idList
}) })
if (res) { // if (res) {
this.backPage(idList) this.backPage(scriptId, idList)
} else { // } else {
console.log('接口返回结果为空,可能存在问题') // console.log('接口返回结果为空,可能存在问题')
} // }
} catch (error) { } catch (error) {
this.backPage()
console.error('更新消息状态时出现错误:', error) console.error('更新消息状态时出现错误:', error)
} finally { } finally {
this.isProcessing = false; // 处理完成,将标志位设为 false this.isProcessing = false; // 处理完成,将标志位设为 false
} }
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!