Authored by lijing

品牌

... ... @@ -99,8 +99,8 @@ const getBrandByChannel = (channel) => {
]).then(result => {
let resu = {
brandPage: true,
showDownloadApp: true,
brandPage: true,
showDownloadApp: true,
channel: {
channels: [{
name: 'Boy'
... ... @@ -112,45 +112,45 @@ const getBrandByChannel = (channel) => {
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'
// }
// ]
// }
]
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'
// }
// ]
// }
]
}
};
... ... @@ -158,74 +158,74 @@ const getBrandByChannel = (channel) => {
if (result && result[0] && result[0].data) {
if (result[0].data[0] && result[0].data[0].data) {
// 轮播图资源位
let adList = result[0].data[0].data;
if (result[0].data[0] && result[0].data[0].data) {
// 轮播图资源位
let adList = result[0].data[0].data;
let build = [];
let build = [];
adList.forEach(ad => {
build.push({
img: helpers.image(ad.src, 640, 240),
url: ad.url
});
});
adList.forEach(ad => {
build.push({
img: helpers.image(ad.src, 640, 240),
url: ad.url
});
});
resu.channel.topData.bannerTop.list = build;
resu.channel.topData.bannerTop.list = build;
}
}
if (result[0].data[1] && result[0].data[1].data) {
// 推荐品牌资源位
let brandList = result[0].data[1].data.list;
if (result[0].data[1] && result[0].data[1].data) {
// 推荐品牌资源位
let brandList = result[0].data[1].data.list;
let brand = [];
let brand = [];
brandList.forEach(ad => {
brand.push({
img: helpers.image(ad.src, 140, 140),
url: ad.url,
textCn: ad.title
});
});
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.name = result[0].data[1].data.title.title;
resu.channel.topData.hotBrandsScroll.list = brand;
resu.channel.topData.hotBrandsScroll.list = brand;
}
}
}
if (result && result[1] && result[1].data) {
let allList = result[1].data.all_list;
let allList = result[1].data.all_list;
let build = [];
let build = [];
let listv = [];
let listv = [];
for (let key in allList) {
for (let key in allList) {
build.push({
title: key
});
build.push({
title: key
});
allList[key].forEach(row => {
allList[key].forEach(row => {
listv.push({
name: row.brand_name
});
listv.push({
name: row.brand_name
});
build.list = listv;
build.list = listv;
build = Object.assign(build, listv);
build = Object.assign(build, listv);
});
});
}
console.log(build);
resu.channel.brandList = build;
}
console.log(build);
resu.channel.brandList = build;
}
... ...
... ... @@ -11,14 +11,17 @@ 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://api.yoho.yohoops.org/',
service: 'http://service.yoho.yohoops.org/',
liveApi: 'http://api.live.yoho.cn/'
// 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/'
},
subDomains: {
host: '.m.yohobuy.com',
... ... @@ -30,16 +33,25 @@ module.exports = {
activity: '//activity.yohobuy.com',
index: '//m.yohobuy.com'
},
useOneapm: false,
useCache: false,
memcache: {
master: ['192.168.102.168:12111'],
slave: ['192.168.102.168:12111'],
session: ['192.168.102.168:12111'],
master: ['192.168.102.205:12111'],
slave: ['192.168.102.205:12111'],
session: ['192.168.102.205:12111'],
timeout: 1000,
retries: 0
},
interfaceShunt: {
open: false
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'
}
},
loggers: {
infoFile: {
... ... @@ -87,13 +99,21 @@ 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: 100,
timeout: 1000,
retries: 0
},
useOneapm: true,
useCache: true,
interfaceShunt: {
open: false,
url: 'http://123.206.2.55/strategy'
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'
}
}
});
} else if (isTest) {
... ... @@ -101,17 +121,18 @@ if (isProduction) {
appName: 'm.yohobuy.com for test',
assetUrl: '//cdn.yoho.cn/m-yohobuy-node/assets',
domains: {
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/'
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: '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: 100,
timeout: 1000,
retries: 0
},
useOneapm: true,
useCache: true
});
}
... ...