From 060ec37ccf9b3f8fd6a61524acb2d4c9c050b99f Mon Sep 17 00:00:00 2001 From: zwq Date: Tue, 5 Jul 2022 16:54:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/common/board-part-table.vue | 9 +- src/views/common/board-part.vue | 100 ++---------------- src/views/common/board.vue | 143 +++++++++++--------------- src/views/main.vue | 4 +- static/img/lu/{BMD .png => BMD1.png} | Bin 5 files changed, 77 insertions(+), 179 deletions(-) rename static/img/lu/{BMD .png => BMD1.png} (100%) diff --git a/src/views/common/board-part-table.vue b/src/views/common/board-part-table.vue index c1477c9..c09e621 100644 --- a/src/views/common/board-part-table.vue +++ b/src/views/common/board-part-table.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2022-03-07 15:31:13 * @LastEditors: zwq - * @LastEditTime: 2022-07-01 16:58:50 + * @LastEditTime: 2022-07-05 16:11:42 * @Description: --> diff --git a/src/views/common/board-part.vue b/src/views/common/board-part.vue index f945c19..81a3d7d 100644 --- a/src/views/common/board-part.vue +++ b/src/views/common/board-part.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2022-03-07 15:31:13 * @LastEditors: zwq - * @LastEditTime: 2022-07-01 16:58:00 + * @LastEditTime: 2022-07-05 16:18:48 * @Description: --> @@ -63,17 +63,9 @@ import partTable from './board-part-table.vue' export default { components: {partTable}, props: { - tableData: { - type: Array, - default: () => [] - }, - countdown: { + wbData: { type: Object, - default: () => ({ - 'hours': 1, - 'minutes': 10, - 'seconds': 0 - }) + default: () => {} }, imgUrl: { type: String, @@ -82,91 +74,21 @@ export default { }, data () { return { - hours: 1, - minutes: 12, - seconds: 0 } }, created () { - this.hours = this.countdown.hours - this.minutes = this.countdown.minutes - this.seconds = this.countdown.seconds }, mounted () { - this.add() - }, - watch: { - // 监听数值变化 - second: { - handler (newVal) { - this.num(newVal) - } - }, - minute: { - handler (newVal) { - this.num(newVal) - } - }, - hour: { - handler (newVal) { - this.num(newVal) - } - } - }, - computed: { - // 初始化数据 - second () { - return this.num(this.seconds) - }, - minute () { - return this.num(this.minutes) - }, - hour () { - return this.num(this.hours) - } }, methods: { - num (n) { - return n < 10 ? '0' + n : '' + n - }, - // 倒计时函数 - add () { - let time = window.setInterval(() => { - if (this.hours !== 0 && this.minutes === 0 && this.seconds === 0) { - this.hours -= 1 - this.minutes = 59 - this.seconds = 59 - } else if ( - this.hours === 0 && - this.minutes !== 0 && - this.seconds === 0 - ) { - this.minutes -= 1 - this.seconds = 59 - } else if ( - this.hours === 0 && - this.minutes === 0 && - this.seconds === 0 - ) { - this.seconds = 0 - window.clearInterval(time) - } else if ( - this.hours !== 0 && - this.minutes !== 0 && - this.seconds === 0 - ) { - this.minutes -= 1 - this.seconds = 59 - } else { - this.seconds -= 1 - } - }, 1000) - } } } diff --git a/src/views/main.vue b/src/views/main.vue index b47bcf7..52545b7 100644 --- a/src/views/main.vue +++ b/src/views/main.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-15 08:20:28 * @LastEditors: zwq - * @LastEditTime: 2022-03-18 14:48:46 + * @LastEditTime: 2022-07-05 15:46:53 * @Description: -->