index.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. || ($order == 1 && $oneMenu.title == "订单管理")
  53. || ($level_order == 1 && $oneMenu.title == "订单管理")
  54. || ($refund_order == 1 && $oneMenu.title == "订单管理")}
  55. <span class="nav-text padding-left-5" style="color: red;font-size: 50px;" id="{$oneMenu.title}">•</span>
  56. {/if}
  57. </a>
  58. </li>
  59. {/foreach}
  60. </ul>
  61. <ul class="layui-nav layui-layout-right">
  62. <li lay-unselect class="layui-nav-item"><a data-reload><i class="layui-icon layui-icon-refresh-3"></i></a></li>
  63. {notempty name='Think.session.user.username'}
  64. <li class="layui-nav-item">
  65. <dl class="layui-nav-child">
  66. <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>
  67. <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>
  68. {if auth('admin/index/clearruntime')}
  69. <dd lay-unselect><a data-modal="{:url('admin/index/clearRuntime')}"><i class="layui-icon layui-icon-fonts-clear margin-right-5"></i>清理缓存</a></dd>
  70. {/if}
  71. {notempty name='GLOBALS.AdminUserRightOption'}{foreach $GLOBALS.AdminUserRightOption as $option}{if auth($option.node)}
  72. <dd lay-unselect><a data-{$option.type}="{$option.action}"><i class="{$option.icon} margin-right-5"></i>{$option.title}</a></dd>
  73. {/if}{/foreach}{/notempty}
  74. <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>
  75. </dl>
  76. <a><span><i class="layui-icon layui-icon-username margin-right-5"></i> {:session('user.username')}</span></a>
  77. </li>
  78. {else}
  79. <li class="layui-nav-item">
  80. <a data-href="{:url('@admin/login')}"><i class="layui-icon layui-icon-username"></i> 立即登录</a>
  81. </li>
  82. {/notempty}
  83. </ul>
  84. </div>
  85. <!-- 顶部菜单 结束 -->
  86. <!-- 左则菜单 开始 -->
  87. <div class="layui-side layui-bg-black notselect">
  88. <div class="layui-side-scroll">
  89. {foreach $menus as $oneMenu}
  90. {notempty name='oneMenu.sub'}
  91. <ul class="layui-nav layui-nav-tree layui-hide" data-menu-layout="m-{$oneMenu.id}">
  92. {foreach $oneMenu.sub as $twoMenu}
  93. {empty name='twoMenu.sub'}
  94. {if ($twoMenu.url == "/order/store_order/index.html" && $order == 1)
  95. || ($twoMenu.url == "/order/level_order/index.html" && $level_order == 1)
  96. || ($twoMenu.url == "/order/refund_order/index.html" && $refund_order == 1)}
  97. <li class="layui-nav-item" onclick="myFunction('{$twoMenu.url}','{$oneMenu.title}')">
  98. {else}
  99. <li class="layui-nav-item">
  100. {/if}
  101. <a style="display: flex" data-target-tips="{$twoMenu.title}" data-menu-node="m-{$oneMenu.id}-{$twoMenu.id}" data-open="{$twoMenu.url}">
  102. <span class='{$twoMenu.icon|default="layui-icon layui-icon-link"}'></span>
  103. <span class="nav-text padding-left-5">{$twoMenu.title}</span>
  104. {if ($twoMenu.url == "/order/store_order/index.html" && $order == 1)
  105. || ($twoMenu.url == "/order/level_order/index.html" && $level_order == 1)
  106. || ($twoMenu.url == "/order/refund_order/index.html" && $refund_order == 1)}
  107. <span class="nav-text padding-left-5" style="color: red;font-size: 50px;" id="{$twoMenu.url}">•</span>
  108. {/if}
  109. </a>
  110. </li>
  111. {else}
  112. <li class="layui-nav-item" data-submenu-layout='m-{$oneMenu.id}-{$twoMenu.id}'>
  113. <a data-target-tips="{$twoMenu.title}" style="background:#393D49">
  114. <span class='nav-icon layui-hide {$twoMenu.icon|default="layui-icon layui-icon-triangle-d"}'></span>
  115. <span class="nav-text padding-left-5">{$twoMenu.title}</span>
  116. </a>
  117. <dl class="layui-nav-child">
  118. {foreach $twoMenu.sub as $thrMenu}
  119. {if ($thrMenu.url == "/operate/forum/index.html" && $forum == 1)
  120. || ($thrMenu.url == "/nutrition/user_datum/index.html" && $datum == 1)
  121. || ($thrMenu.url == "/nutrition/user_article/index.html" && $article == 1)
  122. || ($thrMenu.url == "/nutrition/user_video/index.html" && $video == 1)
  123. || ($thrMenu.url == "/order/store_order/index.html" && $order == 1)
  124. || ($thrMenu.url == "/order/level_order/index.html" && $level_order == 1)
  125. || ($thrMenu.url == "/order/refund_order/index.html" && $refund_order == 1)}
  126. <dd onclick="myFunction('{$thrMenu.url}','{$oneMenu.title}')">
  127. {else}
  128. <dd>
  129. {/if}
  130. <a style="display: flex" data-target-tips="{$thrMenu.title}" data-open="{$thrMenu.url}" data-menu-node="m-{$oneMenu.id}-{$twoMenu.id}-{$thrMenu.id}">
  131. <span class='nav-icon padding-left-5 {$thrMenu.icon|default="layui-icon layui-icon-link"}'></span>
  132. <span class="nav-text padding-left-5">{$thrMenu.title}</span>
  133. {if ($thrMenu.url == "/operate/forum/index.html" && $forum == 1)
  134. || ($thrMenu.url == "/nutrition/user_datum/index.html" && $datum == 1)
  135. || ($thrMenu.url == "/nutrition/user_article/index.html" && $article == 1)
  136. || ($thrMenu.url == "/nutrition/user_video/index.html" && $video == 1)
  137. || ($thrMenu.url == "/order/store_order/index.html" && $order == 1)
  138. || ($thrMenu.url == "/order/level_order/index.html" && $level_order == 1)
  139. || ($thrMenu.url == "/order/refund_order/index.html" && $refund_order == 1)}
  140. <span class="nav-text padding-left-5" style="color: red;font-size: 50px;display: block" id="{$thrMenu.url}">•</span>
  141. {/if}
  142. </a>
  143. </dd>
  144. {/foreach}
  145. </dl>
  146. </li>
  147. {/empty}
  148. {/foreach}
  149. </ul>
  150. {/notempty}
  151. {/foreach}
  152. </div>
  153. </div>
  154. <!-- 左则菜单 结束 -->
  155. <!-- 主体内容 开始 -->
  156. <div class="layui-body layui-bg-gray">{block name='content'}{/block}</div>
  157. <!-- 主体内容 结束 -->
  158. </div>
  159. {/block}
  160. <script src="__ROOT__/static/xm-select.js"></script>
  161. <script src="__ROOT__/static/plugs/layui/layui.all.js"></script>
  162. <script src="__ROOT__/static/plugs/require/require.js"></script>
  163. <script src="__ROOT__/static/admin.js"></script>
  164. <script>
  165. function myFunction(url,menu) {
  166. console.log(url);
  167. console.log(menu);
  168. var button = document.getElementById(url); // 获取按钮元素
  169. button.style.display = 'none';
  170. console.log(button.style.display)
  171. var datum = document.getElementById('/nutrition/user_datum/index.html');
  172. var article = document.getElementById('/nutrition/user_article/index.html');
  173. var video = document.getElementById('/nutrition/user_video/index.html');
  174. var forum = document.getElementById('/operate/forum/index.html');
  175. var order = document.getElementById('/order/store_order/index.html');
  176. var level_order = document.getElementById('/order/level_order/index.html');
  177. var refund_order = document.getElementById('/order/refund_order/index.html');
  178. if(datum == null){
  179. var datum = 0;
  180. }else if(datum.style.display === 'none'){
  181. var datum = 0;
  182. }
  183. if(article == null){
  184. var article = 0;
  185. }else if(article.style.display === 'none'){
  186. var article = 0;
  187. }
  188. if(video == null){
  189. var video = 0;
  190. }else if(video.style.display === 'none'){
  191. var video = 0;
  192. }
  193. if(forum == null){
  194. var forum = 0;
  195. }else if(forum.style.display === 'none'){
  196. var forum = 0;
  197. }
  198. if(order == null){
  199. var order = 0;
  200. }else if(order.style.display === 'none'){
  201. var order = 0;
  202. }
  203. if(level_order == null){
  204. var level_order = 0;
  205. }else if(level_order.style.display === 'none'){
  206. var level_order = 0;
  207. }
  208. if(refund_order == null){
  209. var refund_order = 0;
  210. }else if(refund_order.style.display === 'none'){
  211. var refund_order = 0;
  212. }
  213. // console.log(datum);
  214. if(menu === "媒体管理" && datum === 0 && article === 0 && video === 0 ){
  215. var menu_b = document.getElementById(menu); // 获取按钮元素
  216. menu_b.style.display = 'none';
  217. }
  218. if(menu === "运营中心" && forum === 0){
  219. var menu_b = document.getElementById(menu); // 获取按钮元素
  220. menu_b.style.display = 'none';
  221. }
  222. if(menu === "订单管理" && order === 0 && level_order === 0 && refund_order == 0){
  223. var menu_b = document.getElementById(menu); // 获取按钮元素
  224. menu_b.style.display = 'none';
  225. }
  226. }
  227. </script>
  228. {block name='script'}{/block}
  229. </body>
  230. </html>