base.html 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title><?php echo C('SITE_NAME'); ?>-后台管理中心</title>
  6. <meta name="description" content="overview &amp; stats" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  8. <link href="__CSS__/bootstrap.min.css" rel="stylesheet" />
  9. <link rel="stylesheet" href="__CSS__/font-awesome.min.css" />
  10. <link rel="stylesheet" href="/Common/css/snailfish.css?v=2.0.0" />
  11. <!--[if IE 7]>
  12. <link rel="stylesheet" href="__CSS__/font-awesome-ie7.min.css" />
  13. <![endif]-->
  14. <!-- page specific plugin styles -->
  15. <link type="image/x-icon" href="<?php echo resize(C('SITE_ICON'),16,16); ?>" rel="icon">
  16. <link type="image/x-icon" href="<?php echo resize(C('SITE_ICON'),16,16); ?>" rel="bookmark">
  17. <link rel="stylesheet" href="__CSS__/ace.min.css" />
  18. <link rel="stylesheet" href="__CSS__/ace-rtl.min.css" />
  19. <link rel="stylesheet" href="__CSS__/ace-skins.min.css" />
  20. <link rel="stylesheet" href="__PUBLIC__/css/select.css" />
  21. <!--[if lte IE 8]>
  22. <link rel="stylesheet" href="__CSS__/ace-ie.min.css" />
  23. <![endif]-->
  24. <!-- inline styles related to this page -->
  25. <!-- ace settings handler -->
  26. <script src="__JS__/ace-extra.min.js"></script>
  27. <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  28. <!--[if lt IE 9]>
  29. <script src="__JS__/html5shiv.js"></script>
  30. <script src="__JS__/respond.min.js"></script>
  31. <![endif]-->
  32. <block name="css">
  33. <style>
  34. .search-row {margin-bottom: 10px;}
  35. </style>
  36. </block>
  37. </head>
  38. <body class="navbar-fixed">
  39. <div class="navbar navbar-default navbar-fixed-top" id="navbar">
  40. <div class="navbar-container" id="navbar-container">
  41. <div class="navbar-header pull-left">
  42. <a href="{:U('Index/index')}" class="navbar-brand">
  43. <small>
  44. <!--
  45. <i class="icon-leaf"></i>
  46. -->
  47. <?php echo C('SITE_NAME'); ?> 后台管理
  48. </small>
  49. </a><!-- /.brand -->
  50. </div><!-- /.navbar-header -->
  51. <style>
  52. .fa-bell:before {
  53. content: "\f0f3";
  54. }
  55. .dropdown-navbar>li:last-child>a{
  56. text-align:left;
  57. color:#555;
  58. }
  59. </style>
  60. <div class="navbar-header pull-right" role="navigation">
  61. <ul class="nav ace-nav">
  62. <li class="light-blue">
  63. <a class="dropdown-toggle" target="_blank" href="{:U('Chat/index')}" aria-expanded="true">
  64. <i class="ace-icon fa icon-envelope"></i>
  65. <span class="badge badge-important" id="mseg_count">0</span>
  66. </a>
  67. </li>
  68. <li class="light-blue" style="display:none;">
  69. <a target="_blank" class="btn btn-primary" href="__ROOT__/?ok=1">网站前台</a>
  70. </li>
  71. <li class="light-blue" style="display:none;">
  72. <a href="{:U('Public/clear')}" class="btn btn-primary">清空缓存</a>
  73. </li>
  74. <li class="light-blue">
  75. <a href="{:U('Public/logout')}" class="btn btn-primary">退出系统</a>
  76. </li>
  77. <li class="light-blue">
  78. <a href="#" >
  79. <?php
  80. if (defined('ROLE') && ROLE == 'agenter' )
  81. {
  82. $supper_info = get_agent_logininfo();
  83. echo $supper_info['shopname'];
  84. }else{
  85. echo session('seller_auth.username');
  86. }
  87. ?>
  88. </a>
  89. </li>
  90. </ul><!-- /.ace-nav -->
  91. </div><!-- /.navbar-header -->
  92. </div><!-- /.container -->
  93. </div>
  94. <div class="main-container" id="main-container">
  95. <script type="text/javascript">
  96. try{ace.settings.check('main-container' , 'fixed')}catch(e){}
  97. </script>
  98. <div class="main-container-inner">
  99. <a class="menu-toggler" id="menu-toggler" href="#">
  100. <span class="menu-text"></span>
  101. </a>
  102. <div class="sidebar sidebar-fixed" id="sidebar">
  103. {~W('Menu/menu_show')}
  104. <div class="sidebar-collapse" id="sidebar-collapse">
  105. <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
  106. </div>
  107. <script type="text/javascript">
  108. try{ace.settings.check('sidebar' , 'collapsed')
  109. }catch(e){}
  110. </script>
  111. </div>
  112. <div class="main-content">
  113. <div class="breadcrumbs" id="breadcrumbs">
  114. <script type="text/javascript">
  115. try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
  116. </script>
  117. <ul class="breadcrumb">
  118. <li>
  119. <i class="icon-home home-icon"></i>
  120. <a href="#">{$breadcrumb1}</a>
  121. </li>
  122. <li class="active">{$breadcrumb2}</li>
  123. </ul><!-- .breadcrumb -->
  124. </div>
  125. <div class="page-content">
  126. <block name="content">
  127. </block>
  128. </div><!-- /.page-content -->
  129. </div><!-- /.main-content -->
  130. </div><!-- /.main-container-inner -->
  131. <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
  132. <i class="icon-double-angle-up icon-only bigger-110"></i>
  133. </a>
  134. </div><!-- /.main-container -->
  135. <audio id="bgMusic">
  136. <source = src="__PUBLIC__/js/classic.mp3" type="audio/mp3">
  137. </audio>
  138. <!-- basic scripts -->
  139. <!--[if !IE]> -->
  140. <block name="jquery">
  141. <script src="__PUBLIC__/js/jquery/jquery-2.0.3.min.js"></script>
  142. <script src="__PUBLIC__/js/jquery/jquery-migrate-1.2.1.min.js"></script>
  143. </block>
  144. <!-- <![endif]-->
  145. <!--[if IE]>
  146. <script src="__PUBLIC__/js/jquery/jquery-1.10.2.min.js"></script>
  147. <script src="__PUBLIC__/js/jquery/jquery-migrate-1.2.1.min.js"></script>
  148. <![endif]-->
  149. <script type="text/javascript">
  150. if("ontouchend" in document) document.write("<script src='__JS__/jquery.mobile.custom.min.js'>"+"<"+"/script>");
  151. </script>
  152. <script src="__JS__/bootstrap.min.js"></script>
  153. <script src="__JS__/typeahead-bs2.min.js"></script>
  154. <!-- page specific plugin scripts -->
  155. <!--[if lte IE 8]>
  156. <script src="__JS__/excanvas.min.js"></script>
  157. <![endif]-->
  158. <script src="__JS__/ace-elements.min.js"></script>
  159. <script src="__JS__/ace.min.js"></script>
  160. <!-- inline scripts related to this page -->
  161. <script src="__PUBLIC__/js/oscshop_common.js"></script>
  162. <script type="text/javascript" src="__PUBLIC__/js/swfobject.js"></script>
  163. <script type="text/javascript" src="__PUBLIC__/js/web_socket.js"></script>
  164. <script type="text/javascript">
  165. if (typeof console == "undefined") { this.console = { log: function (msg) { } };}
  166. // 如果浏览器不支持websocket,会使用这个flash自动模拟websocket协议,此过程对开发者透明
  167. WEB_SOCKET_SWF_LOCATION = "__PUBLIC__/swf/WebSocketMain.swf";
  168. // 开启flash的websocket debug
  169. WEB_SOCKET_DEBUG = true;
  170. var ws, name, client_list={};
  171. var domain = document.domain;
  172. // 连接服务端
  173. function connect() {
  174. // 创建websocket
  175. ws = new WebSocket("wss://mall.shiziyu888.com/wss");
  176. // 当socket连接打开时,输入用户名
  177. ws.onopen = onopen;
  178. // 当有消息时根据消息类型显示不同信息
  179. ws.onmessage = onmessage;
  180. ws.onclose = function() {
  181. console.log("连接关闭,定时重连");
  182. connect();
  183. };
  184. ws.onerror = function() {
  185. console.log("出现错误");
  186. };
  187. }
  188. // 连接建立时发送登录信息
  189. function onopen()
  190. {
  191. //document.domain
  192. // 登录
  193. var login_data = '{"type":"sellerlogin","domain":"'+domain+'"}';
  194. console.log("websocket握手成功,发送登录数据:"+login_data);
  195. ws.send(login_data);
  196. //mseg_count
  197. var seller_data = '{"type":"sellermsg_login","room_id":"<?php echo is_seller_login(); ?>","domain":"'+domain+'","uid":"<?php echo is_seller_login(); ?>"}';
  198. console.log("登录卖家消息成功:"+seller_data);
  199. ws.send(seller_data);
  200. }
  201. // 服务端发来消息时
  202. function onmessage(e)
  203. {
  204. console.log('ddddd');
  205. var data = eval("("+e.data+")");
  206. switch(data['type']){
  207. // 服务端ping客户端
  208. case 'ping':
  209. ws.send('{"type":"pong"}');
  210. break;
  211. //array('type'=>'resv_blog','blog_id'=>$blog_id);
  212. // 登录 更新用户列表
  213. case 'resv_blog':
  214. //{"type":"login","client_id":xxx,"client_name":"xxx","client_list":"[...]","time":"xxx"}
  215. var blog_id = data['blog_id'];
  216. var title = data['title'];
  217. var blog_count = $('.badge-important').html();
  218. blog_count = parseInt(blog_count) + 1;
  219. $('.badge-important').html(blog_count);
  220. var new_blg_html = '';
  221. new_blg_html= '';
  222. new_blg_html +='<li>';
  223. new_blg_html +=' <a href="/seller.php?s=/Blog/showdetail/blog_id/'+blog_id+'">';
  224. new_blg_html +=' <i class="btn btn-xs btn-primary fa fa-user"></i>';
  225. new_blg_html +=' '+title;
  226. new_blg_html +=' </a>';
  227. new_blg_html +='</li>';
  228. $('#notify_blog').append(new_blg_html);
  229. //console.log(data['client_name']+"登录成功");
  230. break;
  231. case 'seller_unread_count':
  232. if(data['count']>0)
  233. {
  234. var audio = document.getElementById("bgMusic");
  235. //播放(继续播放)
  236. audio.play();
  237. audio.currentTime = 0;
  238. audio.play();
  239. }
  240. $('#mseg_count').html(data['count']);
  241. break;
  242. break;
  243. }
  244. }
  245. $(function(){
  246. connect();
  247. })
  248. </script>
  249. <block name="javascript">
  250. </block>
  251. </body>
  252. </html>