/**
 * $dom 插入menu的容器，例如 $('#navigation')
 * activeId 对应菜单中的id  例如 preTiedCard
 * isDrop 是否是下拉菜单 是-true  否-false
 * dropId 下拉菜单对应的id  例如 yirongtong
 *
 * 示例：generateMenu($('#navigation'),'preTiedCard',true,'yirongtong')
 *
 * html页面布局
 *<div id="mainBox">
 <!-- 顶部预留导航 -->
 <div id='topNav'>
 <div class="cont">Welcome to our grocery store! </div>
 </div>
 <div id="wrapper">
 <div id='navigation'>
 <!-- 侧边栏内容 -->
 </div>
 <div id="page-content-wrapper">
 <!-- 跟踪导航 -->
 <ol class="breadcrumb">
 <li><a href="#">Home</a></li>
 <li><a href="#">Library</a></li>
 <li class="active">Data</li>
 </ol>
 <!-- 主体内容 -->
 <div class="content">
 主内容
 </div>
 </div>
 </div>
 </div>
 */
function generateMenu($dom, activeId, isDrop, dropId) {
    let dom = `
    <div class="navbar navbar-inverse" id="sidebar-wrapper" role="navigation">
      <div class='topBox'>
<!--        <div class='title'>SDK</div>-->
        <div class='searchBox'>
        <div class="input-group">
          <input type="text" class="form-control" placeholder="Search for...">
          <span class="input-group-btn">
            <button class="btn btn-default" type="button">搜索</button>
          </span>
        </div>
        </div>
      </div>
      <ul class="nav sidebar-nav">
        <li id='home'>
          <a href="#">首页</a>
        </li>
        <li id='yirongtong' class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded='false'>
            易融通V2
            <span class="caret"></span>
          </a>
          <ul class="dropdown-menu" role="menu">
            <li id='userAccess'><a href="#">- 用户入网</a></li>
            <li id='userBalanceQuery'><a href="#">- 用户余额查询</a></li>
            <li id='preTiedCard'><a href="#">- 预绑卡</a></li>
            <li id='tiedCardConfirmation'><a href="#">- 绑卡确认</a></li>
            <li id='tiedCardQueries'><a href="#">- 绑卡查询</a></li>
          </ul>
        </li>
      </ul>
    </div>
  `
    $dom.html(dom)

    $('#' + activeId).addClass('active')
    if (isDrop) {
        $('#' + dropId).addClass('open active')
        $('#' + dropId + '>a').attr('aria-expanded', true)
    }
}
