index.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. {extend name="layout/base" /}
  2. {block name="detail_css"}
  3. <style>
  4. .left-nav {
  5. padding-top: 0;
  6. position: fixed;
  7. top: 0;
  8. left: 0;
  9. bottom: 0;
  10. z-index: 999;
  11. width: 221px;
  12. overflow-x: hidden;
  13. }
  14. .layui-nav-tree {
  15. width: 100%;
  16. padding: 0;
  17. }
  18. .layui-tab-content .layui-nav .sub-menu a {
  19. color: rgba(255, 255, 255, .7);
  20. }
  21. /* 切换tab时的效果1 */
  22. .layui-tab-title .layui-this {
  23. color: #000;
  24. }
  25. .page-content {
  26. position: absolute;
  27. top: 46px;
  28. right: 0px;
  29. bottom: 42px;
  30. left: 221px;
  31. z-index: 1;
  32. overflow: hidden;
  33. }
  34. .layui-tab-title li:hover {
  35. background: #ddd;
  36. }
  37. /* 二级菜单hover效果 */
  38. .sub-menu dd:hover:not(.active) {
  39. background: #009688;
  40. color: white;
  41. }
  42. .sub-menu dd:hover:not(.active) a {
  43. color: white;
  44. }
  45. /* 二级菜单点击后的高亮效果 */
  46. .sub-menu dd.active {
  47. background: #1E9FFF !important;
  48. color: white !important;
  49. }
  50. .sub-menu dd.active a {
  51. background: #1E9FFF !important;
  52. color: white !important;
  53. }
  54. .sub-menu dd.active:hover {
  55. background: #1E9FFF !important;
  56. color: white !important;
  57. }
  58. .sub-menu dd.active:hover a {
  59. background: #1E9FFF !important;
  60. color: white !important;
  61. }
  62. .footer {
  63. color: black;
  64. text-align: center;
  65. background: #ffffff;
  66. }
  67. /*悬浮球*/
  68. .floating_ball_wrap {
  69. position: fixed;
  70. right: 10px;
  71. top: 230px;
  72. opacity: 0.7;
  73. z-index: 999999999;
  74. }
  75. .floating_ball_wrap #floating_ball {
  76. display: inline-block;
  77. width: 50px;
  78. height: 50px;
  79. background: green;
  80. border-radius: 50%;
  81. text-align: center;
  82. line-height: 50px;
  83. text-decoration: none;
  84. color: white;
  85. }
  86. .floating_ball_wrap #content_wrap {
  87. width: 250px;
  88. height: 250px;
  89. overflow: auto;
  90. text-align: center;
  91. background-color: #ddd;
  92. position: fixed;
  93. right: 80px;
  94. top: 160px;
  95. }
  96. .floating_ball_wrap .title {
  97. background: #2f4050;
  98. color: white;
  99. margin: 0;
  100. padding: 10px;
  101. display: flex;
  102. justify-content: space-between;
  103. }
  104. .floating_ball_wrap .title span {
  105. font-size: 14px;
  106. }
  107. .floating_ball_wrap .title span:nth-of-type(2) {
  108. font-size: 12px;
  109. }
  110. .floating_ball_wrap .content section {
  111. margin: 10px;
  112. background: #f3f3f4;
  113. word-wrap: break-word;
  114. word-break: normal;
  115. }
  116. .red_dot {
  117. display: inline-block;
  118. width: 5px;
  119. height: 5px;
  120. background: red;
  121. border-radius: 50%;
  122. position: absolute;
  123. top: 10px;
  124. right: 10px;
  125. }
  126. .show-grand-money-apply-list{
  127. background-color:#009688;
  128. color:white;
  129. }
  130. /* 隐藏小箭头 */
  131. .layui-nav-tree .layui-nav-more {
  132. top: 20px;
  133. right: 10px;
  134. display: none !important;
  135. }
  136. .layui-nav .layui-nav-mored {
  137. top: 14px;
  138. }
  139. .iconfont.nav_right{
  140. position:absolute;
  141. top: 0px;
  142. right: 10px;
  143. }
  144. .layui-tab {
  145. margin: 0;
  146. text-align: left!important;
  147. }
  148. .sub-menu{
  149. display: none;
  150. }
  151. /* 原有的active样式,现在由更具体的.sub-menu dd.active替代 */
  152. /* .active a {
  153. background: #009688;
  154. color: white;
  155. } */
  156. .layui-nav-tree .layui-nav-child dd.layui-this, .layui-nav-tree .layui-nav-child dd.layui-this a, .layui-nav-tree .layui-this, .layui-nav-tree .layui-this>a, .layui-nav-tree .layui-this>a:hover {
  157. background-color: #393D49;
  158. color: #fff;
  159. }
  160. .close-msg{
  161. float:right;
  162. margin-right:5px;
  163. }
  164. .close-msg:hover{
  165. cursor: pointer;
  166. }
  167. .show-grand-money-apply-list:hover{
  168. cursor: pointer;
  169. }
  170. </style>
  171. {/block}
  172. {block name="content"}
  173. <!-- 顶部开始 -->
  174. <div class="container">
  175. <div class="logo">
  176. <a href="javascript:;">{:getEnvs('brand_name')}</a>
  177. </div>
  178. <div class="left_open">
  179. <i title="展开左侧栏" class="iconfont">&#xe699;</i>
  180. </div>
  181. <ul class="layui-nav right" lay-filter="">
  182. <li class="layui-nav-item to-index">
  183. <a href="{:url('SdkCache/clearRedisCache')}">清除缓存</a>
  184. </li>
  185. <li class="layui-nav-item">
  186. <a href="javascript:;">{php}echo session('USERNAME');{/php}</a>
  187. <dl class="layui-nav-child">
  188. <!-- 二级菜单 -->
  189. <dd>
  190. <a href="{:url('user/modifyPassword')}">修改密码</a>
  191. </dd>
  192. <dd>
  193. <a href="{:url('login/logout')}">退出</a>
  194. </dd>
  195. </dl>
  196. </li>
  197. <li class="layui-nav-item to-index">
  198. <a href="/">首页</a>
  199. </li>
  200. </ul>
  201. </div>
  202. <!-- 顶部结束 -->
  203. <!-- 中部开始 -->
  204. <!-- 左侧菜单开始 -->
  205. {php}$submenus=$menus;
  206. function getsubmenu($submenus){
  207. {/php}
  208. {notempty name="submenus"}
  209. {php}foreach($submenus as $menu){{/php}
  210. <dd class="layui-nav-item tab{$menu.tab_type}">
  211. {php} $menu_name=$menu['name']; {/php}
  212. {php} if(empty($menu['items'])){ {/php}
  213. <a _href="{$menu.url}">
  214. <i class="fa fa-{$menu.icon|default='desktop'}"></i>
  215. <cite class="parent_nemu">{$menu_name}</cite>
  216. </a>
  217. {php}} else {{/php}
  218. <a href="javascript:;">
  219. <i class="fa fa-{$menu.icon|default='desktop'} normal"></i>
  220. <cite class="parent_nemu">{$menu_name}</cite>
  221. <!-- <cite>1111</cite> -->
  222. <i class="iconfont nav_right">&#xe697;</i>
  223. </a>
  224. {php} getsubmenu1($menu['items']); {/php} {php} } {/php}
  225. </dd>
  226. {php} } {/php} {/notempty} {php} } {/php}
  227. {php}function getsubmenu1($submenus){{/php}
  228. <dl class="sub-menu">
  229. {php}foreach($submenus as $menu){{/php}
  230. {php} $menu_name=$menu['name']; {/php} {php}if(empty($menu['items'])){{/php}
  231. <dd>
  232. <a _href="{$menu.url}">
  233. <i class="fa fa-caret-right"></i>
  234. <cite>{$menu_name}</cite>
  235. </a>
  236. </dd>
  237. {php}}else{{/php}
  238. <dd>
  239. <a href="javascript:;">
  240. <i class="fa fa-caret-right"></i>
  241. <cite>{$menu_name}</cite>
  242. <b class="arrow fa fa-angle-right"></b>
  243. </a>
  244. </dd>
  245. {php}getsubmenu2($menu['items']); {/php} {php}}{/php}
  246. {php}}{/php}
  247. </dl>
  248. {php}}{/php}
  249. {php}
  250. function getsubmenu2($submenus)
  251. {
  252. foreach($submenus as $menu){
  253. {/php}
  254. <dd>
  255. {php} $menu_name=$menu['name']; {/php}
  256. <a _href="{$menu.url}">
  257. <!--&nbsp;<i class="fa fa-angle-double-right"></i>-->
  258. <cite>{$menu_name}</cite>
  259. </a>
  260. </dd>
  261. {php}
  262. }
  263. }
  264. {/php}
  265. <div class="layui-tab layui-tab-brief">
  266. <ul class="layui-tab-title" id="tabChoose">
  267. <li class="layui-this">SDK管理后台</li>
  268. <li>运营平台及官网后台</li>
  269. <li>系统管理</li>
  270. </ul>
  271. <div class="layui-tab-content">
  272. <div class="layui-tab-item layui-show" id="tab1-container">
  273. <div class="left-nav layui-bg-black" style="top:87px;">
  274. <div id="side-nav">
  275. <dl class="layui-nav layui-nav-tree layui-inline" id="nav2">
  276. {:getsubmenu($submenus)}
  277. </dl>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. <div class="page-content" style="top:87px;">
  283. <div class="layui-tab tab" lay-filter="xbs_tab" lay-allowclose="false">
  284. <ul class="layui-tab-title">
  285. <li>{if condition="$wk_isShow eq true"}工作台{else/}我的桌面{/if}</li>
  286. </ul>
  287. <div class="layui-tab-content">
  288. <div class="layui-tab-item layui-show">
  289. <iframe src="{if condition="$wk_isShow eq true"}{:url('workstation/index')}{else/}""{/if}" frameborder="0" scrolling="yes" class="x-iframe"></iframe>
  290. </div>
  291. </div>
  292. </div>
  293. </div>
  294. </div>
  295. <!-- 悬浮球 -->
  296. <main class="floating_ball_wrap">
  297. <a href="#" id="floating_ball">
  298. <i class="fa fa-wechat"></i>
  299. </a>
  300. <span class="" id="isRead"></span>
  301. <section id="content_wrap" style="display:none">
  302. <div class="title">
  303. <span>请查看您的消息</span>
  304. <span>消息框</span>
  305. </div>
  306. <div class="content">
  307. </div>
  308. </section>
  309. </main>
  310. <template id="message-template">
  311. <div class="left">
  312. <div class="author-name">
  313. __NAME__
  314. <small class="chat-date">
  315. __DATE__
  316. </small>
  317. <!-- <i class="fa fa-remove"></i> -->
  318. </div>
  319. <div class="chat-message active">
  320. __CONTENT__
  321. </div>
  322. </div>
  323. </template>
  324. <div class="page-content-bg"></div>
  325. <div class="layui-footer">
  326. <div class="footer">推荐使用chrome浏览器</div>
  327. </div>
  328. {/block}
  329. {block name="detail_js"}
  330. <script type="text/javascript" src="__STATIC__/js/link_to_wsocket.js?v={$Think.STATIC_VERSION}"></script>
  331. <script type="text/javascript">
  332. var WEB_SOCKET_URL = "{$Think.config.WEBSOCKET_WS_ADDR}";
  333. var WEB_SOCKET_TOKEN = "{:session_id()}";
  334. // console.log("# WEB_SOCKET_URL: ", WEB_SOCKET_URL, " - WEB_SOCKET_TOKEN: ", WEB_SOCKET_TOKEN);
  335. var isNewMesg = 0;
  336. var ERR_CONNECTION_TIMED_OUT_CODE = 1006;
  337. var BusinessActions = {};
  338. var wk_isShow = "{$wk_isShow}"
  339. function loadWsBusiness() {
  340. //通过 AJAX 请求来获得并运行一个 JavaScript 文件
  341. $.getScript(" __STATIC__/js/wsbusiness.js?v={$Think.STATIC_VERSION}");
  342. }
  343. if (!wk_isShow) {
  344. layui.use(['form', 'element'], function () {
  345. layer = layui.layer;
  346. element = layui.element;
  347. //默认打开游戏管理
  348. $('.left-nav #side-nav dd.layui-nav-item').each(function (index, item) {
  349. $(item).children("dl").children("dd").each(function (i, e) {
  350. if ($(e).children().find("cite").text() == "游戏分包") {
  351. $(e).parent().css("display", "block");
  352. $(e).parents().find('.nav_right').html('&#xe6a6;');
  353. $(e).parents(".layui-nav-item").addClass("layui-this");
  354. $(e).parents(".layui-nav-item").addClass("open");
  355. e.click();
  356. }
  357. });
  358. });
  359. });
  360. }
  361. $(function () {
  362. loadWsBusiness();
  363. $(".sub-menu dd a").addClass("refreshThis");
  364. $(".sub-menu dd").on("click", function () {
  365. var url = $(this).children('a').attr('_href');
  366. var index = $('.sub-menu dd').index($(this));
  367. if ($(this).children('a').hasClass("refreshThis")) {
  368. // 移除所有其他菜单项的active状态
  369. $('.sub-menu dd').removeClass('active');
  370. // 为当前点击的菜单项添加active状态
  371. $(this).addClass('active');
  372. // 调试输出
  373. $(this).children('a').removeClass("refreshThis");
  374. for (var i = 0; i < $('.x-iframe').length; i++) {
  375. if ($('.x-iframe').eq(i).attr('tab-id') == index + 1) {
  376. $('.x-iframe').eq(i)[0].contentWindow.location = url;
  377. }
  378. };
  379. setTimeout(function () {
  380. $(".sub-menu dd a").addClass("refreshThis");
  381. }, 300)
  382. } else {
  383. layer.msg("慢点!");
  384. }
  385. });
  386. // 悬浮球
  387. var olink = document.getElementById("floating_ball");
  388. var odiv = document.getElementById("content_wrap");
  389. var p_content = document.getElementsByClassName("content")[0];
  390. olink.onclick = function () {
  391. Show_Hidden(odiv);
  392. return false;
  393. }
  394. });
  395. var $dd = $("#nav2>dd");
  396. for (var i = 0; i < $dd.length; i++) {
  397. $dd[i].style.display = "none"
  398. }
  399. $dd.each(function (index, item) {
  400. if ($(item).hasClass("tab1")) {
  401. item.style.display = "block"
  402. }
  403. })
  404. $("#tabChoose").on("click", "li", function () {
  405. var i = $(this).index() + 1;
  406. for (var j = 0; j < $dd.length; j++) {
  407. $dd[j].style.display = "none";
  408. }
  409. $dd.each(function (index, item) {
  410. if ($(item).hasClass("tab" + i)) {
  411. item.style.display = "block";
  412. }
  413. })
  414. });
  415. function Show_Hidden(obj) {
  416. if (obj.style.display == "block") {
  417. obj.style.display = 'none';
  418. } else {
  419. obj.style.display = 'block';
  420. }
  421. }
  422. function toggleBtn(el, classA, classB, type) {
  423. $(el).click(function () {
  424. var isRead = document.getElementById("isRead");
  425. if (isRead.className == "red_dot") {
  426. $(isRead).removeClass("red_dot");
  427. isNewMesg == 0;
  428. }
  429. var that = $(this);
  430. if (type == "class") {
  431. if (that.children().hasClass(classA)) {
  432. that.children().removeClass(classA).addClass(classB);
  433. } else {
  434. that.children().removeClass(classB).addClass(classA);
  435. }
  436. }
  437. })
  438. }
  439. toggleBtn('#floating_ball', 'fa fa-close', 'fa fa-wechat', 'class');
  440. //推送点击打叉关闭
  441. $(".floating_ball_wrap #content_wrap .content").on("click","small.close-msg",function () {
  442. $(this).parent().parent().parent().remove();
  443. })
  444. </script>
  445. {/block}