<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no"/>
    <title>精准导购系统企业号应用</title>
    <link rel="stylesheet" href="/static/css/wechat/weui.min.css?v=201704281424"/>
    <link rel="stylesheet" type="text/css" href="/static/css/wechat/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="/static/css/wechat/style.css">
</head>

<body ontouchstart class="bg-white">
<input type="hidden" id="customerId" th:value="${customerId}"/>
<input type="hidden" id="projectId" th:value="${projectId}"/>
<header>
    <div class="header">
        <a href="javascript:backToUrl();" class="btn-a-back"><i class="iconfont">&#xe61f;</i></a>
        <h2>状态变更记录</h2>
    </div>
</header>
<div class="bg-white">
    <div id="statusChangeLogs"></div>
</div>
</body>
<script type="text/html" id="statusChangeLogsTemplate">
    {{each changeLogs as log index}}
        <div class="weui-media-box weui-media-box_text">
        <h4 class="weui-media-box__title">{{log.createTime.time | dateFormat:"yyyy-MM-dd hh:mm:ss"}}</h4>
        <p class="weui-media-box__desc">【{{log.toStatusName}}】,添加人【{{log.creater}}】,
            {{if log.occurTime}}
            发生时间:{{log.occurTime.time | dateFormat:"yyyy-MM-dd hh:mm:ss"}},
            {{/if}}
            备注【{{log.remark}}】</p>
        </div>
    {{/each}}
</script>
<script type="text/javascript" src="/static/js/wechat/zepto.min.js"></script>
<script type="text/javascript" src="/static/js/statistics.js"></script>
<script type="text/javascript" src="/static/js/history.js"></script>
<script type="text/javascript" src="/static/js/template.js"></script>
<script type="text/javascript" src="/static/js/utils.js"></script>
<script>
    $(function () {
        $.ajax({
            url: "/project/getstatuschangelogs",
            data: {
                customerId: $("#customerId").val(),
                projectId: $("#projectId").val()
            },
            type: "post",
            success: function (data) {
                var html = template('statusChangeLogsTemplate', {changeLogs: data.data.list});
                $("#statusChangeLogs").append(html);
            }
        });
    });
</script>
</html>
