<#assign title="我的家"/>
<#include "/home/frag.head.ftl" />

<div class="weui-tab">
    <div class="weui-tab__bd">
        <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
            <#include "/home/ribao.ftl" /></div>
        <div id="tab2" class="weui-tab__bd-item">
            <#include "/home/qiuzhu.ftl" /></div>
    <#--<div id="tab3" class="weui-tab__bd-item">-->
    <#--<h1>页面三</h1> </div>-->
    <#--<div id="tab4" class="weui-tab__bd-item">-->
    <#--<h1>页面四</h1> </div>-->
    </div>
    <div class="weui-tabbar">
        <a href="#tab1" class="weui-tabbar__item weui-bar__item--on">
            <div class="weui-tabbar__icon"><img src="/static/images/wx/order.png" alt=""></div>
            <p class="weui-tabbar__label">健康日报</p>
        </a>
        <a href="#tab2" class="weui-tabbar__item">
            <div class="weui-tabbar__icon"><img src="/static/images/wx/customer_service.png" alt=""></div>
            <p class="weui-tabbar__label" onclick="familyClick()">家庭求助</p>
        </a>
    <#--<a href="#tab3" class="weui-tabbar__item">-->
    <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_article.png" alt=""> </div>-->
    <#--<p class="weui-tabbar__label">发现</p>-->
    <#--</a>-->
    <#--<a href="#tab4" class="weui-tabbar__item">-->
    <#--<div class="weui-tabbar__icon"> <img src="./images/icon_nav_cell.png" alt=""> </div>-->
    <#--<p class="weui-tabbar__label">我</p>-->
    <#--</a>-->
    </div>
</div>


</body>

<#include "/home/frag.foot.ftl" />
<script>
    <#include "/home/ribao.js" />
    <#include "/home/qiuzhu.js" />
    var userid = ${user};
    (function ($) {

        $(function () {
            $('.weui-navbar__item').on('click', function () {
                $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
                //内容切换
                var moduleClass = jQuery(this).attr("module");
                var ss = ".weui-tab__panel ." + moduleClass + "_weui_tab_bd_item_active";
                $(ss).removeClass(moduleClass + '_weui_tab_bd_item_active');
                var data_toggle = jQuery(this).attr("target");
                $(data_toggle).addClass(moduleClass + "_weui_tab_bd_item_active");
            });
        });

        console.log(userid);

        ribao_init();
        qiuzhu_init();
        help();
        family_init();
        ribao_add();
        ribao_cancel();
        ribao_commit();
        submit_back();
    })(jQuery);


    //小区求助信息的展示
    function familyClick() {
        $.ajax({
            url: '/home/home/queryQzTask',
            data: {},
            type: 'GET',
            success: function (data) {
                console.log(data);
                if (data.data.length > 0) {
                    hasData = true;
                    data.data.forEach(function (v) {
                        familyValue(v);
                    });
                } else {

                }
            },
            error: function () {
            }
        });
    }

    function familyValue(v) {
        $('#notitle').append($('<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form" href="javascript:;">\n' +
                '                        <div class="weui-cell__bd" taskId="1212>\n' +
                '                            <div class="weui-media-box weui-media-box_text" id="title">\n' +
                '                                <p class="weui-media-box__desc" >' + v.taskTitle + '</p>\n' +
                '                            </div>\n' +
                '                        </div>\n' +
                '                        <div class="weui-cell__ft"></div>\n' +
                '                    </a>\n<br />'));

    }


</script>