朱雀
朱雀
  • 发布:2018-12-04 16:25
  • 更新:2018-12-28 10:23
  • 阅读:2584

【报Bug】H5 uni.showModal bug

分类:uni-app

[内容]
按照我写的demo,应该是每次进入当前页面都会抛出这个showModal吧。但是在H5下,当第一次点击了提示框的确认按钮,页面跳转后,再退回到这个页面,结果:这个提示框没有显示。

重现步骤

    export default {  

        onShow() {  
            console.log('onShow');  

            let str = new Date().getTime();  

            uni.showModal({  
                title: '登录提示',  
                content: `${str}`,  
                showCancel: false,  
                confirmText: '立即登录',  
                success: function(res) {  
                    console.log('showModal - success', '就是不显示');  
                    if (res.confirm) {  
                        uni.navigateTo({  
                            url: './b'  
                        })  
                    }  
                },  
            });  

      // 加上 setTimeout 就可以正常显示  

/*        
            setTimeout(() => {  
                uni.showModal({  
                    title: '登录提示',  
                    content: `${str}`,  
                    showCancel: false,  
                    confirmText: '立即登录',  
                    success: function(res) {  
                        console.log('showModal - success', '就是不显示');  
                        if (res.confirm) {  
                            uni.navigateTo({  
                                url: './b'  
                            })  
                        }  
                    },  
                });  
            }, 0)  
 */  

        }  

    }

[结果]
只有第一次进入页面的时候显示了一次,跳转到b页面后,从b页面原路退回到A页面,这个提示框没有显示出来。
[期望]
从b页面退回来后,提示框应该是显示的。

2018-12-04 16:25 负责人:无 分享
已邀请:
Trust

Trust - 少说废话

页面切换时,会关闭所有的这种dialog。

朱雀

朱雀 (作者)

不是,主要是我已经回到这个页面了啊,不是在B页面调用的,是在A页面。

朱雀

朱雀 (作者)

具体,可以下载 附件 演示一下。

Trust

Trust - 少说废话

这个时机的确存在一些临界的情况,建议暂时延时处理一下吧。

Trust

Trust - 少说废话

HBuilderX 1.4.0 已修复此问题

  • 朱雀 (作者)

    帅呆了

    2018-12-28 12:30

该问题目前已经被锁定, 无法添加新回复