Parcourir la source

工时管家——官网下载页面及后台管理系统修改

ZhouRuiTing il y a 5 ans
Parent
commit
59405270d6

+ 1 - 1
fhKeeper/formulahousekeeper/inva_4_tivo/download.html

@@ -84,7 +84,7 @@
                         </div>
                         <div class="card-body">
                             <h4 class="card-title">Mac版</h4>
-                            <a class="btn-solid-lg page-scroll" href="./download/WorkTime.exe" download="工时管家">立即下载</a>
+                            <a class="btn-solid-lg page-scroll" href="./download/WorkTime.dmg" download="工时管家">立即下载</a>
                         </div>
                     </div>
                 </div>

BIN
fhKeeper/formulahousekeeper/timesheet/src/assets/image/code.jpg


+ 23 - 0
fhKeeper/formulahousekeeper/timesheet/src/common/js/util.js

@@ -66,6 +66,29 @@ export default {
                 iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) + "天" //把相差的毫秒数转换为天数 
             }
             return iDays
+        },
+        cdTime: function(t1, t2, tg) {
+            var ms = Date.parse(t1) - Date.parse(t2);
+            var minutes = 1000 * 60;
+            var hours = minutes * 60;
+            var days = hours * 24;
+            var years = days * 365;
+            //求出天数
+            var d = Math.floor(ms / days);
+            //求出除开天数,剩余的毫秒数
+            ms %= days;
+            var h = Math.floor(ms / hours);
+            ms %= hours;
+            var m = Math.floor(ms / minutes);
+            ms %= minutes;
+            var s = Math.floor(ms / 1000);
+            //返回所需值并退出函数
+            switch(tg){
+                case 'd' : return d;
+                case 'h' : return h;
+                case 'm' : return m;
+                case 's' : return s;
+            }
         }
     }
 

+ 28 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -8,13 +8,14 @@
                     <span>{{sysName}}</span>
                 </div>
             </el-col>
-            <el-col :span="10">
+            <el-col :span="4">
                 <div class="tools" @click.prevent="collapse">
                     <i class="fa fa-align-justify"></i>
                 </div>
             </el-col>
-            <el-col :span="6" class="userinfo">
-                <el-dropdown trigger="hover">
+            <el-col :span="10" class="userinfo">
+                到期日期:{{remainingTime}}
+                <el-dropdown trigger="hover" style="margin-left:10px;">
                     <span class="el-dropdown-link userinfo-inner">
                         <img src="../assets/image/userHead.png" />
                         {{sysUserName}}
@@ -114,10 +115,12 @@
 </template>
 
 <script>
+    import util from "../common/js/util";
     export default {
         data() {
             return {
                 user: sessionStorage.getItem("user"),
+
                 sysName: "工时管家",
                 collapsed: false,
                 sysUserName: "",
@@ -142,7 +145,10 @@
                 },
 
                 //时间
-                activeDate: new Date()
+                activeDate: new Date(),
+
+                timer: null,
+                remainingTime: '',
             };
         },
         methods: {
@@ -265,12 +271,30 @@
                     }
                 });
             },
+
+            setTime() {
+                console.log(new Date().getTime() + this.user.remainingTime,
+                new Date(this.user.remainingTime),
+                new Date())
+                var d = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 'd');
+                var h = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 'h');
+                var m = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 'm');
+                var s = util.formatDate.cdTime(new Date(new Date().getTime() + this.user.remainingTime), new Date(), 's');
+                this.remainingTime = d+'天'+h+'时'+m+'分'+s+'秒';
+            }
         },
         mounted() {
             if (this.user) {
                 var user = JSON.parse(this.user);
                 this.user = user;
                 this.sysUserName = user.name || "";
+                if(this.user.remainingTime != "" && this.user.remainingTime != 0) {
+                    // this.setTime();
+                    this.remainingTime = util.formatDate.format(new Date(new Date().getTime() + this.user.remainingTime), "yyyy-MM-dd")
+                } else {
+                    this.remainingTime = "已过期";
+                    clearInterval(this.timer);
+                }
             } else {
                 this.$router.push("/login");
             }

+ 29 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -16,8 +16,15 @@
                     <el-button type="primary" style="width:100%;" @click.native.prevent="handleSubmit" :loading="logining">登录</el-button>
                 </el-form-item>
                 <div class="toRegister">
+                    <el-link type="primary" class="btn" style="float:left;" @click="jumpTo" :underline="false">联系客服
+                        <div class="service">
+                            <p style="color: #333">扫码加客服微信</p>
+                            <img src="../assets/image/code.jpg">
+                            <p><span style="color: #333">QQ:</span>3052894409</p>
+                        </div>
+                    </el-link>
                     <el-link type="primary" style="margin-right:5px;" :underline="false"><a style="color:#409EFF;text-decoration:none" href="http://gsgj.ttkuaiban.com/download.html" download="工时管家">客户端下载</a></el-link>
-                    <el-link type="primary" @click="jumpTo" :underline="false">立即注册</el-link>
+                    <el-link type="primary" @click="jumpTo" :underline="false">企业注册</el-link>
                 </div>
             </el-form>
         </div>
@@ -132,5 +139,26 @@
     .toRegister {
         margin: 15px 0;
         text-align: right;
+        position: relative;
+
+        .service {
+            display: none;
+            width: 120px;
+            position: absolute;
+            background: #fff;
+            text-align: center;
+            padding: 10px;
+            left: -30px;
+            top: -210px;
+            border-radius: 5px;
+            box-shadow: 3px 3px 10px #dfdfdf;
+            img {
+                width: 80px;
+            }
+        }
+    }
+
+    .btn:hover .service {
+        display: block;
     }
 </style>