header.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <header class="header">
  2. <div class="nav-box">
  3. <div class="l nav-logo">
  4. <a href="/"><img src="{__IMG__}/logo.png" height="60" alt="勾股CMS" /></a>
  5. </div>
  6. <div class="r navbar">
  7. <ul>
  8. {foreach name="COMMON_NAV" item="a"}
  9. {empty name="$a.list"}
  10. <li {if condition="strpos($a.param,$params.action) nheq false"}class="active"{/if}>
  11. <a href="{$a.src==''?'javascript:;':$a.src}" {eq name="a.target" value="1"} target="_blank"{/eq}>{$a.title}</a>
  12. </li>
  13. {else/}
  14. <li class="dropdown">
  15. <a href="{$a.src==''?'javascript:;':$a.src}" {eq name="a.target" value="1"} target="_blank"{/eq}>{$a.title}<i class="bi bi-chevron-down"></i></a>
  16. <ul>
  17. {foreach name="$a.list" item="b"}
  18. <li {notempty name="$b.list"} class="dropdown" {/notempty}>
  19. <a href="{$b.src==''?'javascript:;':$b.src}" {eq name="b.target" value="1"} target="_blank"{/eq}>{$b.title}{notempty name="$b.list"}<i class="bi bi-chevron-down"></i>{/notempty}</a>
  20. {notempty name="$b.list"}
  21. <ul>
  22. {foreach name="$b.list" item="c"}
  23. <li <li {notempty name="$c.list"} class="dropdown" {/notempty}>
  24. <a href="{$b.src==''?'javascript:;':$b.src}" {eq name="b.target" value="1"} target="_blank"{/eq}>{$b.title}{notempty name="$c.list"}<i class="bi bi-chevron-down"></i>{/notempty}</a>
  25. {notempty name="$c.list"}
  26. <ul>
  27. {foreach name="$c.list" item="d"}
  28. <li><a href="{$d.src==''?'javascript:;':$d.src}" {eq name="d.target" value="1"} target="_blank"{/eq}>{$d.title}</a></li>
  29. {/foreach}
  30. </ul>
  31. {/notempty}
  32. </li>
  33. {/foreach}
  34. </ul>
  35. {/notempty}
  36. </li>
  37. {/foreach}
  38. </ul>
  39. </li>
  40. {/empty}
  41. {/foreach}
  42. {empty name="$login_top"}
  43. <li><a class="login-btn scrollto" href="/home/login/index">登录</a></li>
  44. <li><a class="reg-btn scrollto" href="/home/login/reg">注册</a></li>
  45. {else/}
  46. <li class="nav-logined">
  47. {:htmlspecialchars_decode($login_top)}
  48. <div class="nav-login-box">
  49. <div class="login-menu">
  50. <a href="/home/user/index">个人中心</a>
  51. </div>
  52. <div class="login-menu-bottom clearfix">
  53. <a class="l" href="/home/user/index">个人设置</a>
  54. <a class="r" href="javascript:;" data-node="logout">退出</a>
  55. </div>
  56. </div>
  57. </li>
  58. {/empty}
  59. </ul>
  60. </div>
  61. </div>
  62. <script>
  63. $('[data-node="logout"]').on("click", function () {
  64. layer.confirm('确认注销登录吗?', { icon: 7, title: '警告' }, function (index) {
  65. $.ajax({
  66. url: '/home/login/login_out',
  67. success: function (res) {
  68. layer.msg(res.msg);
  69. if (res.code == 0) {
  70. setTimeout(function () {
  71. location.href = "{:url('/')}"
  72. }, 1000)
  73. }
  74. }
  75. })
  76. })
  77. })
  78. </script>
  79. </header>