<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>签到</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="decorator" content="base"/>
    <link rel="stylesheet" type="text/css" href="${ctxPlugin}/static/css/reset.css"/>
    <link rel="stylesheet" href="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/dist/viewer.css" media="all">
    <style>
        html {
            background-color: #fff;
            padding-bottom: 50px;
        }
        .form-span {
            display: block;
            padding: 8px 0;
            margin-left: 110px;
        }

        .page-iframe {
            border: none;
            width: 100%;
            min-height: calc(100vh - 250px);
        }
        .mb-10{
            margin-bottom: 10px !important;
        }
        .pd-10{
            padding: 10px;
        }
        .idea-text{
            width: 320px; height: 100px;outline: none; padding: 3px
        }
        .msg-title{
            text-align: center;
            margin: 10px 0;
            font-size: 16px;
        }
        .title1 {
            border-left: 4px solid #1b6073;
            padding-left: 20px;
            font-size: 14px;
            margin: 10px auto;
            font-weight: 600;
            height: 34px;
            line-height: 34px;
            background-color: #f4f6f9;
            color: #666666;
        }
        .layui-input-block {
            margin-left: 110px;
        }

        .layui-form-label {
            width: 110px;
        }
        .clearfix{*zoom:1;}
        .clearfix:before,.clearfix:after{display:table; line-height:0; content:"";}
        .clearfix:after{clear:both;}

        .layui-tab-title{
            margin: 0 0 0 20px;
        }
        .layui-tab-content{
            margin: 0 0 0 20px;
        }
        .bj-img {
            margin-right: 5px;
        }
        .blank-img {
            background: url('${ctxPlugin}/static/imgs/blankImg.png') center center no-repeat;
            width: 80px;
            height: 80px;
            display: inline-block;
        }
        .link-blue{ color: #1b6073; cursor: pointer;}
        .btn-signin {
            border-radius: 100%;
            border: 1px solid #ddd;
            width: 80px;
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="layui-fluid pd-10">
    <div class="order-win layui-form">
        <div class="layui-card-body pt-40 pb-40" style="display: flex;justify-content: center;flex-direction: column;align-items: center">
            <div class="btn-signin" onclick="signin()">
                <span id="text">签到</span>
            </div>
            <div id="signstatus" class="hide mt-10">
                签到时间：<span id="signinTime"></span>
            </div>
        </div>
    </div>
</div>
<div class="layui-form-item text-c operate-footer">
    <button class="layui-btn layui-btn-primary" onclick="closeSelf()">关闭</button>
</div>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script>
    //图片查看效果
    let form = null;
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'jquery', 'layer','upload','form'], function () {
        $ = layui.$;
        layer = layui.layer;
        upload = layui.upload;
        form = layui.form;
        $("#save").click(function() {
        });
    });

    function closeSelf() {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);//关闭当前页
    }

    let signining = false;
    function signin() {
        if (signining) {
            return;
        }
        signining = true;
        $.ajax({
            url: "${ctx}/taskdispatch/crmReviewGroupMember/signin",
            type: "POST",
            data: JSON.stringify({
            }),
            success: function (data) {
                if (data.code === "200") {
                    layer.msg("签到成功！");
                    $("#text").text('签到成功');
                    $("#signinTime").text(data.data);
                    $("#signstatus").removeClass('hide');
                    parent.changeSigninState();
                } else {
                    layer.msg(data.errMsg, {icon: 2});
                }
            },
            complete: function() {
                signining = false;
            },
            error: function () {
                layer.msg("系统忙，请稍后再试！");
            }
        });
    }

</script>
</body>
</html>
