罗凇
罗凇
  • 发布:2022-07-05 15:33
  • 更新:2022-07-07 11:17
  • 阅读:566

iOS开启侧滑返回,进入多个相同页面后滑动返回不会逐级返回上一级页面,直接返回到page.json首个页面

分类:uni小程序sdk

HBuildX开发制作的wgt包,使用官方提供的uniapp小程序SDK集成到iOS项目内。
iOS加载小程序页面打开为push类型,开启侧滑关闭小程序。

        let configuration = DCUniMPConfiguration.init()  
        configuration.enableBackground = true  
        configuration.openMode = .push  
        configuration.showAnimated = true  
        configuration.hideAnimated = true  
        configuration.enableGestureClose = true  

        configuration.extraData = [  
            "appKey": UserDefault.getAppKey(),  
            "appSecret": UserDefault.getAppSecret(),  
            "themeBgColor": UserDefault.getBackColor(),  
            "themeFontColor": UserDefault.getFontColor(),  
            "token": UserDefault.getToken()  
        ]  

        configuration.path = path  

        DCUniMPSDKEngine.openUniMP(appid, configuration: configuration) { instance, error in  
            if instance != nil {  
                print("小程序打开成功")  
            } else {  
                print(error as Any)  
            }  
        }

pages.json文件中的pages启动页为首页,第二个为一个列表页面。

{  
    "pages": [   
        {  
            "path": "pages/carrier/index",  
            "style": {  
                "navigationBarTitleText": "首页",  
                "navigationStyle": "custom"  
            }  
        },  
        {  
            "path": "pages/function/function-list",  
            "style": {  
                "navigationBarTitleText": "列表"  
            }  
        },  
      ]  
}

列表页面点击可再次打开一个新的相同列表页面,此时在iOS设备侧滑返回动画结束后,直接跳转到了启动页,未达到预期效果,返回上一页。

2022-07-05 15:33 负责人:无 分享
已邀请:
DCloud_iOS_XHY

DCloud_iOS_XHY

在官方提供的 demo 工程测试是否正常? 可加官方开发者群反馈问题qq 892918401

  • 窗外下着雨

    只要是在iOS端使用滑动返回,就会出现这个问题,现在还是没有解决方案吗?

    2022-09-26 17:03

罗凇

罗凇 (作者)

使用官方的demo工程,修改了官方的hellouni-app项目,打开小程序设置了指定path后,滑动返回还是会复现该问题。

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