Authored by lijing

品牌页

... ... @@ -20,7 +20,7 @@ let index = (req, res, next) => {
module: 'channel',
page: 'brand',
title: '品牌一览',
pageFooter: true
//pageFooter: true
};
let param = {
... ...
... ... @@ -8,9 +8,10 @@
var api = global.yoho.API;
const service = global.yoho.ServiceAPI;
const helpers = global.yoho.helpers;
//const utils = '../../../utils';
//const floorProcess = require(`${utils}/floor-process`);
// const utils = '../../../utils';
// const floorProcess = require(`${utils}/floor-process`);
/* 男生频道取品牌广告及热门品牌数据的位置码 */
let CODE_TOPPOS_BOYS = 'ce6ac059493ec26241a8cbe0bfa1b17a';
... ... @@ -93,15 +94,13 @@ const getBrandByChannel = (channel) => {
return api.all([
_packageAd(params),
//_packageList(params)
_packageList(params)
]).then(result => {
console.log(floorProcess.getContent(result));
let resu = {
brandPage: true,
showDownloadApp: true,
brandPage: true,
showDownloadApp: true,
channel: {
channels: [{
name: 'Boy'
... ... @@ -111,12 +110,125 @@ const getBrandByChannel = (channel) => {
name: 'Kid'
}, {
name: 'Lifestyle'
}, ]
}],
topData: {
bannerTop: {},
hotBrandsScroll: {}
},
brandType: '全部品牌',
secondBrandType: '新入驻品牌',
thirdBrandType: '热门品牌',
brandList: [
// {
// title: 'A',
// list: [
// {
// name: '11'
// },
// {
// name: '22'
// }
// ]
// },
// {
// title: 'B',
// list: [
// {
// name: '11'
// },
// {
// name: '33'
// }
// ]
// },
// {
// title: 'C',
// list: [
// {
// name: '11'
// }
// ]
// }
]
}
};
resu.channel.channels[channel - 1].active = true;
if (result && result[0] && result[0].data) {
if (result[0].data[0] && result[0].data[0].data) {
// 轮播图资源位
let adList = result[0].data[0].data;
let build = [];
adList.forEach(ad => {
build.push({
img: helpers.image(ad.src, 640, 240),
url: ad.url
});
});
resu.channel.topData.bannerTop.list = build;
}
if (result[0].data[1] && result[0].data[1].data) {
// 推荐品牌资源位
let brandList = result[0].data[1].data.list;
let brand = [];
brandList.forEach(ad => {
brand.push({
img: helpers.image(ad.src, 140, 140),
url: ad.url,
textCn: ad.title
});
});
resu.channel.topData.hotBrandsScroll.name = result[0].data[1].data.title.title;
resu.channel.topData.hotBrandsScroll.list = brand;
}
}
if (result && result[1] && result[1].data) {
let allList = result[1].data.all_list;
let build = [];
let listv = [];
for (let key in allList) {
build.push({
title: key
});
allList[key].forEach(row => {
listv.push({
name: row.brand_name
});
build.list = listv;
build = Object.assign(build, listv);
});
}
console.log(build);
resu.channel.brandList = build;
}
return resu;
});
... ...
... ... @@ -29,7 +29,7 @@
{{! 热门品牌可滑动}}
{{# hotBrandsScroll}}
{{> home/hot_brands_swipe}}
{{> brand/hot_brands_swipe}}
{{/ hotBrandsScroll}}
{{/ topData}}
... ...
{{# name}}
<div class="floor-header">
<h2>{{.}}</h2>
</div>
{{/ name}}
\ No newline at end of file
... ...
<div class="hot-brands">
{{> brand/floor_header}}
<div class="brands-swiper">
<ul class="brands-list swiper-wrapper clearfix">
{{# list}}
<li class="swiper-slide">
<a href="{{url}}">
<img src="{{img}}" alt="">
<span class="brands-title">{{textCn}}</span>
</a>
</li>
{{/ list}}
</ul>
</div>
</div>
... ...
... ... @@ -11,17 +11,14 @@ const isTest = process.env.NODE_ENV === 'test';
module.exports = {
app: 'h5',
appVersion: '4.9.2', // 调用api的版本
port: 6001,
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
// api: 'http://devapi.yoho.cn:58078/',
// service: 'http://devservice.yoho.cn:58077/'
api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/'
api: 'http://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
liveApi: 'http://api.live.yoho.cn/'
},
subDomains: {
host: '.m.yohobuy.com',
... ... @@ -33,25 +30,16 @@ module.exports = {
activity: '//activity.yohobuy.com',
index: '//m.yohobuy.com'
},
useOneapm: false,
useCache: false,
memcache: {
master: ['192.168.102.205:12111'],
slave: ['192.168.102.205:12111'],
session: ['192.168.102.205:12111'],
master: ['192.168.102.168:12111'],
slave: ['192.168.102.168:12111'],
session: ['192.168.102.168:12111'],
timeout: 1000,
retries: 0
},
interfaceShunt: {
useInterfaceShunt: false,
tencentServers: {
api: ['123.206.1.98', '123.206.2.80'],
service: ['123.206.1.98', '123.206.2.80']
},
awsServers: {
api: 'app-java-168863769.cn-north-1.elb.amazonaws.com.cn',
service: 'service-yoho-579825100.cn-north-1.elb.amazonaws.com.cn'
}
open: false
},
loggers: {
infoFile: {
... ... @@ -99,21 +87,13 @@ if (isProduction) {
master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
slave: ['memcache1.yohoops.org:12112', 'memcache2.yohoops.org:12112', 'memcache3.yohoops.org:12112'],
session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
timeout: 1000,
timeout: 100,
retries: 0
},
useOneapm: true,
useCache: true,
interfaceShunt: {
useInterfaceShunt: false,
tencentServers: {
api: ['123.206.1.98', '123.206.2.80'],
service: ['123.206.1.98', '123.206.2.80']
},
awsServers: {
api: 'app-java-168863769.cn-north-1.elb.amazonaws.com.cn',
service: 'service-yoho-579825100.cn-north-1.elb.amazonaws.com.cn'
}
open: false,
url: 'http://123.206.2.55/strategy'
}
});
} else if (isTest) {
... ... @@ -121,18 +101,17 @@ if (isProduction) {
appName: 'm.yohobuy.com for test',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets',
domains: {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/'
api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',
liveApi: process.env.TEST_LIVE || 'http://testapi.live.yohops.com:9999/'
},
memcache: {
master: ['127.0.0.1:12111'],
slave: ['127.0.0.1:12112'],
session: ['127.0.0.1:12111'],
timeout: 1000,
timeout: 100,
retries: 0
},
useOneapm: true,
useCache: true
});
}
\ No newline at end of file
}
... ...
... ... @@ -74,7 +74,6 @@
.brandNav {
display: block;
width: 100%;
height: 80px;
line-height: 80px;
overflow: hidden;
color: #aeaeae;
... ... @@ -135,9 +134,10 @@
}
.newbrand-search {
width: 93.75%;
width: 100%;
height: 60px;
padding: 14px 3.125%;
padding: 0 3.125%;
margin: 14px 0;
background-color: #f8f8f8;
left: 0;
top: 90px;
... ... @@ -146,7 +146,6 @@
.search-box {
position: relative;
width: 500px;
height: 60px;
background-color: #fff;
border-radius: 30px;
... ...