indexs.html 12 KB

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