Authored by runner

需求修改update

... ... @@ -20,6 +20,15 @@ const log = require(`${library}/logger`);
const serviceApi = new ServiceAPI();
const api = new API();
const dateFormate = (str) =>{
var time = new Date(str * 1000);
var y = time.getFullYear();
var m = time.getMonth()+1;
var d = time.getDate();
var h = time.getHours();
return y + '年' + m + '月' + d + '日' + h + '时';
}
const getOutletResource = (channel, contentcode) => {
const params = {
... ... @@ -73,26 +82,6 @@ const getNavData = (categoryId) => {
});
};
const getActivityDetail = (id) => {
var params = {
method: 'app.outlets.activityGet',
sort: 2,
platform: 3,
yh_channel: 1,
id: id,
type: 0
};
return api.get('', sign.apiSign(params)).then(res => {
if (res.code === 200) {
return res.data;
} else {
log.error('获取奥莱活动详情页接口返回状态码 不是 200', res);
return {};
}
});
};
const convertActicityData = (data) => {
const formatData = [];
... ... @@ -118,7 +107,7 @@ const convertActicityData = (data) => {
title: item.title,
discountNum: discountNum,
discountText: discountText,
leftTime: item.startLeftTime > 0 ? item.startLeftTime : item.endLeftTime,
leftTime: item.startLeftTime > 0 ? dateFormate(item.startTime) : item.endLeftTime,
hide: false
});
});
... ... @@ -126,6 +115,26 @@ const convertActicityData = (data) => {
return formatData;
};
const getActivityDetail = (id) => {
var params = {
method: 'app.outlets.activityGet',
sort: 2,
platform: 3,
yh_channel: 1,
id: id,
type: 0
};
return api.get('', sign.apiSign(params)).then(res => {
if (res.code === 200) {
return convertActicityData(res.data);
} else {
log.error('获取奥莱活动详情页接口返回状态码 不是 200', res);
return {};
}
});
};
const getHomeActivity = (data) => {
var params = {
method: 'app.outlets.activityGet',
... ... @@ -158,9 +167,8 @@ exports.getContent = (categoryId, channel, code) => {
exports.getActivity = (id) => {
return getActivityDetail(id).then(res => {
return {
outletActivity: res,
activity: res,
productPool: res[0] && res[0].productPoolId || '',
activityTitle: res[0] && res[0].title || 'OUTLET',
saleType: 4
... ...
<div class="outlet-page goods-page yoho-page">
{{> product/outlet/banner}}
{{#activity}}
{{> resources/acivity-outlets}}
{{/activity}}
{{> common/filter-nav}}
{{> product/sale/common}}
</div>
... ...
<div class="outlet-page yoho-page">
{{> product/outlet/nav}}
{{# activity}}
<a class="will-end-back" href="{{activityUrl}}" >
<img class="back-image" src="{{image coverUrl 640 300}}">
<div class="last-time"><i class="iconfont time-ico">&#xe603;</i><span>{{>product/outlet/countdown}}</span></div>
<div class="line-space">
<span class="num">{{promotionName}} </span>
<span class="title">{{title}}</span>
<img class="logo" src="{{image logoUrl 150 100}}"></img>
</div>
</a>
{{> resources/acivity-outlets}}
{{/ activity}}
<div class="empty hide">
... ...
... ... @@ -6,7 +6,7 @@
<div class="empty hide">
<div class="bag"></div>
<p>活动正在火热中进行,左滑切换频道,更多潮品,就在YOHO!BUY有货</p>
<p>活动已经上线,左滑切换频道,更多潮品,就在YOHO!BUY有货</p>
</div>
</div>
... ...
<div id="demo1">
<!--默认,服务端输出leftTime,把客户端时间干扰降到最低。单位秒-->
<div class="cd cd-lite time hide" data-config="{'leftTime': {{leftTime}} }">— 仅剩<span class="left-day">${d}天</span>${h}时${m}分${s}秒 —</div>
<div class="cd cd-medium time hide" data-config="{'leftTime': {{leftTime}} }">仅剩<span class="left-day">${d}天</span>${h}时${m}分${s}秒</div>
<div class="cd cd-medium time hide">{{leftTime}}</div>
</div>
<!--<div id="demo4">-->
... ...