yjxx.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
  6. <title>yjxx</title>
  7. <style type="text/css">
  8. @media (device-height:1024px) and (-webkit-min-device-pixel-ratio:2){/* 兼容ipad */
  9. .scrollX{
  10. height: 55px !important;
  11. }
  12. .btnBox{
  13. font-size: 20px !important;
  14. height: 55px !important;
  15. }
  16. .btnBox>div {
  17. width: 120px !important;
  18. height: 52px !important;
  19. line-height: 55px !important;
  20. margin: 0 50px !important;
  21. }
  22. .yujing_iscroll{
  23. top: 100px !important;
  24. bottom: 55px !important;
  25. }
  26. .sbsj1{
  27. height: 40.5px !important;
  28. line-height: 37.5px !important;
  29. font-size: 20px !important;
  30. }
  31. .sbsj2{
  32. font-size: 20px !important;
  33. margin-bottom: 10px;
  34. }
  35. .sbp {
  36. font-size: 18px !important;
  37. }
  38. .iscroll_content>ul>.scxx{
  39. font-size: 22px !important;
  40. }
  41. .iscroll_content>ul>.scxx>a{
  42. width: 605px !important;
  43. }
  44. .badge{
  45. font-size: 18px !important;
  46. }
  47. .fenmian_header{
  48. height: 50px !important;
  49. line-height: 50px !important;
  50. }
  51. .glyphicon-menu-left{
  52. font-size: 22px !important;
  53. }
  54. .fenmian_header p{
  55. font-size: 22px !important;
  56. }
  57. .titleText{
  58. height: 50px !important;
  59. line-height: 50px !important;
  60. font-size:20px !important;
  61. text-alain:center;
  62. }
  63. }
  64. * {
  65. padding: 0;
  66. margin: 0;
  67. }
  68. body,html {
  69. height:100%;
  70. width:100%;
  71. overflow:hidden;
  72. }
  73. ul {
  74. list-style: none;
  75. margin-bottom: 0;
  76. }
  77. a {
  78. text-decoration: none;
  79. }
  80. .unread{
  81. width: 11.7px;
  82. height: 11.7px;
  83. border-radius: 100%;
  84. background: #89C930;
  85. position: absolute;
  86. left: -15.5px;
  87. top: 50%;
  88. margin-top: -5px;
  89. }
  90. /* 滚动条样式 */
  91. .iScrollHorizontalScrollbar {
  92. position: absolute;
  93. z-index: 9999;
  94. height: 2px;
  95. left: 2px;
  96. right: 2px;
  97. bottom: 0;
  98. overflow: hidden;
  99. }
  100. .iScrollHorizontalScrollbar.iScrollBothScrollbars {
  101. right: 18px;
  102. }
  103. .iScrollVerticalScrollbar {
  104. position: absolute;
  105. z-index: 9999;
  106. width: 3px;
  107. bottom: 2px;
  108. top: 2px;
  109. right: 2px;
  110. overflow: hidden;
  111. }
  112. .iScrollVerticalScrollbar.iScrollBothScrollbars {
  113. bottom: 18px;
  114. }
  115. .iScrollIndicator {
  116. position: absolute;
  117. background: rgba(0, 0, 0);
  118. border: 2px solid rgba(0, 0, 0, 0.5);
  119. border-radius: 8px;
  120. }
  121. /* 主页面 */
  122. .container {
  123. width: 100%;
  124. padding: 0;
  125. margin: 0;
  126. }
  127. .header {
  128. width: 100%;
  129. height: 38px;
  130. line-height: 38px;
  131. font-weight: bold;
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. position: relative;
  136. background: #2285e2 !important;
  137. border: none;
  138. }
  139. .header>.btn-group {
  140. position: absolute;
  141. left: 0;
  142. }
  143. .glyphicon-menu-left{
  144. margin: 10px;
  145. font-size: 18px;
  146. color: #fff;
  147. width: 40px;
  148. }
  149. .header p {
  150. font-size: 18px;
  151. color: #fff;
  152. margin-bottom: 0 !important;
  153. }
  154. .titleText {
  155. width: 100%;
  156. background: #f4f2f3 !important;
  157. position: relative;
  158. margin-bottom: 0.1rem;
  159. height: 0.8rem;
  160. line-height: 0.8rem;
  161. border-top: 1px solid #ccc;
  162. border-bottom: 1px solid #ccc;
  163. text-indent: 16px;
  164. font-size: 0.24rem;
  165. font-weight: bold;
  166. }
  167. .yujing_iscroll {
  168. width: 100%;
  169. overflow: hidden;
  170. background: #fff !important;
  171. position: absolute;
  172. padding: 0 8%;
  173. left: 0;
  174. top: 38px;
  175. bottom: 0;
  176. }
  177. .group_iscroll .iscroll_content {
  178. width: 84%;
  179. position: absolute;
  180. padding: 0;
  181. background: #f4f2f3;
  182. }
  183. .btnBox{
  184. height: 38px;
  185. display: flex;
  186. overflow: hidden;
  187. font-size: 14px;
  188. }
  189. .btnBox>div{
  190. width: 80px;
  191. height: 37px;
  192. line-height: 38px;
  193. text-align: center;
  194. margin: 0 20px;
  195. }
  196. .titleText{
  197. height: 38px;
  198. line-height: 38px;
  199. border-top: 1px solid #ccc;
  200. border-bottom: 1px solid #ccc;
  201. text-indent: 16px;
  202. font-size: 14px;
  203. font-weight: bold;
  204. }
  205. .sbsj1{
  206. text-align: center;
  207. height: 27.5px;
  208. line-height: 22.5px;
  209. font-size: 14px;
  210. background: #fff !important;
  211. }
  212. .sbxxBox{
  213. position: relative;
  214. border: 1px solid #ccc;
  215. padding: 15px;
  216. border-radius: 8px;
  217. background: #fff;
  218. }
  219. .sbp1{
  220. font-weight: bold;
  221. font-size: 14px;
  222. margin: 0;
  223. }
  224. .sbsj2{
  225. font-size: 12px;
  226. margin-bottom: 20px;
  227. }
  228. .sbp2{
  229. font-weight: bold;
  230. font-size: 12px;
  231. text-indent: 2em;
  232. }
  233. .iscroll_content>ul>.scxx{
  234. height: 588.2px;
  235. line-height: 48.2px;
  236. border-bottom: 1px solid #ccc;
  237. font-size: 14px;
  238. display: flex;
  239. align-items: center;
  240. background: #fff;
  241. }
  242. .iscroll_content>ul>.scxx>a{
  243. width: 300px;
  244. color: #000;
  245. white-space: nowrap;
  246. overflow: hidden;
  247. text-overflow: ellipsis;
  248. text-decoration: none;
  249. }
  250. .yujingActive{
  251. color: #2285E2;
  252. border-bottom: 2px solid #2285E2;
  253. font-weight: bold;
  254. }
  255. .scrollX{
  256. width: 100%;
  257. height: 38px;
  258. position: absolute;
  259. bottom: 0;
  260. border-top: 1px solid #ccc;
  261. background: #f4f2f3 !important;
  262. display: -webkit-box;
  263. -webkit-box-pack: center;
  264. }
  265. #pullDown,#pullUp{
  266. height:40px;
  267. line-height:40px;
  268. text-align:center;
  269. }
  270. </style>
  271. <script>
  272. $(function(){
  273. var myScroll,mScroll;
  274. var from = '${from}';
  275. /*纵向滚轮 */
  276. myScroll = new IScroll(".yujing_iscroll",{
  277. scrollbars: true,
  278. fadeScrollbars:true,
  279. scrollbars: 'custom',
  280. shrinkScrollbars:'clip',
  281. probeType: 2,
  282. bindToWrapper:true,
  283. bounce:true,
  284. click:true,
  285. tap:true
  286. });
  287. setTimeout(function(){
  288. myScroll.refresh();
  289. }, 100);
  290. /* 横向滚轮 */
  291. mScroll = new IScroll(".scrollX",{
  292. scrollX: true,
  293. scrollY: false,
  294. scrollbars: true,
  295. fadeScrollbars:true,
  296. scrollbars: 'custom',
  297. shrinkScrollbars:'clip',
  298. tap:true
  299. });
  300. setTimeout(function(){
  301. mScroll.refresh();
  302. }, 100);
  303. var pullUp = $("#pullUp"),
  304. pullUpLabel = $(".pullUpLabel"),
  305. loadingStep = 0;//加载状态0默认,1显示加载状态,2执行加载数据,只有当为0时才能再次加载,这是防止过快拉动刷新
  306. pullUp.hide();
  307. myScroll.on("scroll",function(){
  308. if(loadingStep == 0 && !pullUp.attr("class").match('refresh')){
  309. if(this.y < (this.maxScrollY - 14)){//上拉加载更多
  310. pullUp.addClass("refresh").show();
  311. pullUp.css({"background":"","background-size":""});
  312. pullUpLabel.text("松手开始加载...");
  313. loadingStep = 1;
  314. myScroll.refresh();
  315. }
  316. }
  317. });
  318. myScroll.on("scrollEnd",function(){
  319. if(loadingStep == 1){
  320. if( pullUp.attr("class").match("refresh") ){//下拉刷新操作
  321. pullUp.removeClass("refresh").addClass("loading");
  322. pullUpLabel.text("加载中...");
  323. pullUp.css({"background":"#fff url(views/haifm/images/pullUp.gif) 35% center no-repeat","background-size":"8%"});
  324. loadingStep = 2;
  325. pullUpAction();
  326. myScroll.refresh();
  327. }
  328. }
  329. });
  330. //上拉加载方法
  331. function pullUpAction(){
  332. if (parseInt($("#page").val()) < parseInt($("#maxPage").val())) {
  333. setTimeout(function(){
  334. jQuery("#sub").ajaxSubmit({
  335. type: "post",
  336. async: true,
  337. dataType : 'text',
  338. data : {
  339. "page" : parseInt($("#page").val())+1,
  340. "from" : from,
  341. "mcid" :$("#mcid").val()
  342. },
  343. success : function(data) {
  344. var szd= new Array();
  345. szd = data.split("$");
  346. szd.pop();//删除最后一个空元素
  347. page = szd[0];
  348. var maxPage = szd[1];
  349. $("#from").val(szd[2]);
  350. if (parseInt($("#page").val()) < parseInt(maxPage)) {
  351. $("#page").val(parseInt(page));
  352. for (i = 3 ; i < szd.length ; i++) {
  353. var jt = new Array();
  354. jt = szd[i].split("@");
  355. var li, i, el, curIndex;
  356. el = document.getElementsByTagName(".iscroll_content ul");
  357. curIndex = $(".yujingActive").index();
  358. var fbsj = jt[0];
  359. var zw = jt[1];
  360. var tssj = jt[2];
  361. var bt = jt[3];
  362. var id =jt[4];
  363. var ydzt = jt[5];
  364. var fromVal = $("#from").val();
  365. var page = $("#page").val();
  366. li = document.createElement("li");
  367. if (ydzt == 0){
  368. li.innerHTML = "<div class='sbsj1'>" + tssj + "</div><div class='sbxxBox' onclick= 'viewXxtsxx2(" + id +","+ fromVal + "," + page +")'><p class='sbp1'>" + bt + "</p><div class='sbsj2'>"+fbsj+"</div><p class='sbp2'>"+zw+"</p><span class='unread'></span></div>";
  369. }else {
  370. li.innerHTML = "<div class='sbsj1'>" + tssj + "</div><div class='sbxxBox' onclick= 'viewXxtsxx2(" + id +","+ fromVal + "," + page +")'><p class='sbp1'>" + bt + "</p><div class='sbsj2'>"+fbsj+"</div><p class='sbp2'>"+zw+"</p><span class=''></span></div>";
  371. }
  372. $(".iscroll_content ul").append(li);
  373. pullUp.attr("class","").hide();
  374. myScroll.refresh();
  375. loadingStep = 0;
  376. }
  377. }else{
  378. pullUp.css({"background":"","background-size":""});
  379. pullUpLabel.text("没有数据了");
  380. myScroll.refresh();
  381. }
  382. },
  383. error: function(XMLHttpRequest, textStatus, errorThrown,msg) {
  384. alert(XMLHttpRequest.status);
  385. alert(XMLHttpRequest.readyState);
  386. alert(textStatus);
  387. }
  388. });
  389. },1000);
  390. }else{
  391. pullUp.css({"background":"","background-size":""});
  392. pullUpLabel.text("没有数据了");
  393. myScroll.refresh();
  394. };
  395. }
  396. document.addEventListener("touchmove", function (e) {
  397. e.preventDefault();
  398. }, false);
  399. /* tab内容切换*/
  400. $(".btnBox div").on("tap",function() {
  401. var $this = $(this);
  402. $this.addClass("yujingActive").siblings().removeClass();
  403. var data = $(this).data("for");
  404. if (data != "" && data != undefined) {
  405. haifm.loadMobilePage("haifm","viewXxlist.htm?from=" + data +"&page=" + $("#page").val() + "&mcid=" + $("#mcid").val());
  406. }
  407. myScroll.scrollTo(0, 0);
  408. myScroll.refresh();
  409. });
  410. //根据from 显示内容
  411. if (from == "sbxx") {
  412. $("#sbxx").addClass("yujingActive").siblings().removeClass();
  413. } else if (from =="scxx"){
  414. $("#scxx").addClass("yujingActive").siblings().removeClass();
  415. }else if (from =="mctg"){
  416. $("#tgxx").addClass("yujingActive").siblings().removeClass();
  417. }
  418. });
  419. function onBack(){
  420. haifm.loadMobilePage("haifm", "haifmMain.htm?uuid=" + $("#uuid").val() + "&mcid=" + $("#mcid").val());
  421. }
  422. function viewXxtsxx1(id, from, page) {
  423. haifm.loadMobilePage("haifm", "viewGtxxtsxx.htm?xxid=" + id + "&from=" + from + "&mcid="+$("#mcid").val() +"&page=" +page);
  424. }
  425. function viewXxtsxx2(id, from, page) {
  426. haifm.loadMobilePage("haifm", "viewGtxxtsxx.htm?xxid=" + id + "&from=" + $("#from").val() + "&mcid="+$("#mcid").val() +"&page=" +page);
  427. }
  428. </script>
  429. </head>
  430. <body>
  431. <form name="sub" id="sub" method="post" action="jzXxList.htm">
  432. <input type="hidden" id="from" value="$!from">
  433. <input type="hidden" id="page" value="$!page">
  434. <input type="hidden" id="maxPage" value="$!maxPage">
  435. <div class="container">
  436. <div class="header">
  437. <div class="btn-group" role="group">
  438. <span class="glyphicon glyphicon glyphicon-menu-left" aria-hidden="true" onclick="onBack()"></span>
  439. </div>
  440. <p>信息详情</p>
  441. </div>
  442. <div class="fenmian_dayNumBox titleText" style="display:none;">
  443. $!mcmc
  444. </div>
  445. <section class="yujing_iscroll">
  446. <div class="container iscroll_content" id="container">
  447. <ul id = "sb">
  448. #foreach($obj in $!xxtsList)
  449. <li>
  450. <div class="sbsj1">$!dateTool.format('yyyy-MM-dd HH:mm:ss', $!obj.tssj)</div>
  451. <div class="sbxxBox" onclick="viewXxtsxx1('$!obj.id', '$!from', $('#page').val())">
  452. <p class="sbp1">$!obj.bt</p>
  453. <div class="sbsj2">$!dateTool.format('yyyy-MM-dd HH:mm:ss', $!obj.fbsj)</div>
  454. <p class="sbp2">$!obj.zw</p>
  455. <span #if ("$!obj.ydzt" == "0") class="unread" #else class="" #end ></span>
  456. </div>
  457. </li>
  458. #end
  459. </ul>
  460. <div id="pullUp" class="">
  461. <div class="pullUpLabel">上拉加载更多</div>
  462. </div>
  463. </div>
  464. </section>
  465. <div class="scrollX" style="display:none;">
  466. <div class="btnBox">
  467. <div data-for="sbxx" id="sbxx" class="yujingActive">设备信息</div>
  468. <div data-for="scxx" id="scxx">生产信息</div>
  469. <div data-for="mctg" id="tgxx">通告</div>
  470. </div>
  471. </div>
  472. </div>
  473. </form>
  474. </body>
  475. </html>