<!DOCTYPE html>

<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">

    <title><?php echo cutstring($content, 20, ''); ?></title>

    <link rel="stylesheet" type="text/css" href="<?php echo asset_url('h5/css/style_3.css') ?>">

    <link rel="stylesheet" type="text/css" href="<?php echo asset_url('h5/css/activity.css') ?>">

    <script type="text/javascript" src="<?php echo asset_url('js/jquery-1.9.1.min.js') ?>"></script>

    <style>

        body{-webkit-overflow-scrolling: touch;}

        #wrapper{position: absolute;top: 0;left: 0;height: 100%;width:100%;overflow-y: auto; background-color: #F8F8F8;}

        .dropload-down{height: 50px;}

        .dropload-refresh,.dropload-load,.dropload-noData{padding: 15px;text-align: center;color: #666;}

    </style>

</head>

<body>

<div id="wrapper">

    <div class="wra_wrapper">

    <div class="bbs-cv-info">

        <a href="javascript:void(0);" onclick="lbsPerson(<?php echo $uid;?>)" class="user-hd">

            <img class="discuss_portrait" src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $uid;?>&size=small&random=<?php echo $timestamp;?>">

        </a>

        <div class="user-txt">

            <a href="javascript:void(0);" class="user-txt-name namecolor">

                <span><?php echo $username;?></span><?php echo $usergroup_level;?>

                <!--<div class="user_name_type user_gl_w">

                    <div class="user_name_type_left">

                        <img src="<?php /*echo asset_url('h5/images/leaveV.png')*/?>">

                        <span>7</span>

                    </div>

                    <span class="user_name_type_right">萧湖</span>

                </div>-->

            </a>

            <p><?php echo $ctime_format?>&nbsp;&nbsp;来自<?php echo $platform_v;?>客户端</p>

        </div>

<!--        --><?php //if ($is_followed):?>

<!--        <p class="attention attention_y"><a id="follow" href="javascript:void(0);">已关注</a></p>-->

<!--        --><?php //else:?>

<!--        <p class="attention attention_n"><a id="follow" href="javascript:void(0);">+ 关注</a></p>-->

<!--        --><?php //endif;?>

    </div>

    <div class="bbs-cv-main">

        <div class="bbs-cv-hd ">

            <p class="topic_text"><?php echo $content_style;?></p>

            <ul class="topic_img_list">

                <?php if (!empty($img_arr)):?>

                <?php foreach ($img_arr as $value):?>

                <li><img onclick="img_arr_json('<?php echo $value['path'];?>')" src="<?php echo $value['path'] . '.small.jpg';?>"></li>

                <?php endforeach; endif;?>

            </ul>

        </div>

    </div>

    <div class="content_zan ">

        <div class="likea">

            <img id="like_img" onclick="like_post(this)" is_liked="<?php echo $is_liked ? 'yes' : 'no';?>" src="<?php echo $is_liked ? asset_url('h5/images/post_like.png') : asset_url('h5/images/good.png');?>" alt="" >

            <p><?php echo $likecount;?></p>

        </div>

    </div>

    <div class="topic_zan_list">

        <p>点赞用户</p>

        <!-- 列表最多显示9个点赞用户头像、最后一个为“查看所有点赞用户”的图标 -->

        <ul id="ul_post_like" <?php if(!empty($like_users)) {echo 'class="topic_zan_more"';}?>>

            <?php if (!empty($like_users)):?>

            <?php foreach ($like_users as $value):?>

            <li>

                <img src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $value['uid'];?>&size=small&random=<?php echo $timestamp;?>">

            </li>

            <?php endforeach;?>

            <?php endif; ?>

        </ul>

    </div>



    <div class="bbs-feed-list discuss">

        <p class="discuss_type">最新评论</p>

        <ul class="discuss_ulA" id="comment_ul">

            <?php if (!empty($comment['comment_list'])):?>

            <?php foreach ($comment['comment_list'] as $key => $value):?>

            <li>

                <div class="discuss_box ">

                    <a  href="javascript:void(0);" onclick="lbsPerson(<?php echo $value['uid'];?>)">

                        <img class="discuss_portrait"  src="<?php echo UC_API;?>/avatar.php?uid=<?php echo $value['uid'];?>&size=small&random=<?php echo $timestamp;?>">

                    </a>

                    <div class="discuss_user">

                        <p class="user_name" href="javascript:void(0);"><?php echo $value['username'] . $value['usergroup_level'];?></p>

                        <span class="discuss_span span_date"><?php echo $value['ctime_format'];?></span>

                    </div>

                    <div class="post-operation">

                        <span class="post-floor"><?php echo $key + 1;?>楼</span>

                    </div>

                    <div class="discuss_content">

                        <?php

                            if(!empty($value['to_username'])){echo '回复'.$value['to_username'].'：';}

                            echo $value['content_smily'];

                        ?>

                    </div>

                    <div class="discuss_bottom">

                        <div class="praise_reply pid_praise20682685" commentid="<?php echo $value['id'];?>" uid="<?php echo $value['uid'];?>" content="<?php echo $value['content'];?>">

                            <?php if (isset($value['is_liked']) && $value['is_liked']):?>

                            <img is_liked="yes" src="<?php echo asset_url('h5/images/zaned.png')?>" alt="">

                            <span class="discuss_zan color_red"><?php echo $value['likecount'];?></span>

                            <?php else:?>

                            <img is_liked="no" src="<?php echo asset_url('h5/images/zan.png')?>" alt="">

                            <span class="discuss_zan"><?php echo $value['likecount'];?></span>

                            <?php endif;?>

                        </div>

                        <div  class="praise_reply bind_reply" uid="<?php echo $value['uid'];?>" username="<?php echo $value['username'];?>" content="<?php echo $value['content'];?>">

                            <img src="<?php echo asset_url('h5/images/reply.png')?>">

                            <span class="discuss_zan">回复</span>

                        </div>

                    </div>

                </div>

            </li>

            <?php endforeach;?>

            <?php endif;?>

        </ul>

        </div>



    </div>

</div>



<div class="topic_popup_newError" id="div_banned">

    <img src="<?php echo asset_url('h5/images/topic_error.png');?>" alt="">

    <p>您已被禁言</p>

</div>

<div class="topic_popup_newError" id="div_liked">

    <img src="<?php echo asset_url('h5/images/topic_error.png');?>" alt="">

    <p>亲，您已经赞过了呦</p>

</div>

<div class="topic_popup_newError" id="div_no_network">

    <img src="<?php echo asset_url('h5/images/topic_error.png');?>" alt="">

    <p>亲，您没有网络哦</p>

</div>


</body>

<script type="text/javascript" src="<?php echo asset_url('h5/js/fastclick.js') ?>"></script>

<script type="text/javascript" src="<?php echo asset_url('h5/js/jquery.lazyload.min.js') ?>"></script>

<script type="text/javascript" src="<?php echo asset_url('h5/js/dropload.min.js') ?>"></script>

<!--<script type="text/javascript" src="--><?php //echo asset_url('h5/js/iscroll.js') ?><!--"></script>-->

<!--<script type="text/javascript" src="--><?php //echo asset_url('h5/js/iscroll-probe.js') ?><!--"></script>-->

<script>



window.addEventListener( "load", function() {

    FastClick.attach( document.body );

}, false );



var dropload =null,

    total = <?php echo !empty($comment['comment_list']) ? count($comment['comment_list']) : 0;?>,

    tids_filter = [],//用来过滤假数据

    loading = '<div class="topic_slideLoad"><img src="<?php echo asset_url('h5/images/loading.gif')?>" alt=""><span>努力加载中...</span></div>',

    no_more = '<div class="topic_slideOver">没有更多内容了</div>';



function load_data() {



    $.ajax({

        url: "<?php echo site_url('/api/sharecircle/post/comment_more')?>",

        type: 'POST',

        dataType: 'json',

        data: {

            postid: "<?php echo $id;?>",

            uid: "<?php echo $this->user->uid;?>",

            total: total

        },

        success:function(data)

        {

            if (data.code != 1) {  //没有更多内容了

                dropload.noData();

                dropload.resetload();

                dropload.lock();

                // dropload.resetload();

                

                return ;

            }

            

            $.each(data.data.comment_list,function(i,item){

                total++;

                if (tids_filter.length > 0 && $.inArray(item.id, tids_filter) != -1) {

                    tids_filter.removeByValue(item.id);

                    return true;

                }

                var new_item =  '<li>'+

                    '<div class="discuss_box ">'+

                    '<a  href="javascript:void(0);">'+

                    '<img class="discuss_portrait"  src="<?php echo UC_API;?>/avatar.php?uid=' + item.uid + '&size=small&random=<?php echo $timestamp;?>">'+

                    '</a>'+

                    '<div class="discuss_user">'+

                    '<p class="user_name" href="javascript:void(0);">' + item.username + item.usergroup_level + '</p>'+

                    '<span class="discuss_span span_date">' + item.ctime_format + '</span>'+

                    '</div>'+

                    '<div class="post-operation">'+

                    '<span class="post-floor">' + total + '楼</span>'+

                    '</div>'+

                    '<div class="discuss_content">';

                if (item.to_username) {

                    new_item += '回复' + item.to_username + '：';

                }

                new_item += item.content_smily + '</div>' +

                '<div class="discuss_bottom">'+

                '<div class="praise_reply pid_praise20682685" commentid="'

                + item.id + '" uid="' + item.uid + '" content="' + item.content + '">';

                if (item.is_liked) {

                    new_item += '<img is_liked="yes" src="<?php echo asset_url('h5/images/zaned.png')?>" alt="">'+

                    '<span class="discuss_zan color_red">' + item.likecount + '</span>';

                } else {

                    new_item += '<img is_liked="no" src="<?php echo asset_url('h5/images/zan.png')?>" alt="">'+

                    '<span class="discuss_zan">' + item.likecount + '</span>';

                }

                new_item += '</div>'+

                '<div class="praise_reply bind_reply" uid="' + item.uid + '" username="' + item.username + '" content="' + item.content + '">'+

                '<img src="<?php echo asset_url('h5/images/reply.png')?>">'+

                '<span class="discuss_zan">回复</span>'+

                '</div>'+

                '</div>'+

                '</div>'+

                '</li>';

                $('#comment_ul').append(new_item);

                dropload.resetload();

               

            });

            /*setTimeout("myScroll.refresh();",200);

             setTimeout(function(){

             myScroll.scrollBy(0,-200,1000);

             },200);*/

//                        myScroll.refresh();

            if(data.data.is_end){

               

                dropload.noData();

                dropload.resetload();



                

            }

        }

    });

}

    /*var myScroll,

        total = <?php echo !empty($comment['comment_list']) ? count($comment['comment_list']) : 0;?>,

        tids_filter = [],//用来过滤假数据

        loading = '<div class="topic_slideLoad"><img src="<?php echo asset_url('h5/images/loading.gif')?>" alt=""><span>努力加载中...</span></div>',

        no_more = '<div class="topic_slideOver">没有更多内容了</div>';



    function load_data() {

        $('#comment_ul').append(loading);

        $.ajax({

            url: "<?php echo site_url('/api/sharecircle/post/comment_more')?>",

            type: 'POST',

            dataType: 'json',

            data: {

                postid: "<?php echo $id;?>",

                uid: "<?php echo $this->user->uid;?>",

                total: total

            },

            success:function(data)

            {

                $('.topic_slideLoad').remove();

                if (data.code != 1) {  //没有更多内容了

                    $('#comment_ul').append(no_more);

                    setTimeout("$('.topic_slideOver').remove();",1000);

                    return ;

                }

                $.each(data.data.comment_list,function(i,item){

                    total++;

                    if (tids_filter.length > 0 && $.inArray(item.id, tids_filter) != -1) {

                        tids_filter.remove(item.id);

                        return true;

                    }

                    var new_item =  '<li>'+

                        '<div class="discuss_box ">'+

                        '<a  href="javascript:void(0);">'+

                        '<img class="discuss_portrait"  src="<?php echo $domain;?>/uc_server/avatar.php?uid=' + item.uid + '&size=small&random=<?php echo $timestamp;?>">'+

                        '</a>'+

                        '<div class="discuss_user">'+

                        '<p class="user_name" href="javascript:void(0);">' + item.username + item.usergroup_level + '</p>'+

                        '<span class="discuss_span span_date">' + item.ctime_format + '</span>'+

                        '</div>'+

                        '<div class="post-operation">'+

                        '<span class="post-floor">' + total + '楼</span>'+

                        '</div>'+

                        '<div class="discuss_content">';

                    if (item.to_username) {

                        new_item += '回复' + item.to_username + '：';

                    }

                    new_item += item.content_smily + '</div>' +

                        '<div class="discuss_bottom">'+

                        '<div class="praise_reply pid_praise20682685" commentid="'

                        + item.id + '" uid="' + item.uid + '" content="' + item.content + '">';

                    if (item.is_liked) {

                        new_item += '<img is_liked="yes" src="<?php echo asset_url('h5/images/zaned.png')?>" alt="">'+

                        '<span class="discuss_zan color_red">' + item.likecount + '</span>';

                    } else {

                        new_item += '<img is_liked="no" src="<?php echo asset_url('h5/images/zan.png')?>" alt="">'+

                        '<span class="discuss_zan">' + item.likecount + '</span>';

                    }

                    new_item += '</div>'+

                    '<div class="praise_reply bind_reply" uid="' + item.uid + '" username="' + item.username + '" content="' + item.content + '">'+

                    '<img src="<?php echo asset_url('h5/images/reply.png')?>">'+

                    '<span class="discuss_zan">回复</span>'+

                    '</div>'+

                    '</div>'+

                    '</div>'+

                    '</li>';

                    $('#comment_ul').append(new_item);

                });

                myScroll.refresh();

                myScroll.scrollBy(0,-180,1000);

                *//*setTimeout("myScroll.refresh();",200);

                setTimeout(function(){

                    myScroll.scrollBy(0,-200,1000);

                },200);*//*

//                        myScroll.refresh();

                if(data.data.is_end){

                    $('#comment_ul').append(no_more);

                    setTimeout("$('.topic_slideOver').remove();",1000);

                }

            }

        });

    }*/



    dropload = $('#wrapper').dropload({

        distance : 80,

        domDown : {

            domClass   : 'dropload-down',

            // 滑动到底部显示内容

            domRefresh : '<div class="dropload-refresh">上拉加载更多</div>',

            // 内容加载过程中显示内容

            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',

            // 没有更多内容-显示提示

            domNoData  : '<div class="dropload-noData">暂无数据</div>'

        },

        loadDownFn : function(me){

            load_data();

        }

    });



    Array.prototype.removeByValue = function(val) {

      for(var i=0; i<this.length; i++) {

        if(this[i] == val) {

          this.splice(i, 1);

          break;

        }

      }

    }

        /*function loaded () {

        myScroll = new IScroll(

            '#wrapper',

            {

                probeType: 1,

                momentum: true,

                disableMouse: true,

                disablePointer: true,

                fadeScrollbars :false,

                click: true

            }

        );



        myScroll.on('scroll', function(){

            if (this.y < (this.maxScrollY - 40)){

                load_data();

            }



        })



        myScroll.on('scrollEnd',function(){

            if((this.y < this.maxScrollY) && (this.pointY < 1)){

                this.scrollTo(0, this.maxScrollY, 400);

                return;

            } else if (this.y > 0 && (this.pointY > window.innerHeight - 1)) {

                this.scrollTo(0, 0, 400);

                return;

            }

        })

    }

    setTimeout("loaded();",200);*/



    // 浏览器类型检测代码

    var MocuzMobile = {

        Android: function() {

            return /Android/i.test(navigator.userAgent);

        },

        BlackBerry: function() {

            return /BlackBerry/i.test(navigator.userAgent);

        },

        iOS: function() {

            return /iPhone|iPad|iPod/i.test(navigator.userAgent);

        },

        Windows: function() {

            return /IEMobile/i.test(navigator.userAgent);

        },

        any: function() {

            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());

        }

    };



    //为客户端绑定事件浏览图片

    function img_arr_json(img) {

        if(MocuzMobile.Android()) {

            window.myjs.openImage(img, '<?php echo $img_arr_json;?>');//android

            return;

        }

        if(MocuzMobile.iOS()) {

            var img_str = '<?php echo $img_arr_json;?>';

            var param = {};

            param.imglist = JSON.parse(img_str);

            param.img = img;

//            console.log(param);

            window.location.href='objc://openImage/' + JSON.stringify(param);

            return;

        }

    }



    //点赞后发送devicetoken，用来推送

    function send_devicetoken(devicelist, item, to_content) {

        if(MocuzMobile.Android()) {

            window.myjs.praise(devicelist, item, to_content);//android

            return;

        }

        if(MocuzMobile.iOS()) {

            if (item === 'comment_like') {

                window.location.href="objc://praise/" + item + "/" + devicelist + "/" + to_content;

            } else {

                window.location.href="objc://praise/" + item + "/" + devicelist;

            }

            return;

        }

    }



    function check_login() {

        if("<?php echo $login_flag;?>" == 2){

            if(MocuzMobile.Android()) {

                window.myjs.get_uid();//android

                return false;

            }

            if(MocuzMobile.iOS()) {

                window.location.href="objc://get_uid";

            }

            return false;

        }

        return true;

    }



    //评论点赞

    //many_time_comm防止多次连续点击

    var many_time_comm = false;

    $('#wrapper').on('click', '.pid_praise20682685', function() {

        if (many_time_comm) {

            return ;

        }

        many_time_comm = true;

        var _this = $(this);

        var commentid = _this.attr('commentid'),

            to_uid = _this.attr('uid'),

            to_content = _this.attr('content');

//        alert(commentid);



        if (!check_login()) {

            many_time_comm = false;

            return false;

        }

        //检测是否禁言

        if (check_banned()) {

            many_time_comm = false;

            return false;

        }

        var img = _this.find('img');

        var is_liked = img.attr('is_liked');

        if (is_liked === 'yes') {

            $('#div_liked').css('left',($(window).width()-$('#div_liked').outerWidth())/2);

            $('#div_liked').fadeIn(500);

            many_time_comm = false;

            setTimeout("$('#div_liked').fadeOut(500);",1000);

            return ;

        }



        $.ajax({

            url: "<?php echo site_url('/api/sharecircle/comment/like')?>",

            type: 'POST',

            dataType: 'json',

            data: {

                commentid: commentid,

                postid: "<?php echo $id;?>",

                uid: "<?php echo $this->user->uid;?>",

                username: "<?php echo $this->user->username;?>",

                to_uid: to_uid

            },

            error: function(XMLHttpRequest, textStatus, errorThrown) {

                if(XMLHttpRequest.readyState == 0){

                    hint_no_network();

                }

                many_time_comm = false;

            },

            success:function(data)

            {

                if (data.code != 1) {

                    many_time_comm = false;

                    return false;

                }

                //替换图标，点赞数+1

                var src = img.prop('src'),

                    like_count = img.next().text();

                img.attr('src', src.replace('zan', 'zaned'));

                img.next().text(++like_count);

                img.next().css('color', 'red');

                img.attr('is_liked', 'yes');

                many_time_comm = false;



                //告诉客户端点赞成功，准备推送

                send_devicetoken(data.data.devicelist, 'comment_like', to_content);

            }

        });

    });



    //检测是否禁言

    function check_banned() {

        if ("<?php echo $is_banned;?>" === 'yes') {

            $('#div_banned').css('left',(document.body.clientWidth-($('#div_banned').width()+40))/2);

            $('#div_banned').fadeIn(500);

            setTimeout("$('#div_banned').fadeOut(500);",1000);

            return true;

        } else {

            return false;

        }

    }



    //提示没有网络

    function hint_no_network() {

        $('#div_no_network').css('left',(document.body.clientWidth-($('#div_no_network').width()+40))/2);

        $('#div_no_network').fadeIn(500);

        setTimeout("$('#div_no_network').fadeOut(500);",1000);

    }



    //提示没有网络

    function hint_no_network() {

        $('#div_no_network').css('left',(document.body.clientWidth-($('#div_no_network').width()+40))/2);

        $('#div_no_network').fadeIn(500);

        setTimeout("$('#div_no_network').fadeOut(500);",1000);

    }



    //帖子点赞

    //many_time_post防止多次连续点击

    var many_time_post = false;

    function like_post(obj) {

        if (many_time_post) {

            $('#div_liked').css('left',(document.body.clientWidth-($('#div_liked').width()+40))/2);

            $('#div_liked').fadeIn(500);

            many_time_post = false;

            setTimeout("$('#div_liked').fadeOut(500);",1000);

            return ;

        }

        many_time_post = true;

        if (!check_login()) {

            many_time_post = false;

            return false;

        }

        if (check_banned()) {

            many_time_post = false;

            return false;

        }



        many_time_post = true;

        var _this = $(obj);

        var is_liked = _this.attr('is_liked');

        if (is_liked === 'yes') {

            $('#div_liked').css('left',(document.body.clientWidth-($('#div_liked').width()+40))/2);

            $('#div_liked').fadeIn(500);

            many_time_post = false;

            setTimeout("$('#div_liked').fadeOut(500);",1000);

            return ;

        }



        $.ajax({

            url: "<?php echo site_url('/api/sharecircle/post/like')?>",

            type: 'POST',

            dataType: 'json',

            data: {

                postid: "<?php echo $id;?>",

                uid: "<?php echo $this->user->uid;?>",

                username: "<?php echo $this->user->username;?>",

                to_uid: "<?php echo $uid;?>"

            },

            error: function(XMLHttpRequest, textStatus, errorThrown) {

                if(XMLHttpRequest.readyState == 0){

                    hint_no_network();

                }

                many_time_post = false;

            },

            success:function(data)

            {

                if (data.code != 1) {

                    many_time_post = false;

                    return false;

                }

                //替换图标，点赞数+1

                var src = $('#like_img').attr('src'),

                    like_count = $('#like_img').next().text();

                $('#like_img').attr('src', src.replace('good', 'post_like'));

                $('#like_img').next().text(++like_count);

                $('#like_img').next().css('color', 'red');

    //                $('#like_img').prop("onclick",null).off("click");

                _this.attr('is_liked', 'yes');

                //显示点赞头像

                var avatar = '<li><img src="<?php echo UC_API;?>/avatar.php?uid='

                    + "<?php echo $this->user->uid;?>" + '&size=small&random=<?php echo time();?>"></li>';

                $('#ul_post_like').prepend(avatar);

                if ($('#ul_post_like').children().length > 10) {

                    $('.topic_zan_more').prev().remove();

                }

                //告诉客户端点赞成功，准备推送

                send_devicetoken(data.data.devicelist, 'post_like', '');

            }

        });

    }
function HTMLEncode ( input ) 
{ 
var converter = document.createElement("DIV"); 
converter.innerText = input; 
var output = converter.innerHTML; 
converter = null; 
return output; 
}

function HTMLDecode ( input ) 
{ 
var converter = document.createElement("DIV"); 
converter.innerHTML = input; 
var output = converter.innerText; 
converter = null; 
return output; 
}

function escape2Html(str) {
 var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
 return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
}

    //页面加载完成后，调用此函数传递分享数据给客户端

    function jiaohu() {

        var client="<?php echo isset($_GET['client']) ? $_GET['client'] : '';?>";

        var sharelink="<?php echo urlencode($sharelink); ?>";

        var share_text="<?php echo cutstring($content, 30); ?>";

        var sharesubject="<?php echo cutstring($content, 20); ?>";

<?php 
$str=array();
$str['sharelink']=urlencode($sharelink);
$str['client']=isset($_GET['client']) ? $_GET['client'] : '';
$str['sharetext']=$content;
$str['sharesubject']=$content;
$str['shareIcon']=$img_arr[0]['path'].".small.jpg";
$str['uid']=$uid;
$str['username']=$username;
$strjson=json_encode($str);
?>

var str =<?php echo $strjson;?>;
str = JSON.stringify(str);
        /*if(MocuzMobile.Android()&&client==1) {

         window.myjs.jiaohu(str);

         return;

         }

         if (MocuzMobile.iOS()&&client==1) {

         window.location.href="objc://jiaohu:/"+str;

         }*/

        if(MocuzMobile.Android()) {

            window.myjs.jiaohu(str);

            return;

        }

        if (MocuzMobile.iOS()) {

            window.location.href="objc://jiaohu:/"+str;

        }

    }

    window.onload = jiaohu();
/*
    //页面加载完成后，调用此函数传递分享数据给客户端
    function jiaohu() {
        var client="<?php echo isset($_GET['client']) ? $_GET['client'] : '';?>";
        var sharelink="<?php echo urlencode($sharelink); ?>";
        var share_text="<?php echo cutstring($content, 30); ?>";
        var sharesubject="<?php echo cutstring($content, 20); ?>";

        var str = '{"sharelink":"' + sharelink + '", "sharetext":"' +
            share_text + '", "sharesubject":"' + sharesubject +
            '", "shareIcon":"<?php echo $img_arr[0]['path'];?>' + '.small.jpg", ' +
            '"uid":"<?php echo $uid;?>", "username":"<?php echo htmlentities($username, ENT_QUOTES);?>"}';


        if(MocuzMobile.Android()) {
            window.myjs.jiaohu(str);
            return;
        }
        if (MocuzMobile.iOS()) {
            window.location.href="objc://jiaohu:/"+str;
        }
    }
*/
    function add_one_comment(id, uid, username, to_username, message_v, message) {

        var new_item =  '<li id="last_reply">'+

            '<div class="discuss_box ">'+

            '<a  href="javascript:void(0);">'+

            '<img class="discuss_portrait"  src="<?php echo UC_API;?>/avatar.php?uid='

            + uid + '&size=small&random=' + Date.parse(new Date()) + '">'+

            '</a>'+

            '<div class="discuss_user">'+

            '<p class="user_name" href="javascript:void(0);">' +

            username + '<?php echo $this->user->usergroup_level(' + uid + ');?></p><br>'+

            '<span class="discuss_span span_date">1分钟前</span>'+

            '</div>'+

            '<div class="post-operation">'+

//            '<span class="post-floor">' + ($('#comment_ul').children().length + 1) + '楼</span>'+

            '</div>'+

            '<div class="discuss_content">';

        if (to_username) {

            new_item += '回复' + to_username + '：';

        }

        new_item += message_v + '</div>' + '<div class="discuss_bottom">'+

            '<div class="praise_reply pid_praise20682685" uid="' + uid + '" commentid="' + id

            + '" content="' + message + '">';

        new_item += '<img is_liked="no" src="<?php echo asset_url('h5/images/zan.png')?>" alt="">'+

        '<span class="discuss_zan" style="padding-left: 6px;">0</span>';

        new_item += '</div>'+

        '<div class="praise_reply bind_reply" uid="' + uid + '" username="' + username + '" content="' + message + '">'+

        '<img src="<?php echo asset_url('h5/images/reply.png')?>">'+

        '<span class="discuss_zan" style="padding-left: 6px;">回复</span>'+

        '</div>'+

        '</div>'+

        '</div>'+

        '</li>';

        $('#comment_ul').append(new_item);

        dropload.reset_addComment();

         $('#wrapper').animate({ scrollTop: $('.wra_wrapper').height()-$('#wrapper').height()}, 300);



        //刷新myScroll,滚轴下移150px，显示出假数据

//        setTimeout("myScroll.refresh();",200);

//        var pageBottom=myScroll.maxScrollY;

//        myScroll.scrollTo(0,pageBottom-150,1500);

    }



    //评论/回复后客户端调用，显示假数据

//    tagindex = 1;

    function  postParameter(id, uid, username, to_uid, to_username, message) {

        var index = message.indexOf('{:mocs_');

        if (index !== -1) {

            $.ajax({

                url: "<?php echo site_url('/api/sharecircle/post/smilies_switch')?>",

                type: 'POST',

                dataType: 'json',

                data: {

                    message: message

                },

                success:function(data)

                {

                    add_one_comment(id, uid, username, to_username, data.data, message);

                }

            });

        } else {

            add_one_comment(id, uid, username, to_username, message, message);

        }

        tids_filter.push(id);  //加载时过滤掉此条数据

    };



    //跳转个人中心

    function lbsPerson(user_id){

        var user_id = '{"user_id":' + user_id + '}';

        if(MocuzMobile.Android()) {

            window.myjs.lbsPerson(user_id);//android

            return;

        }

        if(MocuzMobile.iOS()) {

            var cmd = "lbsPerson";

            window.location.href="objc://"+cmd+":/"+user_id;

            return;

        }

    }



    $(function(){

//        postParameter(344, '111', 'rttt', 'ffg', 'frfr', '{:mocs_1:}d');

//        postParameter(344, '111', 'rttt', 'ffg', 'frfr', 'ghjd');

        $(".img_detail").lazyload();



        //为客户端绑定回复事件

        $(document).on('click', '.bind_reply', function() {

            var to_uid = $(this).attr('uid'),

                to_username = $(this).attr('username'),

                to_content = $(this).attr('content'),

                postid = '<?php echo $id; ?>';

            if (MocuzMobile.Android()) {

                window.myjs.changePage(to_uid, to_username, to_content);//android

                return;

            }

            if (MocuzMobile.iOS()) {

                window.location.href="objc://changePage:/" + postid + "/" + to_uid + "/" + to_username + "/" + to_content;

            }

        });



        $('#ul_post_like').on('click', function() {

            postid = '<?php echo $id; ?>';

            if (MocuzMobile.Android()) {

                window.myjs.post_like_users(postid);//android

                return;

            }

            if (MocuzMobile.iOS()) {

                window.location.href="objc://post_like_users:/" + postid;

            }

        });



        //关注

        /*$('#follow').on('click', function() {

            if (!check_login()) {

                return false;

            }

            $.ajax({

                url: "<?php echo site_url('/api/sharecircle/post/follow')?>",

                type: 'POST',

                dataType: 'json',

                data: {

                    uid: "<?php echo $this->user->uid;?>",

                    fuid: "<?php echo $uid;?>",

                    fusername: "<?php echo $username;?>"

                },

                success:function(data)

                {

                    if (data.data.is_followed) {

                        $('#follow').parent().removeClass('attention_n');

                        $('#follow').parent().addClass('attention_y');

                        $('#follow').text('已关注');

                    } else {

                        $('#follow').parent().removeClass('attention_y');

                        $('#follow').parent().addClass('attention_n');

                        $('#follow').text('+ 关注');

                    }

                }

            })

        });*/







        /*var finished = true ;

        function loadData() {

            //操作



        }

        $(window).on('scroll', function () {

            var docHeight = $(document).height();    //页面总高度

            var viewHeight = $(window).height();      //窗口高度

            var breakPoint = docHeight - viewHeight -3; // 提前 10 个像素 开始发起请求



            var scrollTop = $(window).scrollTop();



            if(scrollTop >= breakPoint && finished){

                finished= false;

                loadData();

            }

        });*/



        var ua = navigator.userAgent.toLowerCase();

        var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;

        if (/iphone|ipad|ipod/.test(ua)) {

            if(height>504){

                $('.bbs-cv-info,.operate_box,.discuss,.content,.discuss,.award,.discuss_ulA li,.discuss_ul li,.html-data table caption,.html-data table tr td,.vote_box_tle,.activity_box table caption,.activity_box table tr td,.topic_zan_list').css('border-width','0.8px');

            }

        }





        function topic_img(){

            var index=$('.topic_img_list li').length;

            if(index==1){

                $('.topic_img_list').addClass('topic_img_one');

            }else if(index==2){

                $('.topic_img_list').addClass('topic_img_two');

                var width=$('.topic_img_list li').width();

                $('.topic_img_list li').css({

                    'height':width,

                })

            }else{

                var width=$('.topic_img_list li').width();

                var mr=$('.topic_img_list li:first').css('margin-right');

                $('.topic_img_list li').css({

                    'height':width,

                    'margin-bottom':mr

                })

            }





        }

        topic_img();

        window.onresize=function(){

            topic_img();

        }



    })



</script>



</html>