2***@qq.com
2***@qq.com
  • 发布:2017-04-27 16:56
  • 更新:2017-04-27 16:56
  • 阅读:2977

js生成的html里的onclick事件在ios webview点击中无反应,其它浏览器,安卓都是可以的,请问一下这是什么原因呀?

分类:HBuilder

<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>订单查询</title>
<link rel="stylesheet" href="css/mui.min.css?v=1.2">
<link rel="stylesheet" type="text/css" href="css/icons-extra.css" />
<link href="css/app.css" rel="stylesheet" />
<link href="css/page/myTrip.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="css/page/map.css?v=1.2">

<script>
var t_background="#000";
</script>
</head>

<body style="background: #fff; height: 100%;">

  <header class="mui-bar mui-bar-nav">  
<a class="  mui-icon  mui-action-back mui-icon-left-nav mui-pull-left"  ></a>  

        <h1 class="mui-title">订单查询</h1>  
    </header>     

<div id="pullrefresh" class="mui-content mui-scroll-wrapper">

<div class="mui-scroll">  
      <div class="app_thirdBlock">  
             <ul id="list" class="recom">  

         </ul>  

        </div>  
    </div>  

     </div>  

<script type="text/template" id="tpl">  

</script>

<script src="js/mui.min.js"></script>
<script src='js/zepto.min.js'></script>
<script src="js/page/base.js"></script>

<script>
if(!UserInfo.has_login()){
location.href="login.html";
}

        var page = 1;  
        mui.init({  
            swipeBack: true,  
            pullRefresh: {  
                container: '#pullrefresh',  
                down: {  
                    callback: pulldownRefresh  
                },  
                up: {  
                    contentrefresh: '正在加载...',  
                    contentnomore:'没有更多数据了',//可选,请求完毕若没有更多数据时显示的提醒内容;  
                    callback: pullupRefresh  
                }  
            }  
        });  

        if (mui.os.plus) {  
            mui.plusReady(function() {  
                setTimeout(function() {  
                    mui('#pullrefresh').pullRefresh().pullupLoading();  
                }, 400);  
            });  
        } else {  
            mui.ready(function() {  
                mui('#pullrefresh').pullRefresh().pullupLoading();  
            });  
        }  

        function pulldownRefresh() {  
            page = 1;  
            $.ajax({  
            url: Common.domain + '/tools/red_packet_order.ashx',  
            async:true,  
            dataType: 'json',  
            data: {  
                    action:'get_sj_order_list',  
                    PageIndex: page,  
                    access_token:UserInfo.token()  
                },  
                success: function(data) {  

                   var lastPage=false;  
                  if(data.result.length>0)   
                    {page++;}  
                     else{lastPage=true;}  

                     $("#list").append(get_list_nr(data.result));  

                }  
            });  
        }  

function pullupRefresh() {

$.ajax({
url: Common.domain + '/tools/red_packet_order.ashx',
async:true,
dataType: 'json',
data: {
action:'get_sj_order_list',
PageIndex: page,
access_token:UserInfo.token()
},
success: function(data) {

   var lastPage=false;  
    if(data.result.length>0)   
    {page++;}  
    else{lastPage=true; }  
     $("#list").append(get_list_nr(data.result));  

    mui('#pullrefresh').pullRefresh().endPullupToRefresh(lastPage); //参数为true代表没有更多数据了。  

  }  

});  

}

function get_list_nr(data){

var html="";  

for(var i=0;i<data.length;i++){
var v=data[i];
var zurl="order_jxz";
if(v.state==1)
{
zurl="shuttle_ck";
}
if(v.state==3)
{
zurl="order_ywc";
}
var jc_html="";
if(v.jcbs>1)
{
jc_html="加乘"+v.jcbs+"倍"
}

            html+='<li>';  
            html+='<div class="app_titleBlock">';  
            html+='<span class="public_AddFloatLeft">'+v.order_no+'';  
            html+='<b  style="color:red" >&nbsp;&nbsp; '+jc_html+'';  
            html+=' </b> ';  
            html+='</span>';  
           // html+=' <span class="public_AddFloatRight">已评价</span> ';  
            html+=' </div>';  
            html+=' <div class="app_bottomBlock" onclick="open_window(\''+zurl+'.html?order_no='+v.order_no+'\',\'ck_qx\')">';  
             html+='<div class="app_adressBlock">';  
            html+='<span class="ico0">'+v.add_time+'</span>';  
             html+='<span class="ico1">'+v.origin_name+'</span>';  
            html+=' <span class="ico2">'+v.dest_name+'</span>';  
            html+='</div>';  
            html+='<div class="app_rightPrice">';  
            html+=' <span>';  
            html+=' <i class="app_rightPrice_f1">¥'+v.price+'</i>';  
            html+='<i class="app_rightPrice_f2">'+v.state_tilte+'</i>';  
            html+='</span>';  
            html+='</div>';  
            html+='<div class="app_rightJtou"></div>';  
           html+=' </div>';  
           html+='</li>';  
           html+='<li style="clear:both; height: 10px; background: #eee;"></li>';  

            }  

return html;

}

</script>

</body>

</html>

2017-04-27 16:56 负责人:无 分享
已邀请:

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