Commit 2832ab05 by 侯体倬

限时折扣倒计时文案优化

parent 58ba58b7
...@@ -133,6 +133,7 @@ const componentOptions = { ...@@ -133,6 +133,7 @@ const componentOptions = {
second: 0, second: 0,
goodsList: [], goodsList: [],
selectActivityValue:"", selectActivityValue:"",
activityInfo: {}, // 活动信息
}, },
// 数据监听器 // 数据监听器
observers: {}, observers: {},
...@@ -157,6 +158,7 @@ const componentOptions = { ...@@ -157,6 +158,7 @@ const componentOptions = {
promoteApi.getSingleItemActivityV2(query).then(res => { promoteApi.getSingleItemActivityV2(query).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
let copyData = res.data.data; let copyData = res.data.data;
this.setData({ activityInfo: res.data.data });
// 未开始和进行中的活动 // 未开始和进行中的活动
deleteFlag = ![1, 2].includes(+copyData.activityStatus); deleteFlag = ![1, 2].includes(+copyData.activityStatus);
if (dimension == 0 && copyData.goodsItems.length == 0) { if (dimension == 0 && copyData.goodsItems.length == 0) {
...@@ -300,6 +302,14 @@ const componentOptions = { ...@@ -300,6 +302,14 @@ const componentOptions = {
minutes: minutes<10?'0'+minutes:minutes, minutes: minutes<10?'0'+minutes:minutes,
seconds: seconds<10?'0'+seconds:seconds, seconds: seconds<10?'0'+seconds:seconds,
} }
// 活动刚刚开始
const { isStart, activityInfo } = this.data;
if (days <= 0 && hours <= 0 && minutes <= 0 && seconds <= 0 && !isStart) {
this.setData({ isStart: true });
this.setData({
endTime: new Date(activityInfo.endTime.replace(/-/g, "/")).getTime() - (new Date().getTime())
});
}
this.setData({ timeData: detail }); this.setData({ timeData: detail });
}, },
onclickProduct(e) { onclickProduct(e) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
class="countDown" class="countDown"
bind:change="onChange" bind:change="onChange"
> >
<text class="endTimedot">距离活动结束</text> <text class="endTimedot">距离活动{{isStart?'结束':'开始'}}</text>
<text class="endTime days">{{ timeData.days }}</text> <text class="endTime days">{{ timeData.days }}</text>
<text class="endTimedot"></text> <text class="endTimedot"></text>
<text class="endTime hours">{{ timeData.hours }}</text> <text class="endTime hours">{{ timeData.hours }}</text>
......
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