Browse Source

修改倒计时错误的问题

master
Gaoxs 4 years ago
parent
commit
183f9fa4c3
  1. 22
      components/CountDown.vue
  2. 4
      pages/activity/DargainDetails/index.vue
  3. 6
      pages/activity/GroupRule/index.vue

22
components/CountDown.vue

@ -54,28 +54,36 @@ export default {
created: function () {
this.show_time()
},
watch: {
datatime(val) {
clearInterval(this.timeInterval)
this.time = val
this.show_time()
},
},
mounted: function () {},
methods: {
show_time: function () {
let that = this
if (parseInt(this.datatime).length == 13) {
if (parseInt(this.time).length == 13) {
//
console.log('毫秒')
this.datatime = this.datatime / 1000
} else if (parseInt(this.datatime).length == 10) {
this.time = this.time / 1000
} else if (parseInt(this.time).length == 10) {
console.log('秒')
//
} else {
//
console.log('时间')
this.datatime = Date.parse(this.datatime) / 1000
console.log(this.time)
this.time = Date.parse(this.time) / 1000
}
console.log(that.time)
function runTime() {
console.log(that.datatime)
//
let intDiff = that.datatime - Date.parse(new Date()) / 1000 //
let intDiff = that.time - Date.parse(new Date()) / 1000 //
let day = 0,
hour = 0,
minute = 0,
@ -105,7 +113,7 @@ export default {
}
}
runTime()
setInterval(runTime, 1000)
this.timeInterval = setInterval(runTime, 1000)
},
},
}

4
pages/activity/DargainDetails/index.vue

@ -213,8 +213,6 @@ export default {
// urluiduid
that.bargainUid = that.userInfo.uid
}
console.log(this)
//
that.getBargainDetail()
//
@ -310,9 +308,9 @@ export default {
.then(res => {
uni.hideLoading()
that.goodsDetail = res.data.bargain
console.log(that.goodsDetail)
that.goodsDetail.description = that.goodsDetail.description.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
that.goodsDetail.rule = that.goodsDetail.rule.replace(/\<img/gi, '<img style="max-width:100%;height:auto;"')
that.goodsDetail.stopTime = that.goodsDetail.stopTime / 1000
that.getBargainHelpCount()
})
.catch(res => {

6
pages/activity/GroupRule/index.vue

@ -1,6 +1,6 @@
<template>
<view class="group-con">
<view class="tui-goods-item">
<view class="tui-goods-item" v-if="storeCombination">
<image :src="storeCombination.image" class="tui-goods-img"></image>
<view class="tui-goods-center">
<view class="tui-goods-name">{{ storeCombination.title }}</view>
@ -418,7 +418,6 @@ export default {
}
.tui-btn__box {
padding-top: 60rpx;
}
.tni-cell {
@ -499,8 +498,7 @@ export default {
justify-content: space-between;
}
.tui-btn__box .tui-btn {
margin-bottom:30rpx !important
margin-bottom: 30rpx !important;
}
/*拼团玩法介绍 modal*/
.tui-modal__title {

Loading…
Cancel
Save