修改倒计时不显示,以及微信支付的问题
This commit is contained in:
@ -12,93 +12,101 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "CountDown",
|
name: 'CountDown',
|
||||||
props: {
|
props: {
|
||||||
//距离开始提示文字
|
//距离开始提示文字
|
||||||
tipText: {
|
tipText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "倒计时"
|
default: '倒计时',
|
||||||
},
|
|
||||||
dayText: {
|
|
||||||
type: String,
|
|
||||||
default: "天"
|
|
||||||
},
|
|
||||||
hourText: {
|
|
||||||
type: String,
|
|
||||||
default: "时"
|
|
||||||
},
|
|
||||||
minuteText: {
|
|
||||||
type: String,
|
|
||||||
default: "分"
|
|
||||||
},
|
|
||||||
secondText: {
|
|
||||||
type: String,
|
|
||||||
default: "秒"
|
|
||||||
},
|
|
||||||
datatime: {
|
|
||||||
type: Number,
|
|
||||||
default: 0
|
|
||||||
},
|
|
||||||
isDay: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data: function () {
|
dayText: {
|
||||||
return {
|
type: String,
|
||||||
day: "00",
|
default: '天',
|
||||||
hour: "00",
|
|
||||||
minute: "00",
|
|
||||||
second: "00"
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
created: function () {
|
hourText: {
|
||||||
this.show_time();
|
type: String,
|
||||||
|
default: '时',
|
||||||
},
|
},
|
||||||
mounted: function () {},
|
minuteText: {
|
||||||
methods: {
|
type: String,
|
||||||
show_time: function () {
|
default: '分',
|
||||||
let that = this;
|
},
|
||||||
|
secondText: {
|
||||||
function runTime() {
|
type: String,
|
||||||
//时间函数
|
default: '秒',
|
||||||
let intDiff = that.datatime - Date.parse(new Date()) / 1000; //获取数据中的时间戳的时间差;
|
},
|
||||||
let day = 0,
|
datatime: {},
|
||||||
hour = 0,
|
isDay: {
|
||||||
minute = 0,
|
type: Boolean,
|
||||||
second = 0;
|
default: true,
|
||||||
if (intDiff > 0) {
|
},
|
||||||
//转换时间
|
},
|
||||||
if (that.isDay === true) {
|
data: function () {
|
||||||
day = Math.floor(intDiff / (60 * 60 * 24));
|
return {
|
||||||
} else {
|
time: null,
|
||||||
day = 0;
|
day: '00',
|
||||||
}
|
hour: '00',
|
||||||
hour = Math.floor(intDiff / (60 * 60)) - day * 24;
|
minute: '00',
|
||||||
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60;
|
second: '00',
|
||||||
second =
|
|
||||||
Math.floor(intDiff) -
|
|
||||||
day * 24 * 60 * 60 -
|
|
||||||
hour * 60 * 60 -
|
|
||||||
minute * 60;
|
|
||||||
if (hour <= 9) hour = "0" + hour;
|
|
||||||
if (minute <= 9) minute = "0" + minute;
|
|
||||||
if (second <= 9) second = "0" + second;
|
|
||||||
that.day = day;
|
|
||||||
that.hour = hour;
|
|
||||||
that.minute = minute;
|
|
||||||
that.second = second;
|
|
||||||
} else {
|
|
||||||
that.day = "00";
|
|
||||||
that.hour = "00";
|
|
||||||
that.minute = "00";
|
|
||||||
that.second = "00";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
runTime();
|
|
||||||
setInterval(runTime, 1000);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
},
|
||||||
|
created: function () {
|
||||||
|
this.show_time()
|
||||||
|
},
|
||||||
|
mounted: function () {},
|
||||||
|
methods: {
|
||||||
|
show_time: function () {
|
||||||
|
let that = this
|
||||||
|
|
||||||
|
if (parseInt(this.datatime).length == 13) {
|
||||||
|
// 毫秒级
|
||||||
|
console.log('毫秒')
|
||||||
|
this.datatime = this.datatime / 1000
|
||||||
|
} else if (parseInt(this.datatime).length == 10) {
|
||||||
|
console.log('秒')
|
||||||
|
// 秒级
|
||||||
|
} else {
|
||||||
|
// 时间
|
||||||
|
console.log('时间')
|
||||||
|
this.datatime = Date.parse(this.datatime) / 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
function runTime() {
|
||||||
|
console.log(that.datatime)
|
||||||
|
//时间函数
|
||||||
|
let intDiff = that.datatime - Date.parse(new Date()) / 1000 //获取数据中的时间戳的时间差;
|
||||||
|
let day = 0,
|
||||||
|
hour = 0,
|
||||||
|
minute = 0,
|
||||||
|
second = 0
|
||||||
|
if (intDiff > 0) {
|
||||||
|
//转换时间
|
||||||
|
if (that.isDay === true) {
|
||||||
|
day = Math.floor(intDiff / (60 * 60 * 24))
|
||||||
|
} else {
|
||||||
|
day = 0
|
||||||
|
}
|
||||||
|
hour = Math.floor(intDiff / (60 * 60)) - day * 24
|
||||||
|
minute = Math.floor(intDiff / 60) - day * 24 * 60 - hour * 60
|
||||||
|
second = Math.floor(intDiff) - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60
|
||||||
|
if (hour <= 9) hour = '0' + hour
|
||||||
|
if (minute <= 9) minute = '0' + minute
|
||||||
|
if (second <= 9) second = '0' + second
|
||||||
|
that.day = day
|
||||||
|
that.hour = hour
|
||||||
|
that.minute = minute
|
||||||
|
that.second = second
|
||||||
|
} else {
|
||||||
|
that.day = '00'
|
||||||
|
that.hour = '00'
|
||||||
|
that.minute = '00'
|
||||||
|
that.second = '00'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
runTime()
|
||||||
|
setInterval(runTime, 1000)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
:hourText="' 时 '"
|
:hourText="' 时 '"
|
||||||
:minuteText="' 分 '"
|
:minuteText="' 分 '"
|
||||||
:secondText="' 秒'"
|
:secondText="' 秒'"
|
||||||
:datatime="item.datatime/1000"
|
:datatime="item.datatime"
|
||||||
></count-down>
|
></count-down>
|
||||||
<view class="money font-color-red">
|
<view class="money font-color-red">
|
||||||
已砍至
|
已砍至
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
<text class="font-color-red" v-text="item.count"></text>
|
<text class="font-color-red" v-text="item.count"></text>
|
||||||
<text>人成团</text>
|
<text>人成团</text>
|
||||||
</view>
|
</view>
|
||||||
<count-down :isDay="true" :tipText="'剩余 '" :dayText="' 天 '" :hourText="' : '" :minuteText="' : '" :secondText="' '" :datatime="item.stopTime / 1000"></count-down>
|
<count-down :isDay="true" :tipText="'剩余 '" :dayText="' 天 '" :hourText="' : '" :minuteText="' : '" :secondText="' '" :datatime="item.stopTime"></count-down>
|
||||||
</view>
|
</view>
|
||||||
<view class="spellBnt" @click="groupRule(item.id)">
|
<view class="spellBnt" @click="groupRule(item.id)">
|
||||||
去拼单
|
去拼单
|
||||||
|
@ -19,8 +19,9 @@
|
|||||||
<view class="tui-group__box tui-mtop__20">
|
<view class="tui-group__box tui-mtop__20">
|
||||||
<tui-divider backgroundColor="#fff" width="70%" gradual >
|
<tui-divider backgroundColor="#fff" width="70%" gradual >
|
||||||
<view class="tui-divider__content">
|
<view class="tui-divider__content">
|
||||||
<text v-if="pinkBool == 0">拼团失败</text>
|
<text v-if="pinkBool == 0">进行中</text>
|
||||||
<text v-if="pinkBool == 1">拼团成功</text>
|
<text v-if="pinkBool == 1">拼团成功</text>
|
||||||
|
<text v-if="pinkBool == -1">拼团失败</text>
|
||||||
</view>
|
</view>
|
||||||
</tui-divider>
|
</tui-divider>
|
||||||
<view class="tui-group__title" v-if="pinkBool == 0">
|
<view class="tui-group__title" v-if="pinkBool == 0">
|
||||||
@ -30,7 +31,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="tui-group-countdown" v-if="pinkBool == 0">
|
<view class="tui-group-countdown" v-if="pinkBool == 0">
|
||||||
<view class="tui-countdown-right">剩余</view>
|
<view class="tui-countdown-right">剩余</view>
|
||||||
<count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="pinkT.stopTime / 1000"></count-down>
|
<count-down :isDay="true" :tipText="'倒计时 '" :dayText="' 天 '" :hourText="' 时 '" :minuteText="' 分 '" :secondText="' 秒'" :datatime="pinkT.stopTime"></count-down>
|
||||||
<view class="tui-countdown-left">结束</view>
|
<view class="tui-countdown-left">结束</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tui-user__box">
|
<view class="tui-user__box">
|
||||||
|
@ -306,15 +306,13 @@ export default {
|
|||||||
useIntegral() {
|
useIntegral() {
|
||||||
this.computedPrice()
|
this.computedPrice()
|
||||||
},
|
},
|
||||||
$yroute(n) {
|
|
||||||
if (n.name === NAME) this.getCartInfo()
|
|
||||||
},
|
|
||||||
shipping_type() {
|
shipping_type() {
|
||||||
this.computedPrice()
|
this.computedPrice()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onLoad: function() {
|
||||||
let that = this
|
let that = this
|
||||||
|
console.log('loadddddddd')
|
||||||
this.$store.dispatch('getUser', true)
|
this.$store.dispatch('getUser', true)
|
||||||
that.getCartInfo()
|
that.getCartInfo()
|
||||||
console.log(that.$yroute)
|
console.log(that.$yroute)
|
||||||
@ -402,7 +400,8 @@ export default {
|
|||||||
this.storeSelfMention = res.data.storeSelfMention
|
this.storeSelfMention = res.data.storeSelfMention
|
||||||
this.computedPrice()
|
this.computedPrice()
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch((error) => {
|
||||||
|
console.log(error)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '加载订单数据失败',
|
title: '加载订单数据失败',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
Reference in New Issue
Block a user