@kengic/uni 0.3.2-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.css +1 -0
- package/dist/kengic-uni.js +5 -0
- package/dist/src/consts/i18n/en.d.ts +45 -0
- package/dist/src/consts/i18n/index.d.ts +90 -0
- package/dist/src/consts/i18n/zh_CN.d.ts +45 -0
- package/dist/src/consts/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/kg.util.d.ts +5 -0
- package/dist/uni-ui/index.ts +11 -0
- package/dist/uni-ui/uni-badge/uni-badge.vue +253 -0
- package/dist/uni-ui/uni-breadcrumb/uni-breadcrumb.vue +41 -0
- package/dist/uni-ui/uni-breadcrumb-item/uni-breadcrumb-item.vue +121 -0
- package/dist/uni-ui/uni-calendar/calendar.js +546 -0
- package/dist/uni-ui/uni-calendar/i18n/en.json +12 -0
- package/dist/uni-ui/uni-calendar/i18n/index.js +8 -0
- package/dist/uni-ui/uni-calendar/i18n/zh-Hans.json +12 -0
- package/dist/uni-ui/uni-calendar/i18n/zh-Hant.json +12 -0
- package/dist/uni-ui/uni-calendar/uni-calendar-item.vue +187 -0
- package/dist/uni-ui/uni-calendar/uni-calendar.vue +566 -0
- package/dist/uni-ui/uni-calendar/util.js +360 -0
- package/dist/uni-ui/uni-card/uni-card.vue +281 -0
- package/dist/uni-ui/uni-col/uni-col.vue +317 -0
- package/dist/uni-ui/uni-collapse/uni-collapse.vue +147 -0
- package/dist/uni-ui/uni-collapse-item/uni-collapse-item.vue +402 -0
- package/dist/uni-ui/uni-combox/uni-combox.vue +294 -0
- package/dist/uni-ui/uni-countdown/i18n/en.json +6 -0
- package/dist/uni-ui/uni-countdown/i18n/index.js +8 -0
- package/dist/uni-ui/uni-countdown/i18n/zh-Hans.json +6 -0
- package/dist/uni-ui/uni-countdown/i18n/zh-Hant.json +6 -0
- package/dist/uni-ui/uni-countdown/uni-countdown.vue +267 -0
- package/dist/uni-ui/uni-data-checkbox/uni-data-checkbox.vue +821 -0
- package/dist/uni-ui/uni-data-picker/keypress.js +45 -0
- package/dist/uni-ui/uni-data-picker/uni-data-picker.vue +551 -0
- package/dist/uni-ui/uni-data-pickerview/uni-data-picker.js +622 -0
- package/dist/uni-ui/uni-data-pickerview/uni-data-pickerview.vue +323 -0
- package/dist/uni-ui/uni-data-select/uni-data-select.vue +517 -0
- package/dist/uni-ui/uni-dateformat/date-format.js +200 -0
- package/dist/uni-ui/uni-dateformat/uni-dateformat.vue +88 -0
- package/dist/uni-ui/uni-datetime-picker/calendar-item.vue +177 -0
- package/dist/uni-ui/uni-datetime-picker/calendar.vue +928 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/en.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/index.js +8 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hans.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/i18n/zh-Hant.json +22 -0
- package/dist/uni-ui/uni-datetime-picker/time-picker.vue +934 -0
- package/dist/uni-ui/uni-datetime-picker/uni-datetime-picker.vue +1026 -0
- package/dist/uni-ui/uni-datetime-picker/util.js +403 -0
- package/dist/uni-ui/uni-drawer/keypress.js +45 -0
- package/dist/uni-ui/uni-drawer/uni-drawer.vue +181 -0
- package/dist/uni-ui/uni-easyinput/common.js +56 -0
- package/dist/uni-ui/uni-easyinput/uni-easyinput.vue +660 -0
- package/dist/uni-ui/uni-fab/uni-fab.vue +491 -0
- package/dist/uni-ui/uni-fav/i18n/en.json +4 -0
- package/dist/uni-ui/uni-fav/i18n/index.js +8 -0
- package/dist/uni-ui/uni-fav/i18n/zh-Hans.json +4 -0
- package/dist/uni-ui/uni-fav/i18n/zh-Hant.json +4 -0
- package/dist/uni-ui/uni-fav/uni-fav.vue +161 -0
- package/dist/uni-ui/uni-file-picker/choose-and-upload-file.js +224 -0
- package/dist/uni-ui/uni-file-picker/uni-file-picker.vue +667 -0
- package/dist/uni-ui/uni-file-picker/upload-file.vue +325 -0
- package/dist/uni-ui/uni-file-picker/upload-image.vue +292 -0
- package/dist/uni-ui/uni-file-picker/utils.js +109 -0
- package/dist/uni-ui/uni-forms/uni-forms.vue +398 -0
- package/dist/uni-ui/uni-forms/utils.js +293 -0
- package/dist/uni-ui/uni-forms/validate.js +486 -0
- package/dist/uni-ui/uni-forms-item/uni-forms-item.vue +601 -0
- package/dist/uni-ui/uni-goods-nav/i18n/en.json +6 -0
- package/dist/uni-ui/uni-goods-nav/i18n/index.js +8 -0
- package/dist/uni-ui/uni-goods-nav/i18n/zh-Hans.json +6 -0
- package/dist/uni-ui/uni-goods-nav/i18n/zh-Hant.json +6 -0
- package/dist/uni-ui/uni-goods-nav/uni-goods-nav.vue +229 -0
- package/dist/uni-ui/uni-grid/uni-grid.vue +143 -0
- package/dist/uni-ui/uni-grid-item/uni-grid-item.vue +129 -0
- package/dist/uni-ui/uni-group/uni-group.vue +134 -0
- package/dist/uni-ui/uni-icons/icons.js +1169 -0
- package/dist/uni-ui/uni-icons/uni-icons.vue +96 -0
- package/dist/uni-ui/uni-icons/uniicons.css +663 -0
- package/dist/uni-ui/uni-icons/uniicons.ttf +0 -0
- package/dist/uni-ui/uni-indexed-list/uni-indexed-list-item.vue +144 -0
- package/dist/uni-ui/uni-indexed-list/uni-indexed-list.vue +367 -0
- package/dist/uni-ui/uni-link/uni-link.vue +128 -0
- package/dist/uni-ui/uni-list/uni-list.vue +123 -0
- package/dist/uni-ui/uni-list/uni-refresh.vue +65 -0
- package/dist/uni-ui/uni-list/uni-refresh.wxs +87 -0
- package/dist/uni-ui/uni-list-ad/uni-list-ad.vue +107 -0
- package/dist/uni-ui/uni-list-chat/uni-list-chat.scss +58 -0
- package/dist/uni-ui/uni-list-chat/uni-list-chat.vue +593 -0
- package/dist/uni-ui/uni-list-item/uni-list-item.vue +534 -0
- package/dist/uni-ui/uni-load-more/i18n/en.json +5 -0
- package/dist/uni-ui/uni-load-more/i18n/index.js +8 -0
- package/dist/uni-ui/uni-load-more/i18n/zh-Hans.json +5 -0
- package/dist/uni-ui/uni-load-more/i18n/zh-Hant.json +5 -0
- package/dist/uni-ui/uni-load-more/uni-load-more.vue +399 -0
- package/dist/uni-ui/uni-nav-bar/uni-nav-bar.vue +357 -0
- package/dist/uni-ui/uni-nav-bar/uni-status-bar.vue +24 -0
- package/dist/uni-ui/uni-notice-bar/uni-notice-bar.vue +426 -0
- package/dist/uni-ui/uni-number-box/uni-number-box.vue +221 -0
- package/dist/uni-ui/uni-pagination/i18n/en.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/es.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/fr.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/index.js +12 -0
- package/dist/uni-ui/uni-pagination/i18n/zh-Hans.json +5 -0
- package/dist/uni-ui/uni-pagination/i18n/zh-Hant.json +5 -0
- package/dist/uni-ui/uni-pagination/uni-pagination.vue +465 -0
- package/dist/uni-ui/uni-popup/i18n/en.json +7 -0
- package/dist/uni-ui/uni-popup/i18n/index.js +9 -0
- package/dist/uni-ui/uni-popup/i18n/zh-Hans.json +7 -0
- package/dist/uni-ui/uni-popup/i18n/zh-Hant.json +7 -0
- package/dist/uni-ui/uni-popup/keypress.js +45 -0
- package/dist/uni-ui/uni-popup/popup.js +23 -0
- package/dist/uni-ui/uni-popup/uni-popup.vue +464 -0
- package/dist/uni-ui/uni-popup-dialog/keypress.js +45 -0
- package/dist/uni-ui/uni-popup-dialog/uni-popup-dialog.vue +275 -0
- package/dist/uni-ui/uni-popup-message/uni-popup-message.vue +143 -0
- package/dist/uni-ui/uni-popup-share/uni-popup-share.vue +187 -0
- package/dist/uni-ui/uni-rate/uni-rate.vue +365 -0
- package/dist/uni-ui/uni-row/uni-row.vue +190 -0
- package/dist/uni-ui/uni-scss/changelog.md +8 -0
- package/dist/uni-ui/uni-scss/index.scss +1 -0
- package/dist/uni-ui/uni-scss/package.json +82 -0
- package/dist/uni-ui/uni-scss/readme.md +4 -0
- package/dist/uni-ui/uni-scss/styles/index.scss +7 -0
- package/dist/uni-ui/uni-scss/styles/setting/_border.scss +3 -0
- package/dist/uni-ui/uni-scss/styles/setting/_color.scss +66 -0
- package/dist/uni-ui/uni-scss/styles/setting/_radius.scss +55 -0
- package/dist/uni-ui/uni-scss/styles/setting/_space.scss +56 -0
- package/dist/uni-ui/uni-scss/styles/setting/_styles.scss +167 -0
- package/dist/uni-ui/uni-scss/styles/setting/_text.scss +24 -0
- package/dist/uni-ui/uni-scss/styles/setting/_variables.scss +146 -0
- package/dist/uni-ui/uni-scss/styles/tools/functions.scss +19 -0
- package/dist/uni-ui/uni-scss/theme.scss +31 -0
- package/dist/uni-ui/uni-scss/variables.scss +62 -0
- package/dist/uni-ui/uni-search-bar/i18n/en.json +4 -0
- package/dist/uni-ui/uni-search-bar/i18n/index.js +8 -0
- package/dist/uni-ui/uni-search-bar/i18n/zh-Hans.json +4 -0
- package/dist/uni-ui/uni-search-bar/i18n/zh-Hant.json +4 -0
- package/dist/uni-ui/uni-search-bar/uni-search-bar.vue +298 -0
- package/dist/uni-ui/uni-section/uni-section.vue +167 -0
- package/dist/uni-ui/uni-segmented-control/uni-segmented-control.vue +145 -0
- package/dist/uni-ui/uni-steps/uni-steps.vue +269 -0
- package/dist/uni-ui/uni-swipe-action/uni-swipe-action.vue +60 -0
- package/dist/uni-ui/uni-swipe-action-item/bindingx.js +302 -0
- package/dist/uni-ui/uni-swipe-action-item/isPC.js +12 -0
- package/dist/uni-ui/uni-swipe-action-item/mpalipay.js +195 -0
- package/dist/uni-ui/uni-swipe-action-item/mpother.js +260 -0
- package/dist/uni-ui/uni-swipe-action-item/mpwxs.js +84 -0
- package/dist/uni-ui/uni-swipe-action-item/render.js +270 -0
- package/dist/uni-ui/uni-swipe-action-item/uni-swipe-action-item.vue +347 -0
- package/dist/uni-ui/uni-swipe-action-item/wx.wxs +341 -0
- package/dist/uni-ui/uni-swiper-dot/uni-swiper-dot.vue +218 -0
- package/dist/uni-ui/uni-table/uni-table.vue +455 -0
- package/dist/uni-ui/uni-tag/uni-tag.vue +252 -0
- package/dist/uni-ui/uni-tbody/uni-tbody.vue +29 -0
- package/dist/uni-ui/uni-td/uni-td.vue +90 -0
- package/dist/uni-ui/uni-th/filter-dropdown.vue +511 -0
- package/dist/uni-ui/uni-th/uni-th.vue +285 -0
- package/dist/uni-ui/uni-thead/uni-thead.vue +129 -0
- package/dist/uni-ui/uni-title/uni-title.vue +171 -0
- package/dist/uni-ui/uni-tooltip/uni-tooltip.vue +68 -0
- package/dist/uni-ui/uni-tr/table-checkbox.vue +179 -0
- package/dist/uni-ui/uni-tr/uni-tr.vue +171 -0
- package/dist/uni-ui/uni-transition/createAnimation.js +131 -0
- package/dist/uni-ui/uni-transition/uni-transition.vue +281 -0
- package/package.json +90 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="uni-countdown">
|
|
3
|
+
<text v-if="showDay" :style="[timeStyle]" class="uni-countdown__number">{{ d }}</text>
|
|
4
|
+
<text v-if="showDay" :style="[splitorStyle]" class="uni-countdown__splitor">{{dayText}}</text>
|
|
5
|
+
<text :style="[timeStyle]" class="uni-countdown__number">{{ h }}</text>
|
|
6
|
+
<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : hourText }}</text>
|
|
7
|
+
<text :style="[timeStyle]" class="uni-countdown__number">{{ i }}</text>
|
|
8
|
+
<text :style="[splitorStyle]" class="uni-countdown__splitor">{{ showColon ? ':' : minuteText }}</text>
|
|
9
|
+
<text :style="[timeStyle]" class="uni-countdown__number">{{ s }}</text>
|
|
10
|
+
<text v-if="!showColon" :style="[splitorStyle]" class="uni-countdown__splitor">{{secondText}}</text>
|
|
11
|
+
</view>
|
|
12
|
+
</template>
|
|
13
|
+
<script>
|
|
14
|
+
import {
|
|
15
|
+
initVueI18n
|
|
16
|
+
} from '@dcloudio/uni-i18n'
|
|
17
|
+
import messages from './i18n'
|
|
18
|
+
const {
|
|
19
|
+
t
|
|
20
|
+
} = initVueI18n(messages)
|
|
21
|
+
/**
|
|
22
|
+
* Countdown 倒计时
|
|
23
|
+
* @description 倒计时组件
|
|
24
|
+
* @tutorial https://ext.dcloud.net.cn/plugin?id=25
|
|
25
|
+
* @property {String} backgroundColor 背景色
|
|
26
|
+
* @property {String} color 文字颜色
|
|
27
|
+
* @property {Number} day 天数
|
|
28
|
+
* @property {Number} hour 小时
|
|
29
|
+
* @property {Number} minute 分钟
|
|
30
|
+
* @property {Number} second 秒
|
|
31
|
+
* @property {Number} timestamp 时间戳
|
|
32
|
+
* @property {Boolean} showDay = [true|false] 是否显示天数
|
|
33
|
+
* @property {Boolean} show-colon = [true|false] 是否以冒号为分隔符
|
|
34
|
+
* @property {String} splitorColor 分割符号颜色
|
|
35
|
+
* @event {Function} timeup 倒计时时间到触发事件
|
|
36
|
+
* @example <uni-countdown :day="1" :hour="1" :minute="12" :second="40"></uni-countdown>
|
|
37
|
+
*/
|
|
38
|
+
export default {
|
|
39
|
+
name: 'UniCountdown',
|
|
40
|
+
emits: ['timeup'],
|
|
41
|
+
props: {
|
|
42
|
+
showDay: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: true
|
|
45
|
+
},
|
|
46
|
+
showColon: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
start: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
backgroundColor: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ''
|
|
57
|
+
},
|
|
58
|
+
color: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: '#333'
|
|
61
|
+
},
|
|
62
|
+
fontSize: {
|
|
63
|
+
type: Number,
|
|
64
|
+
default: 14
|
|
65
|
+
},
|
|
66
|
+
splitorColor: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: '#333'
|
|
69
|
+
},
|
|
70
|
+
day: {
|
|
71
|
+
type: Number,
|
|
72
|
+
default: 0
|
|
73
|
+
},
|
|
74
|
+
hour: {
|
|
75
|
+
type: Number,
|
|
76
|
+
default: 0
|
|
77
|
+
},
|
|
78
|
+
minute: {
|
|
79
|
+
type: Number,
|
|
80
|
+
default: 0
|
|
81
|
+
},
|
|
82
|
+
second: {
|
|
83
|
+
type: Number,
|
|
84
|
+
default: 0
|
|
85
|
+
},
|
|
86
|
+
timestamp: {
|
|
87
|
+
type: Number,
|
|
88
|
+
default: 0
|
|
89
|
+
},
|
|
90
|
+
zeroPad: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: true
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
data() {
|
|
96
|
+
return {
|
|
97
|
+
timer: null,
|
|
98
|
+
syncFlag: false,
|
|
99
|
+
d: '00',
|
|
100
|
+
h: '00',
|
|
101
|
+
i: '00',
|
|
102
|
+
s: '00',
|
|
103
|
+
leftTime: 0,
|
|
104
|
+
seconds: 0
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
computed: {
|
|
108
|
+
dayText() {
|
|
109
|
+
return t("uni-countdown.day")
|
|
110
|
+
},
|
|
111
|
+
hourText(val) {
|
|
112
|
+
return t("uni-countdown.h")
|
|
113
|
+
},
|
|
114
|
+
minuteText(val) {
|
|
115
|
+
return t("uni-countdown.m")
|
|
116
|
+
},
|
|
117
|
+
secondText(val) {
|
|
118
|
+
return t("uni-countdown.s")
|
|
119
|
+
},
|
|
120
|
+
timeStyle() {
|
|
121
|
+
const {
|
|
122
|
+
color,
|
|
123
|
+
backgroundColor,
|
|
124
|
+
fontSize
|
|
125
|
+
} = this
|
|
126
|
+
return {
|
|
127
|
+
color,
|
|
128
|
+
backgroundColor,
|
|
129
|
+
fontSize: `${fontSize}px`,
|
|
130
|
+
width: `${fontSize * 22 / 14}px`, // 按字体大小为 14px 时的比例缩放
|
|
131
|
+
lineHeight: `${fontSize * 20 / 14}px`,
|
|
132
|
+
borderRadius: `${fontSize * 3 / 14}px`,
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
splitorStyle() {
|
|
136
|
+
const { splitorColor, fontSize, backgroundColor } = this
|
|
137
|
+
return {
|
|
138
|
+
color: splitorColor,
|
|
139
|
+
fontSize: `${fontSize * 12 / 14}px`,
|
|
140
|
+
margin: backgroundColor ? `${fontSize * 4 / 14}px` : ''
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
watch: {
|
|
145
|
+
day(val) {
|
|
146
|
+
this.changeFlag()
|
|
147
|
+
},
|
|
148
|
+
hour(val) {
|
|
149
|
+
this.changeFlag()
|
|
150
|
+
},
|
|
151
|
+
minute(val) {
|
|
152
|
+
this.changeFlag()
|
|
153
|
+
},
|
|
154
|
+
second(val) {
|
|
155
|
+
this.changeFlag()
|
|
156
|
+
},
|
|
157
|
+
start: {
|
|
158
|
+
immediate: true,
|
|
159
|
+
handler(newVal, oldVal) {
|
|
160
|
+
if (newVal) {
|
|
161
|
+
this.startData();
|
|
162
|
+
} else {
|
|
163
|
+
if (!oldVal) return
|
|
164
|
+
clearInterval(this.timer)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
created: function(e) {
|
|
171
|
+
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
|
172
|
+
this.countDown()
|
|
173
|
+
},
|
|
174
|
+
// #ifndef VUE3
|
|
175
|
+
destroyed() {
|
|
176
|
+
clearInterval(this.timer)
|
|
177
|
+
},
|
|
178
|
+
// #endif
|
|
179
|
+
// #ifdef VUE3
|
|
180
|
+
unmounted() {
|
|
181
|
+
clearInterval(this.timer)
|
|
182
|
+
},
|
|
183
|
+
// #endif
|
|
184
|
+
methods: {
|
|
185
|
+
toSeconds(timestamp, day, hours, minutes, seconds) {
|
|
186
|
+
if (timestamp) {
|
|
187
|
+
return timestamp - parseInt(new Date().getTime() / 1000, 10)
|
|
188
|
+
}
|
|
189
|
+
return day * 60 * 60 * 24 + hours * 60 * 60 + minutes * 60 + seconds
|
|
190
|
+
},
|
|
191
|
+
timeUp() {
|
|
192
|
+
clearInterval(this.timer)
|
|
193
|
+
this.$emit('timeup')
|
|
194
|
+
},
|
|
195
|
+
countDown() {
|
|
196
|
+
let seconds = this.seconds
|
|
197
|
+
let [day, hour, minute, second] = [0, 0, 0, 0]
|
|
198
|
+
if (seconds > 0) {
|
|
199
|
+
day = Math.floor(seconds / (60 * 60 * 24))
|
|
200
|
+
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
|
|
201
|
+
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
|
|
202
|
+
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
|
|
203
|
+
} else {
|
|
204
|
+
this.timeUp()
|
|
205
|
+
}
|
|
206
|
+
day = (day < 10 && this.zeroPad) ? `0${day}` : day
|
|
207
|
+
hour = (hour < 10 && this.zeroPad) ? `0${hour}` : hour
|
|
208
|
+
minute = (minute < 10 && this.zeroPad) ? `0${minute}` : minute
|
|
209
|
+
second = (second < 10 && this.zeroPad) ? `0${second}` : second
|
|
210
|
+
this.d = day
|
|
211
|
+
this.h = hour
|
|
212
|
+
this.i = minute
|
|
213
|
+
this.s = second
|
|
214
|
+
},
|
|
215
|
+
startData() {
|
|
216
|
+
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
|
217
|
+
if (this.seconds <= 0) {
|
|
218
|
+
this.seconds = this.toSeconds(0, 0, 0, 0, 0)
|
|
219
|
+
this.countDown()
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
clearInterval(this.timer)
|
|
223
|
+
this.countDown()
|
|
224
|
+
this.timer = setInterval(() => {
|
|
225
|
+
this.seconds--
|
|
226
|
+
if (this.seconds < 0) {
|
|
227
|
+
this.timeUp()
|
|
228
|
+
return
|
|
229
|
+
}
|
|
230
|
+
this.countDown()
|
|
231
|
+
}, 1000)
|
|
232
|
+
},
|
|
233
|
+
update(){
|
|
234
|
+
this.startData();
|
|
235
|
+
},
|
|
236
|
+
changeFlag() {
|
|
237
|
+
if (!this.syncFlag) {
|
|
238
|
+
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
|
|
239
|
+
this.startData();
|
|
240
|
+
this.syncFlag = true;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
</script>
|
|
246
|
+
<style lang="scss" scoped>
|
|
247
|
+
$font-size: 14px;
|
|
248
|
+
|
|
249
|
+
.uni-countdown {
|
|
250
|
+
display: flex;
|
|
251
|
+
flex-direction: row;
|
|
252
|
+
justify-content: flex-start;
|
|
253
|
+
align-items: center;
|
|
254
|
+
|
|
255
|
+
&__splitor {
|
|
256
|
+
margin: 0 2px;
|
|
257
|
+
font-size: $font-size;
|
|
258
|
+
color: #333;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&__number {
|
|
262
|
+
border-radius: 3px;
|
|
263
|
+
text-align: center;
|
|
264
|
+
font-size: $font-size;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
</style>
|