Commit e9658908 authored by 郑秀明's avatar 郑秀明

Merge commit 'afe547c1'

parents 0921498d afe547c1
......@@ -120,8 +120,8 @@
let seconds = this.seconds
let [day, hour, minute, second] = [0, 0, 0, 0]
if (seconds > 0) {
// day = Math.floor(seconds / (60 * 60 * 24))
hour = Math.floor(seconds / (60 * 60))
day = Math.floor(seconds / (60 * 60 * 24))
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
} else {
......@@ -199,7 +199,6 @@
padding: 0 6rpx;
height: 32rpx;
line-height: 32rpx;
margin: 5rpx;
text-align: center;
font-size: 24rpx;
border-radius: 8rpx;
......
......@@ -4,12 +4,13 @@
<view>
<i v-if="style_setting.icon_show" class="promo_icon" :style="{'background-image': 'url('+style_setting.icon_url+')'}"></i>
<text class="promo_title" :style="{'color': style_setting.title_color, 'font-size': style_setting.title_font*2+'rpx'}">{{style_setting.title}}</text>
<text class="du_start" v-if="this.style_setting.is_not_start">距开始:</text>
<text class="countdown" v-if="style_setting.count_down_show">
<uni-countdown :hour="hour" :minute="minute" :second="second" :showDay="false" backgroundColor="#000" color="#fff"></uni-countdown>
<uni-countdown :day="day" :hour="hour" :minute="minute" :second="second" :show-day="day > 0" backgroundColor="#000" color="#fff"></uni-countdown>
</text>
</view>
<text class="check_more" @click="$jump(style_setting.more_link)">{{style_setting.more_title}}
<svg viewBox="64 64 896 896" class="" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path></svg>
<svg viewBox="64 64 896 896" class="svg" data-icon="right" width="1em" height="1em" fill="currentColor" aria-hidden="true" focusable="false"><path d="M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z"></path></svg>
</text>
</view>
<view class="promo_goods_content">
......@@ -46,6 +47,7 @@
return {
style_setting: this.wrapper_props.style_setting,
list: this.wrapper_props.goods_list,
day: 0,
hour:0,
minute: 0,
second: 0,
......@@ -53,11 +55,12 @@
}
},
mounted() {
const t = this.style_setting.count_down_type === 1 ? this.wrapper_props.first_end_time : this.style_setting.count_down_time;
const now = moment(new Date(), 'YYYY-MM-DD HH:mm:ss').format('x')-0,
end = moment(t, 'YYYY-MM-DD HH:mm:ss').format('x')-0,
du = moment.duration(end-now);
this.hour = du.days()*24+du.hours();
const t = this.style_setting.is_not_start ? this.style_setting.count_down_time : (this.style_setting.count_down_type === 1 ? this.wrapper_props.first_end_time : this.style_setting.count_down_time);
const now = moment(new Date(), 'YYYY-MM-DD HH:mm:ss'),
end = moment(t, 'YYYY-MM-DD HH:mm:ss'),
du = moment.duration(end-now, 'ms');
this.day = end.diff(now, 'day');
this.hour = du.hours();
this.minute = du.minutes();
this.second = du.seconds();
const space = 4 - this.list.length % 4;
......@@ -159,4 +162,13 @@
font-size: 20rpx;
}
}
.du_start {
font-size: 20rpx;
vertical-align: middle;
margin-right: 4rpx;
}
.svg {
position: relative;
top: 4rpx;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment