小程序
小游戏
企业微信
微信支付
扫描小程序码分享
目前希望在微信小程序的子页面,点击保存后跳回父页面,在父页面给个操作成功的提示, 目前在Android手机上看,效果正常,但在iOS上看,没提示,这是因为什么
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
本回答由AI生成,可能已过期、失效或不适用于当前情形,请谨慎参考
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
子页面在点击按钮后调用
async checkStatus(status) {
const res = await this.$http.get(/patientFilter/audit/${this.patientId}, {
status
})
if (res && res.code == 200) {
// 操作成功后,父页面重新请求
uni.$emit('initPage', status)
uni.navigateBack({
delta: -1
})
}
},
父页面 onLoad内有 uni.$on('initPage', this.initPage)
对应触发事件如下:
initPage(status) {
console.log(status, this.pageSearchData.audit, 'status++++')
if (status) {
// 延迟显示toast,确保页面切换完成后再显示
setTimeout(() => {
if (this.pageSearchData.audit !== '') {
uni.showToast({
title: status == 1 ? '操作成功, 可通过筛选找到已通过的患者' : '操作成功, 可通过筛选找到已拒绝的患者',
icon: 'none',
duration: 3000
})
} else {
uni.showToast({
title: '操作成功',
icon: 'none',
duration: 3000
})
}
}, 100) // 增加延迟时间,确保在iOS上也能正常显示
}
this.clear()
this.getPatientCheckList()
},
目前效果: Android有提示 iOS没提示
期望效果: Android有提示 iOS有提示
https://developers.weixin.qq.com/s/udZuDdmd8f3A