new_index.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname_name; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  12. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  13. <link href="/static/css/snailfish.css?v=2.0.0" rel="stylesheet">
  14. <style>
  15. .wb-nav .snailfishicon{
  16. position: absolute;
  17. left: 20px;
  18. top: 50%;
  19. margin-top: -10px;
  20. }
  21. </style>
  22. </head>
  23. <body class="layui-layout-body">
  24. <div id="LAY_app">
  25. <div class="layui-layout layui-layout-admin">
  26. <!--头部区域begin-->
  27. <div class="layui-header">
  28. <ul class="layui-nav layui-layout-left">
  29. <li class="layui-nav-item layadmin-flexible" lay-unselect="">
  30. <a href="javascript:;" layadmin-event="flexible" title="侧边伸缩" id="href_flexible">
  31. <i class="layui-icon layui-icon-shrink-right" id="LAY_app_flexible"></i>
  32. </a>
  33. </li>
  34. <li class="layui-nav-item" lay-unselect="">
  35. <a href="javascript:;" layadmin-event="refresh" title="刷新">
  36. <i class="layui-icon layui-icon-refresh-3"></i>
  37. </a>
  38. </li>
  39. <span class="layui-nav-bar" style="left: 30px; top: 48px; width: 0px; opacity: 0;"></span>
  40. </ul>
  41. <?php
  42. $version_info = M('lionfish_comshop_config')->where( array('name' => 'site_version') )->find();
  43. $version = $version_info['value'];
  44. ?>
  45. <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
  46. <li id="neworder" style="display:none;" class="layui-nav-item layui-hide-xs" lay-unselect>
  47. <a href="javascript:void(0)" data-href="{:U('order/index')}">
  48. <span style="margin: -4px -15px 0;"></span>
  49. 新订单<span id="notice">{$order_count}</span>条
  50. </a>
  51. </li>
  52. <li id="orderdistribution" style="display:none;" class="layui-nav-item layui-hide-xs" lay-unselect>
  53. <a href="javascript:void(0)">
  54. <span style="margin: -4px -15px 0;"></span>
  55. 发配送员消息<span id="distributionnotice" style="color:red;"></span>条
  56. </a>
  57. </li>
  58. <li class="layui-nav-item layui-hide-xs" lay-unselect >
  59. <a href="{:U('index/index', array('is_new' => 2) )}" >
  60. <span class="layui-badge-dot" style="margin: -4px -15px 0;"></span>
  61. 切换旧版后台
  62. </a>
  63. </li>
  64. <li class="layui-nav-item layui-hide-xs" lay-unselect style="display:none;">
  65. <a href="javascript:;" layadmin-event="theme">
  66. <i class="layui-icon layui-icon-theme"></i>
  67. </a>
  68. </li>
  69. <li class="layui-nav-item layui-hide-xs"><a class="btn btn-primary" href="/seller.php?s=/Public/clear">清空缓存</a></li>
  70. <?php if (!defined('ROLE') || ROLE != 'agenter' ) {?>
  71. <li class="layui-nav-item layui-hide-xs" lay-unselect >
  72. <font style="color:#009688;">
  73. 当前社区团购版本<?php echo $version; ?>
  74. </font>
  75. </li>
  76. <?php } ?>
  77. <li class="layui-nav-item layui-hide-xs" lay-unselect style="display:none;">
  78. <a href="javascript:;" layadmin-event="fullscreen">
  79. <i class="layui-icon layui-icon-screen-full"></i>
  80. </a>
  81. </li>
  82. <li class="layui-nav-item layui-hide-xs lay-logins" lay-unselect>
  83. <a href="javascript:;">
  84. <?php
  85. if (defined('ROLE') && ROLE == 'agenter' )
  86. {
  87. $agent_auth = session('agent_auth');
  88. echo $agent_auth['shopname'];
  89. }else{
  90. echo D('Home/Front')->get_config_by_name('shoname');
  91. }
  92. ?>
  93. </a>
  94. </li>
  95. <li class="layui-nav-item layui-hide-xs" lay-unselect>
  96. <a href="{:U('Public/logout')}">退出</a>
  97. </li>
  98. <li class="layui-nav-item layui-hide-xs" lay-unselect style="display:none;">
  99. <a href="javascript:;" layadmin-event="about"><i class="layui-icon layui-icon-more-vertical"></i></a>
  100. </li>
  101. <span class="layui-nav-bar" style="left: 28px; top: 48px; width: 0px; opacity: 0;"></span>
  102. </ul>
  103. </div>
  104. <!--头部区域end-->
  105. <!--左侧导航区域begin--->
  106. <div class="layui-side layui-side-menu">
  107. <div class="layui-side-scroll">
  108. <!-- logo -->
  109. <div class="index-inner-container">
  110. <?php $shoplogo = D('Home/Front')->get_config_by_name('shoplogo'); ?>
  111. <div class="layui-logo">
  112. <span>
  113. <?php if( empty($shoplogo) ){ ?>
  114. <img class="layui-circle" src="/static/images/default-pic.jpg" height="46px" width="46px">
  115. <?php }else{ ?>
  116. <img class="layui-circle" src="<?php echo tomedia($shoplogo);?>" height="46px" width="46px">
  117. <?php } ?>
  118. </span>
  119. </div>
  120. <ul class="layui-nav layui-nav-tree" lay-shrink="all" id="LAY-system-side-menu" lay-filter="layadmin-system-side-menu">
  121. <span class="layui-nav-bar" style="height: 0px; top: 0px; opacity: 0;"></span>
  122. <?php $sysmenus = D('Seller/menu')->getMenu(true); ?>
  123. <?php
  124. $i =0;
  125. foreach($sysmenus['menu'] as $key => $menu){
  126. ?>
  127. <li class="layui-nav-item <?php if($i ==0){ ?>layui-nav-itemed<?php } ?>" pinyin="<?php echo $key; ?>">
  128. <a href="javascript:;" <?php if( empty($menu['route']) ){ ?>lay-href="{:U($menu['route'])}"<?php } ?> lay-tips="{$menu['text']}" lay-direction="2">
  129. <i class=" snailfishicon snailfishicon-{$menu['icon']}"></i>
  130. <cite style="font-size:15px">{$menu['text']}</cite>
  131. </a>
  132. </li>
  133. <?php $i++; } ?>
  134. </ul>
  135. </div>
  136. </div>
  137. </div>
  138. <!--左侧导航区域end--->
  139. <!--内容体begin-->
  140. <div class="layui-body" id="LAY_app_body">
  141. <div class="layadmin-tabsbody-item layui-show sub-nav-show">
  142. <!--二级菜单begin-->
  143. <div class="sub-nav" style="width:125px">
  144. <?php $i =0;
  145. foreach($sysmenus['menu'] as $key => $menu){
  146. ?>
  147. <?php if( empty($menu['items']) ){ ?>
  148. <div class="nav-new wb-subnav"></div>
  149. <?php }else{ ?>
  150. <div class="nav-new wb-subnav <?php if($i ==0 ){ ?> layui-this<?php } ?>" >
  151. <div class="subnav-scene" style="font-size: 14px" >
  152. {$menu['subtitle']}
  153. </div>
  154. <?php foreach($menu['items'] as $sub_menu){
  155. ?>
  156. <?php if( !empty($sub_menu['items']) ){ ?>
  157. <!--<div class="menu-header <?php if( $menu['route'] != 'config/index' ){ ?>active<?php } ?>">-->
  158. <div class="menu-header active">
  159. <!--<?php if( $menu['route'] == 'config/index' ){ ?>
  160. <div class="menu-icon fa fa-caret-right layui-icon ">&#xe623;</div>
  161. <?php }else{ ?>-->
  162. <!--<?php } ?>-->
  163. <div class="menu-icon fa fa-caret-right layui-icon " style="color: #656161;">&#xe625;</div>
  164. <div style="font-size: 13px;color: #656161;"> {$sub_menu['title']}</div>
  165. </div>
  166. <?php }else{ ?>
  167. <ul style="display:block;">
  168. <li <?php if($perm_url == $sub_menu['route']){ ?>class="active"<?php } ?> data-class="active">
  169. <a href="javascript:;" lay-href="{:U($sub_menu['route'])}" style="cursor: pointer;font-size: 13px;color: #656161;">{$sub_menu['title']}</a>
  170. </li>
  171. </ul>
  172. <?php } ?>
  173. <?php if( !empty($sub_menu['items']) ){ ?>
  174. <!--<ul style="<?php if( $menu['route'] == 'config/index' ){ ?>display: none;<?php }else{ ?>display: block;<?php } ?>">-->
  175. <ul style="display: block;">
  176. <?php foreach($sub_menu['items'] as $third_sub_menu){ ?>
  177. <li class="" data-class="active">
  178. <a lay-href="{:U($third_sub_menu['route'])}" style="cursor: pointer;"><cite style="font-size:12px;padding-left: 10px;" >{$third_sub_menu['title']}</cite></a>
  179. </li>
  180. <?php } ?>
  181. </ul>
  182. <?php } ?>
  183. <?php } ?>
  184. </div>
  185. <?php } ?>
  186. <?php $i++; } ?>
  187. </div>
  188. <!--二级菜单end-->
  189. <div class="new-iframe">
  190. <?php if( empty($perm_url) || $perm_url == '/' ){ ?>
  191. <iframe src="<?php echo U('index/analys', array('ok' => 1)); ?>" frameborder="0" class="layadmin-iframe"></iframe>
  192. <?php }else{ ?>
  193. <iframe src="<?php echo U( $perm_url, array('ok' => 1)); ?>" frameborder="0" class="layadmin-iframe"></iframe>
  194. <?php } ?>
  195. </div>
  196. </div>
  197. </div>
  198. <!--内容体end-->
  199. </div>
  200. </div>
  201. <style>
  202. .layui-side-menu .layui-nav .layui-nav-item > a{
  203. padding-top: 4px;
  204. padding-bottom: 4px;
  205. }
  206. .layui-layout-admin .layui-side{width: 120px;}
  207. .layui-side-menu .layui-side-scroll {width: 120px;}
  208. .index-inner-container {
  209. position: absolute;
  210. left: 0;
  211. top: 0;
  212. right: -17px;
  213. bottom: 0;
  214. overflow-x: hidden;
  215. overflow-y: scroll;
  216. }
  217. .layui-layout-admin .layui-logo {
  218. position: fixed;
  219. left: 0;
  220. top: 0;
  221. z-index: 1002;
  222. width: 120px;
  223. height: 65px;
  224. padding: 0 15px;
  225. box-sizing: border-box;
  226. overflow: hidden;
  227. font-weight: 300;
  228. background-repeat: no-repeat;
  229. background-position: center center;
  230. }
  231. .layui-side-menu .layui-nav {
  232. width: 120px;
  233. margin-top: 65px;
  234. background: 0 0;
  235. }
  236. .snailfishicon{
  237. position: absolute;
  238. top: 32%;
  239. left: 20px;
  240. font-size: 16px;
  241. }
  242. .layadmin-pagetabs, .layui-layout-admin .layui-body, .layui-layout-admin .layui-footer, .layui-layout-admin .layui-layout-left {
  243. left: 120px;
  244. }
  245. .new-iframe {
  246. position: absolute;
  247. left: 0;
  248. top: 0;
  249. bottom: 0;
  250. right: 0;
  251. overflow-x: auto;
  252. overflow-y: hidden;
  253. }
  254. .sub-nav-show .new-iframe {
  255. left: 126px;
  256. }
  257. .sub-nav {
  258. width: 115px;
  259. background-color: #fff;
  260. position: absolute;
  261. z-index: 998;
  262. left: 0;
  263. top: 0;
  264. bottom: 0;
  265. overflow-y: auto;
  266. display: none;
  267. box-shadow: 2px 0 2px rgba(0,0,0,.05);
  268. }
  269. .sub-nav-show .sub-nav {
  270. display: block;
  271. }
  272. .nav-new {
  273. display: none;
  274. }
  275. .sub-nav-show .sub-nav .nav-new.layui-this {
  276. display: block;
  277. }
  278. .one-nav {
  279. border-bottom: 1px solid #e3e2e5;
  280. padding: 12px 0;
  281. }
  282. .one-nav:last-child {
  283. border-bottom: 0;
  284. }
  285. .one-nav .dt {
  286. font-weight: 700;
  287. }
  288. .one-nav a {
  289. color: #595959;
  290. line-height: 32px;
  291. display: block;
  292. cursor: pointer;
  293. }
  294. .dd p {
  295. margin: 0 -10px 5px;
  296. }
  297. .dd p a {
  298. padding: 0 10px;
  299. font-size: 13px;
  300. }
  301. .dd p.layui-this a, .dd p a:hover {
  302. background-color: #E9EAF0;
  303. border-radius: 3px;
  304. }
  305. .layui-layout-admin .layui-body {
  306. position: fixed;
  307. top: 60px;
  308. }
  309. .layui-layout-admin .layui-body {
  310. top: 50px;
  311. }
  312. .wb-subnav .subnav-scene {
  313. overflow: hidden;
  314. height: 78px;
  315. line-height: 78px;
  316. padding-left: 20px;
  317. }
  318. .menu-header {
  319. line-height: 50px;
  320. height: 50px;
  321. /* border-top: 1px solid #f4f4f4; */
  322. cursor: pointer;
  323. padding-left: 5px;
  324. }
  325. .fa {
  326. display: inline-block;
  327. font: normal normal normal 14px/1 FontAwesome;
  328. font-size: inherit;
  329. text-rendering: auto;
  330. -webkit-font-smoothing: antialiased;
  331. -moz-osx-font-smoothing: grayscale;
  332. }
  333. .menu-icon {
  334. width: 20px;
  335. height: 50px;
  336. float: left;
  337. text-align: center;
  338. font-size: 8px;
  339. color: #666;
  340. line-height: 50px;
  341. }
  342. .fa-caret-down:before {
  343. content: "\f0d7";
  344. }
  345. :after, :before {
  346. -webkit-box-sizing: border-box;
  347. -moz-box-sizing: border-box;
  348. box-sizing: border-box;
  349. }
  350. .wb-subnav ul {
  351. display: none;
  352. overflow: hidden;
  353. }
  354. .wb-subnav ul li {
  355. height: 50px;
  356. line-height: 50px;
  357. font-size: 12px;
  358. cursor:pointer;
  359. }
  360. .wb-subnav ul li.active, .wb-subnav ul li:hover {
  361. background: #edf6ff;
  362. }
  363. .wb-subnav ul a {
  364. padding-left: 25px;
  365. height: 100%;
  366. width: 100%;
  367. }
  368. .wb-subnav ul li a {
  369. color: #7c838a;
  370. }
  371. .wb-subnav ul li.active a {
  372. color: #009688;
  373. }
  374. .layadmin-side-shrink .layui-side {
  375. left: 0;
  376. width: 60px;
  377. }
  378. </style>
  379. <script src="/layuiadmin/layui/layui.js"></script>
  380. <script src="/static/js/jquery-ui.min.js"></script>
  381. <script>
  382. layui.config({
  383. base: '/layuiadmin/' //静态资源所在路径
  384. }).extend({
  385. index: 'lib/index' //主入口模块
  386. }).use('index');
  387. </script>
  388. <audio id="musicClick" src="/static/mp3/click.mp3" preload="auto"></audio>
  389. <script>
  390. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  391. var layer = layui.layer;
  392. var $;
  393. var par_index = 0;
  394. var cur_open_div;
  395. var form;
  396. layui.use(['jquery', 'layer','form'], function(){
  397. $ = layui.$;
  398. setInterval( function() {
  399. order_distribution();
  400. },3000);
  401. function order_distribution() {
  402. $.ajax({
  403. url:"{:U('index/order_distribution')}",
  404. type:'get',
  405. data:{},
  406. dataType:'json',
  407. success:function(ret){
  408. if(ret.no_send > 0)
  409. {
  410. $('#orderdistribution').show();
  411. $("#distributionnotice").html(ret.no_send);
  412. }else{
  413. $("#orderdistribution").hide();
  414. $("#distributionnotice").html(0);
  415. }
  416. }
  417. })
  418. }
  419. setInterval( function() {
  420. $.getJSON("<?php echo "index.php?s=/Cron/index"; ?>");
  421. },10000);
  422. var i = 0;
  423. var y = 0
  424. setInterval(notice,10000);
  425. function notice() {
  426. $.ajax({
  427. url:"{:U('index/order_count')}",
  428. type:'get',
  429. data:{},
  430. dataType:'json',
  431. success:function(ret){
  432. if(ret.resultCode == 200 && ret.data > 0 && ret.voice_notice == 1)
  433. {
  434. if(i<3){
  435. $('#neworder').show();
  436. $("#notice").html(ret.data);
  437. $("#musicClick")[0].play();
  438. i++;
  439. y = ret.data ;
  440. }else{
  441. $('#neworder').show();
  442. $("#notice").html(ret.data);
  443. if( y < ret.data ){
  444. i = 0;
  445. }
  446. }
  447. var url = "";
  448. if(ret.order_type == 'pintuan'){
  449. url = "<?php echo U('group/orderlist'); ?>";
  450. $('#neworder').find('a').attr('data-href',url);
  451. }else if(ret.order_type == 'integral'){
  452. url = "<?php echo U('points/order'); ?>";
  453. $('#neworder').find('a').attr('data-href',url);
  454. }
  455. }else{
  456. $("#neworder").hide();
  457. $("#notice").html(0);
  458. i = 0;
  459. }
  460. }
  461. })
  462. }
  463. <?php if(is_seller_login() == 1){ ?>
  464. setInterval( function() {
  465. //check_lionfish_comshop_upgrade();
  466. },10000);
  467. function check_lionfish_comshop_upgrade() {
  468. $.post('{:U("system/upgrade_check")}', function (ret) {
  469. if (ret && ret.status == '1') {
  470. var result = ret.result;
  471. if (result.filecount > 0 || result.database || result.upgrades) {
  472. $('#new_msg').show();
  473. $('#new_msg_tip').html('点击升级新版本:'+ result.version);
  474. }
  475. }
  476. }, 'json');
  477. }
  478. <?php } ?>
  479. $('.layui-side-scroll .layui-nav-item a').click(function(){
  480. var url = $(this).attr('lay-href');
  481. console.log( $.trim($(this).text()) );
  482. if( url == undefined )
  483. {
  484. var _cur_text = $.trim($(this).text());
  485. if( _cur_text == '应用' )
  486. {
  487. $('.new-iframe').css('left','0px');
  488. $('.sub-nav').hide();
  489. $('.layadmin-iframe').attr('src', "<?php echo U('application/index'); ?>");
  490. }else{
  491. $('.new-iframe').css('left','125px');
  492. $('.sub-nav').show();
  493. var s_index = $(this).parent().index()-1;
  494. par_index = s_index;
  495. $('.wb-subnav').eq(s_index).addClass('layui-this').siblings().removeClass('layui-this');
  496. var s_u = $('.wb-subnav').eq(s_index).children('ul:first');
  497. $('.wb-subnav li').removeClass('active');
  498. if( !$(s_u).children('li:first').hasClass('active') )
  499. {
  500. $(s_u).children('li:first').addClass('active');
  501. }
  502. var s_a = $(s_u).children('li:first').children('a:first');
  503. var s_url = $(s_a).attr('lay-href');
  504. $('.layadmin-iframe').attr('src', s_url);
  505. }
  506. }else{
  507. var s_index = $(this).parent().parent().index()-1;
  508. par_index = s_index+1;
  509. console.log(12);
  510. }
  511. })
  512. $('#neworder a').click(function(event){
  513. var s_url = $(this).attr('data-href');
  514. $('.layadmin-iframe').attr('src', s_url);
  515. })
  516. $('.wb-subnav li a').click(function(event){
  517. var s_url = $(this).attr('lay-href');
  518. $('.layadmin-iframe').attr('src', s_url);
  519. })
  520. $('#update_urlevent').click(function(event){
  521. var s_url = $(this).attr('lay-href');
  522. $('.layadmin-iframe').attr('src', s_url);
  523. })
  524. $('.wb-subnav li').click(function(event){
  525. $('.wb-subnav li').removeClass('active')
  526. $(this).addClass('active');
  527. $('.layui-side-scroll .layui-nav-item').eq(par_index).addClass('layui-this').siblings().removeClass('layui-this');
  528. var s_url = $(this).children('a').attr('lay-href');
  529. $('.layadmin-iframe').attr('src', s_url);
  530. event.stopPropagation();
  531. })
  532. $('.menu-header').click(function(){
  533. if( $(this).hasClass('active') )
  534. {
  535. //关闭 向右
  536. $(this).children('.layui-icon').html('&#xe623;');
  537. $(this).next().hide();
  538. $(this).removeClass('active');
  539. }else{
  540. //开启 向下
  541. $(this).children('.layui-icon').html('&#xe625;');
  542. $(this).next().show();
  543. $(this).addClass('active');
  544. }
  545. })
  546. })
  547. </script>
  548. </body>
  549. </html>