| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="../css/mui.min.css" rel="stylesheet" />
- <link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
- <link href="../css/common.css" rel="stylesheet" />
- <style type="text/css">
- .manageStyle,
- .reportStyle {
- padding: 5px 10px;
- }
-
- .manageStyle h1 {
- font-size: 18px;
- color: #333;
- border-left: 5px solid #21b2e7;
- padding-left: 10px;
- }
-
- .reportStyle h1 {
- font-size: 18px;
- color: #333;
- border-left: 5px solid #6fd867;
- padding-left: 10px;
- }
-
- @media (max-width: 400px) {
- .mui-col-sm-6 {
- width: 50%;
- }
- }
-
- .categoryItem {
- padding: 15px 12px;
- background: #fff;
- border-radius: 10px;
- margin: 5px 7px;
- }
-
- .blueColor {
- box-shadow: 0px 0px 3px 0px rgb(36, 178, 231);
- }
-
- .blueColor .leftTxt p {
- color: #21b2e7;
- }
-
- .greenColor {
- box-shadow: 0px 0px 3px 0px rgb(111, 216, 103);
- }
-
- .greenColor .leftTxt p {
- color: #6fd867;
- }
-
- .categoryItem .leftTxt h2 {
- font-size: 20px;
- /*letter-spacing: 2px;*/
- margin-bottom: 10px;
- font-weight: 100;
- }
-
- .categoryItem .leftTxt p {
- margin: 0;
- }
-
- .categoryItem .rightImg {
- top: 22%;
- right: 8%;
- position: absolute;
- width: 27%;
- }
- .mui-content{
- display:none;
- }
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav">
- <h1 class="mui-title">设备中心</h1>
- </header>
- <div class="mui-content">
- <div class="equipManage manageStyle">
- <h1>设备管理</h1>
- <div class="mui-row" id="equipManageDiv">
- <!--<div class="mui-col-xs-6">
- <div class="categoryItem blueColor">
- <div class="leftTxt">
- <h2>杀虫灯</h2>
- <p>查看更多 >></p>
- </div>
- <img class="rightImg" src="../images/equipPageIcon1.png" />
- </div>
- </div>-->
- </div>
- </div>
- <div class="equipReport reportStyle">
- <h1>报表管理</h1>
- <div class="mui-row" id="equipReportDiv">
- <!--<div class="mui-col-xs-6">
- <div class="categoryItem greenColor">
- <div class="leftTxt">
- <h2>杀虫灯</h2>
- <p>查看更多 >></p>
- </div>
- <img class="rightImg" src="../images/equipPageIcon7.png" />
- </div>
- </div>-->
- </div>
- </div>
- </div>
- <script src="../js/jquery-2.1.0.js"></script>
- <script src="../js/mui.min.js"></script>
- <script type="text/javascript">
- mui.init();
- // var managePath = ['../equipManage/equipManage_scd.html','../equipManage/equipManage_cbd.html',
- // '../equipManage/equipManage_ybq.html','../equipManage/equipManage_qxz.html',
- // '../equipManage/equipManage_bzy.html','../equipManage/equipManage_jk.html'];
- // var reportPath = ['../reportManage/reprotManage_scd.html','../reportManage/reprotManage_cbd.html',
- // '../reportManage/reportManage_ybq.html','../reportManage/reportManage_qxz.html',
- // '../reportManage/reportManage_bzy.html'];
- var manageArr = [{
- name: '杀虫灯',
- type: 2,
- icon: ['../images/equipPageIcon1.png', '../images/equipPageIcon7.png'],
- url: ['../equipManage/equipManage_scd.html', '../reportManage/reprotManage_scd.html']
- },
- {
- name: '虫情测报',
- type: 3,
- icon: ['../images/equipPageIcon2.png', '../images/equipPageIcon8.png'],
- url: ['../equipManage/equipManage_cbd.html', '../reportManage/reprotManage_cbd.html']
- },
- {
- name: '性诱设备',
- type: 4,
- icon: ['../images/equipPageIcon12.png',''],
- url: ['../equipManage/sex_trap.html','']
- },
- {
- name: '环境监测',
- type: 5,
- icon: ['../images/equipPageIcon4.png', '../images/equipPageIcon10.png'],
- url: ['../equipManage/equipManage_qxz.html', '../reportManage/reprotManage_qxz.html']
- },
- {
- name: '监控',
- type: 6,
- icon: ['../images/equipPageIcon6.png', '../images/equipPageIcon6.png'],
- url: ['../equipManage/equipManage_jk.html', '../equipManage_jk/equipManage_jk.html']
- },
- {
- name: '孢子捕捉',
- type: 7,
- icon: ['../images/equipPageIcon5.png', '../images/equipPageIcon11.png'],
- url: ['../equipManage/equipManage_bzy.html', '../reportManage/reprotManage_bzy.html']
- },
- {
- name: '诱捕设备',
- type: 8,
- icon: ['', '../images/equipPageIcon9.png'],
- url: ['', '../reportManage/reprotManage_xyq.html']
- }
- ]
- function sortNumber(a,b){
- return a - b
- }
- mui.plusReady(function() {
- mui.ajax('http://120.27.222.26/product_view', {
- data: {},
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- beforeSend: function() {
- plus.nativeUI.showWaiting('请求中...');
- },
- complete: function() {
- plus.nativeUI.closeWaiting();
- },
- success: function(data) {
- $('.mui-content').show();
- console.log(typeof data)
- var dat = data.sort(sortNumber);
- var equipManageHtml = '';
- var equipreportHtml = '';
- if(dat.length) {
- for(var j = 0; j < dat.length; j++) {
- for(var i = 0; i < manageArr.length; i++) {
- console.log(manageArr[i].type)
- if(manageArr[i].type == dat[j]) {
- if(manageArr[i].type != 8) {
- equipManageHtml += '<div class="mui-col-xs-6" onclick="openwindow(\'' + manageArr[i].url[0] + '\')"><div class="categoryItem blueColor">' +
- '<div class="leftTxt"><h2>' + manageArr[i].name + '</h2><p>查看更多 >></p>' +
- '</div><img class="rightImg" src="' + manageArr[i].icon[0] + '" /></div></div>';
- }
- if(manageArr[i].type != 4 && manageArr[i].type != 6 ) {
- equipreportHtml += '<div class="mui-col-xs-6" onclick="openwindow(\'' + manageArr[i].url[1] + '\')"><div class="categoryItem greenColor">' +
- '<div class="leftTxt"><h2>' + manageArr[i].name + '</h2><p>查看更多 >></p>' +
- '</div><img class="rightImg" src="' + manageArr[i].icon[1] + '" /></div></div>'
- }
- }
- }
- if(j == dat.length - 1) {
- console.log(equipManageHtml)
- console.log(equipreportHtml)
- $('#equipManageDiv').html(equipManageHtml);
- $('#equipReportDiv').html(equipreportHtml);
- }
- }
- } else {
- var html = '<div class="mui-col-xs-6"><div>暂无设备</h2></div></div>';
- $('#equipManageDiv').html(html);
- $('#equipReportDiv').html(html);
- }
- },
- error: function(xhr, type, errorThrown) {
- console.log(errorThrown)
- mui.toast('登录请求失败');
- }
- });
- })
- function openwindow(para) {
- var path = para;
- var id = (path.substr(path.lastIndexOf('/') + 1)).split('.')[0]
- mui.openWindow({
- url: path,
- id: id
- })
- }
- </script>
- </body>
- </html>
|