{include file="Application/Home/View/Public/header.blade.php"}
{include file="Application/Home/View/Public/userLeft.blade.php"}
<link rel="stylesheet" href="/Public/Home/css/center.css"/>
<div class="member-content">
    <div class="content_h">

        <div class="feedback">
            <span>意见反馈</span>
        </div>

        <div class="opinion">
            <div class="opinion_one">
                <input name="checkbox" class="check_h" type="radio">
                <lable name="checkbox">建议</lable>
            </div>

            <div class="opinion_one">
                <input name="checkbox" class="check_h" type="radio">
                <lable name="checkbox">错误报告</lable>
            </div>

            <div class="opinion_one">
                <input name="checkbox" class="check_h" type="radio">
                <lable name="checkbox">投注</lable>
            </div>
        </div>

        <div class="textarea_all">
            <textarea name="" id="textarea" cols="30" rows="10" style="color: black"></textarea>
            <button class="btn" id="toastBtn">提交反馈</button>
        </div>

        <div class="process">
            <span>进程</span>
        </div>

        {literal}
        <div class="process_answer">
            <div class="process_answer_A" v-for="v in todos">
               <div class="answer_oa">
                <span>Q</span><span>:</span>
                <span v-text="v.content"></span>
               </div>

               <div class="answer_ob">

                <span v-if="v.status==1">Q</span><span v-if="v.status==1">:</span>
                <span v-if="v.status==1" v-text="v.reply"></span>
                <span v-if="v.status!=1">正在处理中……</span>

               </div>

            </div>
            <div class="page" id="setpage"></div>
        </div>
        {/literal}

        </div>
    </div>
    </div>
    </div>
<script src="/Public/Home/js/checkToken.js"></script>
{literal}
<script>
    var datas = new Vue({
        el: ".process_answer",
        data:{
            todos:[],
            gamels:''
        }
    });

    function setTable(data)
    {
        datas.todos=data;
    }

    function showpage(page) {
        var url=window.location.search;
        var map = url.split('&');

        apiAjax('/Api-Other/FeedBackList',{page:page,lists:3},function (res) {
            data = res.data.data;
            setTable(data);
            laypage({
                cont: $('#setpage'), //容器。值支持id名、原生dom对象，jquery对象。【如该容器为】：<div id="page1"></div>
                pages: res.data.count_page, //通过后台拿到的总页数
                curr: res.data.page || 1, //当前页
                jump: function(obj, first){ //触发分页后的回调
                    if(!first){ //点击跳页触发函数自身，并传递当前页：obj.curr
                        var currpage = $(this)[0]['curr']
                        showpage(currpage);
                    }
                }
            });
        });
    }

    showpage(1);

    document.getElementById("toastBtn").addEventListener('click', function () {
        var radio = $('.check_h');
        var obj = document.getElementsByTagName("lable");
        //console.log(obj);
        for (var i = 0; i < radio.length; i++) {
            var choice = radio[i].checked;
            var con = document.getElementById('textarea').value;
            if (choice) {//得到选中的单选按钮如果要得到值 那么可以：
                var tit = obj[i].innerText;
                console.log(tit);
                //console.log(con);
            } else if (!radio[0].checked && !radio[1].checked && !radio[2].checked) {
                alert('请选择提交分类');
                return;
            } else if (con == '') {
                alert('未输入内容');
                return;
            }
        }
        apiAjax('/Api-Other/FeedBack',{type:tit,content:con},function(data){
            lalert(data['msg'],'/Home-Account/Faceback');
        });
    });

    //导航高亮
    $(".leftList>li").removeClass('active');
    $(".leftList>li li").removeClass('active');
    $(".leftList>li").eq(1).addClass('active');
    $(".leftList>li.active").find('li').eq(3).addClass('active');
</script>
{/literal}
{include file="Application/Home/View/Public/footer.php"}