Authored by runner

需求修改update

@@ -20,6 +20,15 @@ const log = require(`${library}/logger`); @@ -20,6 +20,15 @@ const log = require(`${library}/logger`);
20 const serviceApi = new ServiceAPI(); 20 const serviceApi = new ServiceAPI();
21 const api = new API(); 21 const api = new API();
22 22
  23 +const dateFormate = (str) =>{
  24 + var time = new Date(str * 1000);
  25 + var y = time.getFullYear();
  26 + var m = time.getMonth()+1;
  27 + var d = time.getDate();
  28 + var h = time.getHours();
  29 +
  30 + return y + '年' + m + '月' + d + '日' + h + '时';
  31 +}
23 32
24 const getOutletResource = (channel, contentcode) => { 33 const getOutletResource = (channel, contentcode) => {
25 const params = { 34 const params = {
@@ -73,26 +82,6 @@ const getNavData = (categoryId) => { @@ -73,26 +82,6 @@ const getNavData = (categoryId) => {
73 }); 82 });
74 }; 83 };
75 84
76 -const getActivityDetail = (id) => {  
77 - var params = {  
78 - method: 'app.outlets.activityGet',  
79 - sort: 2,  
80 - platform: 3,  
81 - yh_channel: 1,  
82 - id: id,  
83 - type: 0  
84 - };  
85 -  
86 - return api.get('', sign.apiSign(params)).then(res => {  
87 - if (res.code === 200) {  
88 - return res.data;  
89 - } else {  
90 - log.error('获取奥莱活动详情页接口返回状态码 不是 200', res);  
91 - return {};  
92 - }  
93 - });  
94 -};  
95 -  
96 const convertActicityData = (data) => { 85 const convertActicityData = (data) => {
97 const formatData = []; 86 const formatData = [];
98 87
@@ -118,7 +107,7 @@ const convertActicityData = (data) => { @@ -118,7 +107,7 @@ const convertActicityData = (data) => {
118 title: item.title, 107 title: item.title,
119 discountNum: discountNum, 108 discountNum: discountNum,
120 discountText: discountText, 109 discountText: discountText,
121 - leftTime: item.startLeftTime > 0 ? item.startLeftTime : item.endLeftTime, 110 + leftTime: item.startLeftTime > 0 ? dateFormate(item.startTime) : item.endLeftTime,
122 hide: false 111 hide: false
123 }); 112 });
124 }); 113 });
@@ -126,6 +115,26 @@ const convertActicityData = (data) => { @@ -126,6 +115,26 @@ const convertActicityData = (data) => {
126 return formatData; 115 return formatData;
127 }; 116 };
128 117
  118 +const getActivityDetail = (id) => {
  119 + var params = {
  120 + method: 'app.outlets.activityGet',
  121 + sort: 2,
  122 + platform: 3,
  123 + yh_channel: 1,
  124 + id: id,
  125 + type: 0
  126 + };
  127 +
  128 + return api.get('', sign.apiSign(params)).then(res => {
  129 + if (res.code === 200) {
  130 + return convertActicityData(res.data);
  131 + } else {
  132 + log.error('获取奥莱活动详情页接口返回状态码 不是 200', res);
  133 + return {};
  134 + }
  135 + });
  136 +};
  137 +
129 const getHomeActivity = (data) => { 138 const getHomeActivity = (data) => {
130 var params = { 139 var params = {
131 method: 'app.outlets.activityGet', 140 method: 'app.outlets.activityGet',
@@ -158,9 +167,8 @@ exports.getContent = (categoryId, channel, code) => { @@ -158,9 +167,8 @@ exports.getContent = (categoryId, channel, code) => {
158 167
159 exports.getActivity = (id) => { 168 exports.getActivity = (id) => {
160 return getActivityDetail(id).then(res => { 169 return getActivityDetail(id).then(res => {
161 -  
162 return { 170 return {
163 - outletActivity: res, 171 + activity: res,
164 productPool: res[0] && res[0].productPoolId || '', 172 productPool: res[0] && res[0].productPoolId || '',
165 activityTitle: res[0] && res[0].title || 'OUTLET', 173 activityTitle: res[0] && res[0].title || 'OUTLET',
166 saleType: 4 174 saleType: 4
1 <div class="outlet-page goods-page yoho-page"> 1 <div class="outlet-page goods-page yoho-page">
2 - {{> product/outlet/banner}} 2 + {{#activity}}
  3 + {{> resources/acivity-outlets}}
  4 + {{/activity}}
3 {{> common/filter-nav}} 5 {{> common/filter-nav}}
4 {{> product/sale/common}} 6 {{> product/sale/common}}
5 </div> 7 </div>
1 <div class="outlet-page yoho-page"> 1 <div class="outlet-page yoho-page">
2 {{> product/outlet/nav}} 2 {{> product/outlet/nav}}
3 {{# activity}} 3 {{# activity}}
4 - <a class="will-end-back" href="{{activityUrl}}" >  
5 - <img class="back-image" src="{{image coverUrl 640 300}}">  
6 - <div class="last-time"><i class="iconfont time-ico">&#xe603;</i><span>{{>product/outlet/countdown}}</span></div>  
7 - <div class="line-space">  
8 - <span class="num">{{promotionName}} </span>  
9 - <span class="title">{{title}}</span>  
10 - <img class="logo" src="{{image logoUrl 150 100}}"></img>  
11 - </div>  
12 - </a> 4 + {{> resources/acivity-outlets}}
13 {{/ activity}} 5 {{/ activity}}
14 6
15 <div class="empty hide"> 7 <div class="empty hide">
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 6
7 <div class="empty hide"> 7 <div class="empty hide">
8 <div class="bag"></div> 8 <div class="bag"></div>
9 - <p>活动正在火热中进行,左滑切换频道,更多潮品,就在YOHO!BUY有货</p> 9 + <p>活动已经上线,左滑切换频道,更多潮品,就在YOHO!BUY有货</p>
10 </div> 10 </div>
11 </div> 11 </div>
12 12
1 <div id="demo1"> 1 <div id="demo1">
2 <!--默认,服务端输出leftTime,把客户端时间干扰降到最低。单位秒--> 2 <!--默认,服务端输出leftTime,把客户端时间干扰降到最低。单位秒-->
3 <div class="cd cd-lite time hide" data-config="{'leftTime': {{leftTime}} }">— 仅剩<span class="left-day">${d}天</span>${h}时${m}分${s}秒 —</div> 3 <div class="cd cd-lite time hide" data-config="{'leftTime': {{leftTime}} }">— 仅剩<span class="left-day">${d}天</span>${h}时${m}分${s}秒 —</div>
4 - <div class="cd cd-medium time hide" data-config="{'leftTime': {{leftTime}} }">仅剩<span class="left-day">${d}天</span>${h}时${m}分${s}秒</div> 4 + <div class="cd cd-medium time hide">{{leftTime}}</div>
5 </div> 5 </div>
6 6
7 <!--<div id="demo4">--> 7 <!--<div id="demo4">-->