<?php
use yii\helpers\Url; 
?>
<div class="content">

    <!-- banner -->
    <div class="banner analysis-banner">
        <!--<h2 class="main-title-en container">
        	<?= !empty($name) ?  $name : '' ?>
        	<span class="en">/<?= !empty($e_name) ?  $e_name : '' ?></span>
        </h2>-->

    </div>
    <div class="container activity-container clearfix">
        <div class="analysis-aside">
            <div class="analysis-nav">
                <h3 class="title">
                	<img src="<?= STATIC_URL ?>/static/fxm/images/new-activity-icon.jpg" alt="">
                </h3>
                <ul id="new_article_list">
                </ul>
            </div>
            <!--<a class="img" href="javascript:;">
                <img src="<?= STATIC_URL ?>/static/fxm/images/Analysis-img.jpg" alt="HANDZ INVESTMENT全球注册及监管,澳大利亚 ASIC 塞浦路斯 CySec 英国 FCA">
            </a>-->
        </div>

        <div class="analysis-main">
           <iframe frameborder="0" width="100%" height="850px" scrolling="yes" src="https://rili-d.jin10.com/open.php?fontSize=14px&theme=primary"></iframe>
            <!--<ul class="analysis-list" id="analysisList">
            </ul>-->
            <div class="pages-wrap">
                <div id="page" class="pagination"></div>
            </div>
        </div>
    </div>
</div>
<?php $this->beginBlock('footer_script'); ?>
<script src="<?= STATIC_URL ?>/static/fxm/js/page.js"></script>
<script>
    // 获取链接参数
    function GeturlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    $(function () {
        getNewArticleList();
        var id = GeturlParam('id');
        var pageNumber = GeturlParam('pageNumber') || 1;


        $.getJSON('/article/article-list?id=' + id + '&pageNumber=' + pageNumber, function (res) {
            var articleList = res.res.data
            var html = ''
            articleList.forEach(function (item) {
                var min_content = (item.min_content == null) ? '' : item.min_content;
                item.image_path = item.image_path ? item.image_path : 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
                html += '<li class="list-item">' +
                    '<a href="/article/detail?id=' + item.id + '" >' +
                    '<img src="' + item.image_path + '" width="220" height="145" >' +
                    '<div class="desc">' +
                    '<h4>' + item.title + '</h4>' +
                    '<div class="date">' + min_content + '</div>' +
                    '<p>' + item.create_date + '</p></div></a></li >';
            })
            analysisList.innerHTML = html
            laypage.render({
                elem: 'page',
                count: res.totalNum,
                layout: ['prev', 'page', 'next'],
                curr: pageNumber,
                jump: function (obj, first) {
                    if (!first) {
                        location.href = '/article/list?id=' + id + '&pageNumber=' + obj.curr
                    }
                }
            });
            
           	$('.layui-laypage-prev').html('');
           	$('.layui-laypage-next').html('');
        })
    });
</script>
<?php $this->endBlock(); ?>
