q***@163.com
q***@163.com
  • 发布:2017-07-18 11:47
  • 更新:2017-07-18 12:08
  • 阅读:851

原生View控件打包后绑定click事件无效

分类:HBuilder

原生View控件打包后绑定click事件无效
在没有打包时,绑定事件可以用

2017-07-18 11:47 负责人:无 分享
已邀请:
zfh1005

zfh1005

可以提供更多信息吗?
版本之类的?操作之类的?

q***@163.com

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

var view = plus.nativeObj.View.getViewById('messageTipsView');

    var system_view =plus.webview.getWebviewById('system_chat');  
    var chat_view =plus.webview.getWebviewById('message_chat');  

    if(!view){  
        view = new plus.nativeObj.View('messageTipsView',  
        {bottom:'100px',left:'80%',height:'50px',width:'50px'},  
        [{tag:'img',id:'messageTipsImg',src:'/images/mapmark.png',position:{top:'0px',left:'0px',width:'45px',height:'45px'}}]);  
        view.drawRect({color:'#f90',radius:'10px'},  
        {top:'0px',left:'32px',width:'18px',height:'18px'});  
        view.drawText(i, {top:'0px',left:'32px',width:'18px',height:'18px'},{color:'#000',size:'12px',align:'center'},'messageTipsText');  
        view.interceptTouchEvent(true);  
        view.addEventListener("click", function(){  
            console.log('click _www/tmpl/message/message_list.html');  
            mui.openWindow({  
                    url: '_www/tmpl/message/message_list.html',  
                    id: _.pageName.message_center,  
                    waiting: {  
                        autoShow: true, //自动显示等待框,默认为true  
                        title: '正在加载...' //等待对话框上显示的提示内  
                    }  
                })  
            global_message_count = 1;  
            view.close();  
        }, false);  
    }else{  
        view.drawText(i, {top:'0px',left:'32px',width:'18px',height:'18px'},{color:'#000',size:'12px',align:'center'},'messageTipsText');  
    }

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