index.html 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <title>{block name="title"}{$title|default=''}{if !empty($title)} · {/if}{:sysconf('site_name')}{/block}</title>
  5. <meta charset="utf-8">
  6. <meta name="renderer" content="webkit">
  7. <meta name="format-detection" content="telephone=no">
  8. <meta name="apple-mobile-web-app-capable" content="yes">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  11. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=0.4">
  12. <link rel="shortcut icon" href="{:sysconf('site_icon')}">
  13. <link rel="stylesheet" href="__ROOT__/static/plugs/awesome/fonts.css?at={:date('md')}">
  14. <link rel="stylesheet" href="__ROOT__/static/plugs/layui/css/layui.css?at={:date('md')}">
  15. <link rel="stylesheet" href="__ROOT__/static/theme/css/console.css?at={:date('md')}">
  16. {block name="style"}{/block}
  17. <script>window.ROOT_URL = '__ROOT__';</script>
  18. <script src="__ROOT__/static/plugs/jquery/pace.min.js"></script>
  19. <style>
  20. .layui-header .layui-layout-right li a{
  21. padding-right: 35px;
  22. }
  23. .tangram-suggestion-main{
  24. z-index: 999;
  25. }
  26. </style>
  27. <script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=E4Y9cdBjAvDM6DjGcOmBA4v2GcEXAWvG"></script>
  28. </head>
  29. <body class="layui-layout-body">
  30. {block name='body'}
  31. <div class="layui-layout layui-layout-admin layui-layout-left-hide">
  32. <!-- 顶部菜单 开始 -->
  33. <div class="layui-header notselect">
  34. <a href="{:url('@')}" class="layui-logo layui-elip">
  35. {:sysconf('app_name')} {if sysconf('app_version')}<sup class="padding-left-5">{:sysconf('app_version')}</sup>{/if}
  36. </a>
  37. <ul class="layui-nav layui-layout-left">
  38. <li class="layui-nav-item" lay-unselect>
  39. <a class="text-center" data-target-menu-type>
  40. <i class="layui-icon layui-icon-spread-left"></i>
  41. </a>
  42. </li>
  43. {foreach $menus as $oneMenu}
  44. <li class="layui-nav-item">
  45. <a style="display: flex" data-menu-node="m-{$oneMenu.id}" data-open="{$oneMenu.url}">
  46. {notempty name='oneMenu.icon'}<span class='{$oneMenu.icon} padding-right-5'></span>{/notempty}
  47. <span>{$oneMenu.title|default=''}</span>
  48. {if ($forum == 1 && $oneMenu.title == "运营中心")
  49. || ($datum == 1 && $oneMenu.title == "媒体管理")
  50. || ($article == 1 && $oneMenu.title == "媒体管理")
  51. || ($video == 1 && $oneMenu.title == "媒体管理")}
  52. <span class="nav-text padding-left-5" style="color: red;font-size: 50px;" id="{$oneMenu.title}">•</span>
  53. {/if}
  54. </a>
  55. </li>
  56. {/foreach}
  57. </ul>
  58. <ul class="layui-nav layui-layout-right">
  59. <li lay-unselect class="layui-nav-item"><a data-reload><i class="layui-icon layui-icon-refresh-3"></i></a></li>
  60. {notempty name='Think.session.user.username'}
  61. <li class="layui-nav-item">
  62. <dl class="layui-nav-child">
  63. <dd lay-unselect><a data-modal="{:url('admin/index/info',['id'=>session('user.id')])}"><i class="layui-icon layui-icon-set-fill margin-right-5"></i>基本资料</a></dd>
  64. <dd lay-unselect><a data-modal="{:url('admin/index/pass',['id'=>session('user.id')])}"><i class="layui-icon layui-icon-component margin-right-5"></i>安全设置</a></dd>
  65. {if auth('admin/index/clearruntime')}
  66. <dd lay-unselect><a data-modal="{:url('admin/index/clearRuntime')}"><i class="layui-icon layui-icon-fonts-clear margin-right-5"></i>清理缓存</a></dd>
  67. {/if}
  68. {notempty name='GLOBALS.AdminUserRightOption'}{foreach $GLOBALS.AdminUserRightOption as $option}{if auth($option.node)}
  69. <dd lay-unselect><a data-{$option.type}="{$option.action}"><i class="{$option.icon} margin-right-5"></i>{$option.title}</a></dd>
  70. {/if}{/foreach}{/notempty}
  71. <dd lay-unselect><a data-confirm="确定要退出登录吗?" data-load="{:url('admin/login/out')}"><i class="layui-icon layui-icon-release margin-right-5"></i>退出登录</a></dd>
  72. </dl>
  73. <a><span><i class="layui-icon layui-icon-username margin-right-5"></i> {:session('user.username')}</span></a>
  74. </li>
  75. {else}
  76. <li class="layui-nav-item">
  77. <a data-href="{:url('@admin/login')}"><i class="layui-icon layui-icon-username"></i> 立即登录</a>
  78. </li>
  79. {/notempty}
  80. </ul>
  81. </div>
  82. <!-- 顶部菜单 结束 -->
  83. <!-- 左则菜单 开始 -->
  84. <div class="layui-side layui-bg-black notselect">
  85. <div class="layui-side-scroll">
  86. {foreach $menus as $oneMenu}
  87. {notempty name='oneMenu.sub'}
  88. <ul class="layui-nav layui-nav-tree layui-hide" data-menu-layout="m-{$oneMenu.id}">
  89. {foreach $oneMenu.sub as $twoMenu}
  90. {empty name='twoMenu.sub'}
  91. <li class="layui-nav-item">
  92. <a data-target-tips="{$twoMenu.title}" data-menu-node="m-{$oneMenu.id}-{$twoMenu.id}" data-open="{$twoMenu.url}">
  93. <span class='{$twoMenu.icon|default="layui-icon layui-icon-link"}'></span>
  94. <span class="nav-text padding-left-5">{$twoMenu.title}</span>
  95. </a>
  96. </li>
  97. {else}
  98. <li class="layui-nav-item" data-submenu-layout='m-{$oneMenu.id}-{$twoMenu.id}'>
  99. <a data-target-tips="{$twoMenu.title}" style="background:#393D49">
  100. <span class='nav-icon layui-hide {$twoMenu.icon|default="layui-icon layui-icon-triangle-d"}'></span>
  101. <span class="nav-text padding-left-5">{$twoMenu.title}</span>
  102. </a>
  103. <dl class="layui-nav-child">
  104. {foreach $twoMenu.sub as $thrMenu}
  105. {if ($thrMenu.url == "/operate/forum/index.html" && $forum == 1)
  106. || ($thrMenu.url == "/nutrition/user_datum/index.html" && $datum == 1)
  107. || ($thrMenu.url == "/nutrition/user_article/index.html" && $article == 1)
  108. || ($thrMenu.url == "/nutrition/user_video/index.html" && $video == 1)}
  109. <dd onclick="myFunction('{$thrMenu.url}','{$oneMenu.title}')">
  110. {else}
  111. <dd>
  112. {/if}
  113. <a style="display: flex" data-target-tips="{$thrMenu.title}" data-open="{$thrMenu.url}" data-menu-node="m-{$oneMenu.id}-{$twoMenu.id}-{$thrMenu.id}">
  114. <span class='nav-icon padding-left-5 {$thrMenu.icon|default="layui-icon layui-icon-link"}'></span>
  115. <span class="nav-text padding-left-5">{$thrMenu.title}</span>
  116. {if ($thrMenu.url == "/operate/forum/index.html" && $forum == 1)
  117. || ($thrMenu.url == "/nutrition/user_datum/index.html" && $datum == 1)
  118. || ($thrMenu.url == "/nutrition/user_article/index.html" && $article == 1)
  119. || ($thrMenu.url == "/nutrition/user_video/index.html" && $video == 1)}
  120. <span class="nav-text padding-left-5" style="color: red;font-size: 50px;display: block" id="{$thrMenu.url}">•</span>
  121. {/if}
  122. </a>
  123. </dd>
  124. {/foreach}
  125. </dl>
  126. </li>
  127. {/empty}
  128. {/foreach}
  129. </ul>
  130. {/notempty}
  131. {/foreach}
  132. </div>
  133. </div>
  134. <!-- 左则菜单 结束 -->
  135. <!-- 主体内容 开始 -->
  136. <div class="layui-body layui-bg-gray">{block name='content'}{/block}</div>
  137. <!-- 主体内容 结束 -->
  138. </div>
  139. {/block}
  140. <script src="__ROOT__/static/xm-select.js"></script>
  141. <script src="__ROOT__/static/plugs/layui/layui.all.js"></script>
  142. <script src="__ROOT__/static/plugs/require/require.js"></script>
  143. <script src="__ROOT__/static/admin.js"></script>
  144. <script>
  145. function myFunction(url,menu) {
  146. console.log(url);
  147. console.log(menu);
  148. var button = document.getElementById(url); // 获取按钮元素
  149. button.style.display = 'none';
  150. console.log(button.style.display)
  151. var datum = document.getElementById('/nutrition/user_datum/index.html');
  152. var article = document.getElementById('/nutrition/user_article/index.html');
  153. var video = document.getElementById('/nutrition/user_video/index.html');
  154. var forum = document.getElementById('/operate/forum/index.html');
  155. if(datum == null){
  156. var datum = 0;
  157. }else if(datum.style.display === 'none'){
  158. var datum = 0;
  159. }
  160. if(article == null){
  161. var article = 0;
  162. }else if(article.style.display === 'none'){
  163. var article = 0;
  164. }
  165. if(video == null){
  166. var video = 0;
  167. }else if(video.style.display === 'none'){
  168. var video = 0;
  169. }
  170. if(forum == null){
  171. var forum = 0;
  172. }else if(forum.style.display === 'none'){
  173. var forum = 0;
  174. }
  175. // console.log(datum);
  176. if(menu === "媒体管理" && datum === 0 && article === 0 && video === 0 ){
  177. var menu_b = document.getElementById(menu); // 获取按钮元素
  178. menu_b.style.display = 'none';
  179. }
  180. if(menu === "运营中心" && forum === 0){
  181. var menu_b = document.getElementById(menu); // 获取按钮元素
  182. menu_b.style.display = 'none';
  183. }
  184. }
  185. </script>
  186. {block name='script'}{/block}
  187. </body>
  188. </html>