Merge remote-tracking branch 'origin/master'
Showing
4 changed files
with
35 additions
and
25 deletions
@@ -124,27 +124,29 @@ const _convertActicityData = (data) => { | @@ -124,27 +124,29 @@ const _convertActicityData = (data) => { | ||
124 | 124 | ||
125 | data = data || []; | 125 | data = data || []; |
126 | _.forEach(data, (item) => { | 126 | _.forEach(data, (item) => { |
127 | - discountArr = item.promotionName.split('~'); | ||
128 | - if (discountArr.length === 1) { | ||
129 | - discountNum = _transDiscountToArr(discountArr[0])[0]; | ||
130 | - discountText = _transDiscountToArr(discountArr[0])[1]; | ||
131 | - } else { | ||
132 | - discountNum = discountArr[0] + '~' + _transDiscountToArr(discountArr[1])[0]; | ||
133 | - discountText = _transDiscountToArr(discountArr[1])[1]; | 127 | + if (item.promotionName) { |
128 | + discountArr = item.promotionName.split('~'); | ||
129 | + if (discountArr.length === 1) { | ||
130 | + discountNum = _transDiscountToArr(discountArr[0])[0]; | ||
131 | + discountText = _transDiscountToArr(discountArr[0])[1]; | ||
132 | + } else { | ||
133 | + discountNum = discountArr[0] + '~' + _transDiscountToArr(discountArr[1])[0]; | ||
134 | + discountText = _transDiscountToArr(discountArr[1])[1]; | ||
135 | + } | ||
136 | + | ||
137 | + | ||
138 | + formatData.push({ | ||
139 | + activityUrl: '/product/outlet/activity?id=' + item.id, | ||
140 | + coverUrl: item.coverUrl, | ||
141 | + logoUrl: item.logoUrl, | ||
142 | + title: item.title, | ||
143 | + discountNum: discountNum, | ||
144 | + discountText: discountText, | ||
145 | + productPoolId: item.productPoolId || '', | ||
146 | + leftTime: item.startLeftTime > 0 ? dateFormate(item.startTime) : item.endLeftTime, | ||
147 | + hide: false | ||
148 | + }); | ||
134 | } | 149 | } |
135 | - | ||
136 | - | ||
137 | - formatData.push({ | ||
138 | - activityUrl: '/product/outlet/activity?id=' + item.id, | ||
139 | - coverUrl: item.coverUrl, | ||
140 | - logoUrl: item.logoUrl, | ||
141 | - title: item.title, | ||
142 | - discountNum: discountNum, | ||
143 | - discountText: discountText, | ||
144 | - productPoolId: item.productPoolId || '', | ||
145 | - leftTime: item.startLeftTime > 0 ? dateFormate(item.startTime) : item.endLeftTime, | ||
146 | - hide: false | ||
147 | - }); | ||
148 | }); | 150 | }); |
149 | 151 | ||
150 | return formatData; | 152 | return formatData; |
@@ -4,8 +4,14 @@ | @@ -4,8 +4,14 @@ | ||
4 | <div class="center-square"> | 4 | <div class="center-square"> |
5 | <div class="title">{{title}}</div> | 5 | <div class="title">{{title}}</div> |
6 | <div class="num"><span class="discount-num">{{discountNum}}</span> {{discountText}}</div> | 6 | <div class="num"><span class="discount-num">{{discountNum}}</span> {{discountText}}</div> |
7 | - {{>product/outlet/countdown}} | 7 | + <div id="demo1"> |
8 | + <!--默认,服务端输出leftTime,把客户端时间干扰降到最低。单位秒--> | ||
9 | + <div class="cd cd-lite time hide" data-config="{'leftTime': {{leftTime}} }">— 仅剩<span class="left-day">${d}天</span>${h}时${m}分${s}秒 —</div> | ||
10 | + <div class="cd cd-medium time hide">{{leftTime}}</div> | ||
11 | + </div> | ||
8 | </div> | 12 | </div> |
9 | </a> | 13 | </a> |
10 | </div> | 14 | </div> |
15 | +{{#if @last}} | ||
11 | <div class="more-activity hide"><p>更多精彩活动</p><span class="iconfont count-down-icon"></span></div> | 16 | <div class="more-activity hide"><p>更多精彩活动</p><span class="iconfont count-down-icon"></span></div> |
17 | +{{/if}} |
@@ -14,8 +14,9 @@ | @@ -14,8 +14,9 @@ | ||
14 | display:inline-block; | 14 | display:inline-block; |
15 | width: 20px; | 15 | width: 20px; |
16 | height: 20px; | 16 | height: 20px; |
17 | - background: url('/channel/tip.png') no-repeat; | ||
18 | - background-size: 20px 20px; | 17 | + background: url('/channel/tip.png'); |
18 | + background-repeat: no-repeat; | ||
19 | + background-size: contain; | ||
19 | vertical-align: -2px; | 20 | vertical-align: -2px; |
20 | margin-right: 8px; | 21 | margin-right: 8px; |
21 | } | 22 | } |
@@ -32,7 +33,8 @@ | @@ -32,7 +33,8 @@ | ||
32 | 33 | ||
33 | .chan { | 34 | .chan { |
34 | background-image: url('/channel/up-icon.png'); | 35 | background-image: url('/channel/up-icon.png'); |
35 | - background-size: 31px 31px; | 36 | + background-repeat: no-repeat; |
37 | + background-size: contain; | ||
36 | position: absolute; | 38 | position: absolute; |
37 | top: 50%; | 39 | top: 50%; |
38 | margin-top: -15px; | 40 | margin-top: -15px; |
-
Please register or login to post a comment