header.js
930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
* router of sub app guang
* @author: biao<bill.zhao@yoho.cn>
* @date: 2016/05/12
*/
'use strict';
const _ = require('lodash');
// const getChannle = () => ('kids');
/**
* 设置头部
* @param {String} title 标题
* @param {Boolen} channel 频道
* @param {Boolen} backUrl 返回的url
* @param {Boolen} navBtn 是否显示导航
* @param {Boolen} navBack 是否显示返回箭头
*/
exports.setNavHeader = (title, channel, navBack, backUrl, navBtn) => {
let header = {
navTitle: title,
backUrl: backUrl,
navBack: navBack,
navBtn: navBtn
};
header[channel] = true;
return _.merge({
navTitle: '',
backUrl: true,
navBack: '',
navBtn: {
indexUrl: '/?go=1',
categoryUrl: '/cate',
shoppingCartUrl: '/cart/index/index',
mineUrl: '/home'
},
boys: true
}, header);
};