Merge branch 'release/3.0' of http://git.yoho.cn/fe/yohoblk-wap into release/3.0
Showing
1 changed file
with
13 additions
and
6 deletions
@@ -15,10 +15,10 @@ | @@ -15,10 +15,10 @@ | ||
15 | </div> | 15 | </div> |
16 | <div class="bottom clearfix"> | 16 | <div class="bottom clearfix"> |
17 | <span class="time-month"> | 17 | <span class="time-month"> |
18 | - <i class="month-num">{{formatTime(editorial.publish_time_long, 'month')}}</i> | ||
19 | - <i>{{formatTime(editorial.publish_time_long, 'monthEn')}}</i> | 18 | + <i class="month-num">{{editorial._formatTime.month}}</i> |
19 | + <i>{{editorial._formatTime.monthEn}}</i> | ||
20 | </span> | 20 | </span> |
21 | - <span class="time-day">/{{formatTime(editorial.publish_time_long, 'day')}}</span> | 21 | + <span class="time-day">/{{editorial._formatTime.day}}</span> |
22 | </div> | 22 | </div> |
23 | </div> | 23 | </div> |
24 | <div v-if="!scrollDisabled" class="is-loading">loading...</div> | 24 | <div v-if="!scrollDisabled" class="is-loading">loading...</div> |
@@ -147,18 +147,19 @@ | @@ -147,18 +147,19 @@ | ||
147 | } | 147 | } |
148 | }, | 148 | }, |
149 | methods: { | 149 | methods: { |
150 | - formatTime(val, flag) { | 150 | + formatTime(val) { |
151 | let time = new Date(+val); | 151 | let time = new Date(+val); |
152 | let day = time.getDate(); | 152 | let day = time.getDate(); |
153 | let month = time.getMonth() + 1; | 153 | let month = time.getMonth() + 1; |
154 | - let monthEn = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'][month]; | 154 | + let monthEn = |
155 | + ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'][month - 1]; | ||
155 | let opt = { | 156 | let opt = { |
156 | day: day, | 157 | day: day, |
157 | month: month, | 158 | month: month, |
158 | monthEn: monthEn | 159 | monthEn: monthEn |
159 | }; | 160 | }; |
160 | 161 | ||
161 | - return opt[flag]; | 162 | + return opt; |
162 | }, | 163 | }, |
163 | 164 | ||
164 | /* 获取资讯列表数据 */ | 165 | /* 获取资讯列表数据 */ |
@@ -182,6 +183,12 @@ | @@ -182,6 +183,12 @@ | ||
182 | this.editorialList = result.data.list; | 183 | this.editorialList = result.data.list; |
183 | } | 184 | } |
184 | 185 | ||
186 | + let time; | ||
187 | + this.editorialList.forEach(item => { | ||
188 | + time = this.formatTime(item.publish_time_long); | ||
189 | + this.$set(item, '_formatTime', time); | ||
190 | + }); | ||
191 | + | ||
185 | // 如果未加载完,继续翻页加载 | 192 | // 如果未加载完,继续翻页加载 |
186 | if (result.data.list.length > 0) { | 193 | if (result.data.list.length > 0) { |
187 | this.page++; | 194 | this.page++; |
-
Please register or login to post a comment