indexsub1.html 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=0, maximum-scale=0, user-scalable=yes,shrink-to-fit=no">
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. <title>{:get_config('web_site_title')}</title>
  9. <link rel="icon" href="./favicon.png">
  10. <meta name="keywords" content="" />
  11. <meta name="description" content="" />
  12. <link rel="shortcut icon" href="/favicon.ico">
  13. <link rel="stylesheet" href="/static/hplus/css/bootstrap.min.css">
  14. <link rel="stylesheet" href="/static/hplus/css/font-awesome.min.css?v=4.4.0" />
  15. <link rel="stylesheet" href="/static/hplus/css/animate.css"/>
  16. <link rel="stylesheet" href="/static/hplus/css/style.css?v=4.1.0">
  17. <link rel="stylesheet" href="/static/hplus/css/jquery.contextMenu.min.css"/>
  18. <link rel="stylesheet" href="/static/elementui2.15.5/index.css"/>
  19. <link rel="stylesheet" href="/admin/css/common.css">
  20. <link rel="stylesheet" href="/admin/css/index.css">
  21. <link rel="stylesheet" href="/admin/css/indexsub.css">
  22. <link rel="stylesheet" href="/static/swiper4.5/css/swiper.min.css">
  23. <script src="/static/hplus/js/jquery.min.js?v=2.1.4"></script>
  24. <style>
  25. .nav.navbar-right > li > a {
  26. display: inline-block;
  27. }
  28. #orderNums{
  29. /*vertical-align: middle;*/
  30. color: red;
  31. position: relative;
  32. top: -3px;
  33. }
  34. .nn:focus, .nn:hover{
  35. background-color:#fff !important;
  36. }
  37. .navbar-title{
  38. display: inline-block;
  39. font-size: 20px;
  40. font-family: Source Han Sans CN;
  41. font-weight: 500;
  42. color: #284A94;
  43. padding-left: 20px;
  44. line-height: 60px;
  45. float: left;
  46. }
  47. .navbar-header{
  48. width: auto;
  49. max-width: 310px;
  50. height: 70px;
  51. line-height: 70px;
  52. font-size: 20px;
  53. font-family: Source Han Sans CN;
  54. font-weight: 500;
  55. color: #284A94;
  56. overflow: hidden;
  57. text-overflow:ellipsis;
  58. white-space: nowrap;
  59. }
  60. .sidebox{
  61. width: 100%;
  62. height: 100%;
  63. position: relative;
  64. }
  65. .side-box-switch{
  66. width: 28px;
  67. height: 168px;
  68. position: absolute;
  69. z-index: 10;
  70. top: 50%;
  71. right: -28px;
  72. /*background-color: red !important;*/
  73. margin-top: -84px;
  74. cursor: pointer;
  75. }
  76. .side-box-switch .switch-img{
  77. width: 100%;
  78. height: 100%;
  79. }
  80. .main-box-padding-left{
  81. padding-left: 120px !important;
  82. }
  83. .main-box-padding-left1{
  84. padding-left: 280px !important;
  85. }
  86. .main-box-padding-left3{
  87. padding-left: 0px !important;
  88. }
  89. .menusub-box{
  90. width: 100%;
  91. height: 100%;
  92. overflow: hidden;
  93. }
  94. html,body{
  95. width: 100%;
  96. height: 100% !important;
  97. overflow: hidden;
  98. padding-bottom: 5px;
  99. }
  100. body{
  101. background-image: url("/admin/img/indexsub-bg.png");
  102. background-repeat: no-repeat;
  103. background-size: 100% 100%;
  104. /*background-size: cover;*/
  105. }
  106. .navbar{
  107. width: 100%;
  108. height: 70px !important;
  109. background-color:transparent!important;
  110. border-bottom: 0 !important;
  111. margin-bottom: 0px;
  112. /*background-image: url("/admin/img/index-header-bg.png");*/
  113. /*background-repeat: no-repeat;*/
  114. /*background-size: 100% 100%;*/
  115. /*margin-bottom: 0 !important;*/
  116. /*border-bottom: none !important;*/
  117. }
  118. .navbar-logo{
  119. width: 157px;
  120. height: 40px;
  121. display: inline-block;
  122. float: left;
  123. margin-left: 50px;
  124. margin-top: 15px;
  125. }
  126. .navbar-logo img{
  127. width: 100%;
  128. height: 100%;
  129. }
  130. .nav>li>a:focus, .nav>li>a:hover{
  131. background: none !important;
  132. }
  133. .nav .open > a, .nav .open > a:hover, .nav .open > a:focus{
  134. background: none !important;
  135. }
  136. .userhead{
  137. width: 41px;
  138. height: 40px;
  139. border-radius: 50%;
  140. }
  141. </style>
  142. </head>
  143. <!--<body class="fixed-sidebar full-height-layout gray-bg fixed-nav pace-done">-->
  144. <body>
  145. <nav class="navbar navbar-fixed-top" role="navigation">
  146. <!-- <div class="navbar-title">{:get_config('web_site_title')}</div>-->
  147. <!-- <div class="navbar-logo" style="margin-left: 20px!important;">-->
  148. <!-- <img src="/admin/img/index-logo.png" alt="">-->
  149. <!-- </div>-->
  150. <div style="width: 100%;height: 70px">
  151. <div class="navbar-header">
  152. {if $userInfo.type==1}
  153. <!--{:get_config('web_site_title')}&nbsp;|&nbsp;-->
  154. <div data-width="60%" data-title="切换组织" url="{:url('Index/changeOrg')}" onclick="layer_open(this,2)" style="cursor: pointer;display: inline-block;height: 70px;line-height: 70px;width: 100%;text-overflow:ellipsis;
  155. white-space: nowrap;overflow: hidden;">
  156. {:session('orgName')} <span class="glyphicon glyphicon-menu-down" style="font-size: 16px;" aria-hidden="true"></span>
  157. </div>
  158. {else}
  159. <!--{:get_config('web_site_title')}&nbsp;|&nbsp;-->
  160. <div data-width="60%" style="display: inline-block;width: 100%;text-overflow:ellipsis;
  161. white-space: nowrap;">
  162. {:session('orgName')}
  163. </div>
  164. {/if}
  165. </div>
  166. <div class="level-menu-box">
  167. {volist name="menus" id="v"}
  168. <div class="menu-name-box {if $curmenu == $v.id}cur-menu-style{/if}" data-id="{$v['id']}" onclick="changeMenu(this)">
  169. <text>{$v.title}</text>
  170. </div>
  171. {/volist}
  172. </div>
  173. <ul class="nav navbar-top-links navbar-right" style="height: 70px">
  174. {empty name="userInfo['head_image']"}
  175. <img src="/img/defaulthead.png" class="userhead" style="" alt="">
  176. {else /}
  177. <img src="{$userInfo['head_image']}" class="userhead" alt="">
  178. {/empty}
  179. <li class="dropdown" style="height: 100%">
  180. <!-- {if ($isDispatch == 1)}
  181. <a href="javascript:;" id="goOrder" url="{:url('Index/ordersList')}?mode=0&order_mode=1" onclick="layer_open_dispatch(this,2)" class="glyphicon glyphicon-bell">
  182. <text id="orderNums">{if condition="$orderNums > 0"}({$orderNums}){/if}</text>
  183. </a>
  184. <a href="javascript:;" class="nn" onclick="offNotice()" id="offNotice" >
  185. <text id="offNoticeBtn">关闭通知</text>
  186. </a>
  187. <input type="hidden" id="offNoticeVal" value="0">
  188. {/if}-->
  189. <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;" style="color: #284A94;height: 100%;margin-top: 5px">欢迎,{:session('user_auth.real_name')} </a>
  190. <ul class="dropdown-menu animated fadeInRight m-t-xs">
  191. <li><a class="JmenuItem" href="{:url('User/modifyPass')}">修改密码</a></li>
  192. <li><a href="{:url('Common/logout')}">安全退出</a></li>
  193. </ul>
  194. </li>
  195. </ul>
  196. </div>
  197. </nav>
  198. <div class="gyindexsub-menu-list-box" style="display: none">
  199. <div class="indexsub-bread-crumbs-box" style="margin: 70px 19px 0px;width: calc(100% - 38px)">
  200. <a href="{:url('index/index')}" class="active">首页</a>
  201. {if $menuTitle}
  202. <a href="javascript:;" id="onebreadcrumbs">{$menuTitle}</a>
  203. {/if}
  204. {if $menuTitle1}
  205. <a href="javascript:;" id="twobreadcrumbs">{$menuTitle1}</a>
  206. {/if}
  207. {if $menuTitle2}
  208. <a href="javascript:;" id="threebreadcrumbs">{$menuTitle2}</a>
  209. {/if}
  210. </div>
  211. <div class="qsidenav" style="height: calc(100% - 58px)!important;">
  212. <div class="qsidenav-list qsidenablistthreemenulist" >
  213. <!-- <div class="qsidenav-twomenu-name">设备维保</div>
  214. <div class="sub">
  215. <a href="">
  216. <div class="sub-list cur">设备管理</div>
  217. </a>
  218. <a href="">
  219. <div class="sub-list">设备管理</div>
  220. </a>
  221. </div>-->
  222. </div>
  223. </div>
  224. <div class="gymenu-body-box" id="gy-main-iframe-menu">
  225. <!-- <iframe class="J_iframe" name="iframe0" width="100%" height="100%" id="gyindexsub-iframes" frameborder="0" data-id="index_v1.html" seamless></iframe>-->
  226. </div>
  227. </div>
  228. <div class="main-box main-box-h2 gongzuotaimenu" id="main-iframe">
  229. <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="{:url('Index/def')}" frameborder="0" data-id="index_v1.html" seamless></iframe>
  230. </div>
  231. <script src="/static/hplus/js/bootstrap.min.js?v=3.3.7"></script>
  232. <script src="/static/layer3.2.0/layer.js"></script>
  233. <script src="/static/hplus/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
  234. <script src="/static/hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
  235. <script src="/static/hplus/js/plugins/contextMenu/jquery.contextMenu.min.js"></script>
  236. <script src="/static/hplus/js/hplus.js?v=4.1.0"></script>
  237. <script type="text/javascript" src="/static/hplus/js/contabs.js"></script>
  238. <!-- 第三方插件 -->
  239. <script src="/static/hplus/js/plugins/pace/pace.min.js"></script>
  240. <script src="/static/elementui2.15.5/vue-2.6.14.js"></script>
  241. <script src="/static/elementui2.15.5/index.js"></script>
  242. <script src="/admin/js/common.js"></script>
  243. {if condition="is_login() and !is_admin(is_login()) and btnAuth(is_login(),'PhoneMonitor/show')"}
  244. <textarea style="display: none;" id="StatusArea" rows="13" name="S1" class="form-control" readonly></textarea>
  245. <script language="javascript" type="text/javascript" src="/static/phonejs/qnviccub.js"></script>
  246. <script language="javascript" type="text/javascript" src="/static/phonejs/qnvfunc.js"></script>
  247. <script language="javascript" type="text/javascript" src="/static/phonejs/json2.js"></script>
  248. <script language="javascript" type="text/javascript" src="/static/phonejs/deviceapi.js"></script>
  249. <script>
  250. var fp;
  251. $(document).ready(function(){
  252. TV_Initialize();
  253. getEvent(T_GetEvent);
  254. });
  255. $(window).unload(function(){
  256. TV_Disable();
  257. });
  258. setInterval(function () {
  259. OpenDevice(ODT_LBRIDGE,function(nResult){AppendStatus('打开设备.');});
  260. },30000);
  261. //离开页面
  262. $(window).bind('beforeunload',function(){
  263. TV_Disable();
  264. });
  265. function openPhone() {
  266. // let gphone = "13838379499";
  267. // let fp = "d:\\wyluyin\\" + getCurrentDate(3) + "_" + gphone + ".wav";
  268. // check_phone(gphone,fp);
  269. }
  270. function playBtn() {
  271. // let path = "d:\\wyluyin\\20220608191204_13027625915.wav";
  272. // console.log('path:',path);
  273. PlayFile(1,QNV_PLAY_FILE_START,0,PLAYFILE_MASK_REPEAT,path,function(id){
  274. console.log('play:',id);
  275. });
  276. }
  277. function check_phone(gphone,fp) {
  278. fp = base64encode(fp);
  279. var url = '{:url("orders/phone")}?phone=' + gphone + '&fp='+fp;
  280. var title = '添加订单';
  281. layer.open({
  282. type: 2,
  283. shade: 0.8,
  284. title: title,
  285. area: ['800px', '400px'],
  286. fix: false, //不固定
  287. maxmin: true,
  288. content: url,
  289. skin: 'layer-ext-moon',
  290. success: function(layero, index) {
  291. layer.iframeAuto(index);
  292. },
  293. // btn: ['取消']
  294. });
  295. return false;
  296. }
  297. function AppendStatus(szStatus)
  298. {
  299. // console.log(szStatus);
  300. // $("#StatusArea").append(szStatus+"\r\n" );
  301. // var scrollTop = $("#StatusArea")[0].scrollHeight;
  302. // $("#StatusArea").scrollTop(scrollTop);
  303. }
  304. function AppendStatusEx(uID,szStatus)
  305. {
  306. uID=uID+1;
  307. AppendStatus("通道"+uID+":"+szStatus);
  308. }
  309. function T_GetEvent(uID,uEventType,uHandle,uResult,szdata)
  310. {
  311. // console.log(uID,uEventType,uHandle,uResult,szdata);
  312. //var vValueArray=qnviccub.QNV_Event(0,2,0,"","",1024);
  313. if(uEventType == -1)
  314. return;
  315. var vValue=" type="+uEventType+" Handle="+uHandle+" Result="+uResult+" szdata="+szdata;
  316. switch(uEventType)
  317. {
  318. case BriEvent_PhoneHook:// 本地电话机摘机事件
  319. AppendStatusEx(uID,"本地电话机摘机"+vValue);
  320. TV_StartRecordFile(uID,fp);
  321. break;
  322. case BriEvent_PhoneDial:// 只有在本地话机摘机,没有调用软摘机时,检测到DTMF拨号
  323. AppendStatusEx(uID,"本地话机拨号"+vValue);
  324. break;
  325. case BriEvent_PhoneHang:// 本地电话机挂机事件
  326. TV_HangUpCtrl(uID);
  327. AppendStatusEx(uID,"本地电话机挂机"+vValue);
  328. TV_StopRecordFile(uID);
  329. break;
  330. case BriEvent_CallIn:// 外线通道来电响铃事件
  331. AppendStatusEx(uID,"外线通道来电响铃事件"+vValue);
  332. break;
  333. case BriEvent_GetCallID://得到来电号码
  334. AppendStatusEx(uID,"得到来电号码"+vValue);
  335. fp = "d:\\wyluyin\\" + getCurrentDate(3) + "_" + szdata + ".wav";
  336. check_phone(szdata,fp);
  337. break;
  338. case BriEvent_StopCallIn:// 对方停止呼叫(产生一个未接电话)
  339. AppendStatusEx(uID,"对方停止呼叫(产生一个未接电话)"+vValue);
  340. break;
  341. case BriEvent_DialEnd:// 调用开始拨号后,全部号码拨号结束
  342. AppendStatusEx(uID,"调用开始拨号后,全部号码拨号结束"+vValue);
  343. break;
  344. case BriEvent_PlayFileEnd:// 播放文件结束事件
  345. AppendStatusEx(uID,"播放文件结束事件"+vValue);
  346. break;
  347. case BriEvent_PlayMultiFileEnd:// 多文件连播结束事件
  348. AppendStatusEx(uID,"多文件连播结束事件"+vValue);
  349. break;
  350. case BriEvent_PlayStringEnd://播放字符结束
  351. AppendStatusEx(uID,"播放字符结束"+vValue);
  352. break;
  353. case BriEvent_RepeatPlayFile:// 播放文件结束准备重复播放
  354. AppendStatusEx(uID,"播放文件结束准备重复播放"+vValue);
  355. break;
  356. case BriEvent_SendCallIDEnd:// 给本地设备发送震铃信号时发送号码结束
  357. AppendStatusEx(uID,"给本地设备发送震铃信号时发送号码结束"+vValue);
  358. break;
  359. case BriEvent_RingTimeOut://给本地设备发送震铃信号时超时
  360. AppendStatusEx(uID,"给本地设备发送震铃信号时超时"+vValue);
  361. break;
  362. case BriEvent_Ringing://正在内线震铃
  363. AppendStatusEx(uID,"正在内线震铃"+vValue);
  364. break;
  365. case BriEvent_Silence:// 通话时检测到一定时间的静音.默认为5秒
  366. AppendStatusEx(uID,"通话时检测到一定时间的静音"+vValue);
  367. break;
  368. case BriEvent_GetDTMFChar:// 线路接通时收到DTMF码事件
  369. AppendStatusEx(uID,"线路接通时收到DTMF码事件"+vValue);
  370. break;
  371. case BriEvent_RemoteHook:// 拨号后,被叫方摘机事件
  372. AppendStatusEx(uID,"拨号后,被叫方摘机事件"+vValue);
  373. break;
  374. case BriEvent_RemoteHang://对方挂机事件
  375. TV_HangUpCtrl(uID);
  376. AppendStatusEx(uID,"对方挂机事件"+vValue);
  377. TV_StopRecordFile(uID);
  378. break;
  379. case BriEvent_Busy:// 检测到忙音事件,表示PSTN线路已经被断开
  380. AppendStatusEx(uID,"检测到忙音事件,表示PSTN线路已经被断开"+vValue);
  381. break;
  382. case BriEvent_DialTone:// 本地摘机后检测到拨号音
  383. AppendStatusEx(uID,"本地摘机后检测到拨号音"+vValue);
  384. break;
  385. case BriEvent_RingBack:// 电话机拨号结束呼出事件。
  386. AppendStatusEx(uID,"电话机拨号结束呼出事件"+vValue);
  387. break;
  388. case BriEvent_MicIn:// MIC插入状态
  389. AppendStatusEx(uID,"MIC插入状态"+vValue);
  390. break;
  391. case BriEvent_MicOut:// MIC拔出状态
  392. AppendStatusEx(uID,"MIC拔出状态"+vValue);
  393. break;
  394. case BriEvent_FlashEnd:// 拍插簧(Flash)完成事件,拍插簧完成后可以检测拨号音后进行二次拨号
  395. AppendStatusEx(uID,"拍插簧(Flash)完成事件,拍插簧完成后可以检测拨号音后进行二次拨号"+vValue);
  396. break;
  397. case BriEvent_RefuseEnd:// 拒接完成
  398. AppendStatusEx(uID,"拒接完成"+vValue);
  399. break;
  400. case BriEvent_SpeechResult:// 语音识别完成
  401. AppendStatusEx(uID,"语音识别完成"+vValue);
  402. break;
  403. case BriEvent_FaxRecvFinished:// 接收传真完成
  404. AppendStatusEx(uID,"接收传真完成"+vValue);
  405. break;
  406. case BriEvent_FaxRecvFailed:// 接收传真失败
  407. AppendStatusEx(uID,"接收传真失败"+vValue);
  408. break;
  409. case BriEvent_FaxSendFinished:// 发送传真完成
  410. AppendStatusEx(uID,"发送传真完成"+vValue);
  411. break;
  412. case BriEvent_FaxSendFailed:// 发送传真失败
  413. AppendStatusEx(uID,"发送传真失败"+vValue);
  414. break;
  415. case BriEvent_OpenSoundFailed:// 启动声卡失败
  416. AppendStatusEx(uID,"启动声卡失败"+vValue);
  417. break;
  418. case BriEvent_UploadSuccess://远程上传成功
  419. AppendStatusEx(uID,"远程上传成功"+vValue);
  420. break;
  421. case BriEvent_UploadFailed://远程上传失败
  422. AppendStatusEx(uID,"远程上传失败"+vValue);
  423. break;
  424. case BriEvent_EnableHook:// 应用层调用软摘机/软挂机成功事件
  425. AppendStatusEx(uID,"应用层调用软摘机/软挂机成功事件"+vValue);
  426. break;
  427. case BriEvent_EnablePlay:// 喇叭被打开或者/关闭
  428. AppendStatusEx(uID,"喇叭被打开或者/关闭"+vValue);
  429. break;
  430. case BriEvent_EnableMic:// MIC被打开或者关闭
  431. AppendStatusEx(uID,"MIC被打开或者关闭"+vValue);
  432. break;
  433. case BriEvent_EnableSpk:// 耳机被打开或者关闭
  434. AppendStatusEx(uID,"耳机被打开或者关闭"+vValue);
  435. break;
  436. case BriEvent_EnableRing:// 电话机跟电话线(PSTN)断开/接通
  437. AppendStatusEx(uID,"电话机跟电话线(PSTN)断开/接通"+vValue);
  438. break;
  439. case BriEvent_DoRecSource:// 修改录音源
  440. AppendStatusEx(uID,"修改录音源"+vValue);
  441. break;
  442. case BriEvent_DoStartDial:// 开始软件拨号
  443. AppendStatusEx(uID,"开始软件拨号"+vValue);
  444. break;
  445. case BriEvent_RecvedFSK:// 接收到FSK信号,包括通话中FSK/来电号码的FSK
  446. AppendStatusEx(uID,"接收到FSK信号,包括通话中FSK/来电号码的FSK"+vValue);
  447. break;
  448. case BriEvent_PlugOut:
  449. AppendStatusEx(uID,"设备移除");
  450. // alert('设备移除');
  451. break;
  452. case BriEvent_DevErr://设备错误
  453. AppendStatusEx(uID,"设备错误"+ decodeURIComponent(vValue) );
  454. // alert('设备错误');
  455. break;
  456. default:
  457. if(uEventType < BriEvent_EndID)
  458. AppendStatusEx(uID,"忽略其它事件发生:ID=" + uEventType+ vValue);
  459. break;
  460. }
  461. }
  462. </script>
  463. {/if}
  464. {if condition="$isDispatch eq 1"}
  465. <audio id="dingdantixing" src="/static/tixing.mp3" controls="controls" style="display: none;"></audio>
  466. <script>
  467. var time1;
  468. var audio = document.getElementById('dingdantixing');
  469. $(function () {
  470. var interval = function () {
  471. var url = "{:url('Index/order')}";
  472. $.get(url,function (data) {
  473. if(data.code == 1){
  474. var audio = document.getElementById('dingdantixing');
  475. audio.play();
  476. if(data.data > 0){
  477. document.getElementById('orderNums').innerHTML ='('+data.data +')';
  478. }
  479. // layer.msg('您有新的订单请及时处理',{time:3000});
  480. }
  481. });
  482. }
  483. time1 = setInterval(interval,30000);
  484. $("#offNoticeBtn").click(function () {
  485. var off = parseInt($("#offNoticeVal").val());
  486. if(off==0){
  487. clearInterval(time1);
  488. $("#offNoticeVal").val(1)
  489. $("#offNoticeBtn").html('开启通知');
  490. audio.pause();
  491. }else {
  492. $("#offNoticeVal").val(0)
  493. time1 = setInterval(interval,30000);
  494. $("#offNoticeBtn").html('关闭通知');
  495. }
  496. })
  497. })
  498. </script>
  499. {/if}
  500. <script>
  501. var menus = {:json_encode($menus)};
  502. $(function () {
  503. // $('#side-menu').slimScroll({
  504. // height: ($('.sidebar-box').height() + 40) + 'px'
  505. // });
  506. // $('#side-menu2').slimScroll({
  507. // height: $('.sidebar-box').height() + 'px'
  508. // });
  509. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  510. $('#main-iframe').addClass('main-box-h2');
  511. $('#menu-1').addClass('active');
  512. // $('.sidenav .side-list a').hover(
  513. // function () {
  514. // $(this).addClass("hover");
  515. // let id = $(this).attr('data-id');
  516. // initSubMenu(id);
  517. // },
  518. // function () {
  519. // $(this).removeClass("hover");
  520. // }
  521. // );
  522. $(document).on('click','#side-menu .Jiframe',function () {
  523. let id = $(this).attr('data-id');
  524. let url = $(this).attr('data-url');
  525. $('#main-iframe').removeClass('main-box-padding-left');
  526. $('#main-iframe').removeClass('main-box-padding-left1');
  527. $('#main-iframe').removeClass('main-box-padding-left3');
  528. // var width2 = localStorage.getItem("width1");
  529. // console.log(width2,'xxxxxxxxxxxxxxxx')
  530. // if(width2 == 120){
  531. // $('#main-iframe').css('padding-left','120px');
  532. // }
  533. // if(width2 == 280){
  534. // $('#main-iframe').css('padding-left','280px');
  535. // }
  536. if(url){
  537. if(id==485 || id==467 || id==488 || id==489){
  538. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  539. $('#main-iframe').addClass('main-box-h2');
  540. window.open(url);
  541. }else {
  542. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  543. $('#main-iframe').addClass('main-box-h2');
  544. let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+url+'" frameborder="0" data-id="'+url+'" seamless></iframe>';
  545. $('#main-iframe').html(str);
  546. }
  547. }else{
  548. $('#sidebar-box-h2').addClass('sidebar-box-h2');
  549. $('#main-iframe').removeClass('main-box-h2');
  550. }
  551. $(this).addClass("hover");
  552. initSubMenu(id);
  553. $('#side-menu .Jiframe').removeClass('active');
  554. $(this).addClass('active');
  555. });
  556. $(document).on('click','#side-menu2 .Jiframe',function () {
  557. $('#main-iframe').removeClass('main-box-padding-left');
  558. $('#main-iframe').removeClass('main-box-padding-left1');
  559. $('#main-iframe').removeClass('main-box-padding-left3');
  560. let pid = $(this).attr('data-pid');
  561. let url = $(this).attr('data-url');
  562. let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+url+'" frameborder="0" data-id="'+url+'" seamless></iframe>';
  563. $('#main-iframe').html(str);
  564. $('#side-menu2 .Jiframe').removeClass('active');
  565. $(this).addClass('active');
  566. // 寻找父级元素
  567. $('#side-menu .Jiframe').removeClass('active');
  568. $('#menu'+pid).addClass('active');
  569. });
  570. $(document).on('click','.JmenuItem',function () {
  571. $('#main-iframe').removeClass('main-box-padding-left');
  572. $('#main-iframe').removeClass('main-box-padding-left1');
  573. $('#main-iframe').removeClass('main-box-padding-left3');
  574. let url = $(this).attr('href');
  575. let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+url+'" frameborder="0" data-id="'+url+'" seamless></iframe>';
  576. $('#main-iframe').html(str);
  577. return false;
  578. });
  579. });
  580. function initSubMenu(id) {
  581. $('#main-iframe').removeClass('main-box-padding-left');
  582. $('#main-iframe').removeClass('main-box-padding-left1');
  583. $('#main-iframe').removeClass('main-box-padding-left3');
  584. let submenus = [];
  585. for (let o in menus){
  586. if(id == menus[o].id){
  587. submenus = menus[o].child;
  588. break;
  589. }
  590. }
  591. if(submenus.length > 0){
  592. $('#sidebar-box-h2').addClass('sidebar-box-h2');
  593. $('#main-iframe').removeClass('main-box-h2');
  594. }else{
  595. $('#sidebar-box-h2').removeClass('sidebar-box-h2');
  596. $('#main-iframe').addClass('main-box-h2');
  597. }
  598. let str = '';
  599. for (let o in submenus){
  600. if(submenus[o].child.length > 0){
  601. // <div class="side-group">
  602. // <div class="side-group-label">系统设置</div>
  603. // <div class="side-list">
  604. // <a class="J_iframe" href="layouts.html"><span>项目管理</span></a>
  605. // </div>
  606. // </div>
  607. str += '<div class="side-group">';
  608. str += '<div class="side-group-label">'+submenus[o].title+'</div>';
  609. let children = submenus[o].child;
  610. for(let n in children){
  611. str += '<div class="side-list">';
  612. str += '<a class="Jiframe" id="menu'+children[n].id+'" data-id="'+children[n].id+'" data-pid="'+submenus[o].pid+'" data-url="'+children[n].url+'" href="javascript:;"><span>'+children[n].title+'</span></a>';
  613. str += '</div>';
  614. }
  615. str += '</div>';
  616. }else{
  617. // <div class="side-list">
  618. // <a class="J_iframe active" href="layouts.html"><span>权限管理</span></a>
  619. // </div>
  620. str += '<div class="side-list">';
  621. str += '<a class="Jiframe" id="menu'+submenus[o].id+'" data-id="'+submenus[o].id+'" data-pid="'+submenus[o].pid+'" data-url="'+submenus[o].url+'" href="javascript:;"><span>'+submenus[o].title+'</span></a>';
  622. str += '</div>';
  623. }
  624. }
  625. $('#side-menu2').html(str);
  626. }
  627. function add_highlight(url){
  628. console.log('url',url);
  629. $('.side-list a').removeClass('active');
  630. for (let o in menus){
  631. if(menus[o].url && menus[o].url == url){
  632. $('#menu'+menus[o].id).addClass('active');
  633. break;
  634. }
  635. let child1 = menus[o].child;
  636. let flag = false;
  637. let id = 0;
  638. if(child1.length > 0){
  639. for (let m in child1){
  640. if(child1[m].url && child1[m].url == url){
  641. flag = true;
  642. id = child1[m].id;
  643. break;
  644. }
  645. let child2 = child1[m].child;
  646. for (let n in child2){
  647. if(child2[n].url && child2[n].url == url){
  648. flag = true;
  649. id = child2[n].id;
  650. break;
  651. }
  652. }
  653. if(flag){
  654. break;
  655. }
  656. }
  657. }
  658. console.log('flag11',flag,id);
  659. if(flag){
  660. initSubMenu(menus[o].id);
  661. $('#menu'+menus[o].id).addClass('active');
  662. $('#menu'+id).addClass('active');
  663. break;
  664. }
  665. }
  666. }
  667. function layer_open_dispatch(_self,flag){
  668. var url = $(_self).attr('url');
  669. var title = $(_self).attr('data-title');
  670. var width = $(_self).attr('data-width')?$(_self).attr('data-width'):'90%';
  671. var height = $(_self).attr('data-height')?$(_self).attr('data-height'):'90%';
  672. layer.open({
  673. type: 2,
  674. title: title,
  675. shadeClose: true,
  676. shade: 0.3,
  677. maxmin: true,
  678. area: [width, height],
  679. content: url,
  680. end: function () {
  681. update_order_count();
  682. }
  683. });
  684. }
  685. function update_order_count() {
  686. let url = "{:url('Index/ocount')}";
  687. $.post(url,function (res) {
  688. if(res.code == 1){
  689. let count = res.data.count;
  690. if(count > 0){
  691. $('#orderNums').html('('+count+')');
  692. }else{
  693. $('#orderNums').html('');
  694. }
  695. }
  696. });
  697. }
  698. </script>
  699. <script>
  700. function goindex(){
  701. window.location.href = '{:url("index/index")}';
  702. }
  703. var menus = {:json_encode($menus)};
  704. function changeMenu(_self) {
  705. var menuId = $(_self).attr('data-id');
  706. window.location.href="{:url('indexsub','','')}/curmenu/"+menuId;
  707. }
  708. function changeEndSubMenu(_self,type){
  709. var menuId = $(_self).attr('data-id');
  710. var menuurl = $(_self).attr('data-url');
  711. $('.sub-list').removeClass('cur');
  712. $(_self).addClass('cur');
  713. var menutitle = $(_self).attr('data-title');
  714. var menuftitle = $(_self).attr('data-ftitle');
  715. if(type == 1){
  716. $('#twobreadcrumbs').html(menuftitle)
  717. $('#threebreadcrumbs').html(menutitle)
  718. }else{
  719. $('#twobreadcrumbs').html(menutitle)
  720. }
  721. let str = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+menuurl+'" frameborder="0" data-id="'+menuurl+'" seamless></iframe>';
  722. $('#gy-main-iframe-menu').html(str);
  723. return false;
  724. }
  725. var curmenu = {:json_encode($curmenu)};
  726. var menuId = {:json_encode($menuId)};
  727. var ct = {:json_encode($ct)};
  728. var submenus = {:json_encode($submenus)};
  729. $(function (){
  730. if(ct == 0){
  731. if(curmenu == 500){
  732. $('.gyindexsub-menu-list-box').css('display','none');
  733. $('.gongzuotaimenu').css('display','block');
  734. }else{
  735. $('.gyindexsub-menu-list-box').css('display','block');
  736. $('.gongzuotaimenu').css('display','none');
  737. var menusublist = [];
  738. var menuurl2 = '';
  739. var firstmenuid = '';
  740. for (let i in menus){
  741. if(curmenu == menus[i].id){
  742. menusublist = menus[i].child;
  743. let submenulistaa = menus[i].child;
  744. if(submenulistaa.length >0){
  745. for (let a in submenulistaa){
  746. menuurl2 = submenulistaa[0].url;
  747. firstmenuid = submenulistaa[0].id;
  748. let aaaa = submenulistaa[0].child;
  749. if(aaaa.length > 0){
  750. for (let z in aaaa){
  751. menuurl2 = aaaa[0].url;
  752. firstmenuid = aaaa[0].id;
  753. }
  754. }
  755. }
  756. }else{
  757. menuurl2 = submenus[0].url;
  758. firstmenuid = submenus[0].id;
  759. }
  760. }
  761. }
  762. var str = '';
  763. for (let i in menusublist){
  764. var childList = menusublist[i].child;
  765. if(childList.length >0){
  766. str += '<div class="qsidenav-list">';
  767. str += '<div class="qsidenav-twomenu-name">'+menusublist[i].title+'</div>';
  768. str += '<div class="sub">';
  769. let ftitle = menusublist[i].title;
  770. if(childList.length >0){
  771. for (let o in childList){
  772. str += '<a href="javascript:;">';
  773. str += '<div class="sub-list endmenuactive'+childList[o].id+'" data-url="'+childList[o].url+'" data-id="'+menusublist[i].id+'" data-title="'+childList[o].title+'" data-ftitle="'+ftitle+'" onclick="changeEndSubMenu(this,1)">'+childList[o].title+'</div>';
  774. str += '</a>';
  775. }
  776. }
  777. str += '</div>';
  778. str += '</div>';
  779. }else{
  780. str += '<div class="qsidenav-list">';
  781. str += '<div class="sub">';
  782. str += '<a href="javascript:;">';
  783. str += '<div class="sub-list endmenuactive'+menusublist[i].id+'" data-url="'+menusublist[i].url+'" data-id="'+menusublist[i].id+'" data-ftitle="" data-title="'+menusublist[i].title+'" onclick="changeEndSubMenu(this,2)">'+menusublist[i].title+'</div>';
  784. str += '</a>';
  785. str += '</div>';
  786. str += '</div>';
  787. }
  788. }
  789. $('.qsidenablistthreemenulist').html(str);
  790. let menustr = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+menuurl2+'" frameborder="0" data-id="'+menuurl2+'" seamless></iframe>';
  791. $('#gy-main-iframe-menu').html(menustr);
  792. if(firstmenuid){
  793. $('.endmenuactive'+firstmenuid).addClass('cur');
  794. }
  795. }
  796. }else{
  797. $('.gyindexsub-menu-list-box').css('display','block');
  798. $('.gongzuotaimenu').css('display','none');
  799. var menusublist = [];
  800. var menuurl2 = '';
  801. var firstmenuid = '';
  802. console.log(menuId);
  803. console.log(submenus);
  804. for (let i in submenus){
  805. if(menuId == submenus[i].id){
  806. menusublist.push(submenus[i]);
  807. let submenulistaa = submenus[i].child;
  808. if(submenulistaa.length >0){
  809. for (let a in submenulistaa){
  810. menuurl2 = submenulistaa[0].url;
  811. firstmenuid = submenulistaa[0].id;
  812. let aaaa = submenulistaa[0].child;
  813. if(aaaa.length > 0){
  814. for (let z in aaaa){
  815. menuurl2 = aaaa[0].url;
  816. firstmenuid = aaaa[0].id;
  817. }
  818. }
  819. }
  820. }else{
  821. menuurl2 = submenus[0].url;
  822. firstmenuid = submenus[0].id;
  823. }
  824. }
  825. }
  826. var str = '';
  827. for (let i in menusublist){
  828. var childList = menusublist[i].child;
  829. if(childList.length >0){
  830. str += '<div class="qsidenav-list">';
  831. str += '<div class="qsidenav-twomenu-name">'+menusublist[i].title+'</div>';
  832. str += '<div class="sub">';
  833. let ftitle = menusublist[i].title;
  834. if(childList.length >0){
  835. for (let o in childList){
  836. str += '<a href="javascript:;">';
  837. str += '<div class="sub-list endmenuactive'+childList[o].id+'" data-url="'+childList[o].url+'" data-id="'+menusublist[i].id+'" data-title="'+childList[o].title+'" data-ftitle="'+ftitle+'" onclick="changeEndSubMenu(this,1)">'+childList[o].title+'</div>';
  838. str += '</a>';
  839. }
  840. }
  841. str += '</div>';
  842. str += '</div>';
  843. }else{
  844. str += '<div class="qsidenav-list">';
  845. str += '<div class="sub">';
  846. str += '<a href="javascript:;">';
  847. str += '<div class="sub-list endmenuactive'+menusublist[i].id+'" data-url="'+menusublist[i].url+'" data-id="'+menusublist[i].id+'" data-ftitle="" data-title="'+menusublist[i].title+'" onclick="changeEndSubMenu(this,2)">'+menusublist[i].title+'</div>';
  848. str += '</a>';
  849. str += '</div>';
  850. str += '</div>';
  851. }
  852. }
  853. $('.qsidenablistthreemenulist').html(str);
  854. let menustr = '<iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="'+menuurl2+'" frameborder="0" data-id="'+menuurl2+'" seamless></iframe>';
  855. $('#gy-main-iframe-menu').html(menustr);
  856. if(firstmenuid){
  857. $('.endmenuactive'+firstmenuid).addClass('cur');
  858. }
  859. }
  860. })
  861. </script>
  862. </body>
  863. </html>