|
|
|
@ -7,7 +7,7 @@ |
|
|
|
累计进馆人数:3,435,123万人 |
|
|
|
</div> |
|
|
|
<img class="topImg" src="@/assets/index/top_title.png" /> |
|
|
|
<div style="margin-right: 2%" class="topTitle">星期四 16:33:33</div> |
|
|
|
<div style="margin-right: 2%" class="topTitle"> {{nowtime}} {{ curtime }} </div> |
|
|
|
</div> |
|
|
|
<div class="links"> |
|
|
|
<router-link to="/ty">体育</router-link> |
|
|
|
@ -27,18 +27,46 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// |
|
|
|
|
|
|
|
// 当前时间 |
|
|
|
date:new Date(), |
|
|
|
nowtime:"", |
|
|
|
curtime:'', |
|
|
|
}; |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// console.log(this.$route) |
|
|
|
const cweeks =['星期一','星期二','星期三','星期四','星期五','星期六','星期日',] |
|
|
|
// 取当前时间 |
|
|
|
const year = this.date.getFullYear(); |
|
|
|
const month = ('0' + (this.date.getMonth() + 1)).slice(-2); |
|
|
|
const day = ('0' + this.date.getDate()).slice(-2); |
|
|
|
// 周几 |
|
|
|
const wday = this.date.getDay()-1; |
|
|
|
// 创建时候附带时间 |
|
|
|
const hours = ('0' + this.date.getHours()).slice(-2); |
|
|
|
const minutes = ('0' + this.date.getMinutes()).slice(-2); |
|
|
|
const seconds = ('0' + this.date.getSeconds()).slice(-2); |
|
|
|
this.curtime = `${hours}:${minutes}:${seconds}` |
|
|
|
this.nowtime = `${year}.${month}.${day} `+ cweeks[wday]; |
|
|
|
console.log(this.nowtime) |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// |
|
|
|
this.getTimespan(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// |
|
|
|
getTimespan(){ |
|
|
|
// 时分秒 |
|
|
|
|
|
|
|
setInterval(()=>{ |
|
|
|
let tdate = new Date(); |
|
|
|
//this.curtime = new Date().get.toLocaleString() |
|
|
|
const hours = ('0' + tdate.getHours()).slice(-2); |
|
|
|
const minutes = ('0' + tdate.getMinutes()).slice(-2); |
|
|
|
const seconds = ('0' + tdate.getSeconds()).slice(-2); |
|
|
|
// console.log(seconds) |
|
|
|
this.curtime = `${hours}:${minutes}:${seconds}` |
|
|
|
},1000) |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
@ -58,7 +86,7 @@ body { |
|
|
|
// 基类 |
|
|
|
.btgym { |
|
|
|
width: 100vw; |
|
|
|
height: 100%; |
|
|
|
// height: 100%; |
|
|
|
position: relative; |
|
|
|
background-size: 100%; |
|
|
|
background-repeat: no-repeat; |
|
|
|
|