Commit 43becd6a by 李伟康

```

feat(HomeFrame): 为活动消息获取添加错误处理

- 在getActivityMessage方法中添加try-catch块来捕获异步请求错误
- 确保在发生错误时重置onShowCount计数器,避免状态不一致
- 提高组件的错误处理能力和稳定性
```
1 parent 2f927a3f
......@@ -722,14 +722,18 @@ export default {
})
},
async getActivityMessage (count = 1) {
this.onShowCount = count
if (this.activityStatus) return
const { sceneType } = this,
data = await uni.$api.activityApi.getActivityMessagePopUpWindow({
businessType: sceneType
})
this.onShowCount = 0
if (data) this.$refs.activityPopup.open(data)
try {
this.onShowCount = count
if (this.activityStatus) return
const { sceneType } = this,
data = await uni.$api.activityApi.getActivityMessagePopUpWindow({
businessType: sceneType
})
this.onShowCount = 0
if (data) this.$refs.activityPopup.open(data)
} catch (error) {
this.onShowCount = 0
}
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!