homePage.html 2.15 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>UFO首页</title>
    <script type="text/javascript" src="/ufoPlatform/js/vue.min.js"></script>
    <style type="text/css">
        html, body{
            width: 100%;
            height: 100%;
        }

        body {
            margin: 0;
            padding: 0;
        }

        .wrapper {
            width: 100%;
            height: 100%;
        }

        .main {
            width: 100%;
            height: 100%;
            display: flex;
            display: -webkit-flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .main-title {
            font-size: 60px;
            text-align: center;
            color: #515a6e;
            text-shadow: 1px 1px 5px #1E88C7;
            margin: 20px auto;
        }

        .main-time {
            font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
            font-size: 30px;
            text-align: center;
            color: lightgray;
        }


    </style>
</head>
<body>
    <div class="wrapper">
        <div id="main" class="main">
            <!--<p class="main-title">欢迎进入UFO运营管理平台</p>-->
            <p class="main-time">{{time}}</p>
        </div>
    </div>
    <script type="text/javascript">
        let app = new Vue({
          el: '#main',
          data: {
            time: ''
          },
          methods: {
            getTime: function () {
              let date = new Date();
              let time = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' +
                date.getDate() + ' ' + (date.getHours() > 9 ? date.getHours() : '0' + date.getHours()) + ':' + (date.getMinutes() > 9 ? date.getMinutes() : '0' + date.getMinutes()) + ':' +
                (date.getSeconds() > 9 ? date.getSeconds() : '0' + date.getSeconds());
              this.time = time;
              setTimeout(this.getTime.bind(this), 1000);
            }
          },
          mounted: function() {
            this.getTime();
          }
        })
    </script>
</body>
</html>