正正
正正
  • 发布:2020-10-19 10:54
  • 更新:2021-01-02 13:44
  • 阅读:1061

使用pages.json配置tabBar,Android点击tabbar切换时,底部tab已经切换了但是页面还是停留在上个tab的页面

分类:uni小程序sdk

我使用uni小程序的SDK,按照官网教程在pages.json使用tabBar,如下:
"tabBar": {
"color": "#999999",
"selectedColor": "#333333",
"borderStyle": "white",
"fontSize": "12px",
// "iconWidth": "25px",
"spacing": "4px",
"height": "56px",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/tabBar/punch/home",
"iconPath": "static/images/tabBar/menu01.png",
"selectedIconPath": "static/images/tabBar/menu01_active.png",
"text": "测试1"
},
{
"pagePath": "pages/tabBar/shift/shift",
"iconPath": "static/images/tabBar/menu02.png",
"selectedIconPath": "static/images/tabBar/menu02_active.png",
"text": "测试2"
},
{
"pagePath": "pages/tabBar/reminder/reminder",
"iconPath": "static/images/tabBar/menu03.png",
"selectedIconPath": "static/images/tabBar/menu03_active.png",
"text": "测试3"
}
]
在部分手机上点击tabbar切换页面,例如我点击第二个tab,底部tab的图标和文字切换正常,但是页面还是停留在home页面,预期是应该跳转到shift页面。在性能稍微差的手机,经常会出现点击tab,底部tab样式切换正常,但是tab页面却没有跟着切换的情况。因为没有源码可看,网上相关的资料也很少,希望有人帮忙看看,感谢!

2020-10-19 10:54 负责人:无 分享
已邀请:
DCloud_Android_ST

DCloud_Android_ST

1、先用HX默认基座真机调试看看是否存在该问题? 如果有问题概率问题是uniappHX项目配置有问题。
2、如果基座调试OK没有问题。你需要测试下unimpdemo的项目出现该问题?

正正

正正 (作者)

你好,我用HBuilderX跑了自己的项目和小程序的demo,发现都会出现上述点击tab时,tab样式已经切换成功,但是页面却没切换过来。出现该问题时,在Hbuildx上都看到相同的日志错误,如下:
[JS Framework] Failed to execute the callback function:
13:55:30.322 TypeError: Cannot read property 'call_hook' of undefined
13:55:30.343 reportJSException >>>> exception function:WEEX_CALL_JAVASCRIPT, exception:JavaScript execute error!Uncaught TypeError: Cannot read property '__call_hook' of undefined
13:55:32.902 [JS Framework] Failed to execute the callback function:
13:55:32.927 TypeError: Cannot read property '
call_hook' of undefined
13:55:33.109 [JS Framework] Failed to execute the callback function:
13:55:33.131 TypeError: Cannot read property 'call_hook' of undefined
13:55:36.774 [JS Framework] Failed to execute the callback function:
13:55:36.797 TypeError: Cannot read property '__call_hook' of undefined
13:55:37.483 [JS Framework] Failed to execute the callback function:
13:55:37.506 TypeError: Cannot read property '
call_hook' of undefined
13:55:42.602 [JS Framework] Failed to execute the callback function:
继续点击tab切换,这两行会不停打印出来:
TypeError: Cannot read property '__call_hook' of undefined
[JS Framework] Failed to execute the callback function:

小程序demo截图了,点击第一个tab时,还停留在“接口”标题tab的页面,预期效果是跳转到“内置组件”标题tab页面。

7***@qq.com

7***@qq.com

解决了吗

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