Commit 4cec7159 authored by YIyiyi's avatar YIyiyi

pref:修改页面

parent ed02f100
...@@ -18,41 +18,11 @@ export default { ...@@ -18,41 +18,11 @@ export default {
data() { data() {
return {}; return {};
}, },
created() { created() {},
this.isTimeOut();
},
methods: { methods: {
handleBack() { handleBack() {
this.$router.back(); this.$router.back();
}, },
// 5分钟返回首页
startTimer() {
let that = this;
clearInterval(that.timeOut);
this.timeOut = setInterval(function () {
that.$router.push({ path: "/" });
}, 1000 * 60 * 5);
},
// 5分钟无任何操作返回首页
isTimeOut() {
if (this.$route.path == "/" || this.$route.path == "/home") {
return;
}
this.startTimer();
document.body.addEventListener("mousemove", this.startTimer);
document.body.addEventListener("mouseup", this.startTimer);
document.body.addEventListener("keyup", this.startTimer);
document.body.addEventListener("click", this.startTimer);
document.body.addEventListener("touchend", this.startTimer);
},
},
beforeDestroy() {
document.body.removeEventListener("mousemove", this.startTimer);
document.body.removeEventListener("mouseup", this.startTimer);
document.body.removeEventListener("keyup", this.startTimer);
document.body.removeEventListener("click", this.startTimer);
document.body.removeEventListener("touchend", this.startTimer);
clearInterval(this.timeOut);
}, },
}; };
</script> </script>
...@@ -63,6 +33,7 @@ export default { ...@@ -63,6 +33,7 @@ export default {
height: 100px; height: 100px;
padding: 0px 40px; padding: 0px 40px;
background: url("../assets/img/title.jpg") no-repeat center; background: url("../assets/img/title.jpg") no-repeat center;
background-size: 100% 100%;
box-shadow: 0px 2px 6px 6px #ccc; box-shadow: 0px 2px 6px 6px #ccc;
.back-text { .back-text {
font-size: 28px; font-size: 28px;
...@@ -75,4 +46,4 @@ export default { ...@@ -75,4 +46,4 @@ export default {
color: #ffffff; color: #ffffff;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -5,12 +5,49 @@ ...@@ -5,12 +5,49 @@
</template> </template>
<script> <script>
export default {}; export default {
data() {
return {};
},
created() {
this.isTimeOut();
},
methods: {
// 返回首页
startTimer() {
let that = this;
clearInterval(that.timeOut);
this.timeOut = setInterval(function () {
that.$router.push({ path: "/" });
}, 1000 * 60 * 2);
},
// 无任何操作返回首页
isTimeOut() {
if (this.$route.path == "/" || this.$route.path == "/home") {
return;
}
this.startTimer();
document.body.addEventListener("mousemove", this.startTimer);
document.body.addEventListener("mouseup", this.startTimer);
document.body.addEventListener("keyup", this.startTimer);
document.body.addEventListener("click", this.startTimer);
document.body.addEventListener("touchend", this.startTimer);
},
},
beforeDestroy() {
document.body.removeEventListener("mousemove", this.startTimer);
document.body.removeEventListener("mouseup", this.startTimer);
document.body.removeEventListener("keyup", this.startTimer);
document.body.removeEventListener("click", this.startTimer);
document.body.removeEventListener("touchend", this.startTimer);
clearInterval(this.timeOut);
},
};
</script> </script>
<style lang="less" > <style lang="less">
.layouts { .layouts {
width: 100%; width: 100%;
height: auto; height: auto;
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment