let args = '{"loginId":"9999"}';
if (args.indexOf('loginId') > -1) {
let argsObj = eval('(' + args + ')');
uni.navigateTo({
url: 'pages/index/main?loginId='+argsObj.loginId
});
}
- 发布:2022-04-15 15:30
- 更新:2023-10-10 14:53
- 阅读:1185
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: 21H1
HBuilderX类型: 正式
HBuilderX版本号: 3.3.13
手机系统: Android
手机系统版本号: Android 11
手机厂商: OPPO
手机机型: OPPO FINX X2
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
15:26:28.962 App Launch at App.vue:4
15:26:28.993 App Show at App.vue:7
15:26:29.025 9999 at App.vue:27
15:26:29.057 [Object] {"loginId":"9999","rlbkid":"undefined","clbkid":"undefined"} at pages/index/main.vue:18
15:26:29.090 [Object] {"data":{"code":0,"msg":"成功","data":{"id":"441900021121","userType":"10","personname":"测试","deptid":"7B038...} at pages/index/main.vue:49
15:26:28.962 App Launch at App.vue:4
15:26:28.993 App Show at App.vue:7
15:26:29.025 9999 at App.vue:27
15:26:29.057 [Object] {"loginId":"9999","rlbkid":"undefined","clbkid":"undefined"} at pages/index/main.vue:18
15:26:29.090 [Object] {"data":{"code":0,"msg":"成功","data":{"id":"441900021121","userType":"10","personname":"测试","deptid":"7B038...} at pages/index/main.vue:49
实际结果:
15:26:28.962 App Launch at App.vue:4
15:26:28.993 App Show at App.vue:7
15:26:29.025 9999 at App.vue:27
15:26:29.057 [Object] {"loginId":"9999","rlbkid":"undefined","clbkid":"undefined"} at pages/index/main.vue:18
15:26:29.090 [Object] {"data":{"code":0,"msg":"成功","data":{"id":"441900021121","userType":"10","personname":"测试","deptid":"7B038...} at pages/index/main.vue:49
15:26:29.313 [Object] {"loginId":"9999","rlbkid":"undefined","clbkid":"undefined"} at pages/index/main.vue:18
15:26:29.383 [Object] {"data":{"code":0,"msg":"成功","data":{"id":"441900021121","userType":"10","personname":"测试","deptid":"7B038...} at pages/index/main.vue:49
15:26:28.962 App Launch at App.vue:4
15:26:28.993 App Show at App.vue:7
15:26:29.025 9999 at App.vue:27
15:26:29.057 [Object] {"loginId":"9999","rlbkid":"undefined","clbkid":"undefined"} at pages/index/main.vue:18
15:26:29.090 [Object] {"data":{"code":0,"msg":"成功","data":{"id":"441900021121","userType":"10","personname":"测试","deptid":"7B038...} at pages/index/main.vue:49
15:26:29.313 [Object] {"loginId":"9999","rlbkid":"undefined","clbkid":"undefined"} at pages/index/main.vue:18
15:26:29.383 [Object] {"data":{"code":0,"msg":"成功","data":{"id":"441900021121","userType":"10","personname":"测试","deptid":"7B038...} at pages/index/main.vue:49
bug描述:
APP第一次启动时,App.vue onShow中跳转到另一个页面,另一个页面的onLoad执行两次
y***@163.com (作者)
您好,请问什么时候能修复
2022-04-15 17:31
BoredApe
回复 y***@163.com: 不推荐在
onShow
中去跳转页面。很容易触发这个问题。推荐去别的生命周期内去打开页面onLoad
、onLaunch
等2022-04-18 08:40
y***@163.com (作者)
回复 BoredApe: onLaunch中也有这个问题
2022-04-18 09:07
即时通讯开发
回复 y***@163.com: 我的也有这个问题
2022-11-30 18:09
即时通讯开发
回复 BoredApe: onLaunch中也有这个问题 亲 刚发现的
2022-11-30 18:10
即时通讯开发
回复 BoredApe: 我找到问题了 我的是不能用uni.reLaunch打开新页面 用其他都可以 用这就会让打开的页面执行两次
2022-12-01 09:23