升级uni-ui到最新版本1.4.27

This commit is contained in:
RuoYi
2023-07-12 09:42:10 +08:00
parent 296b15acbe
commit c27a8aa129
70 changed files with 1900 additions and 1578 deletions

View File

@@ -58,10 +58,10 @@
color: {
type: String,
default: '#333'
},
fontSize: {
type: Number,
default: 14
},
fontSize: {
type: Number,
default: 14
},
splitorColor: {
type: String,
@@ -86,6 +86,10 @@
timestamp: {
type: Number,
default: 0
},
zeroPad: {
type: Boolean,
default: true
}
},
data() {
@@ -116,23 +120,23 @@
timeStyle() {
const {
color,
backgroundColor,
backgroundColor,
fontSize
} = this
return {
color,
backgroundColor,
fontSize: `${fontSize}px`,
width: `${fontSize * 22 / 14}px`, // 按字体大小为 14px 时的比例缩放
lineHeight: `${fontSize * 20 / 14}px`,
borderRadius: `${fontSize * 3 / 14}px`,
backgroundColor,
fontSize: `${fontSize}px`,
width: `${fontSize * 22 / 14}px`, // 按字体大小为 14px 时的比例缩放
lineHeight: `${fontSize * 20 / 14}px`,
borderRadius: `${fontSize * 3 / 14}px`,
}
},
splitorStyle() {
const { splitorColor, fontSize, backgroundColor } = this
return {
color: splitorColor,
fontSize: `${fontSize * 12 / 14}px`,
splitorStyle() {
const { splitorColor, fontSize, backgroundColor } = this
return {
color: splitorColor,
fontSize: `${fontSize * 12 / 14}px`,
margin: backgroundColor ? `${fontSize * 4 / 14}px` : ''
}
}
@@ -141,10 +145,10 @@
day(val) {
this.changeFlag()
},
hour(val) {
hour(val) {
this.changeFlag()
},
minute(val) {
minute(val) {
this.changeFlag()
},
second(val) {
@@ -199,30 +203,22 @@
} else {
this.timeUp()
}
if (day < 10) {
day = '0' + day
}
if (hour < 10) {
hour = '0' + hour
}
if (minute < 10) {
minute = '0' + minute
}
if (second < 10) {
second = '0' + second
}
day = (day < 10 && this.zeroPad) ? `0${day}` : day
hour = (hour < 10 && this.zeroPad) ? `0${hour}` : hour
minute = (minute < 10 && this.zeroPad) ? `0${minute}` : minute
second = (second < 10 && this.zeroPad) ? `0${second}` : second
this.d = day
this.h = hour
this.i = minute
this.s = second
this.s = second
},
startData() {
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
if (this.seconds <= 0) {
this.seconds = this.toSeconds(0, 0, 0, 0, 0)
if (this.seconds <= 0) {
this.seconds = this.toSeconds(0, 0, 0, 0, 0)
this.countDown()
return
}
}
clearInterval(this.timer)
this.countDown()
this.timer = setInterval(() => {
@@ -233,11 +229,11 @@
}
this.countDown()
}, 1000)
},
update(){
this.startData();
},
changeFlag() {
update(){
this.startData();
},
changeFlag() {
if (!this.syncFlag) {
this.seconds = this.toSeconds(this.timestamp, this.day, this.hour, this.minute, this.second)
this.startData();
@@ -248,24 +244,24 @@
}
</script>
<style lang="scss" scoped>
$font-size: 14px;
$font-size: 14px;
.uni-countdown {
.uni-countdown {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
align-items: center;
&__splitor {
margin: 0 2px;
font-size: $font-size;
color: #333;
font-size: $font-size;
color: #333;
}
&__number {
&__number {
border-radius: 3px;
text-align: center;
font-size: $font-size;
font-size: $font-size;
}
}
</style>
</style>