header.js 738 Bytes
/**
 * 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} backUrl 返回的url
 * @param {Boolen} navBtn 是否显示导航
 * @param {Boolen} navBack 是否显示返回箭头
 */
exports.setNavHeader = (title, navBack, backUrl, navBtn) => {
    let header = {
        navTitle: title,
        backUrl: backUrl,
        navBack: navBack,
        navBtn: navBtn
    };

    header[getChannle()] = true;

    return _.merge({
        navTitle: '',
        backUrl: true,
        navBack: '',
        navBtn: true,
        boys: true
    }, header);
};