Authored by 陈峰

Merge branch 'release/3.0' of http://git.yoho.cn/fe/yohoblk-wap into release/3.0

... ... @@ -15,10 +15,10 @@
</div>
<div class="bottom clearfix">
<span class="time-month">
<i class="month-num">{{formatTime(editorial.publish_time_long, 'month')}}</i>
<i>{{formatTime(editorial.publish_time_long, 'monthEn')}}</i>
<i class="month-num">{{editorial._formatTime.month}}</i>
<i>{{editorial._formatTime.monthEn}}</i>
</span>
<span class="time-day">/{{formatTime(editorial.publish_time_long, 'day')}}</span>
<span class="time-day">/{{editorial._formatTime.day}}</span>
</div>
</div>
<div v-if="!scrollDisabled" class="is-loading">loading...</div>
... ... @@ -147,18 +147,19 @@
}
},
methods: {
formatTime(val, flag) {
formatTime(val) {
let time = new Date(+val);
let day = time.getDate();
let month = time.getMonth() + 1;
let monthEn = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'][month];
let monthEn =
['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'][month - 1];
let opt = {
day: day,
month: month,
monthEn: monthEn
};
return opt[flag];
return opt;
},
/* 获取资讯列表数据 */
... ... @@ -182,6 +183,12 @@
this.editorialList = result.data.list;
}
let time;
this.editorialList.forEach(item => {
time = this.formatTime(item.publish_time_long);
this.$set(item, '_formatTime', time);
});
// 如果未加载完,继续翻页加载
if (result.data.list.length > 0) {
this.page++;
... ...