Authored by 王水玲

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuywap-node into release/4.6

... ... @@ -24,8 +24,9 @@ exports.index = (req, res) => {
let headerData = headerModel.setNavHeader('OUTLET', channel, true, '', null);
let categoryId = req.query.category_id;
let yhChannel = req.query.yh_channel || 1;
let contentcode = req.query.content_code;
outletModel.getContent(categoryId, yhChannel).then(result => {
outletModel.getContent(categoryId, yhChannel, contentcode).then(result => {
res.render('outlet', Object.assign({
page: 'outlet',
pageHeader: headerData,
... ... @@ -53,7 +54,7 @@ exports.activityChannel = (req, res) => {
let categoryId = req.query.category_id;
let type = req.query.type || 2;
let template = type === 2 ? 'outlet/will-end' : 'outlet/will-start';
let page = type === 2 ? 'tobeend' : 'soon';
let page = type === 2 ? 'outlet-will-end' : 'outlet-will-start';
let yhChannel = yhChannelMap[channel];
outletModel.getNearlyActivity(yhChannel, type, categoryId).then(result => {
... ...
... ... @@ -22,9 +22,10 @@ const serviceApi = new ServiceAPI();
const api = new API();
const getOutletResource = (channel) => {
const getOutletResource = (channel, contentcode) => {
console.log(contentcode);
const params = {
content_code: 'c19ffa03f053f4cac3690b22c8da26b7',
content_code: contentcode || 'c19ffa03f053f4cac3690b22c8da26b7',
limit: 25,
yh_channel: channel || '',
debug: 'XYZ'
... ... @@ -58,8 +59,7 @@ const convertNavData = (list) => {
const getNavData = (categoryId) => {
const params = {
v: 7,
parent_id: categoryId,
debug: 'XYZ'
parent_id: categoryId
};
return serviceApi.get('operations/api/v6/category/getCategory', sign.apiSign(params)).then(result => {
... ... @@ -137,7 +137,6 @@ const getHomeActivity = (data) => {
var params = {
method: 'app.outlets.activityGet',
platform: 2,
size: 0,
sort: 2,
client_type: 'h5'
};
... ... @@ -147,19 +146,16 @@ const getHomeActivity = (data) => {
});
};
exports.getContent = (categoryId, channel) => {
exports.getContent = (categoryId, channel, code) => {
let floorsData = {},
params = {
type: 0,
id: 0
};
if (channel === 'boys') {
params.yh_channel = 1;
}
const promises = [getNavData(categoryId), getOutletResource(channel), getHomeActivity(params), getGoodsList()];
const p = [getNavData(categoryId), getOutletResource(channel, code), getHomeActivity(params), getGoodsList()];
return Promise.all(promises).then(data => {
return Promise.all(p).then(data => {
floorsData.nav = data[0] || [];
floorsData.content = data[1] || [];
floorsData.activity = {data: data[2]};
... ... @@ -186,10 +182,6 @@ exports.getNearlyActivity = (channel, type, categoryId) => {
type: type
};
if (channel === 'boys') {
params.yh_channel = 1;
}
return Promise.all([getNavData(categoryId), getHomeActivity(params)]).then(res => {
var data = {
nav: res[0] || [],
... ...
<div class="outlet-page">
<div class="outlet-page yoho-page">
{{> product/outlet/nav}}
{{# activity}}
{{#data}}
... ...
<div class="outlet-page">
<div class="outlet-page yoho-page">
{{> product/outlet/nav}}
{{# activity}}
{{> resources/acivity-outlets}}
... ...
/**
* Created by runner on 16/6/14.
*/
var $ = require('yoho-jquery'),
Countdown = require('./outlet/countdown'),
tip = require('../plugin/tip');
var el = $('.cd-lite');
require('../common');
new Countdown.Countdown({
el: el
});
$('.will-end-back').on('click', function() {
tip.show('活动即将结束');
return false;
});
... ...
/**
* Created by runner on 16/6/14.
*/
var $ = require('yoho-jquery'),
Countdown = require('./outlet/countdown'),
tip = require('../plugin/tip');
var el = $('.cd-lite');
require('../common');
new Countdown.Countdown({
el: el
});
$('.back-ground-white').on('click', function() {
tip.show('活动即将开始');
return false;
});
... ...