Browse Source

修复秒杀界面倒计时显示0的问题

master
Gao xiaosong 4 years ago
parent
commit
112b22be69
  1. 9
      components/CountDown.vue

9
components/CountDown.vue

@ -44,7 +44,7 @@ export default {
},
data: function() {
return {
time: null,
time: this.datatime,
day: '00',
hour: '00',
minute: '00',
@ -65,21 +65,18 @@ export default {
methods: {
show_time: function() {
let that = this
if (parseInt(this.time).length == 13) {
if (this.time.toString().length == 13) {
//
console.log('毫秒')
this.time = this.time / 1000
} else if (parseInt(this.time).length == 10) {
} else if (this.time.toString().length == 10) {
console.log('秒')
//
} else {
//
console.log('时间')
console.log(this.time)
this.time = Date.parse(this.time) / 1000
}
console.log(that.time)
function runTime() {
//

Loading…
Cancel
Save