Showing
3 changed files
with
24 additions
and
12 deletions
@@ -96,14 +96,27 @@ const getActivityDetail = (id) => { | @@ -96,14 +96,27 @@ const getActivityDetail = (id) => { | ||
96 | const convertActicityData = (data) => { | 96 | const convertActicityData = (data) => { |
97 | const formatData = []; | 97 | const formatData = []; |
98 | 98 | ||
99 | + let discountArr = [], | ||
100 | + discountNum = 0, | ||
101 | + discountText = 0; | ||
99 | data = data || []; | 102 | data = data || []; |
100 | _.forEach(data, (item) => { | 103 | _.forEach(data, (item) => { |
104 | + discountArr = item.promotionName.split('~'); | ||
105 | + if (discountArr.length === 1) { | ||
106 | + discountNum = discountArr[0].replace(/[^0-9]/g,""); | ||
107 | + discountText = discountArr[0].replace(/[0-9]/g,""); | ||
108 | + }else { | ||
109 | + discountNum = discountArr[0] + '~' +discountArr[1].replace(/[^0-9]/g,""); | ||
110 | + discountText = discountArr[1].replace(/[0-9]/g,""); | ||
111 | + } | ||
112 | + | ||
101 | formatData.push({ | 113 | formatData.push({ |
102 | activityUrl: '/product/outlet/activity?id=' + item.id, | 114 | activityUrl: '/product/outlet/activity?id=' + item.id, |
103 | coverUrl: item.coverUrl, | 115 | coverUrl: item.coverUrl, |
104 | logoUrl: item.logoUrl, | 116 | logoUrl: item.logoUrl, |
105 | title: item.title, | 117 | title: item.title, |
106 | - promotionName: item.promotionName, | 118 | + discountNum: discountNum, |
119 | + discountText: discountText, | ||
107 | leftTime: item.startLeftTime > 0 ? item.startLeftTime : item.endLeftTime, | 120 | leftTime: item.startLeftTime > 0 ? item.startLeftTime : item.endLeftTime, |
108 | hide: false | 121 | hide: false |
109 | }); | 122 | }); |
@@ -2,9 +2,8 @@ | @@ -2,9 +2,8 @@ | ||
2 | <a class="back-ground-white {{#if hide}} hidden {{/if}}" href="{{activityUrl}}" > | 2 | <a class="back-ground-white {{#if hide}} hidden {{/if}}" href="{{activityUrl}}" > |
3 | <img class="back-image" src="{{image coverUrl 640 300}}"> | 3 | <img class="back-image" src="{{image coverUrl 640 300}}"> |
4 | <div class="center-square"> | 4 | <div class="center-square"> |
5 | - <img class="logo" src="{{image logoUrl 85 55}}"></img> | ||
6 | <div class="title">{{title}}</div> | 5 | <div class="title">{{title}}</div> |
7 | - <div class="num">{{promotionName}} </div> | 6 | + <div class="num"><span class="discountNum">{{discountNum}}</span> {{discountText}}</div> |
8 | {{>product/outlet/countdown}} | 7 | {{>product/outlet/countdown}} |
9 | </div> | 8 | </div> |
10 | </a> | 9 | </a> |
@@ -53,15 +53,14 @@ | @@ -53,15 +53,14 @@ | ||
53 | height: 212px; | 53 | height: 212px; |
54 | } | 54 | } |
55 | 55 | ||
56 | - .logo { | ||
57 | - margin-bottom: 10px; | ||
58 | - margin-top: 20px; | ||
59 | - } | ||
60 | - | ||
61 | .num { | 56 | .num { |
62 | text-align: center; | 57 | text-align: center; |
63 | - font-size: 28px; | ||
64 | - color: #ff0705;; | 58 | + font-size: 25px; |
59 | + color: #ff0705; | ||
60 | + | ||
61 | + .discountNum { | ||
62 | + font-size: 40px; | ||
63 | + } | ||
65 | } | 64 | } |
66 | 65 | ||
67 | .title { | 66 | .title { |
@@ -73,6 +72,7 @@ | @@ -73,6 +72,7 @@ | ||
73 | overflow: hidden; | 72 | overflow: hidden; |
74 | text-overflow: ellipsis; | 73 | text-overflow: ellipsis; |
75 | white-space: nowrap; | 74 | white-space: nowrap; |
75 | + margin-top: 75px; | ||
76 | } | 76 | } |
77 | 77 | ||
78 | .time { | 78 | .time { |
@@ -134,7 +134,7 @@ | @@ -134,7 +134,7 @@ | ||
134 | .num { | 134 | .num { |
135 | top: 10px; | 135 | top: 10px; |
136 | width: 100px; | 136 | width: 100px; |
137 | - font-size: 30px; | 137 | + font-size: 20px; |
138 | color: #ff0705; | 138 | color: #ff0705; |
139 | margin-left: 30px; | 139 | margin-left: 30px; |
140 | } | 140 | } |
@@ -143,7 +143,7 @@ | @@ -143,7 +143,7 @@ | ||
143 | top: 10px; | 143 | top: 10px; |
144 | margin-left: 30px; | 144 | margin-left: 30px; |
145 | width: 200px; | 145 | width: 200px; |
146 | - font-size: 28px; | 146 | + font-size: 30px; |
147 | font-weight: bold; | 147 | font-weight: bold; |
148 | overflow: hidden; | 148 | overflow: hidden; |
149 | text-overflow: ellipsis; | 149 | text-overflow: ellipsis; |
-
Please register or login to post a comment