...
|
...
|
@@ -34,44 +34,51 @@ const bindController = require(`${cRoot}/3party-bind`); |
|
|
// const AddressController = require(`${cRoot}/address`);
|
|
|
// const GiftController = require(`${cRoot}/gift`);
|
|
|
|
|
|
const homeNav = [
|
|
|
{
|
|
|
title: '交易管理',
|
|
|
subNav: [
|
|
|
{name: '我的订单', href: '/home/orders', catchs: ['/home/orders', '/home/index']},
|
|
|
{name: '我的收藏', href: '/home/favorite'},
|
|
|
{name: '我的有货币', href: '/home/currency'},
|
|
|
{name: '我的红包', href: '/home/redenvelopes'},
|
|
|
{name: '我的优惠券', href: '/home/coupons'},
|
|
|
{name: '我的VIP', href: '/home/vip'}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
title: '服务中心',
|
|
|
subNav: [
|
|
|
{name: '我的退/换货', href: '/home/returns'},
|
|
|
{name: '我的咨询', href: '/home/consult'},
|
|
|
{name: '我的评论', href: '/home/comment'},
|
|
|
|
|
|
/* {name: '我的投诉', href: '/home/complaints'}, */
|
|
|
{name: '我的信息', href: '/home/message', count: 0},
|
|
|
{name: '在线客服', href: 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409', isBlank: true}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
title: '个人信息管理',
|
|
|
subNav: [
|
|
|
{name: '编辑个人资料', href: '/home/user'},
|
|
|
{name: '账号安全', href: '/home/account'},
|
|
|
{name: '地址管理', href: '/home/address'},
|
|
|
{name: '兑换礼品卡', href: '/home/gift'}
|
|
|
]
|
|
|
}
|
|
|
];
|
|
|
|
|
|
const getActiveNav = (req)=>{
|
|
|
|
|
|
let mHomeNav = _.cloneDeep(homeNav);
|
|
|
const homeNav = (req, res) => {
|
|
|
return [
|
|
|
{
|
|
|
title: '交易管理',
|
|
|
subNav: [
|
|
|
{name: '我的订单', href: '/home/orders', catchs: ['/home/orders', '/home/index']},
|
|
|
{name: '我的收藏', href: '/home/favorite'},
|
|
|
{name: '我的有货币', href: '/home/currency'},
|
|
|
{name: '我的红包', href: '/home/redenvelopes'},
|
|
|
{name: '我的优惠券', href: '/home/coupons'},
|
|
|
{name: '我的VIP', href: '/home/vip'}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
title: '服务中心',
|
|
|
subNav: [
|
|
|
{name: '我的退/换货', href: '/home/returns'},
|
|
|
{name: '我的咨询', href: '/home/consult'},
|
|
|
{name: '我的评论', href: '/home/comment'},
|
|
|
|
|
|
/* {name: '我的投诉', href: '/home/complaints'}, */
|
|
|
{name: '我的信息', href: '/home/message', count: 0},
|
|
|
{
|
|
|
name: '在线客服',
|
|
|
href: res.locals.customerServiceSwitch ?
|
|
|
'/service/client' : 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409',
|
|
|
isBlank: true
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
{
|
|
|
title: '个人信息管理',
|
|
|
subNav: [
|
|
|
{name: '编辑个人资料', href: '/home/user'},
|
|
|
{name: '账号安全', href: '/home/account'},
|
|
|
{name: '地址管理', href: '/home/address'},
|
|
|
{name: '兑换礼品卡', href: '/home/gift'}
|
|
|
]
|
|
|
}
|
|
|
];
|
|
|
}
|
|
|
|
|
|
const getActiveNav = (req, res)=>{
|
|
|
|
|
|
let mHomeNav = _.cloneDeep(homeNav(req, res));
|
|
|
|
|
|
return mHomeNav.map((item) => {
|
|
|
item.subNav = item.subNav.map((nav) => {
|
...
|
...
|
@@ -101,7 +108,7 @@ const getActiveNav = (req)=>{ |
|
|
|
|
|
const getHomeNav = (req, res, next) => {
|
|
|
res.locals.path = [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}, {name: '个人中心'}];
|
|
|
res.locals.homeNav = getActiveNav(req);
|
|
|
res.locals.homeNav = getActiveNav(req, res);
|
|
|
res.locals.userThumb = '//img10.static.yhbimg.com/headimg/' +
|
|
|
'2013/11/28/09/01cae078abe5fe320c88cdf4c220212688.gif?imageView/2/w/100/h/100';
|
|
|
next();
|
...
|
...
|
|