3***@163.com
3***@163.com
  • 发布:2018-07-25 15:27
  • 更新:2020-07-15 20:09
  • 阅读:1785

webviewGroup.js中的switchTab存在Bug

分类:MUI

详细问题描述
[内容]

项目要求:顶部tab展示多个页面,要求点击切换、左右滑动切换功能。在调用webviewGroup.js中的switchTab方法切换页面(页面尚未创建)的时候,子页面会出现创建失败,如果是左右侧滑进行创建子页面不会出现失败现象。在子页面调用checkRenderedContent()返回Code:-100

重现步骤
[步骤]
[结果]
[期望]

运行环境
[系统版本]
三星S6e+,Android 7.0
[浏览器版本]
[IDE版本]
[mui版本]
HBuilder 9.0.8.201806081953

附件
[代码片段]

proto.switchTab = function(id) {
// id = id.replace('_0', ''); //首页需要替换为appid
var fromWebview = this.currentWebview;
if(id === fromWebview.id) {
return;
}
var toWebviewContext = this.webviewContexts[id];
var toWebview = toWebviewContext.webview;
var fromToLeft = '100%';
var toFromLeft = '-100%';
if(toWebviewContext.options.extras.__mui_index > fromWebview.__mui_index) {
fromToLeft = '-100%';
toFromLeft = '100%';
}
var isNew = false;
if(!toWebview) {
isNew = true;
toWebviewContext.createWebview('startAnimation');
toWebview = toWebviewContext.webview;
//toWebview.showBehind(plus.webview.getSecondWebview());
toWebview.show();
this._initDrags(toWebview);
this._checkDrags(toWebview); //新建的时候均需校验
}
var self = this;
// console.log("current:" + fromWebview.id + ",to:" + fromToLeft);
// console.log("next:" + toWebview.id + ",from:" + toFromLeft);

plus.webview.startAnimation({  
        'view': fromWebview,  
        'styles': {  
            'fromLeft': '0',  
            'toLeft': fromToLeft  
        },  
        'action': 'show'  
    }, {  
        'view': toWebview,  
        'styles': {  
            'fromLeft': toFromLeft,  
            'toLeft': '0'  
        },  
        'action': 'show'  
    },  
    function(e) {  
        //console.log("startAnimation callback...");  
        if(e.id === toWebview.id) {  
            isNew && plus.nativeUI.showWaiting();  
            this.currentWebview = toWebview;  
            this.onChange({  
                index: toWebview.__mui_index  
            });  
        }  
    }.bind(this)  
)  

};

[安装包]

联系方式
[QQ]
[电话]

2018-07-25 15:27 负责人:无 分享
已邀请:
3***@163.com

3***@163.com (作者)

有人回复一下吗?官方各位大佬

3***@qq.com

3***@qq.com

我也出现这个问题了。点上面选项卡会报错。直接滑动切换就没问题。。。

碧霜寒冰

碧霜寒冰

最近也遇到同样的问题,新的webview在不可见的情况下后台渲染就会出现这样的错误,重新hide,show就可以显示了

y***@163.com

y***@163.com

一直有这样的问题,官方有解决方案么

j***@qq.com

j***@qq.com

应该是调用switchTab方法的时候Id没传过去

1***@qq.com

1***@qq.com

碰到相同的问题,同问

愿随风丶飘雪

愿随风丶飘雪 - 勿在浮沙筑高台

相同的问题

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