yf_zd 5 سال پیش
کامیت
fbab62050f
100فایلهای تغییر یافته به همراه25278 افزوده شده و 0 حذف شده
  1. 127 0
      .project
  2. 134 0
      css/common.css
  3. 88 0
      css/equipList.css
  4. 65 0
      css/equipjk.css
  5. 80 0
      css/feedback-page.css
  6. 115 0
      css/feedback.css
  7. 261 0
      css/iconfont.css
  8. 6 0
      css/mescroll.min.css
  9. 1 0
      css/mobiscroll.custom-3.0.0-beta6.min.css
  10. 5612 0
      css/mui.css
  11. 5 0
      css/mui.min.css
  12. 85 0
      css/mui.picker.css
  13. 7 0
      css/mui.picker.min.css
  14. 64 0
      css/mui.poppicker.css
  15. 88 0
      css/pagination.css
  16. 111 0
      css/rangeslider.css
  17. 42 0
      css/reset.css
  18. 12 0
      css/swiper-4.4.6.min.css
  19. 12 0
      css/swiper.min.css
  20. 114 0
      css/timeLine.css
  21. 110 0
      equipAllot/equip_allot_info.html
  22. 615 0
      equipAllot/equip_allot_item.html
  23. 218 0
      equipAllot/equip_allot_list.html
  24. 206 0
      equipList/equip_list.html
  25. 245 0
      equipList/equip_list_info.html
  26. 189 0
      equipList/equip_list_map.html
  27. 552 0
      equipManage/configuration_bzy.html
  28. 555 0
      equipManage/configuration_cbd.html
  29. 177 0
      equipManage/equipManage_bzy.html
  30. 705 0
      equipManage/equipManage_bzy_detail.html
  31. 176 0
      equipManage/equipManage_cbd.html
  32. 458 0
      equipManage/equipManage_cbd_detail.html
  33. 216 0
      equipManage/equipManage_jk.html
  34. 274 0
      equipManage/equipManage_jk_detail.html
  35. 175 0
      equipManage/equipManage_qxz.html
  36. 278 0
      equipManage/equipManage_qxz_data24.html
  37. 258 0
      equipManage/equipManage_qxz_data24Old.html
  38. 342 0
      equipManage/equipManage_qxz_detail.html
  39. 345 0
      equipManage/equipManage_qxz_detailOld.html
  40. 262 0
      equipManage/equipManage_qxz_manualCtrl.html
  41. 404 0
      equipManage/equipManage_qxz_setAstrict.html
  42. 392 0
      equipManage/equipManage_qxz_setTiming.html
  43. 176 0
      equipManage/equipManage_scd.html
  44. 898 0
      equipManage/equipManage_scd_detail.html
  45. 174 0
      equipManage/equipManage_ybq.html
  46. 521 0
      equipManage/equipManage_ybq_detail.html
  47. 401 0
      equipManage/lookImage_jk.html
  48. 193 0
      equipManage/sex_trap.html
  49. 828 0
      equipManage/sex_trap_detail1.html
  50. 470 0
      equipManage/sex_trap_detail1_config.html
  51. 737 0
      equipManage/sex_trap_detail2.html
  52. 442 0
      equipManage/sex_trap_detail2_config.html
  53. 401 0
      equipManage/sex_trap_detail_echart.html
  54. 212 0
      equipManage/sex_trap_detail_list.html
  55. 257 0
      equipManage/sex_trap_detail_list_detail1.html
  56. 184 0
      equipManage/sex_trap_detail_list_detail2.html
  57. 448 0
      equipManage/sex_trap_photo2.html
  58. BIN
      fonts/iconfont.eot
  59. 1 0
      fonts/iconfont.js
  60. 364 0
      fonts/iconfont.svg
  61. BIN
      fonts/iconfont.ttf
  62. BIN
      fonts/iconfont.woff
  63. BIN
      fonts/iconfont.woff2
  64. BIN
      fonts/mui.ttf
  65. 34 0
      helpcenter/copy---feedback.html
  66. 34 0
      helpcenter/feedback.html
  67. 157 0
      helpcenter/help_detail.html
  68. 94 0
      helpcenter/help_list.html
  69. 113 0
      helpcenter/useDirection.html
  70. 217 0
      home/autoDiscern.html
  71. 338 0
      home/autoDiscernResult.html
  72. 126 0
      home/bottonTab.html
  73. 133 0
      home/copy-equip.html
  74. 325 0
      home/copyhomePage.html
  75. 244 0
      home/equip.html
  76. 156 0
      home/guide.html
  77. 573 0
      home/homePage.html
  78. 387 0
      home/login.html
  79. 171 0
      home/main.html
  80. 436 0
      home/map.html
  81. 122 0
      home/map_nav.html
  82. 72 0
      home/permission.html
  83. 405 0
      home/personalinfo.html
  84. 253 0
      home/register.html
  85. BIN
      images/1.png
  86. BIN
      images/11.png
  87. BIN
      images/2.png
  88. BIN
      images/3.png
  89. BIN
      images/7.png
  90. BIN
      images/8.png
  91. BIN
      images/IDicon.png
  92. BIN
      images/admin.png
  93. BIN
      images/againLoad.png
  94. BIN
      images/allotEqueip.png
  95. BIN
      images/annular.png
  96. BIN
      images/ant.jpg
  97. BIN
      images/autoDiscern.jpg
  98. BIN
      images/banner1.jpg
  99. BIN
      images/banner2.jpg
  100. 0 0
      images/banner3.jpg

+ 127 - 0
.project

@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>yfzhwlw</name>
+	<comment>Create By HBuilder</comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.pandora.projects.ui.MKeyBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.aptana.ide.core.unifiedBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.pandora.projects.ui.MKeyNature</nature>
+		<nature>com.aptana.projects.webnature</nature>
+	</natures>
+	<filteredResources>
+		<filter>
+			<id>1529571268810</id>
+			<name></name>
+			<type>10</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.orFilterMatcher</id>
+				<arguments>
+					<matcher>
+						<id>org.eclipse.ui.ide.multiFilter</id>
+						<arguments>1.0-projectRelativePath-matches-false-false-bin</arguments>
+					</matcher>
+					<matcher>
+						<id>org.eclipse.ui.ide.multiFilter</id>
+						<arguments>1.0-projectRelativePath-matches-false-false-setting</arguments>
+					</matcher>
+				</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1543632554497</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1543632554503</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1543826698320</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1562032727949</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1562033735532</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1562033941455</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1583913951206</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+		<filter>
+			<id>1587885920573</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+<<<<<<< HEAD
+		<filter>
+			<id>1596695415474</id>
+			<name></name>
+			<type>26</type>
+			<matcher>
+				<id>org.eclipse.ui.ide.multiFilter</id>
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
+			</matcher>
+		</filter>
+=======
+>>>>>>> 18572b175d7739344de36ad55dfb3ea8a40b8a4e
+	</filteredResources>
+</projectDescription>

+ 134 - 0
css/common.css

@@ -0,0 +1,134 @@
+/*蓝色导航*/
+
+.mui-bar {
+	background-color: #21b2e7;
+}
+
+.mui-title,
+.mui-bar a {
+	color: #fff;
+}
+body{
+	font-size: 14px;
+}
+
+
+/*导航右侧按钮*/
+
+.headRightIcon {
+	display: inline-block;
+	font-size: 12px;
+}
+
+.headRightIcon:before {
+	display: block;
+	text-align: center;
+	font-size: 19px;
+	margin: 3px 0;
+}
+
+
+/*无背景搜索框*/
+
+.faxSearchBox {
+	background-color: #eee;
+	padding: 0px 8px;
+	position: relative;
+	margin: 6px 0 8px;
+}
+
+.faxSearchBox .mui-search .mui-placeholder {
+	text-align: left;
+	left: 5px;
+}
+
+.faxSearchBox input[type=search] {
+	background: #fff;
+}
+
+.faxSearchBox .mui-search .mui-placeholder .mui-icon {
+	color: #777;
+}
+
+.faxSearchBox .searchBtnBox {
+	position: absolute;
+	right: 8px;
+	top: 0px;
+	z-index: 10;
+}
+
+.faxSearchBox #searchBtn {
+	letter-spacing: 3px;
+	line-height: 1.6;
+	border: none;
+}
+
+.faxSearchBox .cutline {
+	display: inline-block;
+	border-left: .08em dashed #777;
+	margin-top: 6px;
+}
+
+
+/*有背景搜索框*/
+
+.searchBox {
+	position: fixed;
+	left: 0;
+	right: 0;
+	z-index: 222;
+	padding: 0;
+}
+
+.searchBox:before {
+	position: absolute;
+	content: '';
+	background: #21b2e7;
+	width: 100%;
+	height: 35%;
+}
+
+.searchBox .searchControl {
+	width: 91%;
+	margin: 0 auto;
+}
+
+.searchBox .mui-search {
+	display: inline-block;
+	width: 79%;
+}
+
+.searchBox .searchBtn,
+.searchBox .mui-search>input,
+.searchBox .equipItem {
+	box-shadow: 1px 2px 3px 1px #cccccc;
+}
+
+.searchBox .searchBtn,
+.searchBox .mui-search>input {
+	background: #fff;
+}
+
+.searchBox .searchBtn {
+	border-color: #fff;
+	width: 19%;
+}
+
+/*标题颜色*/
+.equipTitle {
+	color: #21b2e7;
+	font-size: 14px;
+}
+/*清除浮动*/
+.clearfix:after {
+	content: " "; 
+	display: block; 
+	clear: both; 
+	visibility: hidden; 
+	line-height: 0; 
+	height: 0; 
+	font-size: 0;
+}
+.clearfix{
+	*zoom:1;
+}

+ 88 - 0
css/equipList.css

@@ -0,0 +1,88 @@
+/*列表*/
+
+.equipItem {
+	margin: 0 15px 10px;
+	background: #fff;
+	border-radius: 7px;
+}
+
+.equipItem_top,
+.equipItem_bottom {
+	padding: 0 10px;
+}
+
+.equipItem_top {
+	position: relative;
+	height: 60px;
+}
+
+.equipTitle {
+	border-bottom: 1px dashed #ccc;
+	height: 45px;
+	line-height: 45px;
+}
+
+.equipTitle img {
+	vertical-align: middle;
+}
+
+.equipIdIcon {
+	margin-right: 5px;
+}
+
+.equipType {
+	float: right;
+	margin-top: 8px;
+}
+
+.equipItem_line {
+	position: absolute;
+	bottom: 5px;
+	left: 0;
+	right: 0;
+}
+
+.equipItem_line:before,
+.equipItem_line:after {
+	position: absolute;
+	bottom: 5px;
+	width: 15px;
+	height: 15px;
+	border-radius: 50%;
+	content: '';
+	background: #efeff4;
+}
+
+.equipItem_line:before {
+	left: -6px;
+}
+
+.equipItem_line:after {
+	right: -6px;
+}
+
+.equipItem_bottom {
+	padding-bottom: 10px;
+}
+
+.equipMsg {
+	text-align: right;
+	line-height: 28px;
+}
+
+.equipMsg>label {
+	float: left;
+	color: #ccc;
+}
+
+ul {
+	padding: 0;
+}
+
+.mescroll {
+	position: fixed;
+	top: 73px;
+	bottom: 0;
+	height: auto;
+	/*如设置bottom:50px,则需height:auto才能生效*/
+}

+ 65 - 0
css/equipjk.css

@@ -0,0 +1,65 @@
+.jkitem{
+	position: relative;
+    margin: .4rem;
+    border-radius: .2rem;
+    background: #FFF url(../images/jkListBj.png) no-repeat 92% bottom;
+    background-size: 1.3rem;
+}
+.jkmsg{
+	padding: .22rem 2rem .22rem .38rem;
+}
+.jkmsgTop{
+	letter-spacing: 0.04rem;
+    border-bottom: 1px dashed #777;
+    padding-bottom: .2rem;
+    line-height: .5rem;
+    margin-bottom: .2rem;
+}
+.jkmsgBottom{
+	letter-spacing: .1rem;
+	font-size: .22rem;
+}
+.blue >div{
+	background: #21b2e7;
+}
+.blue{
+	color: #21b2e7;
+}
+.pink{
+	color: #f77b7b;
+}
+.pink >div{
+	background: #f77b7b;
+}
+.jkmsgBottom >div{
+	display: inline-block;
+    width: .4rem;
+    height: .4rem;
+    border-radius: 50%;
+    line-height: .38rem;
+    overflow: hidden;
+    text-align: center;
+    vertical-align: middle;
+    margin-right: .1rem;
+}
+.jkmsgBottom >div >img{
+	width: 51%;
+}
+.circleBj{
+	position: absolute;
+    right: -.17rem;
+    top: 0;
+    bottom: 0;
+    width: .3rem;
+}
+.circleBj div{
+	width: .3rem;
+    height: 0.22rem;
+    border-radius: .1rem;
+    background: #efeff4;
+    margin: .14rem 0;
+}
+/*jk详情*/
+.bottomCtrl{
+	background: url(../images/jkctrl.png) no-repeat center;
+}

+ 80 - 0
css/feedback-page.css

@@ -0,0 +1,80 @@
+.feedback body {
+	background-color: #EFEFF4;
+}
+.feedback input,
+.feedback textarea {
+	border: none !important;
+}
+.feedback textarea {
+	height: 100px;
+	margin-bottom: 0 !important;
+	padding-bottom: 0 !important;
+}
+.feedback .row {
+	width: 100%;
+	background-color: #fff;
+}
+.feedback p {
+	padding: 10px 15px 0;
+}
+.feedback button { 
+	width: 90%;
+	height: 46px;
+	left: 50%;
+	-webkit-transform: translate(-50%);
+}
+.feedback .hidden {
+	display: none;
+}
+.feedback .image-list {
+	width: 100%;
+	height: 85px;
+	background-size: cover;
+	padding: 10px 10px;
+	overflow: hidden;
+}
+.feedback .image-item {
+	width: 65px;
+	height: 65px;
+	background-image: url(../images/iconfont-tianjia.png);
+	background-size: 100% 100%;
+	display: inline-block;
+	position: relative;
+	border-radius: 5px;
+	margin-right: 10px;
+	margin-bottom: 10px;
+	border: solid 1px #e8e8e8;
+}
+.feedback .image-item input[type="file"] {
+	position: absolute;
+	left: 0px;
+	top: 0px;
+	width: 100%;
+	height: 100%;
+	opacity: 0;
+	cursor: pointer;
+	z-index: 0;
+}
+.feedback .image-item.space {
+	border: none;
+}
+.feedback .image-item .image-close {
+	position: absolute;
+	display: inline-block;
+	right: -6px;
+	top: -6px;
+	width: 20px;
+	height: 20px;
+	text-align: center;
+	line-height: 20px;
+	border-radius: 12px;
+	background-color: #FF5053;
+	color: #f3f3f3;
+	border: solid 1px #FF5053;
+	font-size: 9px;
+	font-weight: 200;
+	z-index: 1;
+}
+.feedback .image-item.space .image-close {
+	display: none;
+}

+ 115 - 0
css/feedback.css

@@ -0,0 +1,115 @@
+/*!
+ * ======================================================
+ * FeedBack Template For MUI (http://dev.dcloud.net.cn/mui)
+ * =======================================================
+ * @version:1.0.0
+ * @author:cuihongbao@dcloud.io
+ */
+
+.feedback body {
+	background-color: #EFEFF4;
+}
+.feedback input,
+.feedback textarea {
+	border: none !important;
+}
+.feedback textarea {
+	height: 100px;
+	margin-bottom: 0 !important;
+	padding-bottom: 0 !important;
+}
+.feedback .row {
+	width: 100%;
+	background-color: #fff;
+}
+.feedback p {
+	padding: 10px 15px 0;
+}
+/*.feedback button#submit { 
+	width: 90%;
+	height: 46px;
+	left: 50%;
+	-webkit-transform: translate(-50%);
+}*/
+
+input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{
+	font-size: 14px;
+}
+
+.feedback .hidden {
+	display: none;
+}
+.feedback .image-list {
+	width: 100%;
+	height: 85px;
+	background-size: cover;
+	padding: 10px 10px;
+	overflow: hidden;
+}
+.feedback .image-item {
+	width: 65px;
+	height: 65px;
+	background-image: url(../images/iconfont-tianjia.png);
+	background-size: 100% 100%;
+	display: inline-block;
+	position: relative;
+	border-radius: 5px;
+	margin-right: 10px;
+	margin-bottom: 10px;
+	border: solid 1px #e8e8e8;
+}
+.feedback .image-item .file {
+	position: absolute;
+	left: 0px;
+	top: 0px;
+	width: 100%;
+	height: 100%;
+	opacity: 0;
+	cursor: pointer;
+	z-index: 0;
+}
+.feedback .image-item.space {
+	border: none;
+}
+.feedback .image-item .image-close {
+	position: absolute;
+	display: inline-block;
+	right: -6px;
+	top: -6px;
+	width: 20px;
+	height: 20px;
+	text-align: center;
+	line-height: 20px;
+	border-radius: 12px;
+	background-color: #FF5053;
+	color: #f3f3f3;
+	border: solid 1px #FF5053;
+	font-size: 9px;
+	font-weight: 200;
+	z-index: 1;
+}
+.feedback .image-item.space .image-close {
+	display: none;
+}
+.feedback .mui-inline{
+	vertical-align: bottom;
+	font-size: 14px;
+	color: #8f8f94;
+}
+.mui-icon-star{
+	color: #B5B5B5;
+	font-size: 22px;
+}
+.mui-icon-star-filled{
+	color: #FFB400;
+	font-size: 22px;
+} 
+.mui-popover {
+	height: 180px;
+}
+.stream{
+	display: none;
+}
+.mui-plus-stream .stream{
+	display: block;
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 261 - 0
css/iconfont.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 6 - 0
css/mescroll.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
css/mobiscroll.custom-3.0.0-beta6.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 5612 - 0
css/mui.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 5 - 0
css/mui.min.css


+ 85 - 0
css/mui.picker.css

@@ -0,0 +1,85 @@
+/**
+ * 地址选择器使用样式〃鎻掍欢
+ * varstion 2.0.0
+ * by Houfeng
+ * Houfeng@DCloud.io
+ */
+
+.mui-picker {
+    background-color: #ddd;
+    position: relative;
+    height: 200px;
+    overflow: hidden;
+    border: solid 1px rgba(0, 0, 0, 0.1);
+    -webkit-user-select: none;
+    user-select: none;
+    box-sizing: border-box;
+}
+.mui-picker-inner {
+    box-sizing: border-box;
+    position: relative;
+    width: 100%;
+    height: 100%;
+    overflow: hidden;
+    -webkit-mask-box-image: -webkit-linear-gradient(bottom, transparent, transparent 5%, #fff 20%, #fff 80%, transparent 95%, transparent);
+    -webkit-mask-box-image: linear-gradient(top, transparent, transparent 5%, #fff 20%, #fff 80%, transparent 95%, transparent);
+}
+.mui-pciker-list,
+.mui-pciker-rule {
+    box-sizing: border-box;
+    padding: 0px;
+    margin: 0px;
+    width: 100%;
+    height: 36px;
+    line-height: 36px;
+    position: absolute;
+    left: 0px;
+    top: 50%;
+    margin-top: -18px;
+}
+.mui-pciker-rule-bg {
+    z-index: 0;
+    /*background-color: #cfd5da;*/
+}
+.mui-pciker-rule-ft {
+    z-index: 2;
+    border-top: solid 1px rgba(0, 0, 0, 0.1);
+    border-bottom: solid 1px rgba(0, 0, 0, 0.1);
+    /*-webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);*/
+    /*box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1);*/
+}
+.mui-pciker-list {
+    z-index: 1;
+    -webkit-transform-style: preserve-3d;
+    transform-style: preserve-3d;
+    -webkit-transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
+    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
+}
+.mui-pciker-list li {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    text-align: center;
+    vertical-align: middle;
+    -webkit-backface-visibility: hidden;
+    backface-visibility: hidden;
+    overflow: hidden;
+    box-sizing: border-box;
+    font-size: 16px;
+    font-family: "Helvetica Neue", "Helvetica", "Arial", "sans-serif";
+    color: #888;
+    padding: 0px 8px;
+    white-space: nowrap;
+    -webkit-text-overflow: ellipsis;
+    text-overflow: ellipsis;
+    overflow: hidden;
+    cursor: default;
+    visibility: hidden;
+}
+.mui-pciker-list li.highlight,
+.mui-pciker-list li.visible {
+    visibility: visible;
+}
+.mui-pciker-list li.highlight {
+    color: #222;
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 7 - 0
css/mui.picker.min.css


+ 64 - 0
css/mui.poppicker.css

@@ -0,0 +1,64 @@
+.mui-poppicker {
+	position: fixed;
+	left: 0px;
+	width: 100%;
+	z-index: 999;
+	background-color: #eee;
+	border-top: solid 1px #ccc;
+	box-shadow: 0px -5px 7px 0px rgba(0, 0, 0, 0.1);
+	-webkit-transition: .3s;
+	bottom: 0px;
+	-webkit-transform: translateY(300px);
+}
+.mui-poppicker.mui-active {
+	-webkit-transform: translateY(0px);
+}
+.mui-android-5-1 .mui-poppicker {
+	bottom: -300px;
+	-webkit-transition-property: bottom;
+	-webkit-transform: none;
+}
+.mui-android-5-1 .mui-poppicker.mui-active {
+	bottom: 0px;
+	-webkit-transition-property: bottom;
+	-webkit-transform: none;
+}
+.mui-poppicker-header {
+	padding: 6px;
+	font-size: 14px;
+	color: #888;
+}
+.mui-poppicker-header .mui-btn {
+	font-size: 12px;
+	padding: 5px 10px;
+}
+.mui-poppicker-btn-cancel {
+	float: left;
+}
+.mui-poppicker-btn-ok {
+	float: right;
+}
+.mui-poppicker-clear {
+	clear: both;
+	height: 0px;
+	line-height: 0px;
+	font-size: 0px;
+	overflow: hidden;
+}
+.mui-poppicker-body {
+	position: relative;
+	width: 100%;
+	height: 200px;
+	border-top: solid 1px #ddd;
+	/*-webkit-perspective: 1200px;
+	perspective: 1200px;
+	-webkit-transform-style: preserve-3d;
+	transform-style: preserve-3d;*/
+}
+.mui-poppicker-body .mui-picker {
+	width: 100%;
+	height: 100%;
+	margin: 0px;
+	border: none;
+	float: left;
+}

+ 88 - 0
css/pagination.css

@@ -0,0 +1,88 @@
+@charset "UTF-8";
+.m-style {
+    position: relative;
+    text-align: center;
+    zoom: 1;
+}
+
+.m-style:before,
+.m-style:after {
+    content: "";
+    display: table;
+}
+
+.m-style:after {
+    clear: both;
+    overflow: hidden;
+}
+
+.m-style span {
+    float: left;
+    margin: 0 5px;
+    width: 38px;
+    height: 38px;
+    line-height: 38px;
+    color: #bdbdbd;
+    font-size: 14px;
+}
+
+.m-style .active {
+    float: left;
+    margin: 0 5px;
+    width: 38px;
+    height: 38px;
+    line-height: 38px;
+    background: #e91e63;
+    color: #fff;
+    font-size: 14px;
+    border: 1px solid #e91e63;
+}
+
+.m-style a {
+    float: left;
+    margin: 0 5px;
+    width: 38px;
+    height: 38px;
+    line-height: 38px;
+    background: #fff;
+    border: 1px solid #ebebeb;
+    color: #bdbdbd;
+    font-size: 14px;
+}
+
+.m-style a:hover {
+    color: #fff;
+    background: #e91e63;
+}
+
+.m-style .next,
+.m-style .prev {
+    font-family: "Simsun";
+    font-size: 16px;
+    font-weight: bold;
+}
+
+.now,
+.count {
+    padding: 0 5px;
+    color: #f00;
+}
+
+.eg img {
+    max-width: 800px;
+    min-height: 500px;
+}
+
+input {
+    float: left;
+    margin: 0 5px;
+    width: 38px;
+    height: 38px;
+    line-height: 38px;
+    text-align: center;
+    background: #fff;
+    border: 1px solid #ebebeb;
+    outline: none;
+    color: #bdbdbd;
+    font-size: 14px;
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 111 - 0
css/rangeslider.css


+ 42 - 0
css/reset.css

@@ -0,0 +1,42 @@
+html, body, div, span,object, iframe,input,button,select,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,strong,var,b,i,
+dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details,figure, figcaption, footer, header, hgroup, 
+menu, nav, output,section, summary,time, mark, textarea, audio, video ,hr{
+    margin: 0;
+    padding: 0;
+    border: 0;
+    font-size: 100%;
+    font: inherit;
+    vertical-align: baseline;
+    outline: none;
+}
+/* HTML5 display-role reset for older browsers */
+article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
+    display: block;
+}
+hr,input,button,textarea{
+   border: none;
+}
+input, select{
+    vertical-align:middle;
+}
+li{
+    list-style:none;
+}
+img{
+    border:0;
+    outline: 0;
+    vertical-align:middle;
+}
+button{
+    cursor:pointer;
+}
+a{
+    color:#666;
+    text-decoration:none;
+}
+textarea{
+    resize: none;
+}
+::-ms-clear{
+    display:none;
+}

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 12 - 0
css/swiper-4.4.6.min.css


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 12 - 0
css/swiper.min.css


+ 114 - 0
css/timeLine.css

@@ -0,0 +1,114 @@
+.mui-bar-nav~.mui-content {
+	padding-top: 51px;
+}
+
+#timeSelect {
+	background: #fff url(../images/calendar.png) no-repeat 10px center;
+	background-size: 20px;
+	padding-left: 30px;
+	font-size: 16px;
+	-webkit-box-sizing: border-box;
+	box-sizing: border-box;
+	height: 34px;
+	border: 0;
+	border-radius: 6px;
+	line-height: 34px;
+	color: #535353;
+}
+
+
+/*列表*/
+
+ul {
+	padding: 0;
+	list-style: none;
+}
+
+#dataList>li {
+	border-left: 1px dashed #b8b8b8;
+	margin-left: 20px;
+	padding-bottom: 10px;
+}
+
+.equipItem {
+	margin: 0 20px 0px 18px;
+	position: relative;
+	background: #fff;
+	border-radius: 7px;
+	padding: 12px;
+}
+
+.equipItem:before {
+	position: absolute;
+	top: 20px;
+	left: -25px;
+	width: 12px;
+	height: 12px;
+	border-radius: 50%;
+	content: '';
+}
+
+.equipItem:after {
+	position: absolute;
+	top: 18px;
+	left: -7px;
+	width: 0;
+	height: 0;
+	content: '';
+	background-size: 100% 100%;
+	border: 8px solid #fff;
+	border-left-color: transparent;
+	border-top-color: transparent;
+	transform: rotate(-225deg);
+}
+
+.upl_time {
+	font-size: 16px;
+	line-height: 30px;
+	font-weight: bold;
+}
+
+.equipItem:active {
+	background-color: #e4e3e3 !important;
+}
+
+.equipItem:active.equipItem:after {
+	border: 8px solid #e4e3e3;
+	border-left-color: transparent;
+	border-top-color: transparent;
+}
+
+
+/*皮肤*/
+
+.blue:before {
+	background: #00b9fe;
+}
+
+.blue .upl_time {
+	color: #00b9fe;
+}
+
+.purple:before {
+	background: #c8c6f7;
+}
+
+.purple .upl_time {
+	color: #c8c6f7;
+}
+
+.searchBox {
+	position: fixed;
+	left: 0;
+	right: 0;
+	z-index: 222;
+	padding: 0;
+}
+
+.mescroll {
+	position: fixed;
+	top: 100px;
+	bottom: 0;
+	height: auto;
+	/*如设置bottom:50px,则需height:auto才能生效*/
+}

+ 110 - 0
equipAllot/equip_allot_info.html

@@ -0,0 +1,110 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" type="text/css" href="../css/common.css" />
+		<style type="text/css">
+			.nullData {
+				top: 45px;
+			}
+			.allotBtn{
+				display: none;
+			}
+			.equipTitle {
+				color: #21b2e7;
+				font-size: 14px;
+			}
+			.mui-table-view-cell p {
+				color: #333;
+				font-size: 16px;
+				margin-top: 4px;
+			}
+			.mui-content>.mui-table-view:first-child{
+				margin-top: 0;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title"></h1>
+			<a class="headRightIcon fa fa-sitemap mui-pull-right" id="allotBtn">分配</a>
+		</header>
+		<div class="mui-content">
+			<!--<input type="hidden" name="userId" id="userId" value="" />-->
+			<ul class="mui-table-view" id="equip">
+				
+			</ul>
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			var userId;
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				console.log(self.userId);
+				userId = self.userId;
+				pulldownRefresh()
+			})
+			function pulldownRefresh(){
+				mui.ajax('http://120.27.222.26/app_usermanage_detail', {
+					data: {
+						userId: userId,
+					},
+					dataType: 'json', //服务器返回json格式数据
+					type: 'post', //HTTP请求类型
+					timeout: 10000, //超时时间设置为10秒;
+					success: function(data) {
+						$('#allotBtn').show();
+						$('.nullData').remove();
+						$('#title').html(data.username+'用户');	
+						var tel = data.tel || '暂未填写';
+						var usertype;
+						if(data.usertype == 0){
+							usertype = '超级管理员';
+						}else if(data.usertype == 1){
+							usertype = '管理员';
+						}else if(data.usertype == 2){
+							usertype = '用户';
+						}
+						var is_use = data.is_active?'不可用':'可用';
+						var html = '<li class="mui-table-view-cell" id="123456"><span class="equipTitle">用户名</span><p>'+data.username+'</p></li>'+
+									'<li class="mui-table-view-cell" id="11"><span class="equipTitle">用户邮箱</span><p>'+data.email+'</p></li>'+
+									'<li class="mui-table-view-cell" id="22"><span class="equipTitle">用户电话</span><p>'+tel+'</p></li>'+
+									'<li class="mui-table-view-cell" id="22"><span class="equipTitle">用户类型</span><p>'+usertype+'</p></li>'+
+									'<li class="mui-table-view-cell" id="22"><span class="equipTitle">是否可用</span><p>'+is_use+'</p></li>'+
+									'<li class="mui-table-view-cell" id="22"><span class="equipTitle">创建时间</span><p>'+data.creatTime+'</p></li>';
+						$('#equip').html(html);
+					},
+					error: function(xhr, type, errorThrown) {
+						$('#allotBtn').hide();
+						$('#equiplist').empty();
+						mui('.mui-content')[0].appendChild(netStyle('../images/error.png'));
+						mui.toast('数据请求失败');
+					}
+				});
+			}
+			mui('.mui-bar').on('tap','.fa-sitemap',function(){
+				if(userId){
+					mui.openWindow({
+						url:'equip_allot_item.html',
+						id:'equip_allot_item',
+						extras: {
+							userId: userId
+						}
+					})
+				}else{
+					mui.toast('当前设备请求失败');
+				}
+			})
+		</script>
+	</body>
+
+</html>

+ 615 - 0
equipAllot/equip_allot_item.html

@@ -0,0 +1,615 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link href="../css/reset.css" rel="stylesheet" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			/*搜索浮动*/
+			.searchBox {
+				position: fixed;
+				left: 0;
+				right: 0;
+				z-index: 222;
+				padding: 0;
+			}
+			.searchBox:before{
+				position: absolute;
+				content: '';
+				background: #21b2e7;
+				width: 100%;
+				height: 35%;
+			}
+			.searchControl{
+				width: 91%;
+    			margin: 0 auto;
+			}
+			.mui-search{
+				display: inline-block;
+    			width: 79%;
+			}
+			.searchBtn,.mui-search >input,.equipItem{
+    			box-shadow: 1px 2px 3px 1px #cccccc;
+			}
+			.searchBtn,.mui-search >input{
+				background: #fff;
+			}
+			
+			.searchBtn{
+				border-color: #fff;
+			    width: 19%;
+			}
+			.equipTitle {
+				color: #21b2e7;
+				font-size: 14px;
+			}
+			
+			.mui-table-view-cell p {
+				color: #333;
+				font-size: 16px;
+				margin-top: 4px;
+			}
+			/*方块形复选框*/
+			
+			.mui-checkbox input[type=checkbox]:before {
+				content: '\e413';
+			}
+			
+			.mui-checkbox input[type=checkbox]:checked:before {
+				content: '\e443';
+			}
+			
+			.mui-checkbox input[type=checkbox]:before,
+			.mui-radio input[type=radio]:before {
+				font-size: 18px;
+			}
+			
+			.mui-checkbox.mui-left input[type=checkbox],
+			.mui-radio.mui-left input[type=radio] {
+				left: 15px;
+			}
+			
+			.mui-checkbox.mui-left label,
+			.mui-radio.mui-left label {
+				padding-left: 40px
+			}
+			
+			.mui-checkbox {
+				display: inline-block;
+			}
+			
+			.mui-checkbox input[type=checkbox],
+			.mui-radio input[type=radio] {
+				top: 10px;
+				width: 20px;
+				height: 20px;
+			}
+			
+			.mui-navigate-right:after,
+			.mui-push-right:after {
+				content: '\e581';
+			}
+			
+			.secondary.active .mui-navigate-right:after,
+			.secondary.active .mui-push-right:after {
+				content: '\e580';
+			}
+			
+			.mui-table-view-cell>a:not(.mui-btn) {
+				padding: 0;
+				margin: 0;
+			}
+			
+			.secondary>.secondaryDetial {
+				display: none;
+				transition: height .35s ease;
+			}
+			
+			.secondary.active>.secondaryDetial {
+				display: block;
+			}
+			
+			.mui-table-view-cell {
+				padding: 0;
+			}
+			
+			.secondaryDetial {
+				padding: 5px 0 0 40px;
+				background: #eee;
+			}
+			
+			.secondaryDetial p {
+				line-height: 25px;
+				color: #333;
+			}
+			/*input*/
+			
+			.secondary input {
+				position: absolute;
+				display: inline-block;
+				border: 0;
+				outline: 0!important;
+				background-color: transparent;
+				-webkit-appearance: none;
+				top: 10px;
+				width: 20px;
+				height: 20px;
+				left: 14px;
+			}
+			
+			.secondary input:before {
+				font-size: 18px;
+				content: '\e413';
+				font-family: Muiicons;
+				font-weight: 400;
+				line-height: 1;
+				text-decoration: none;
+				color: #aaa;
+				border-radius: 0;
+				background: 0 0;
+				-webkit-font-smoothing: antialiased;
+			}
+			
+			.secondary input[type=checkbox]:checked:before {
+				content: '\e443';
+				color: #007aff;
+			}
+			
+			.secondary span {
+				line-height: 40px;
+				padding-left: 40px;
+			}
+			/*list*/
+			.mescroll{
+				position: fixed;
+				top: 87px;
+				bottom: 0;
+				height: auto; /*如设置bottom:50px,则需height:auto才能生效*/
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">分配设备</h1>
+			<a class="headRightIcon fa fa-cloud-upload mui-pull-right" id="allotBtn">提交</a>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+					    <input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll"> <!--id可以改,而"mescroll"的class不能删-->
+		   		<ul class="mui-table-view" id="dataList">
+					<!--<li class="mui-table-view-cell">
+						<div class="mui-input-row mui-checkbox  mui-left">
+							<label>全选</label>
+							<input name="checkbox1" id="checkall" type="checkbox">
+						</div>
+					</li>
+
+					<li class="mui-table-view-cell secondary">
+						<a class="mui-navigate-right" href="#">
+							<input type="checkbox" name="checkbox1" checked="checked" class="check" value="3" />
+							<span>设备imei:444444444444</span>
+						</a>
+						<div class="secondaryDetial">
+							<p>设备名称:无</p>
+							<p>设备类型:测报灯</p>
+							<p>设备添加时间:2018/6-23</p>
+							<p>设备用户:无</p>
+						</div>
+					</li>-->
+				</ul>
+		   </div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mui.min.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/common.js"></script>
+			<script type="text/javascript">
+			var chknum = 0;
+			var checklen;
+			var userId;
+			mui.init()
+			mui.plusReady(function() {
+					var self = plus.webview.currentWebview();
+					console.log(self.userId);
+					userId = self.userId;
+
+
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop:{ //配置回到顶部按钮
+							src : "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset : 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId:	"dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+				        	use: true // 是否开启懒加载,默认false
+				        }
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page){
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData,totalSize){
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData,page.num);
+					}, function(){
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+		                mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData,pageNum){
+					var html = '';
+					var dat = curPageData;
+					if(pageNum == 1) {
+						$('.nullData').remove();
+						$('#dataList').empty();
+						html = '<li class="mui-table-view-cell"><div class="mui-input-row mui-checkbox  mui-left">' +
+							'<label>全选</label><input name="checkbox1" id="checkall" type="checkbox"></div></li>';
+					}
+					for(var i = 0; i < dat.length; i++) {
+						var checked;
+						if(dat[i].checked == 1) {
+							checked = '<input type="checkbox" checked="checked" name="checkbox1"class="check" value="' + dat[i].equipid + '" />';
+						} else {
+							checked = '<input type="checkbox" name="checkbox1"class="check" value="' + dat[i].equipid + '" />';
+						}
+
+						var equiptype;
+						if(dat[i].equiptype) {
+							equiptype = '测报灯';
+						} else {
+							equiptype = '杀虫灯';
+						}
+						var equip_user;
+						if(dat[i].equip_user == 'None' || dat[i].equip_user == '') {
+							equip_user = '无'
+						} else {
+							equip_user = dat[i].equip_user;
+						}
+						html += '<li class="mui-table-view-cell secondary"><a class="mui-navigate-right" href="#">' +
+							checked + '<span>设备ID:' + dat[i].equipid + '</span>' +
+							'</a><div class="secondaryDetial"><p>设备名称:无</p><p>设备类型:' + equiptype + '</p>' +
+							'<p>设备添加时间:' + dat[i].equip_add_time + '</p><p>设备用户:' + equip_user + '</p></div></li>';
+					}
+					$('#dataList').append(html);
+					//选中回显
+					checklen = mui('.check').length;
+					//判断当前是否全选
+					chknum = 0;
+					var checkboxs = mui('.check');
+					checkboxs.each(function() {
+						var ele = this;
+						if(ele.checked == true) {
+							chknum++;
+						}
+					})
+					console.log('chknum:' + chknum)
+					if(chknum == checklen) {
+						document.getElementById('checkall').checked = true;
+					} else {
+						document.getElementById('checkall').checked = false;
+
+					}
+					//全选
+					document.getElementById('checkall').addEventListener('change', function(e) {
+						var checkboxs = mui('.check');
+						if(e.target.checked) {
+							checkboxs.each(function() {
+								var ele = this;
+								ele.checked = true
+							})
+							chknum = mui('.check').length
+						} else {
+							checkboxs.each(function() {
+								var ele = this;
+								ele.checked = false
+							})
+							chknum = 0
+						}
+						console.log(chknum)
+					})
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum,pageSize,successCallback,errorCallback) {
+                	$.ajax({
+		                type: 'POST',
+		                url: 'http://120.27.222.26/app_equip_allot_list',
+		                timeout : 10000, //超时时间设置,单位毫秒
+		                data:{
+		                	'page': pageNum,
+							'userid':userId,
+							'f_id': mui('#searchInp')[0].value
+		                },
+		                dataType: 'json',
+		                success: function(data){
+		                	console.log(JSON.stringify(data.dat))
+		                	successCallback(data.dat,data.nums);
+		                },
+		                error: function(){
+		                	errorCallback();
+		                }
+		            });
+				}
+				
+				//搜索操作
+				$("#searchInp").on('keypress',function(e) {
+					var keycode = e.keyCode;  
+	                if(keycode=='13') {  
+	                    e.preventDefault();    
+	                    //请求搜索接口  
+	                    if(mui('#searchInp')[0].value) {
+							getListData({num:1, size:10})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+	                }  
+				})
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						getListData({num:1, size:10})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+				
+				
+
+
+				function pulldownRefresh() {
+					mui('.mui-content').pullRefresh().refresh(true);
+					startPage = 1;
+					chknum = 0;
+					mui('#dataList')[0].innerHTML = '';
+					pullupRefresh();
+					mui('.mui-content').pullRefresh().endPulldownToRefresh(false);
+				}
+
+				function pullupRefresh(isSearch) {
+										console.log(startPage)
+										console.log(userId)
+										console.log(mui('#searchInp')[0].value)
+					mui.ajax('http://120.27.222.26/app_equip_allot_list', {
+						data: {
+							'page': startPage,
+							'userid':userId,
+							'f_id': mui('#searchInp')[0].value
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							console.log(JSON.stringify(data.dat))
+							if(data.nums) {
+								var html = '';
+								var dat = data.dat;
+								totalPage = Math.ceil(data.nums / 10);
+								if(startPage == 1) {
+									$('.nullData').remove();
+									$('#dataList').empty();
+									html = '<li class="mui-table-view-cell"><div class="mui-input-row mui-checkbox  mui-left">' +
+										'<label>全选</label><input name="checkbox1" id="checkall" type="checkbox"></div></li>';
+								}
+								for(var i = 0; i < dat.length; i++) {
+									var checked;
+									if(dat[i].checked == 1) {
+										checked = '<input type="checkbox" checked="checked" name="checkbox1"class="check" value="' + dat[i].equipid + '" />';
+									} else {
+										checked = '<input type="checkbox" name="checkbox1"class="check" value="' + dat[i].equipid + '" />';
+									}
+
+									var equiptype;
+									if(dat[i].equiptype) {
+										equiptype = '测报灯';
+									} else {
+										equiptype = '杀虫灯';
+									}
+									var equip_user;
+									if(dat[i].equip_user) {
+										equip_user = dat[i].equip_user;
+									} else {
+										equip_user = '无'
+									}
+									html += '<li class="mui-table-view-cell secondary"><a class="mui-navigate-right" href="#">' +
+										checked + '<span>设备ID:' + dat[i].equipid + '</span>' +
+										'</a><div class="secondaryDetial"><p>设备名称:无</p><p>设备类型:' + equiptype + '</p>' +
+										'<p>设备添加时间:' + dat[i].equip_add_time + '</p><p>设备用户:' + equip_user + '</p></div></li>';
+								}
+								$('#dataList').append(html);
+								//选中回显
+								checklen = mui('.check').length;
+								//判断当前是否全选
+								chknum = 0;
+								var checkboxs = mui('.check');
+								checkboxs.each(function() {
+									var ele = this;
+									if(ele.checked == true) {
+										chknum++;
+									}
+								})
+								console.log('chknum:' + chknum)
+								if(chknum == checklen) {
+									document.getElementById('checkall').checked = true;
+								} else {
+									document.getElementById('checkall').checked = false;
+
+								}
+								//全选
+								document.getElementById('checkall').addEventListener('change', function(e) {
+									var checkboxs = mui('.check');
+									if(e.target.checked) {
+										checkboxs.each(function() {
+											var ele = this;
+											ele.checked = true
+										})
+										chknum = mui('.check').length
+									} else {
+										checkboxs.each(function() {
+											var ele = this;
+											ele.checked = false
+										})
+										chknum = 0
+									}
+									console.log(chknum)
+								})
+
+								if(totalPage == startPage) { //总页码等于当前页码,停止上拉下拉
+									mui('.mui-content').pullRefresh().endPullupToRefresh(true);
+								} else {
+									startPage++;
+									setTimeout(function() {
+										mui('.mui-content').pullRefresh().endPullupToRefresh(false);
+									}, 500); //重置下拉加载
+								}
+
+							} else {
+								$('.nullData').remove();
+								$('#dataList').empty();
+								if(isSearch) {
+									var nullHtml = '<div class="nullData"><img src="../images/searchNull.png" alt="" width="110" /></div>'
+								} else {
+									var nullHtml = '<div class="nullData"><img src="../images/listNull.png" alt="" width="110" /></div>'
+								}
+
+								$('.mui-content').append(nullHtml);
+								setTimeout(function() {
+									mui('.mui-content').pullRefresh().disablePullupToRefresh();
+								}, 500); //重置下拉加载
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							$('#dataList').empty();
+							mui('.mui-content')[0].appendChild(netStyle('../images/error.png'));
+							mui.toast('数据请求失败');
+						}
+					});
+
+				}
+
+				//二级选项卡
+				mui('#dataList').on('tap', '.secondary', function() {
+					var classAttr = this.getAttribute("class").split(' ');
+					if(classAttr.indexOf('active') == -1) {
+						mui('.secondary').each(function() {
+							this.classList.remove("active"); 
+						})
+						this.classList.add("active");
+					} else {
+						this.classList.remove("active"); 
+					}
+				})
+				mui('#dataList').on('tap', '.secondary .secondaryDetial', function(event) {
+					console.log(event)
+					event.stopPropagation();
+				})
+
+				//单选
+				mui('#dataList').on('tap', '.secondary input', function(event) {
+					checklen = mui('.check').length;
+					if(this.checked) {
+						this.checked = false;
+						chknum--;
+					} else {
+						this.checked = true;
+						chknum++;
+					}
+					if(chknum == checklen) {
+						document.getElementById('checkall').checked = true;
+					} else {
+						document.getElementById('checkall').checked = false;
+					}
+					event.stopPropagation();
+				})
+
+				//分配按钮
+				document.getElementById('allotBtn').addEventListener('tap', function(){
+					var topicidAll = []; //全部imei数组
+					var checkboxs = mui('.check');
+					checkboxs.each(function() {
+						var ele = this;
+						topicidAll.push(ele.getAttribute('value'))						
+					})
+					var check_box_list = allotFun();
+					
+					console.log(topicid)
+					console.log(topicidAll);
+					if(topicidAll.length){
+						mui.ajax('http://120.27.222.26/app_equip_allot_confirm', {
+							data: {
+								'userid':userId,
+								'equip_ids':JSON.stringify(topicidAll),
+								'check_box_list': JSON.stringify(check_box_list),
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting("分配中...");
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								if(data == 0){
+									mui.toast('分配成功');
+								}else{
+									mui.toast('分配失败');
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								mui.toast('请求失败');
+							}
+						})
+					}else{
+						mui.toast('请至少选择一台设备');
+					}
+				})
+				var topicid = []; //imei数组
+				function allotFun() {
+					topicid = []
+					var checkboxs = mui('.check');
+					checkboxs.each(function() {
+						var ele = this;
+						if(ele.checked == true) {
+							topicid.push(ele.getAttribute('value'))
+						}
+					})
+					return topicid;
+				}
+			})
+				
+				
+			</script>
+	</body>
+
+</html>

+ 218 - 0
equipAllot/equip_allot_list.html

@@ -0,0 +1,218 @@
+<!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" href="../css/mescroll.min.css">
+		<link href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			/*搜索浮动*/
+			.searchBox {
+				position: fixed;
+				left: 0;
+				right: 0;
+				z-index: 222;
+				padding: 0;
+			}
+			.searchBox:before{
+				position: absolute;
+				content: '';
+				background: #21b2e7;
+				width: 100%;
+				height: 35%;
+			}
+			.searchControl{
+				width: 91%;
+    			margin: 0 auto;
+			}
+			.mui-search{
+				display: inline-block;
+    			width: 79%;
+			}
+			.searchBtn,.mui-search >input,.equipItem{
+    			box-shadow: 1px 2px 3px 1px #cccccc;
+			}
+			.searchBtn,.mui-search >input{
+				background: #fff;
+			}
+			
+			.searchBtn{
+				border-color: #fff;
+			    width: 19%;
+			}
+			/*list*/
+			.mescroll{
+				position: fixed;
+				top: 87px;
+				bottom: 0;
+				height: auto; /*如设置bottom:50px,则需height:auto才能生效*/
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">设备分配列表</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+					    <input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入用户名称">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<!--<ul class="mui-table-view" id="equiplist">
+				<li class="mui-table-view-cell" id="123456">
+					<a class="mui-navigate-right">
+						<div>设备ID:845265</div>
+						<div>用户名:山东曹县</div>
+					</a>
+				</li>
+			</ul>-->
+			<div id="scrollPlace" class="mescroll"> <!--id可以改,而"mescroll"的class不能删-->
+		   		<ul id="dataList"  class="mui-table-view">
+		   			<li class="mui-table-view-cell" id="123456">
+						<a class="mui-navigate-right">
+							<div>设备ID:845265</div>
+							<div>用户名:山东曹县</div>
+						</a>
+					</li>
+					<li class="mui-table-view-cell" id="123456">
+						<a class="mui-navigate-right">
+							<div>设备ID:845265</div>
+							<div>用户名:山东曹县</div>
+						</a>
+					</li>
+		   		</ul>
+	    	</div>
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/mescroll.min.js" charset="utf-8"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			mui.init()
+			//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+			var mescroll = new MeScroll("scrollPlace", {
+				up: {
+					callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+					isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+					clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+					toTop:{ //配置回到顶部按钮
+						src : "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+						offset : 700
+					},
+					empty: {
+						//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+						warpId:	"dataList", //父布局的id (1.3.5版本支持传入dom元素)
+						icon: "../images/listNull.png", //图标,默认null,支持网络图
+						tip: "暂无相关数据~" //提示
+					},
+					htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+					noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+					lazyLoad: {
+			        	use: true // 是否开启懒加载,默认false
+			        }
+				}
+			});
+			/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+			function getListData(page){
+				//联网加载数据
+				getListDataFromNet(page.num, page.size, function(curPageData,totalSize){
+					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+					//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+					//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+					mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+					//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+					setListData(curPageData);
+				}, function(){
+					//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+	                mescroll.endErr();
+					mui.toast('数据请求失败');
+				});
+			}
+			/*设置列表数据*/
+			function setListData(curPageData){
+				var html = '';
+//				var listDom=document.getElementById("dataList");
+				var dat = curPageData;
+				for(var i = 0; i < dat.length; i++) {
+					var equip_name = dat[i].equip_name || '无';
+					var equip_user = dat[i].equip_user || '未分配';
+					var equipicon = '';
+					if(dat[i].equip_type == 2){
+						equipicon = '../images/scdIcon.png';
+					}else if(dat[i].equip_type == 3){
+						equipicon = '../images/cbdIcon.png';
+					}
+					html += '<li class="mui-table-view-cell" data-id="' + dat[i].userid + '">' +
+							'<a class="mui-navigate-right"><div>用户:' + dat[i].username + '</div>' +
+							'<div>邮箱:' + dat[i].email + '</div></a></li>';
+				}
+				$('#dataList').append(html);
+			}
+			/*联网加载列表数据*/
+			function getListDataFromNet(pageNum,pageSize,successCallback,errorCallback) {
+                	$.ajax({
+		                type: 'POST',
+		                url: 'http://120.27.222.26/app_equip_allot',
+		                timeout : 10000, //超时时间设置,单位毫秒
+		                data:{
+		                	'page': pageNum,
+							'uname': mui('#searchInp')[0].value
+		                },
+		                dataType: 'json',
+		                success: function(data){
+		                	successCallback(data.dat,data.nums);
+		                },
+		                error: function(){
+		                	errorCallback();
+		                }
+		            });
+			}
+			
+			//进入详情页面
+			mui('#dataList').on('tap', 'li', function() {
+				var userId = this.getAttribute('data-id');
+				mui.openWindow({
+					url: 'equip_allot_info.html',
+					id: 'equip_allot_info',
+					extras: {
+						userId: userId
+					},
+				})
+			})
+			
+			//搜索操作
+			$("#searchInp").on('keypress',function(e) {
+				var keycode = e.keyCode;  
+                if(keycode=='13') {  
+                    e.preventDefault();    
+                    //请求搜索接口  
+                    if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({num:1, size:10})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+                }  
+			})
+			document.getElementById('searchBtn').addEventListener('tap', function() {
+				if(mui('#searchInp')[0].value) {
+					$('#dataList').html('');
+					getListData({num:1, size:10})
+				} else {
+					mui.toast("请输入设备ID");
+				}
+			})
+
+		</script>
+	</body>
+
+</html>

+ 206 - 0
equipList/equip_list.html

@@ -0,0 +1,206 @@
+<!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 rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css"/>
+		<link rel="stylesheet" href="../css/common.css"/>
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">设备列表</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+					    <input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll"> <!--id可以改,而"mescroll"的class不能删-->
+		   		<ul id="dataList">
+		   			<!--<li>
+		   				<div class="equipItem">
+		   					<div class="equipItem_top">
+			   					<div class="equipTitle">
+			   						<img class="equipIdIcon"  src="../images/IDicon.png" width="22"/>
+			   						<span class="">84521212212122</span>
+			   						<img class="equipType" src="../images/cbdIcon.png" width="26"/>
+			   					</div>
+			   					<div class="equipItem_line"></div>
+			   				</div>
+			   				<div class="equipItem_bottom">
+		   						<div class="equipMsg">
+		   							<label>设备名称</label>
+		   							<div class="equipVal">无</div>
+		   						</div>
+		   						<div class="equipMsg">
+		   							<label>所属用户</label>
+		   							<div class="equipVal">无</div>
+		   						</div>
+		   					</div>
+		   				</div>
+		   			</li>-->
+		   		</ul>
+	    	</div>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mescroll.min.js" charset="utf-8"></script>
+		<script src="../js/mui.min.js"></script>
+		
+
+		<script type="text/javascript">
+			mui.init()
+			//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+			var mescroll = new MeScroll("scrollPlace", {
+				up: {
+					callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+					isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+					clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+					toTop:{ //配置回到顶部按钮
+						src : "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+						offset : 700
+					},
+					empty: {
+						//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+						warpId:	"dataList", //父布局的id (1.3.5版本支持传入dom元素)
+						icon: "../images/listNull.png", //图标,默认null,支持网络图
+						tip: "暂无相关数据~" //提示
+					},
+					htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+					noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+					lazyLoad: {
+			        	use: true // 是否开启懒加载,默认false
+			        }
+				}
+			});
+			/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+			function getListData(page){
+				//联网加载数据
+				getListDataFromNet(page.num, page.size, function(curPageData,totalSize){
+					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+					//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+					//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+					mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+					//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+					setListData(curPageData);
+				}, function(){
+					//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+	                mescroll.endErr();
+					mui.toast('数据请求失败');
+				});
+			}
+			/*设置列表数据*/
+			function setListData(curPageData){
+				var html = '';
+//				var listDom=document.getElementById("dataList");
+				var dat = curPageData;
+				for(var i = 0; i < dat.length; i++) {
+					var equip_name = dat[i].equip_name || '无';
+					var equip_user = dat[i].equip_user || '未分配';
+					var equipicon = '';
+					if(dat[i].equip_type == 2){
+						equipicon = '../images/scdIcon.png';
+					}else if(dat[i].equip_type == 3){
+						equipicon = '../images/cbdIcon.png';
+					}else if(dat[i].equip_type == 4){
+						equipicon = '../images/xyIcon.png';
+					}else if(dat[i].equip_type == 5){
+						equipicon = '../images/qxzIcon.png';
+					}else if(dat[i].equip_type == 6){
+						equipicon = '../images/jkIcon.png';
+					}else if(dat[i].equip_type == 7){
+						equipicon = '../images/bzyIcon.png';
+					}else if(dat[i].equip_type == 8){
+						equipicon = '../images/xyIcon.png';
+					}else if(dat[i].equip_type == 9){
+						equipicon = '../images/tccbIcon.png';
+					}else if(dat[i].equip_type == 10){
+						equipicon = '../images/cbdIcon.png';
+					}
+					html += '<li data-id="' + dat[i].equip_id + '"><div class="equipItem"><div class="equipItem_top">'+
+			   				'<div class="equipTitle"><img class="equipIdIcon" src="../images/IDicon.png" width="22"/>'+
+			   				'<span class="">'+dat[i].equip_id+'</span><img class="equipType" src="'+equipicon+'" width="26"/>'+
+			   				'</div><div class="equipItem_line"></div></div><div class="equipItem_bottom">'+
+		   					'<div class="equipMsg"><label>设备名称</label><div class="equipVal equipName">'+equip_name+'</div></div>'+
+		   					'<div class="equipMsg"><label>所属用户</label><div class="equipVal">'+equip_user+'</div>'+
+		   					'</div></div></div></li>';
+				}
+				$('#dataList').append(html);
+			}
+			/*联网加载列表数据*/
+			function getListDataFromNet(pageNum,pageSize,successCallback,errorCallback) {
+                	$.ajax({
+		                type: 'POST',
+		                url: 'http://120.27.222.26/app_equip_list',
+		                timeout : 10000, //超时时间设置,单位毫秒
+		                data:{
+		                	'page': pageNum,
+							'filter': mui('#searchInp')[0].value,
+		                },
+		                dataType: 'json',
+		                success: function(data){
+		                	successCallback(data.dat,data.nums);
+		                },
+		                error: function(){
+		                	errorCallback();
+		                }
+		            });
+			}
+			
+			var markingid = ''//用于记录点击的当前id 以便刷新
+			window.addEventListener('refresh', function(event){//如果详情页面更改数据  才页面刷新
+				$('#dataList li').each(function(){
+					if(markingid == $(this).data('id')){
+						$(this).find('.equipName').html(event.detail.markingEquipName);
+					}
+				})
+			})
+			//进入详情页面
+			mui('#dataList').on('tap', 'li', function() {
+				var imei = this.getAttribute('data-id');
+				markingid = imei;
+				mui.openWindow({
+					url: 'equip_list_info.html',
+					id: 'equip_list_info',
+					extras: {
+						'imei': imei
+					},
+				})
+			})
+			
+			//搜索操作
+			$("#searchInp").on('keypress',function(e) {
+				var keycode = e.keyCode;  
+                if(keycode=='13') {  
+                    e.preventDefault();    
+                    //请求搜索接口  
+                    if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({num:1, size:10})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+                }  
+			})
+			document.getElementById('searchBtn').addEventListener('tap', function() {
+				if(mui('#searchInp')[0].value) {
+					$('#dataList').html('');
+					getListData({num:1, size:10})
+				} else {
+					mui.toast("请输入设备ID");
+				}
+			})
+		</script>
+	</body>
+
+</html>

+ 245 - 0
equipList/equip_list_info.html

@@ -0,0 +1,245 @@
+<!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/common.css" />
+		<style type="text/css">
+			/*弹出菜单*/
+			
+			.mui-popover {
+				width: 150px;
+			}
+			
+			.mui-popover .mui-popover-arrow {
+				left: 118px;
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+			#autoAddressParent{
+				display: none;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">设备详情</h1>
+			<a id="openPopover" class="mui-icon mui-icon-more mui-pull-right"></a>
+		</header>
+		<div class="mui-content">
+			<div id="popover" class="mui-popover">
+				<ul class="mui-table-view">
+					<li class="mui-table-view-cell">
+						<a href="#" id="editName">
+							<i class="mui-icon mui-icon-compose"></i>修改名称
+						</a>
+					</li>
+					<li class="mui-table-view-cell">
+						<a href="#" id="editAddress">
+							<i class="mui-icon mui-icon-compose"></i>添加位置
+						</a>
+					</li>
+					<li class="mui-table-view-cell" id="autoAddressParent">
+						<a href="#" id="autoAddress">
+							<i class="mui-icon mui-icon-location"></i>定位
+						</a>
+					</li>
+				</ul>
+			</div>
+			<ul class="mui-table-view" id="user">
+				
+			</ul>
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js" type="text/javascript" charset="utf-8"></script>
+		<script type="text/javascript">
+			mui.init({
+				beforeback:function(){
+					if(markingEquipName){
+						var list = plus.webview.currentWebview().opener();
+						//触发父页面的自定义事件(refresh),从而进行刷新
+						mui.fire(list, 'refresh',{
+							markingEquipName:markingEquipName
+						});
+					}
+					//返回true,继续页面关闭逻辑
+					return true;
+				}
+			});
+			var markingEquipName = '';
+			//接收上页传输数据
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();//获取上页发送的id
+				console.log(self.imei)
+
+				mui.ajax('http://120.27.222.26/app_equip_list_detail', {
+					data: {
+						'equip_id': self.imei,
+					},
+					dataType: 'json', //服务器返回json格式数据
+					type: 'post', //HTTP请求类型
+					timeout: 10000, //超时时间设置为10秒;
+					beforeSend: function() {
+						plus.nativeUI.showWaiting();
+					},
+					complete: function() {
+						plus.nativeUI.closeWaiting();
+					},
+					success: function(data) {
+						console.log(data.equip_type)
+						var equip_user = data.equip_user || '未分配';
+						var equip_name = data.equip_name || '无';
+						var equip_location = data.equip_location || '无';
+						if(data.equip_type == 2){
+							var equip_type = '杀虫灯';
+						}else if(data.equip_type == 3){
+							var equip_type = '虫情测报';
+						}else if(data.equip_type == 4){
+							var equip_type = '诱捕器';
+						}else if(data.equip_type == 5){
+							var equip_type = '环境监测';
+							$('#autoAddressParent').show();
+						}else if(data.equip_type == 6){
+							var equip_type = '监控';
+						}else if(data.equip_type == 7){
+							var equip_type = '孢子仪';
+						}else if(data.equip_type == 8){
+							var equip_type = '性诱设备';
+						}
+						var html = '<li class="mui-table-view-cell"><span class="equipTitle">设备ID</span><p id="imei">' + data.equip_id + '</p></li>' +
+							'<li class="mui-table-view-cell"><span class="equipTitle">设备用户</span><p id="">' + equip_user + '</p></li>' +
+							'<li class="mui-table-view-cell"><span class="equipTitle">设备名称</span><p id="equipName">' + equip_name + '</p></li>' +
+							'<li class="mui-table-view-cell"><span class="equipTitle">添加时间</span><p id="">' + data.equip_add_time + '</p></li>' +
+							'<li class="mui-table-view-cell"><span class="equipTitle">设备类型</span><p id="">' + equip_type + '</p></li>' +
+							'<li class="mui-table-view-cell"><span class="equipTitle">位置</span><p id="addressTxt">' + equip_location + '</p></li>'
+						$('#user').append(html)
+					},
+					error: function(xhr, type, errorThrown) {
+						console.log(type)
+						mui.toast('数据请求失败');
+						mui('.mui-content')[0].appendChild(netStyle('../images/error.png'));
+					}
+				});
+			})
+
+			//修改操作
+			var a = 1;
+			document.getElementById('openPopover').addEventListener('tap', function() {
+//				if(a) {
+					mui('#popover').popover('toggle', document.getElementById('openPopover'));
+//				} else {
+//					mui.toast('暂无法执行此操作');
+//				}
+
+			})
+			//修改用户名
+			document.getElementById('editName').addEventListener('tap', function(e) {
+				mui('#popover').popover('toggle'); //show hide toggle
+				e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug,使用plus.nativeUI.prompt会造成输入法闪一下又没了
+				var btnArray = ['确定', '取消'];
+				mui.prompt('请填写设备名称:', '设备名称', '设备', btnArray, function(e) {
+					if(e.index == 0) {
+						if(e.value == '') {
+							return false;
+						}
+						mui.ajax('http://120.27.222.26/equiplist', {
+							data: {
+								'req': 'rename',
+								'ename': e.value,
+								'eid': document.getElementById("imei").innerHTML
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							success: function(data) {
+								console.log(data)
+								if(data == 0) {
+									document.getElementById('equipName').innerHTML = e.value;
+									markingEquipName = e.value;
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								console.log(type)
+							}
+						});
+
+					} else {
+						//						info.innerText = '你点了取消按钮';
+						console.log('你点了取消按钮')
+					}
+				}, 'div')
+				//prompt默认值
+				if(document.getElementById('equipName').innerHTML != '无') {
+					document.querySelector('.mui-popup-input input').value = document.getElementById('equipName').innerHTML;
+				}
+
+			})
+			
+			//添加位置
+			document.getElementById('editAddress').addEventListener('tap', function(e) {
+				mui('#popover').popover('toggle'); //show hide toggle
+				e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug,使用plus.nativeUI.prompt会造成输入法闪一下又没了
+				var btnArray = ['确定', '取消'];
+				mui.prompt('请填写设备地址:', '设备地址', '设备', btnArray, function(e) {
+					if(e.index == 0) {
+						var value = document.querySelector('.mui-popup-input textarea').value;
+						
+						if(value == '') {
+							return false;
+						}
+						mui.ajax('http://120.27.222.26/equiplist', {
+							data: {
+								'req': 'addAddr',
+								'address': value,
+								'eid': document.getElementById("imei").innerHTML
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							success: function(data) {
+								console.log(data)
+								if(data == 2) {
+									document.getElementById('addressTxt').innerText = value;
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								console.log(type)
+							}
+						});
+
+					} else {
+						//						info.innerText = '你点了取消按钮';
+						console.log('你点了取消按钮')
+					}
+				}, 'div')
+				$('.mui-popup-input').html('');
+				$('.mui-popup-input').append('<textarea></textarea>')
+				//prompt默认值
+				if(document.getElementById('addressTxt').innerHTML != '无') {
+					document.querySelector('.mui-popup-input textarea').value = document.getElementById('addressTxt').innerHTML;
+				}
+
+			})
+			
+			//自动定位
+			document.getElementById('autoAddress').addEventListener('tap', function(e) {
+				mui.openWindow({
+					url: 'equip_list_map.html',
+					id: 'equip_list_map',
+					extras: {
+						'imei': document.getElementById("imei").innerHTML
+					},
+				})
+			})
+		</script>
+	</body>
+
+</html>

+ 189 - 0
equipList/equip_list_map.html

@@ -0,0 +1,189 @@
+<!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 rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css" />
+		<style type="text/css">
+			.mapBox {
+				position: fixed;
+				left: 0;
+				right: 0;
+				top: 0;
+				bottom: 0;
+				/*background: pink;*/
+			}
+			
+			#map {
+				height: 100%;
+				width: 100%;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">手动定位</h1>
+			<a id="addbtn" class="mui-icon mui-icon-gear mui-pull-right"></a>
+		</header>
+		<div class="mui-content">
+			<!--srfwegwerg-->
+			<!--<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+					    <input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>-->
+			<div class="mapBox">
+				<div id="map"></div>
+			</div>
+
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
+		<script type="text/javascript">
+			mui.init();
+			mui.plusReady(function() {
+				//百度地图获取坐标
+				var map = new BMap.Map("map"); // 创建地图实例  
+				map.centerAndZoom(new BMap.Point(113.64964385, 34.75661006), 13); // 创建点坐标  
+				map.enableScrollWheelZoom(true);
+				map.addControl(new BMap.ScaleControl()); // 添加比例尺控件 
+				map.addControl(new BMap.NavigationControl()); //为地图添加鱼骨(默认)
+				map.addEventListener("tilesloaded", function() {
+					$(".BMap_cpyCtrl").hide();
+				}); //地图加载完毕后 隐藏百度图标
+				var lng = '',
+					lat = '';
+				//单击获取点击的经纬度
+				map.addEventListener("click", function(e) {
+					map.clearOverlays();
+					lng = '';
+					lat = '';
+					$('#lng').val(e.point.lng);
+					$('#lat').val(e.point.lat);
+					var point = new BMap.Point(e.point.lng, e.point.lat);
+					var marker = new BMap.Marker(point);
+					map.addOverlay(marker);
+					lng = e.point.lng;
+					lat = e.point.lat;
+					mui.confirm('添加经纬度', '添加经纬度', ['确定', '取消'], function() {
+						mui.ajax('http://120.27.222.26/qxz_location', {
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							data: {
+								e_id: self.imei,
+								lng: lng,
+								lat: lat,
+							},
+							success: function(data) {
+								console.log(data)
+								if(data == 0) {
+									mui.toast('添加成功')
+								} else {
+									mui.toast('添加失败')
+								}
+							},
+							error: function(type) {
+								console.log(type)
+							}
+						});
+					}, 'div')
+
+					// alert(e.point.lng + "," + e.point.lat);
+				});
+
+				var self = plus.webview.currentWebview(); //获取上页发送的id
+				console.log(self.imei)
+				//添加位置
+				document.getElementById('addbtn').addEventListener('tap', function(e) {
+					mui('#popover').popover('toggle'); //show hide toggle
+					e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug,使用plus.nativeUI.prompt会造成输入法闪一下又没了
+					var btnArray = ['确定', '取消'];
+					mui.prompt('英文逗号隔开:', '请填写设备经纬度', '请填写设备经纬度', btnArray, function(e) {
+						if(e.index == 0) {
+							var value = document.querySelector('.mui-popup-input textarea').value;
+
+							if(value == '') {
+								return false;
+							}
+							lng = value.split(',')[0];
+							lat = value.split(',')[1];
+							map.clearOverlays();
+							var points = []
+							var point = new BMap.Point(lng, lat);
+							var marker = new BMap.Marker(point);
+							map.addOverlay(marker);
+							points.push(point)
+							console.log(points)
+							map.setViewport(points);
+							mui.ajax('http://120.27.222.26/qxz_location', {
+								dataType: 'json', //服务器返回json格式数据
+								type: 'post', //HTTP请求类型
+								timeout: 10000, //超时时间设置为10秒;
+								data: {
+									e_id: self.imei,
+									lng: lng,
+									lat: lat,
+								},
+								success: function(data) {
+									console.log(data)
+									if(data == 0) {
+										mui.toast('添加成功')
+									} else {
+										mui.toast('添加失败')
+									}
+								},
+								error: function(type) {
+									console.log(type)
+								}
+							});
+
+						} else {
+							//						info.innerText = '你点了取消按钮';
+							console.log('你点了取消按钮')
+						}
+					}, 'div')
+					$('.mui-popup-input').html('');
+					$('.mui-popup-input').append('<textarea></textarea>')
+					//prompt默认值
+					if(lng != '' && lng != '') {
+						document.querySelector('.mui-popup-input textarea').value = lng + ',' + lat;
+					}
+
+				})
+			})
+			//搜索操作
+			//			$("#searchInp").on('keypress',function(e) {
+			//				var keycode = e.keyCode;  
+			//              if(keycode=='13') {  
+			//                  e.preventDefault();    
+			//                  //请求搜索接口  
+			//                  if(mui('#searchInp')[0].value) {
+			//						getListData({num:1, size:10})
+			//					} else {
+			//						mui.toast("请输入设备ID");
+			//					}
+			//              }  
+			//			})
+			//			document.getElementById('searchBtn').addEventListener('tap', function() {
+			//				if(mui('#searchInp')[0].value) {
+			//					getListData({num:1, size:10})
+			//				} else {
+			//					mui.toast("请输入设备ID");
+			//				}
+			//			})
+		</script>
+	</body>
+
+</html>

+ 552 - 0
equipManage/configuration_bzy.html

@@ -0,0 +1,552 @@
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<title>Hello MUI</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<!--标准mui.css-->
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+
+		<link rel="stylesheet" href="../css/common.css">
+		<link rel="stylesheet" href="../css/iconfont.css">
+		<link rel="stylesheet" href="../css/rangeslider.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.poppicker.css" />
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<!--App自定义的css-->
+		<style type="text/css">
+			.mui-content>.mui-table-view:first-child {
+			    margin-top: 0;
+			}
+			.mui-table-view-cell.mui-active {
+				background-color: #fff;
+			}
+			
+			.mui-input-range .mui-tooltip {
+				display: none;
+			}
+			
+			.mui-radio input[type=radio] {
+				top: -2px;
+			}
+			
+			.equipOption {
+				color: #21B2E7 !important;
+				margin-bottom: 15px;
+			}
+			
+			.mui-checkbox input[type=checkbox]:before,
+			.mui-radio input[type=radio]:before {
+				font-size: 22px;
+			}
+			/*提交按钮*/
+			
+			.equipTitle {
+				color: #21b2e7;
+				font-size: 14px;
+			}
+			
+			.mui-table-view-cell p {
+				color: #333;
+				font-size: 16px;
+				margin-top: 4px;
+			}
+			/*单选按钮*/
+			
+			.mui-radio label {
+				padding-right: 37px;
+			}
+			/*滑块*/
+			
+			.sliderDiv {
+				width: 80%;
+				display: inline-block;
+			}
+			
+			.rangeslider--horizontal {
+				height: 12px;
+			}
+			
+			.rangeslider__fill {
+				background: #7ed7ff;
+			}
+			
+			.rangeslider__handle {
+				width: 20px;
+				height: 20px;
+			}
+			
+			.rangeslider--horizontal .rangeslider__handle {
+				top: -5px;
+			}
+			
+			.rangeslider__handle:after {
+				width: 8px;
+				height: 8px;
+			}
+			
+			.equipOptionInitVal {
+				display: inline-block;
+				width: 15px;
+				text-align: right;
+			}
+			/*开始结束时间选择*/
+			
+			.timeItem {
+				border: 1px solid #e6e6e6;
+				margin-bottom: 5px;
+				line-height: 30px;
+				border-radius: 5px;
+				margin-top: 5px;
+			}
+			
+			.timeItem>button {
+				border: none;
+				background: #e6e6e6;
+				margin-right: 10px;
+			}
+			.smallSpaceBox .mui-radio{
+				width: 20%;
+				float: left;
+				margin-top: 5px;
+			}
+			.smallSpaceBox .mui-radio input[type=radio]{
+				right: 10px;
+			}
+			#timePattern >div >p{
+				height: 10px;
+			}
+		</style>
+
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">11</h1>
+			<a class="headRightIcon fa fa-cloud-upload mui-pull-right" onclick="sendData()">提交</a>
+		</header>
+		<div class="mui-content">
+			<ul class="mui-table-view">
+				<li class="mui-table-view-cell smallSpaceBox">
+					<p class="equipOption">设备开关:</p>
+					<div class="mui-radio">
+						<label>开</label>
+						<input name="equipOnOff" type="radio" value="1" id="equipOn">
+					</div>
+					<div class="mui-radio">
+						<label>关</label>
+						<input name="equipOnOff" type="radio" value="0" id="equipOff">
+					</div>
+				</li>
+				<li class="mui-table-view-cell smallSpaceBox">
+					<p class="equipOption">风机开关:</p>
+					<div class="mui-radio">
+						<label>开</label>
+						<input name="coldOnOff" type="radio" value="0" checked="checked" id="coldOn">
+					</div>
+					<div class="mui-radio">
+						<label>关</label>
+						<input name="coldOnOff" type="radio" value="1" id="coldOff">
+					</div>
+				</li>
+				<li class="mui-table-view-cell smallSpaceBox">
+					<p class="equipOption">载玻片滴液时间:</p>
+					<div class="mui-radio">
+						<label>1</label>
+						<input name="dropTime" type="radio" value="1" id="dropTime1" checked="checked">
+					</div>
+					<div class="mui-radio">
+						<label>2</label>
+						<input name="dropTime" type="radio" value="2" id="dropTime2">
+					</div>
+					<div class="mui-radio">
+						<label>3</label>
+						<input name="dropTime" type="radio" value="3" id="dropTime3">
+					</div>
+					<div class="mui-radio">
+						<label>4</label>
+						<input name="dropTime" type="radio" value="4" id="dropTime4">
+					</div>
+					<div class="mui-radio">
+						<label>5</label>
+						<input name="dropTime" type="radio" value="5" id="dropTime5">
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">载玻片培养时间:</p>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>12小时</label>
+						<input name="staytime" type="radio" value="0" checked="checked" id="staytime12">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>24小时</label>
+						<input name="staytime" type="radio" value="1" id="staytime24">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>48小时</label>
+						<input name="staytime" type="radio" value="1" id="staytime48">
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">图片分辨率:</p>
+					<div class="mui-radio" style="width: 28%;float: left;">
+						<label>高</label>
+						<input name="imgHvga" type="radio" value="0" id="highHvga" checked="checked">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;">
+						<label>中</label>
+						<input name="imgHvga" type="radio" value="1" id="middleHvga">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;">
+						<label>低</label>
+						<input name="imgHvga" type="radio" value="2" id="lowHvga">
+					</div>
+				</li>
+				
+				<li class="mui-table-view-cell">
+					<p class="equipOption">保温仓设定温度(°C)</p>
+					<span class="equipOptionInitVal">1</span>
+					<div class="sliderDiv">
+						<input type="range" min="10" max="40" step="1" data-rangeslider>
+					</div>
+					<span id="setTemp">1</span>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">数据上传时间间隔:</p>
+					<span class="equipOptionInitVal">10</span>
+					<div class="sliderDiv">
+						<input type="range" min="10" max="60" step="10" data-rangeslider>
+					</div>
+					<span id="dataUpTime">10</span>
+				</li>
+				
+				<li class="mui-table-view-cell" id="timePattern">
+					<p class="equipOption">开始结束时间:</p>
+					<div>
+						<div class="timeItem">
+							<button id='pickTimeBtn' type="button" class="mui-btn">开始时间</button><span id="begin1"></span>
+						</div>
+						<div class="timeItem">
+							<button id='pickTimeBtn2' type="button" class="mui-btn">结束时间</button><span id="end1"></span>
+						</div>
+						<p></p>
+						<div class="timeItem">
+							<button id='pickTimeBtn3' type="button" class="mui-btn">开始时间</button><span id="begin2"></span>
+						</div>
+						<div class="timeItem">
+							<button id='pickTimeBtn4' type="button" class="mui-btn">结束时间</button><span id="end2"></span>
+						</div>
+						<p></p>
+						<div class="timeItem">
+							<button id='pickTimeBtn5' type="button" class="mui-btn">开始时间</button><span id="begin3"></span>
+						</div>
+						<div class="timeItem">
+							<button id='pickTimeBtn6' type="button" class="mui-btn">结束时间</button><span id="end3"></span>
+						</div>
+					</div>
+				</li>
+			</ul>
+		</div>
+	</body>
+	<script src="../js/mui.min.js"></script>
+	<script src="../js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
+	<script src="../js/rangeslider.js"></script>
+	<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+	<script src="../js/common.js"></script>
+	<script>
+		mui.init();
+		var equipId,bzy_status;
+		mui.plusReady(function() {
+//			alert(1)
+			var self = plus.webview.currentWebview();
+			equipId = self.equipId;
+			bzy_status = self.status;
+			document.getElementById("title").innerHTML = equipId;
+			var status = eval('('+bzy_status+')');
+			if(status.on_off == 1){				
+				$('#equipOn').prop('checked',true);
+			}else{
+				$('#equipOff').prop('checked',true);
+			}
+			if(status.cold_sw == 1){				
+				$('#coldOn').prop('checked',true);
+			}else{
+				$('#coldOff').prop('checked',true);
+			}
+			if(status.drop_time == 1){				
+				$('#dropTime1').prop('checked',true);
+			}else if(status.drop_time == 2){
+				$('#dropTime2').prop('checked',true);
+			}else if(status.drop_time == 3){
+				$('#dropTime3').prop('checked',true);
+			}else if(status.drop_time == 4){
+				$('#dropTime4').prop('checked',true);
+			}else if(status.drop_time == 5){
+				$('#dropTime5').prop('checked',true);
+			}
+			if(status.cul_time == 12){				
+				$('#staytime12').prop('checked',true);
+			}else if(status.drop_time == 24){
+				$('#staytime24').prop('checked',true);
+			}else if(status.drop_time == 48){
+				$('#staytime48').prop('checked',true);
+			}
+			if(status.imgres == 0){				
+				$('#highHvga').prop('checked',true);
+			}else if(status.drop_time == 1){
+				$('#middleHvga').prop('checked',true);
+			}else if(status.drop_time == 3){
+				$('#lowHvga').prop('checked',true);
+			}
+			mui('#setTemp')[0].innerHTML = status.set_temp;
+			$('#setTemp').prev().find('input').val(status.set_temp).change();
+			mui('#dataUpTime')[0].innerHTML = status.datt;
+			$('#dataUpTime').prev().find('input').val(status.datt).change();
+//			"coll_time":["8-9","11-12","23-24"],
+			var colltime = [];
+			for(var i = 0;i<status.coll_time.length;i++){
+				var tim = status.coll_time[i].split('-');
+				colltime.push(tim[0]);
+				colltime.push(tim[1]);
+				if(i == status.coll_time.length-1){
+					$('#begin1').html(colltime[0]+':00');
+					currStartNum1 = colltime[0]
+					$('#end1').html(colltime[1]+':00');
+					currStartNum2 = colltime[1]
+					$('#begin2').html(colltime[2]+':00');
+					currStartNum3 = colltime[2]
+					$('#end2').html(colltime[3]+':00');
+					currStartNum4 = colltime[3]
+					$('#begin3').html(colltime[4]+':00');
+					currStartNum5 = colltime[4]
+					$('#end3').html(colltime[5]+':00');
+					currStartNum6 = colltime[5]
+				}
+			}
+			
+			//设备开关
+			$('input[name = "equipOnOff"]').on('tap',function(){
+				var txt;
+				if($(this).prop('checked')){
+					return;
+				}
+				if($(this).val() == 0){
+					txt = '关闭'
+				}else{
+					txt = '开启'
+				}
+				var currvalue = $(this).val();
+				mui.confirm('是否'+txt+'设备?','信息',['确定','取消'],function(){
+					$.ajax({
+						url: 'http://120.27.222.26/bzy_mqtt',
+						type: "post",
+						data: {
+							'req': 'on_off',
+		                    'id': equipId,
+		                    'on_off': currvalue,
+						},
+						dataType: "json",
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							mui.toast(txt+'成功!');
+						},
+						error: function(xhr, type, errorThrown) {
+							//联网失败的回调,隐藏下拉刷新的状态
+							plus.nativeUI.closeWaiting();
+							if(currvalue == 0){
+								$('#equipOn').prop('checked',true);
+							}else{
+								$('#equipOff').prop('checked',true);
+							}
+							
+							mui.toast(txt+'失败!');
+						}
+					});
+				})
+			})
+			//风机开关
+			$('input[name = "coldOnOff"]').on('tap',function(){
+				var txt;
+				if($(this).prop('checked')){
+					return;
+				}
+				if($(this).val() == 0){
+					txt = '关闭'
+				}else{
+					txt = '开启'
+				}
+				var currvalue = $(this).val();
+				sendData()
+			})
+		})
+		//提交配置
+		function sendData(){
+			var coldOnOff = $('input[name = "coldOnOff"]:checked').val();
+			var dropTime = $('input[name = "dropTime"]:checked').val();
+			var staytime = $('input[name = "staytime"]:checked').val();
+			var imgHvga = $('input[name = "imgHvga"]:checked').val();
+			var setTemp = $('#setTemp').html(); 
+			var dataUpTime = $('#dataUpTime').html(); 
+			var colltime = [];
+			var selectVal1 = [];
+			selectVal1.push(currStartNum1)
+			selectVal1.push(currStartNum2)
+			var time1 = selectVal1.join('-');
+			var selectVal2 = [];
+			selectVal2.push(currStartNum3)
+			selectVal2.push(currStartNum4)
+			var time2 = selectVal2.join('-');
+			var selectVal3 = [];
+			selectVal3.push(currStartNum5)
+			selectVal3.push(currStartNum6)
+			var time3 = selectVal3.join('-');
+			colltime.push(time1)
+			colltime.push(time2)
+			colltime.push(time3)
+			mui.ajax('http://120.27.222.26/bzy_mqtt',{
+				data:{
+					'req': 'set',
+					'id': equipId,
+					'wind': coldOnOff,
+					'drop': dropTime,
+					'culTime': staytime,
+					'imgres': imgHvga,
+					'stemp': setTemp,
+					'takt': dataUpTime,
+					'colltime': JSON.stringify(colltime)
+				},
+				dataType:'json',//服务器返回json格式数据
+				type:'post',//HTTP请求类型
+				timeout:10000,//超时时间设置为10秒;
+				beforeSend: function() {
+					plus.nativeUI.showWaiting('请求中...');
+				},
+				complete: function() {
+					plus.nativeUI.closeWaiting();
+				},
+				success:function(data){
+					mui.toast('配置成功!')
+				},
+				error:function(xhr,type,errorThrown){
+					mui.toast('配置失败!')
+				}
+			});
+		}
+
+		//slider初始化
+		$('input[type="range"]').rangeslider({
+			polyfill: false
+		});
+		//获取slider
+		var $document = $(document);
+		var selector = '[data-rangeslider]';
+		var $inputRange = $(selector);
+		// 获取slider值
+		$document.on('input', selector, function(e) {
+			valueOutput(e.target);
+		});
+		// 将对应值写入对应文本框
+		function valueOutput(element) {
+			var value = element.value;
+			var output = element.parentNode.nextElementSibling;
+			output.innerHTML = value;
+		}
+		
+		//自定义时间值
+		var picker;
+		var currStartNum1 = 0,currStartNum2 = 0,currStartNum3 = 0,currStartNum4 = 0,currStartNum5 = 0,currStartNum6 = 0;
+		
+		function PopPickerNum(startnum,endnum){
+			picker = new mui.PopPicker();
+			var array=[];
+			for(var i = startnum;i<endnum;i++){
+				var data = {
+					value:i,
+					text:i+':00',
+				}
+				array.push(data);
+				if(i == endnum-1){
+					picker.setData(array);
+				}
+			}
+		}
+
+		function PopPicker() {
+			picker = new mui.PopPicker();
+			picker.setData([ {
+				value: "1",
+				text: "1"
+			},])
+		}
+		//开始时间选择器
+		document.getElementById("pickTimeBtn").addEventListener('tap', function() {
+			PopPickerNum(1,25)
+			picker.show(function(getSelectedItems) {
+				document.getElementById('begin1').innerHTML = getSelectedItems[0].text;
+				currStartNum1 = getSelectedItems[0].value
+				document.getElementById('end1').innerHTML = getSelectedItems[0].text;
+				document.getElementById('begin2').innerHTML = getSelectedItems[0].text;
+				document.getElementById('end2').innerHTML = getSelectedItems[0].text;
+				document.getElementById('begin3').innerHTML = getSelectedItems[0].text;
+				document.getElementById('end3').innerHTML = getSelectedItems[0].text;
+			})
+		});
+		//结束时间选择器
+		document.getElementById("pickTimeBtn2").addEventListener('tap', function() {
+			PopPickerNum(currStartNum1,25)
+			picker.show(function(getSelectedItems) {
+				document.getElementById('end1').innerHTML = getSelectedItems[0].text;
+				currStartNum2 = getSelectedItems[0].value
+				document.getElementById('begin2').innerHTML = getSelectedItems[0].text;
+				document.getElementById('end2').innerHTML = getSelectedItems[0].text;
+				document.getElementById('begin3').innerHTML = getSelectedItems[0].text;
+				document.getElementById('end3').innerHTML = getSelectedItems[0].text;
+			})
+		});
+		document.getElementById("pickTimeBtn3").addEventListener('tap', function() {
+			PopPickerNum(currStartNum2,25)
+			picker.show(function(getSelectedItems) {
+				document.getElementById('begin2').innerHTML = getSelectedItems[0].text;
+				currStartNum3 = getSelectedItems[0].value
+				document.getElementById('end2').innerHTML = getSelectedItems[0].text;
+				document.getElementById('begin3').innerHTML = getSelectedItems[0].text;
+				document.getElementById('end3').innerHTML = getSelectedItems[0].text;
+			})
+		});
+		document.getElementById("pickTimeBtn4").addEventListener('tap', function() {
+			PopPickerNum(currStartNum3,25)
+			picker.show(function(getSelectedItems) {
+				document.getElementById('end2').innerHTML = getSelectedItems[0].text;
+				currStartNum4 = getSelectedItems[0].value
+				document.getElementById('begin3').innerHTML = getSelectedItems[0].text;
+				document.getElementById('end3').innerHTML = getSelectedItems[0].text;
+			})
+		});
+		document.getElementById("pickTimeBtn5").addEventListener('tap', function() {
+			PopPickerNum(currStartNum4,25)
+			picker.show(function(getSelectedItems) {
+				document.getElementById('begin3').innerHTML = getSelectedItems[0].text;
+				currStartNum5 = getSelectedItems[0].value
+				document.getElementById('end3').innerHTML = getSelectedItems[0].text;
+			})
+		});
+		document.getElementById("pickTimeBtn6").addEventListener('tap', function() {
+			PopPickerNum(currStartNum5,25)
+			picker.show(function(getSelectedItems) {
+				document.getElementById('end3').innerHTML = getSelectedItems[0].text;
+				currStartNum6 = getSelectedItems[0].value
+			})
+		});
+		
+	</script>
+
+</html>

+ 555 - 0
equipManage/configuration_cbd.html

@@ -0,0 +1,555 @@
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<title>Hello MUI</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<!--标准mui.css-->
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+
+		<link rel="stylesheet" href="../css/common.css">
+		<link rel="stylesheet" href="../css/iconfont.css">
+		<link rel="stylesheet" href="../css/rangeslider.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.poppicker.css" />
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<!--App自定义的css-->
+		<style type="text/css">
+			.mui-table-view-cell.mui-active {
+				background-color: #fff;
+			}
+			
+			.mui-input-range .mui-tooltip {
+				display: none;
+			}
+			
+			.mui-radio input[type=radio] {
+				top: -2px;
+			}
+			
+			.equipOption {
+				color: #21B2E7 !important;
+				margin-bottom: 15px;
+			}
+			
+			.mui-checkbox input[type=checkbox]:before,
+			.mui-radio input[type=radio]:before {
+				font-size: 22px;
+			}
+			/*提交按钮*/
+			
+			.equipTitle {
+				color: #21b2e7;
+				font-size: 14px;
+			}
+			
+			.mui-table-view-cell p {
+				color: #333;
+				font-size: 16px;
+				margin-top: 4px;
+			}
+			/*单选按钮*/
+			
+			.mui-radio label {
+				padding-right: 37px;
+			}
+			/*滑块*/
+			
+			.sliderDiv {
+				width: 80%;
+				display: inline-block;
+			}
+			
+			.rangeslider--horizontal {
+				height: 12px;
+			}
+			
+			.rangeslider__fill {
+				background: #7ed7ff;
+			}
+			
+			.rangeslider__handle {
+				width: 20px;
+				height: 20px;
+			}
+			
+			.rangeslider--horizontal .rangeslider__handle {
+				top: -5px;
+			}
+			
+			.rangeslider__handle:after {
+				width: 8px;
+				height: 8px;
+			}
+			
+			.equipOptionInitVal {
+				display: inline-block;
+				width: 15px;
+				text-align: right;
+			}
+			/*开始结束时间选择*/
+			
+			.timeItem {
+				border: 1px solid #e6e6e6;
+				margin-bottom: 5px;
+				line-height: 30px;
+				border-radius: 5px;
+				margin-top: 5px;
+			}
+			
+			.timeItem>button {
+				border: none;
+				background: #e6e6e6;
+				margin-right: 10px;
+			}
+		</style>
+
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title"></h1>
+			<a class="headRightIcon fa fa-cloud-upload mui-pull-right" onclick="sendData()">提交</a>
+		</header>
+		<div class="mui-content">
+			<ul class="mui-table-view">
+				<li class="mui-table-view-cell " id="worktypebox">
+					<p class="equipOption">工作模式:</p>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>节能</label>
+						<input name="worktype" type="radio" value="0" id="worktype0">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>常规</label>
+						<input name="worktype" type="radio" value="1" id="worktype1">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>加强</label>
+						<input name="worktype" type="radio" value="2" id="worktype2">
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">定时模式:</p>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>光控</label>
+						<input name="type" type="radio" value="0" checked="checked" id="dimming">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;margin-top: 5px;">
+						<label>时控</label>
+						<input name="type" type="radio" value="1" id="timeControl">
+					</div>
+				</li>
+				<li class="mui-table-view-cell" id="lightPattern">
+					<p class="equipOption">定时时长:</p>
+					<span class="equipOptionInitVal">1</span>
+					<div class="sliderDiv">
+						<input type="range" min="1" max="10" step="1" data-rangeslider>
+					</div>
+					<span id="timingLength">1</span>
+				</li>
+				<li class="mui-table-view-cell mui-hidden" id="timePattern">
+					<p class="equipOption">开始结束时间:</p>
+					<div>
+						<div class="timeItem">
+							<button id='pickTimeBtn' type="button" class="mui-btn">开始时间</button><span id="begin"></span>
+						</div>
+						<div class="timeItem">
+							<button id='pickTimeBtn2' type="button" class="mui-btn">结束时间</button><span id="end"></span>
+						</div>
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">落虫时间:</p>
+					<span class="equipOptionInitVal">5</span>
+					<div class="sliderDiv">
+						<input type="range" min="5" max="20" step="1" data-rangeslider>
+					</div>
+					<span id="dropTime">5</span>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">加热时间:</p>
+					<span class="equipOptionInitVal">5</span>
+					<div class="sliderDiv">
+						<input type="range" min="5" max="20" step="1" data-rangeslider>
+					</div>
+					<span id="calefactionTime">5</span>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">加热温度:</p>
+					<span class="equipOptionInitVal">75</span>
+					<div class="sliderDiv">
+						<input type="range" min="75" max="120" step="1" data-rangeslider>
+					</div>
+					<span id="calefactionTemperature">75</span>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">高温保护阈值:</p>
+					<span class="equipOptionInitVal">50</span>
+					<div class="sliderDiv">
+						<input type="range" min="50" max="70" step="1" data-rangeslider>
+					</div>
+					<span id="highLimit">50</span>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">低温保护阈值:</p>
+					<span class="equipOptionInitVal">1</span>
+					<div class="sliderDiv">
+						<input type="range" min="1" max="10" step="1" data-rangeslider>
+					</div>
+					<span id="lowLimit">1</span>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">数据上传时间间隔:</p>
+					<span class="equipOptionInitVal">10</span>
+					<div class="sliderDiv">
+						<input type="range" min="10" max="60" step="10" data-rangeslider>
+					</div>
+					<span id="dataUpTime">10</span>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">图片分辨率:</p>
+					<div class="mui-radio" style="width: 28%;float: left;">
+						<label>高</label>
+						<input name="imgHvga" type="radio" value="0" id="highHvga" checked="checked">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;">
+						<label>中</label>
+						<input name="imgHvga" type="radio" value="1" id="middleHvga">
+					</div>
+					<div class="mui-radio" style="width: 28%;float: left;">
+						<label>低</label>
+						<input name="imgHvga" type="radio" value="2" id="lowHvga">
+					</div>
+				</li>
+			</ul>
+		</div>
+	</body>
+	<script src="../js/mui.min.js"></script>
+	<script src="../js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
+	<script src="../js/rangeslider.js"></script>
+	<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+	<script src="../js/common.js"></script>
+	<script>
+		mui.init();
+		mui.plusReady(function() {
+			var self = plus.webview.currentWebview();
+			var equipId = self.equipId;
+			document.getElementById("title").innerHTML = equipId;
+			mui.ajax('http://120.27.222.26/cbd_mqtt', {
+				data: {
+					"req": "read", //读取
+					"topicid": JSON.stringify(equipId),
+					"kind": "paramconf" //读取下位机状态
+				},
+				dataType: 'json', //服务器返回json格式数据
+				type: 'post', //HTTP请求类型
+				timeout: 10000, //超时时间设置为10秒;
+				beforeSend: function() {
+					plus.nativeUI.showWaiting('请求中...');
+				},
+				complete: function() {
+					plus.nativeUI.closeWaiting();
+				},
+				success: function(data) {
+					if(data == "0") {
+						mui.toast("发送成功!");
+						mui.ajax('http://120.27.222.26/equipmanage_cbd', {
+							data: {
+								id: equipId,
+								req: "paramconf"
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								console.log(JSON.stringify(data))
+								var dat = eval("(" + data.paramconf + ")");
+								if(dat != '' && dat != null) {
+									if(dat.ts == 0) {
+										$('#dimming').attr("checked", "checked");
+										$("#timeControl").removeAttr("checked");
+										document.getElementById("lightPattern").classList.remove("mui-hidden");
+										document.getElementById("timePattern").classList.add("mui-hidden");
+									} else {
+										$('#timeControl').attr("checked", "checked");
+										$("#dimming").removeAttr("checked");
+										document.getElementById("lightPattern").classList.add("mui-hidden");
+										document.getElementById("timePattern").classList.remove("mui-hidden");
+									}
+									mui('#timingLength')[0].innerHTML = dat.tt;
+									$('#timingLength').prev().find('input').val(dat.tt).change();
+
+									mui('#begin')[0].innerHTML = dat.st;
+									$('#begin').html(dat.st);
+
+									mui('#end')[0].innerHTML = dat.et;
+									$('#end').html(dat.et);
+
+									mui('#dropTime')[0].innerHTML = dat.collt;
+									$('#dropTime').prev().find('input').val(dat.collt).change();
+
+									mui('#calefactionTime')[0].innerHTML = dat.htim;
+									$('#calefactionTime').prev().find('input').val(dat.htim).change();
+
+									mui('#calefactionTemperature')[0].innerHTML = dat.hst;
+									$('#calefactionTemperature').prev().find('input').val(dat.hst).change();
+
+									mui('#highLimit')[0].innerHTML = dat.tph;
+									$('#highLimit').prev().find('input').val(dat.tph).change();
+
+									mui('#lowLimit')[0].innerHTML = dat.tpl;
+									$('#lowLimit').prev().find('input').val(dat.tpl).change();
+
+									mui('#dataUpTime')[0].innerHTML = dat.datt;
+									$('#dataUpTime').prev().find('input').val(dat.datt).change();
+
+									mui('.mui-table-view-cell input[name="imgHvga"]:checked')[0].value = dat.imgres;
+									if(dat.imgres == 0) {
+										$('#highHvga').attr("checked", "checked");
+										$("#middleHvga").removeAttr("checked");
+										$("#lowHvga").removeAttr("checked");
+									} else if(dat.imgres == 1) {
+										$('#highHvga').removeAttr("checked");
+										$("#middleHvga").attr("checked", "checked");
+										$("#lowHvga").removeAttr("checked");
+									} else {
+										$('#highHvga').removeAttr("checked");
+										$("#middleHvga").removeAttr("checked");
+										$("#lowHvga").attr("checked", "checked");
+									}
+								} else {
+									//slider回显
+									$('input[type="range"]').val(1).change();
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+
+							}
+						});
+					}
+				},
+				error: function(xhr, type, errorThrown) {
+
+				}
+			});
+		})
+
+		//slider初始化
+		$('input[type="range"]').rangeslider({
+			polyfill: false
+		});
+		//获取slider
+		var $document = $(document);
+		var selector = '[data-rangeslider]';
+		var $inputRange = $(selector);
+		// 获取slider值
+		$document.on('input', selector, function(e) {
+			valueOutput(e.target);
+		});
+		// 将对应值写入对应文本框
+		function valueOutput(element) {
+			var value = element.value;
+			var output = element.parentNode.nextElementSibling;
+			output.innerHTML = value;
+		}
+		//自定义时间值
+		var picker;
+
+		function PopPicker() {
+			picker = new mui.PopPicker();
+			picker.setData([{
+				value: "0",
+				text: "0"
+			}, {
+				value: "1",
+				text: "1"
+			}, {
+				value: "2",
+				text: "2"
+			}, {
+				value: "3",
+				text: "3"
+			}, {
+				value: "4",
+				text: "4"
+			}, {
+				value: "5",
+				text: "5"
+			}, {
+				value: "6",
+				text: "6"
+			}, {
+				value: "7",
+				text: "7"
+			}, {
+				value: "8",
+				text: "8"
+			}, {
+				value: "9",
+				text: "9"
+			}, {
+				value: "10",
+				text: "10"
+			}, {
+				value: "11",
+				text: "11"
+			}, {
+				value: "12",
+				text: "12"
+			}, {
+				value: "13",
+				text: "13"
+			}, {
+				value: "14",
+				text: "14"
+			}, {
+				value: "15",
+				text: "15"
+			}, {
+				value: "16",
+				text: "16"
+			}, {
+				value: "17",
+				text: "17"
+			}, {
+				value: "18",
+				text: "18"
+			}, {
+				value: "19",
+				text: "19"
+			}, {
+				value: "20",
+				text: "20"
+			}, {
+				value: "21",
+				text: "21"
+			}, {
+				value: "22",
+				text: "22"
+			}, {
+				value: "23",
+				text: "23"
+			}, ])
+		}
+		//开始时间选择器
+		document.getElementById("pickTimeBtn").addEventListener('tap', function() {
+			PopPicker()
+			picker.show(function(getSelectedItems) {
+				document.getElementById('begin').innerHTML = getSelectedItems[0].value;
+			})
+		});
+		//结束时间选择器
+		document.getElementById("pickTimeBtn2").addEventListener('tap', function() {
+			PopPicker()
+			picker.show(function(getSelectedItems) {
+				document.getElementById('end').innerHTML = getSelectedItems[0].value;
+			})
+		});
+		//时控光控对应操作显示
+		mui('.mui-table-view-cell').on('change', 'input[name="type"]', function() {
+			if(this.value == 0) {
+				document.getElementById("lightPattern").classList.remove("mui-hidden");
+				document.getElementById("timePattern").classList.add("mui-hidden");
+			} else {
+				document.getElementById("lightPattern").classList.add("mui-hidden");
+				document.getElementById("timePattern").classList.remove("mui-hidden");
+			}
+		})
+		//提交数据
+		function sendData() {
+			var id = document.getElementById("title").innerHTML,
+				timing = mui('.mui-table-view-cell input[name="type"]:checked')[0].value,
+				timingLength = mui('#timingLength')[0].innerHTML,
+				begin = mui('#begin')[0].innerHTML,
+				end = mui('#end')[0].innerHTML,
+				dropTime = mui('#dropTime')[0].innerHTML,
+				calefactionTime = mui('#calefactionTime')[0].innerHTML,
+				calefactionTemperature = mui('#calefactionTemperature')[0].innerHTML,
+				highLimit = mui('#highLimit')[0].innerHTML,
+				lowLimit = mui('#lowLimit')[0].innerHTML,
+				dataUpTime = mui('#dataUpTime')[0].innerHTML,
+				imgHvga = mui('.mui-table-view-cell input[name="imgHvga"]:checked')[0].value;
+
+			mui.ajax('http://120.27.222.26/cbd_mqtt', {
+				data: {
+					req: 'set',
+					id: id,
+					timing: timing,
+					timingLength: timingLength,
+					begin: begin,
+					end: end,
+					dropTime: dropTime,
+					calefactionTime: calefactionTime,
+					calefactionTemperature: calefactionTemperature,
+					highLimit: highLimit,
+					lowLimit: lowLimit,
+					dataUpTime: dataUpTime,
+					imgHvga: imgHvga
+				},
+				dataType: 'json', //服务器返回json格式数据
+				type: 'post', //HTTP请求类型
+				timeout: 10000, //超时时间设置为10秒;
+				beforeSend: function() {
+					plus.nativeUI.showWaiting('请求中...');
+				},
+				complete: function() {
+					plus.nativeUI.closeWaiting();
+				},
+				success: function(data) {
+					mui.toast('配置成功!')
+				},
+				error: function(xhr, type, errorThrown) {
+					mui.toast('配置失败!')
+				}
+			});
+		}
+
+		//工作模式对应操作显示
+		mui('.mui-table-view-cell').on('change', 'input[name="worktype"]', function() {
+			var type = this.value;
+			mui.confirm('切换工作模式','是否确定',['取消','确定'],function(e){
+				if (e.index == 1) {
+					$.ajax({
+						type: "post",
+						url: 'http://120.27.222.26/cbd_mqtt',
+						data: {
+							"req": "ctrl",//控制
+							"topicid": document.getElementById("title").innerHTML,
+							"cmd": 'workmode',//升级 update
+							"type": type
+						},
+						dataType: "json",
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							setTimeout(function () {
+							plus.nativeUI.closeWaiting();
+							}, 3000)
+						},
+						success: function (data) {
+							setTimeout(function () {
+								if(data == 0){
+									mui.toast('下发成功')
+								}
+							}, 3000)
+							
+						}
+					})
+                }
+				
+			},'div')
+			
+		})
+	</script>
+
+</html>

+ 177 - 0
equipManage/equipManage_bzy.html

@@ -0,0 +1,177 @@
+<!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 rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">孢子仪设备</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+						<input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+
+				</ul>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/mui.min.js"></script>
+
+			<script type="text/javascript">
+				mui.init()
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop: { //配置回到顶部按钮
+							src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset: 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+							use: true // 是否开启懒加载,默认false
+						}
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page) {
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData);
+					}, function() {
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+						mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData) {
+					var html = '';
+					//				var listDom=document.getElementById("dataList");
+					var dat = curPageData;
+					for(var i = 0; i < dat.length; i++) {
+						var equip_name = dat[i].equip_name || '无';
+						var equipicon = '';
+						if(dat[i].is_online == 0) {
+							equipicon = '../images/red.png';
+						} else if(dat[i].is_online == 1) {
+							equipicon = '../images/green.png';
+						}
+						html += '<li data-id="' + dat[i].equip_id + '"><div class="equipItem"><div class="equipItem_top">' +
+							'<div class="equipTitle"><img class="equipIdIcon" src="../images/IDicon.png" width="22"/>' +
+							'<span class="">' + dat[i].equip_id + '</span><img class="equipType" src="' + equipicon + '" width="26"/>' +
+							'</div><div class="equipItem_line"></div></div><div class="equipItem_bottom">' +
+							'<div class="equipMsg"><label>设备名称</label><div class="equipVal equipName">' + equip_name + '</div></div>' +
+							'<div class="equipMsg"><label>上报时间</label><div class="equipVal">' + dat[i].upl_time + '</div>' +
+							'</div></div></div></li>';
+					}
+					$('#dataList').append(html);
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+					console.log(pageNum)
+					$.ajax({
+						type: 'POST',
+						url: 'http://120.27.222.26/app_equipmanage',
+						timeout: 10000, //超时时间设置,单位毫秒
+						data: {
+							'etype': 'bzy',
+							'page': pageNum,
+							'filter': mui('#searchInp')[0].value,
+						},
+						dataType: 'json',
+						success: function(data) {
+							console.log(JSON.stringify(data.dat))
+							successCallback(data.dat, data.nums);
+						},
+						error: function() {
+							errorCallback();
+						}
+					});
+				}
+
+				var markingid = '' //用于记录点击的当前id 以便刷新
+				window.addEventListener('refresh', function(event) { //如果详情页面更改数据  才页面刷新
+					$('#dataList li').each(function() {
+						if(markingid == $(this).data('id')) {
+							$(this).find('.equipName').html(event.detail.markingEquipName);
+						}
+					})
+				})
+				//进入详情页面
+				mui('#dataList').on('tap', 'li', function() {
+					var imei = this.getAttribute('data-id');
+					markingid = imei;
+					mui.openWindow({
+						url: 'equipManage_bzy_detail.html',
+						id: 'equipManage_bzy_detail',
+						extras: {
+							'equipId': imei
+						},
+					})
+				})
+
+				//搜索操作
+				$("#searchInp").on('keypress', function(e) {
+					var keycode = e.keyCode;
+					if(keycode == '13') {
+						e.preventDefault();
+						//请求搜索接口  
+						if(mui('#searchInp')[0].value) {
+							$('#dataList').html('');
+							getListData({
+								num: 1,
+								size: 10
+							})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+					}
+				})
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({
+							num: 1,
+							size: 10
+						})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+			</script>
+	</body>
+
+</html>

+ 705 - 0
equipManage/equipManage_bzy_detail.html

@@ -0,0 +1,705 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/common.css" rel="stylesheet" />
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<style type="text/css">
+			.mui-content {
+				background: #fff;
+			}
+			
+			.iconfont {
+				font-size: 35px;
+				color: #3bb9e7;
+				/*font-weight: bold;*/
+				line-height: 80px;
+				margin: 10px 10px 10px 20px;
+			}
+			
+			.equipState {
+				font-size: 18px;
+				margin-top: 14px;
+				color: #333;
+			}
+			
+			.conversion {
+				width: 110px;
+			}
+			
+			#detial>div {
+				border-bottom: 2px solid #eee;
+			}
+			
+			#detial>div:nth-of-type(odd) {
+				border-right: 2px solid #eee;
+			}
+			
+			.mui-table-view:after,
+			.mui-table-view:before {
+				height: 2px;
+				background-color: #eee;
+			}
+			
+			@media(max-width: 400px) {
+				.mui-col-sm-6 {
+					width: 50%;
+				}
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+			/*查看详情*/
+			
+			.areaTitle {
+				color: #424242;
+				padding-left: 5px;
+				border-left: 5px solid #5870f6;
+				font-weight: bold;
+				font-size: 16px;
+			}
+			
+			.detialBox .fa {
+				padding-right: 5px;
+				color: #ff6e00;
+			}
+			/**/
+			
+			.controlVal {
+				position: absolute;
+				top: 50%;
+				right: 35px;
+				-webkit-transform: translateY(-50%);
+				transform: translateY(-50%);
+			}
+			
+			#controlBtn {
+				width: 80%;
+				/*height: 0px;*/
+				background: white;
+				position: fixed;
+				top: 24%;
+				left: 50%;
+				margin-left: -40%;
+			}
+			/*移除底部或顶部三角,需要在删除此代码*/
+			
+			.mui-popover .mui-popover-arrow:after {
+				width: 0px;
+			}
+			
+			.lnglat>p {
+				color: #333;
+				font-size: 14px;
+			}
+			
+			.lnglat #lng {
+				margin: 18px 0 3px 0;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">孢子仪设备</h1>
+			<a class="headRightIcon fa fa-camera mui-pull-right" id="takephoto">拍照</a>
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll">
+				<div id="dataList">
+					<ul class="mui-table-view" id="equip">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">设备信息</h1>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipId"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipName"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="upl_time"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="lat_lng"></p>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<!--<li class="mui-table-view-cell" id="equipSW">
+							<a class="mui-navigate-right">
+								<i class="fa fa-calendar" aria-hidden="true"></i> 设备开关
+								<span class="controlVal" data-time='' id="equipSWValue"></span>
+							</a>
+						</li>-->
+						<li class="mui-table-view-cell" id="glass">
+							<a class="mui-navigate-right">
+								<i class="fa fa-calendar" aria-hidden="true"></i> 载玻片更换时间
+								<span class="controlVal" data-time='' id="glassValue"></span>
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="liquid">
+							<a class="mui-navigate-right">
+								<i class="fa fa-tint" aria-hidden="true"></i> 培养液更换时间
+								<span class="controlVal" data-time='' id="liquidValue"></span>
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="configBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cog" aria-hidden="true"></i> 设备详细配置
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="refreshBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-refresh" aria-hidden="true"></i> 查询最新状态
+							</a>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<!--<li class="mui-table-view-cell" id="equipSW">
+							<a class="mui-navigate-right">
+								<i class="fa fa-calendar" aria-hidden="true"></i> 设备开关
+								<span class="controlVal" data-time='' id="equipSWValue"></span>
+							</a>
+						</li>-->
+						<li class="mui-table-view-cell" id="glass">
+							<a class="mui-navigate-right">
+								<i class="fa fa-calendar" aria-hidden="true"></i> 载玻片更换时间
+								<span class="controlVal" data-time='' id="glassValue"></span>
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="liquid">
+							<a class="mui-navigate-right">
+								<i class="fa fa-tint" aria-hidden="true"></i> 培养液更换时间
+								<span class="controlVal" data-time='' id="liquidValue"></span>
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="configBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cog" aria-hidden="true"></i> 设备详细配置
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="refreshBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-refresh" aria-hidden="true"></i> 查询最新状态
+							</a>
+						</li>
+					</ul>
+					
+					<div class="mui-row" id="detial">
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe698;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="ds">开</p>
+								<p class="equipFun">设备开关</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe60b;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="ws">待机</p>
+								<p class="equipFun">在线状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe8f3;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="bat_sta">4</p>
+								<p class="equipFun">电池状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe612;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="usb_sta">正常</p>
+								<p class="equipFun">摄像头状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe610;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="pre_temp">正常</p>
+								<p class="equipFun">保温仓温度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe624;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="v_bat">正常</p>
+								<p class="equipFun">当前电压</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xeaae;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="staytime">正常</p>
+								<p class="equipFun">已培养时间</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe711;</i>
+							</div>
+							<div class="mui-pull-left lnglat">
+								<p class="equipState conversion" id="lng">正常</p>
+								<p class="equipFun conversion" id="lat">经纬度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe60a;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="csq">29</p>
+								<p class="equipFun">信号强度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe65f;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState conversion" id="dver">1.0.1</p>
+								<p class="equipFun">版本型号</p>
+							</div>
+						</div>
+					</div>
+					
+				</div>
+			</div>
+			
+			<div id="popover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 310px;background-color: #fff;">
+				<div class="mui-popover-arrow"></div>
+				<!--<div class="popoverheader">
+					<div class="text"></div>
+					<a href="#popover"><img src="../image/close.png" alt=""></a>
+				</div>-->
+				<div id="simDetial">
+					
+				</div>
+				<div class="mui-table-view mui-table-view-chevron next">
+					<a href="#popover" class="x-next add">我知道了</a>
+				</div>
+			</div>
+		</div>
+		<div id="aaa" style="display: none;">
+			sdvsdvsdvsd
+		</div>
+		<div id="map" style="display: none;"></div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
+		<script type="text/javascript">
+			var equipId,bzy_status,iccid;
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				$('#equipId').html('设备ID:' + equipId);
+				console.log(equipId);
+				downCallback()
+				var map = new BMap.Map("map"); //
+				geoc = new BMap.Geocoder();
+				//拍照
+				document.getElementById("takephoto").addEventListener('tap', function() {
+					$.ajax({
+							url: 'http://120.27.222.26/bzy_mqtt',
+							type: "post",
+							data: {
+								'req': 'ctrl',
+								'topicid': equipId,
+								'cmd': 'ctrl',
+								'type': 'takephoto'
+							},
+							dataType: "json",
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							timeout: 10000, //超时时间设置为10秒;
+							success: function(data) {
+								mui.toast('请求成功');
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+				})
+				//载玻片更换时间
+				document.getElementById("glass").addEventListener('tap', function() {
+					var year = new Date().getFullYear();
+					var dtpicker = new mui.DtPicker({
+						"type": "date",
+						"beginYear": 1999,
+						"endYear": year + 6,
+					});
+					dtpicker.show(function(selectItems) {
+						console.log(selectItems.text)
+						$.ajax({
+							url: 'http://120.27.222.26/bzy_mqtt',
+							type: "post",
+							data: {
+								"req": "glass", //读取
+								'id': equipId,
+								"glass": selectItems.text,
+							},
+							dataType: "json",
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							timeout: 10000, //超时时间设置为10秒;
+							success: function(data) {
+								headChangeFun(selectItems.text, $('#liquidValue').data('time'));
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+					})
+				})
+				//滴液更换时间
+				document.getElementById("liquid").addEventListener('tap', function() {
+					var year = new Date().getFullYear();
+					var dtpicker = new mui.DtPicker({
+						"type": "date",
+						"beginYear": 1999,
+						"endYear": year + 6,
+					});
+					dtpicker.show(function(selectItems) {
+						console.log(selectItems.text)
+						$.ajax({
+							url: 'http://120.27.222.26/bzy_mqtt',
+							type: "post",
+							data: {
+								"req": "liquid", //读取
+								'id': equipId,
+								"liquid": selectItems.text,
+							},
+							dataType: "json",
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							timeout: 10000, //超时时间设置为10秒;
+							success: function(data) {
+								headChangeFun($('#glassValue').data('time'),selectItems.text);
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+					})
+				})
+				
+				// 过期时间
+				function getNextDay(setTime, num) {
+				    var date = new Date(setTime);
+				    var nextDay = date.getTime() + (num * 24 * 60 * 60 * 1000);
+				    var d = new Date(nextDay);
+				    var datetime = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
+				    return datetime;
+				}
+
+				// 相差天数
+				function getSurplusDay(sDate2) {
+					var newData = new Date();
+					var dateSpan,
+						iDays;
+					sDate2 = Date.parse(sDate2);
+					newData = Date.parse(newData);
+					dateSpan = sDate2 - newData;
+					// dateSpan = Math.abs(dateSpan);
+					iDays = Math.floor(dateSpan / (24 * 3600 * 1000));
+					return iDays;
+				}
+				// 载玻片更换提示
+				function headChangeFun(setGlassTime, setLiquidTime) {
+					var glassSurplusDay = getSurplusDay(getNextDay(setGlassTime, 10));
+					var liquidSurplusDay = getSurplusDay(getNextDay(setLiquidTime, 10));
+					if(setGlassTime) {
+						$('#glassValue').data('time',setGlassTime)
+						if(glassSurplusDay < 10 && glassSurplusDay > 0) {
+							$('#glassValue').html(setGlassTime+'('+glassSurplusDay+'天过期)').css('color','#cfd51c')
+						} else if(glassSurplusDay <= 0) {
+							$('#glassValue').html(setGlassTime+'(已过期)').css('color','red')
+						} else {
+							$('#glassValue').html(setGlassTime).css('color','#333')
+						}
+					} else {
+						$('#glassValue').data('time','')
+						$('#glassValue').html('请及时设置').css('color','red')
+					}
+					if(setLiquidTime) {
+						$('#liquidValue').data('time',setLiquidTime)
+						if(liquidSurplusDay < 10 && liquidSurplusDay > 0) {
+							$('#liquidValue').html(setLiquidTime+'('+liquidSurplusDay+'天过期)').css('color','#cfd51c')
+						} else if(liquidSurplusDay <= 0) {
+							$('#liquidValue').html(setLiquidTime+'(已过期)').css('color','red')
+						} else {
+							$('#liquidValue').html(setLiquidTime).css('color','#333')
+						}
+					} else {
+						$('#liquidValue').data('time','')
+						$('#liquidValue').html('请及时设置').css('color','red')
+					}
+				}
+				//下拉刷新的回调
+				function downCallback() {
+					$.ajax({
+						url: 'http://120.27.222.26/app_equipmanage_detail',
+						data: {
+							'etype': 'bzy',
+							'equip_id': equipId,
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							bzy_status = data.bzy_status;
+							console.log(JSON.stringify(data))
+							//联网成功的回调,隐藏下拉刷新的状态;
+//							mescroll.endSuccess(); //无参. 注意结束下拉刷新是无参的
+							var equip_name = data.equip_name || '无';
+							$('#equipName').html('设备名称:' + equip_name);
+							$('#upl_time').html('上报时间:' + data.upl_time);
+							var stat = eval('(' + data.bzy_status + ')');
+							var point = new BMap.Point(stat.lng, stat.lat);
+							geoc.getLocation(point, function (rs) {
+							    var addComp = rs.addressComponents;
+								$('#lat_lng').html('位置:'  + addComp.province + ", " + addComp.city + ", " + addComp.district);
+							});
+							if(stat.on_off == 1) {
+								$('#ds').html('开');
+							} else {
+								$('#ds').html('关');
+							}
+							
+							if(data.is_online == 1) {
+								$('#ws').html('在线');
+							} else if(data.is_online == 0) {
+								$('#ws').html('离线');
+							} else {
+								$('#ws').html('--');
+							}
+							
+							if(stat.bat_sta == 0) $('#bat_sta').html('正常');
+							else $('#bat_sta').html('异常');
+							if(stat.usb_sta == 0) $('#usb_sta').html('正常');
+							else $('#usb_sta').html('异常');
+							$('#pre_temp').html(stat.pre_temp + '°C')
+							var dverNum = stat.dver.split('.')[0];
+							if((stat.v_bat > 30) && (dverNum == 1)){
+								var v_bat = 24;
+							}else{
+								var v_bat = stat.v_bat;
+							}
+							$('#v_bat').html(v_bat + 'V')
+							$('#staytime').html(stat.staytime || 0 + '(hour)')
+							$('#csq').html(stat.csq)
+							$('#dver').html(stat.dver)
+							$('#lng').html('经:' + parseFloat(stat.lng).toFixed(4))
+							$('#lat').html('纬:' + parseFloat(stat.lat).toFixed(4))
+							if (data.glass) {
+						        var glassValArr = data.glass.split('#');
+						        var glassVal = glassValArr[glassValArr.length - 1];
+						    } else {
+						        var glassVal = '';
+						    }
+						    if (data.liquid) {
+						        var liquidValArr = data.liquid.split('#');
+						        var liquidVal = liquidValArr[liquidValArr.length - 1];
+						    } else {
+						        var liquidVal = '';
+						    }
+						    iccid = stat.iccid;
+						    // 载玻片更换时间提示
+						    headChangeFun(glassVal, liquidVal);
+						},
+						error: function(xhr, type, errorThrown) {
+							//联网失败的回调,隐藏下拉刷新的状态
+							mescroll.endErr();
+							mui.toast('数据请求失败');
+						}
+					});
+				}
+				//设备详细配置
+				$('#configBtn').on('tap', function() {
+					mui.openWindow({
+						url: 'configuration_bzy.html',
+						id: 'configuration_bzy',
+						extras: {
+							equipId: equipId,
+							status:bzy_status
+						}
+					})
+				})
+				
+				//sim卡查新  
+				document.getElementById('simCodeSearch').addEventListener('tap', function() {
+					if(iccid) {
+						$.ajax({
+							url: 'http://120.27.222.26/siminfo',
+							data: {
+								simid: iccid,
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								var dat = data.data;
+								if(data.code == 0) {
+									var status;
+									if(dat.account_status == "0") {
+										status = "未知";
+									} else if(dat.account_status == "1") {
+										status = "测试期";
+									} else if(dat.account_status == "2") {
+										status = "沉默期";
+									} else if(dat.account_status == "3") {
+										status = "使用中";
+									} else if(dat.account_status == "4") {
+										status = "停机";
+									} else if(dat.account_status == "5") {
+										status = "停机保号";
+									} else if(dat.account_status == "6") {
+										status = "预销号";
+									} else if(dat.account_status == "7") {
+										status = "销号";
+									}
+									var usage;
+									if(dat.iccid) {
+										usage = dat.data_usage;
+									} else {
+										usage.innerHTML = '--';
+									}
+									var balance;
+									if(dat.iccid) {
+										balance = dat.data_balance;
+									} else {
+										balance = '--';
+									}
+									var time;
+									if(dat.iccid) {
+										var timestamp4 = new Date(dat.expiry_date * 1000); //直接用 new Date(时间戳) 格式转化获得当前时间
+										time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
+									} else {
+										time = '--';
+									}
+									html = '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + iccid + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
+									$('#simDetial').html(html);
+									mui('.mui-popover').popover('show', document.getElementById("popover"));
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+
+					} else {
+						mui.toast('未查询到SIM卡号');
+					}
+				})
+
+				//查询
+				$('#refreshBtn').on('tap', function() {
+					var id = [];
+					id.push(equipId);
+					mui.ajax('http://120.27.222.26/bzy_mqtt', {
+						data: {
+							'req': 'read',
+							'topicid': JSON.stringify(id),
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							setTimeout(function() {
+								plus.nativeUI.closeWaiting();
+							}, 5000)
+						},
+						success: function(data) {
+							setTimeout(function() {
+								location.reload();
+							}, 5000)
+						},
+						error: function(xhr, type, errorThrown) {
+							mui.toast('请求失败!')
+						}
+					});
+				})
+
+			})
+		</script>
+	</body>
+
+</html>

+ 176 - 0
equipManage/equipManage_cbd.html

@@ -0,0 +1,176 @@
+<!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 rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">测报灯设备</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+						<input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+
+				</ul>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/mui.min.js"></script>
+
+			<script type="text/javascript">
+				mui.init()
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop: { //配置回到顶部按钮
+							src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset: 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+							use: true // 是否开启懒加载,默认false
+						}
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page) {
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData);
+					}, function() {
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+						mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData) {
+					var html = '';
+					//				var listDom=document.getElementById("dataList");
+					var dat = curPageData;
+					for(var i = 0; i < dat.length; i++) {
+						var equip_name = dat[i].equip_name || '无';
+						var equipicon = '';
+						if(dat[i].is_online == 0) {
+							equipicon = '../images/red.png';
+						} else if(dat[i].is_online == 1) {
+							equipicon = '../images/green.png';
+						}
+						html += '<li data-id="' + dat[i].equip_id + '"><div class="equipItem"><div class="equipItem_top">' +
+							'<div class="equipTitle"><img class="equipIdIcon" src="../images/IDicon.png" width="22"/>' +
+							'<span class="">' + dat[i].equip_id + '</span><img class="equipType" src="' + equipicon + '" width="26"/>' +
+							'</div><div class="equipItem_line"></div></div><div class="equipItem_bottom">' +
+							'<div class="equipMsg"><label>设备名称</label><div class="equipVal equipName">' + equip_name + '</div></div>' +
+							'<div class="equipMsg"><label>上报时间</label><div class="equipVal">' + dat[i].upl_time + '</div>' +
+							'</div></div></div></li>';
+					}
+					$('#dataList').append(html);
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+					console.log(pageNum)
+					$.ajax({
+						type: 'POST',
+						url: 'http://120.27.222.26/app_equipmanage',
+						timeout: 10000, //超时时间设置,单位毫秒
+						data: {
+							'etype': 'cbd',
+							'page': pageNum,
+							'filter': mui('#searchInp')[0].value,
+						},
+						dataType: 'json',
+						success: function(data) {
+							successCallback(data.dat, data.nums);
+						},
+						error: function() {
+							errorCallback();
+						}
+					});
+				}
+
+				var markingid = '' //用于记录点击的当前id 以便刷新
+				window.addEventListener('refresh', function(event) { //如果详情页面更改数据  才页面刷新
+					$('#dataList li').each(function() {
+						if(markingid == $(this).data('id')) {
+							$(this).find('.equipName').html(event.detail.markingEquipName);
+						}
+					})
+				})
+				//进入详情页面
+				mui('#dataList').on('tap', 'li', function() {
+					var imei = this.getAttribute('data-id');
+					markingid = imei;
+					mui.openWindow({
+						url: 'equipManage_cbd_detail.html',
+						id: 'equipManage_cbd_detail',
+						extras: {
+							'equipId': imei
+						},
+					})
+				})
+
+				//搜索操作
+				$("#searchInp").on('keypress', function(e) {
+					var keycode = e.keyCode;
+					if(keycode == '13') {
+						e.preventDefault();
+						//请求搜索接口  
+						if(mui('#searchInp')[0].value) {
+							$('#dataList').html('');
+							getListData({
+								num: 1,
+								size: 10
+							})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+					}
+				})
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({
+							num: 1,
+							size: 10
+						})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+			</script>
+	</body>
+
+</html>

+ 458 - 0
equipManage/equipManage_cbd_detail.html

@@ -0,0 +1,458 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link href="../css/common.css" rel="stylesheet" />
+
+		<style type="text/css">
+			.mui-content {
+				background: #fff;
+			}
+			
+			.iconfont {
+				font-size: 35px;
+				color: #3bb9e7;
+				/*font-weight: bold;*/
+				line-height: 80px;
+				margin: 10px 10px 10px 20px;
+			}
+			.mui-col-sm-6 .mui-pull-left:nth-child(2){
+				    width: 60%;
+			}
+			
+			.equipState {
+				font-size: 18px;
+				margin-top: 14px;
+				color: #333;
+				white-space: nowrap;
+				overflow: hidden;
+				text-overflow: ellipsis;
+			}
+			
+			.conversion {
+				width: 110px;
+			}
+			
+			#detial>div {
+				border-bottom: 2px solid #eee;
+			}
+			
+			#detial>div:nth-of-type(odd) {
+				border-right: 2px solid #eee;
+			}
+			
+			.mui-table-view:after,
+			.mui-table-view:before {
+				height: 2px;
+				background-color: #eee;
+			}
+			
+			@media(max-width: 400px) {
+				.mui-col-sm-6 {
+					width: 50%;
+				}
+			}
+			/*设置*/
+			
+			#detial .mui-navigate-right {
+				line-height: 80px;
+			}
+			
+			#detial .mui-navigate-right:after,
+			#detial .mui-push-right:after {
+				font-size: 33px;
+				color: #3bb9e7;
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+			
+			.areaTitle {
+				color: #424242;
+				padding-left: 5px;
+				border-left: 5px solid #5870f6;
+				font-weight: bold;
+				font-size: 16px;
+			}
+			
+			.detialBox .fa {
+				padding-right: 5px;
+				color: #ff6e00;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">测报灯设备</h1>
+			<a class="headRightIcon mui-icon mui-icon-loop mui-pull-right" onclick="location.reload();"></a>
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll">
+				<div id="dataList">
+					<ul class="mui-table-view" id="equip">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">设备信息</h1>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipId"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipName"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="upl_time"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="lat_lng"></p>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<li class="mui-table-view-cell" id="configuration">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cog" aria-hidden="true"></i> 设备配置
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="downInquire">
+							<a class="mui-navigate-right">
+								<i class="fa fa-refresh" aria-hidden="true"></i> 查询最新状态
+							</a>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<li class="mui-table-view-cell" id="configuration">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cog" aria-hidden="true"></i> 设备配置
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="downInquire">
+							<a class="mui-navigate-right">
+								<i class="fa fa-refresh" aria-hidden="true"></i> 查询最近状态
+							</a>
+						</li>
+					</ul>
+					<div class="mui-row" id="detial">
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xeaae;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="ts"></p>
+								<p class="equipFun">定时模式</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe64c;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="lps"></p>
+								<p class="equipFun">光控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe633;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="tps"></p>
+								<p class="equipFun">温控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe635;</i>
+							</div>
+							<div class="mui-pull-left">
+								<p class="equipState" id="rps"></p>
+								<p class="equipFun">雨控状态</p>
+							</div>
+						</div>
+
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe682;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="gs"></p>
+								<p class="equipFun">通道状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe610;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="hs"></p>
+								<p class="equipFun">加热状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe6db;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="upds"></p>
+								<p class="equipFun">上仓门状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xeaaf;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="dnds"></p>
+								<p class="equipFun">下仓门状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe60a;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="csq"></p>
+								<p class="equipFun">信号强度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe65f;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState conversion" id="dver"></p>
+								<p class="equipFun">版本型号</p>
+							</div>
+						</div>
+					</div>
+					
+				</div>
+			</div>
+
+			<div id="popover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 310px;background-color: #fff;">
+				<div class="mui-popover-arrow"></div>
+				<!--<div class="popoverheader">
+					<div class="text"></div>
+					<a href="#popover"><img src="../image/close.png" alt=""></a>
+				</div>-->
+				<div id="simDetial">
+					
+				</div>
+				<div class="mui-table-view mui-table-view-chevron next">
+					<a href="#popover" class="x-next add">我知道了</a>
+				</div>
+			</div>
+		</div>
+		<div id="map" style="display: none;"></div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
+		<script type="text/javascript">
+			var equipId;
+			var iccid;
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				$('#equipId').html('设备ID:' + equipId);
+				console.log(equipId);
+				downCallback()
+				var map = new BMap.Map("map"); //
+				geoc = new BMap.Geocoder();
+				//下拉刷新的回调
+				function downCallback() {
+					$.ajax({
+						url: 'http://120.27.222.26/app_equipmanage_detail',
+						data: {
+							'etype': 'cbd',
+							'equip_id': equipId,
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						success: function(data) {
+							var equip_name = data.equip_name || '无';
+							$('#equipName').html('设备名称:' + equip_name);
+							$('#upl_time').html('上报时间:' + data.upl_time);
+							var stat = eval('(' + data.cbd_status + ')');
+							var point = new BMap.Point(stat.lng, stat.lat);
+							geoc.getLocation(point, function (rs) {
+							    var addComp = rs.addressComponents;
+								$('#lat_lng').html('位置:'  + addComp.province + ", " + addComp.city + ", " + addComp.district);
+							});
+							var ts = stat.ts == 0 ? '光控' : '时控';
+							$('#ts').html(ts);
+							var lps = stat.lps == 0 ? '夜晚' : '白天';
+							$('#lps').html(lps);
+							var tps = stat.tps == 0 ? '正常' : '异常';
+							$('#tps').html(tps);
+							var rps = stat.rps == 0 ? '正常' : '异常';
+							$('#rps').html(rps);
+							var gs = stat.gs == 0 ? '排水' : '落虫';
+							$('#gs').html(gs);
+							var hs = stat.hs == 0 ? '正常' : '加热';
+							$('#hs').html(hs);
+							var upds = stat.upds == 0 ? '关闭' : '打开';
+							$('#upds').html(upds);
+							var dnds = stat.dnds == 0 ? '关闭' : '打开';
+							$('#dnds').html(dnds);
+							$('#csq').html(stat.csq);
+							$('#dver').html(stat.dver);
+							iccid = stat.iccid;
+						},
+						error: function(xhr, type, errorThrown) {
+							//联网失败的回调,隐藏下拉刷新的状态
+							mescroll.endErr();
+							mui.toast('数据请求失败');
+						}
+					});
+				}
+				//配置
+				document.getElementById('configuration').addEventListener('tap', function() {
+					mui.openWindow({
+						url: 'configuration_cbd.html',
+						id: 'configuration_cbd',
+						extras: {
+							equipId: equipId
+						}
+					})
+				})
+				//sim卡查新  
+				document.getElementById('simCodeSearch').addEventListener('tap', function() {
+					if(iccid) {
+						$.ajax({
+							url: 'http://120.27.222.26/siminfo',
+							data: {
+								simid: iccid,
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								var dat = data.data;
+								if(data.code == 0) {
+									var status;
+									if(dat.account_status == "0") {
+										status = "未知";
+									} else if(dat.account_status == "1") {
+										status = "测试期";
+									} else if(dat.account_status == "2") {
+										status = "沉默期";
+									} else if(dat.account_status == "3") {
+										status = "使用中";
+									} else if(dat.account_status == "4") {
+										status = "停机";
+									} else if(dat.account_status == "5") {
+										status = "停机保号";
+									} else if(dat.account_status == "6") {
+										status = "预销号";
+									} else if(dat.account_status == "7") {
+										status = "销号";
+									}
+									var usage;
+									if(dat.iccid) {
+										usage = dat.data_usage;
+									} else {
+										usage.innerHTML = '--';
+									}
+									var balance;
+									if(dat.iccid) {
+										balance = dat.data_balance;
+									} else {
+										balance = '--';
+									}
+									var time;
+									if(dat.iccid) {
+										var timestamp4 = new Date(dat.expiry_date * 1000); //直接用 new Date(时间戳) 格式转化获得当前时间
+										time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
+									} else {
+										time = '--';
+									}
+									html = '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + iccid + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
+									$('#simDetial').html(html);
+									mui('.mui-popover').popover('show', document.getElementById("popover"));
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+
+					} else {
+						mui.toast('未查询到SIM卡号');
+					}
+				})
+				//查询
+				document.getElementById('downInquire').addEventListener('tap', function() {
+					mui.ajax('http://120.27.222.26/cbd_mqtt', {
+						data: {
+							"req": "read", //读取
+							"topicid": equipId,
+							"kind": "status" //读取下位机状态
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							setTimeout(function() {
+								plus.nativeUI.closeWaiting();
+							}, 5000)
+						},
+						success: function(data) {
+							setTimeout(function() {
+								location.reload();
+							}, 5000)
+						},
+						error: function(xhr, type, errorThrown) {
+							mui.toast('请求失败!')
+						}
+					});
+				})
+
+			})
+		</script>
+	</body>
+
+</html>

+ 216 - 0
equipManage/equipManage_jk.html

@@ -0,0 +1,216 @@
+<!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 rel="stylesheet" href="../css/reset.css" />
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipjk.css"/>
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<style type="text/css">
+			.mescroll {
+				position: fixed;
+				top: 73px;
+				bottom: 0;
+				height: auto;
+				/*如设置bottom:50px,则需height:auto才能生效*/
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">监控</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+						<input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+					<!--<li class="jkitem" data-id ="">
+						<div class="jkmsg">
+							<div class="jkmsgTop">
+								<p>设备</p>
+								<h4>59126446498</h4>
+							</div>
+							<div class="jkmsgBottom blue">
+								<div class="">
+									<img src="../images/jkListBj.png"/>
+								</div>
+								监控
+							</div>
+						</div>
+						<div class="circleBj">
+							<div></div>
+							<div></div>
+							<div></div>
+							<div></div>
+							<div></div>
+							<div></div>
+						</div>
+					</li>-->
+				</ul>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/mui.min.js"></script>
+
+			<script type="text/javascript">
+				mui.init()
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop: { //配置回到顶部按钮
+							src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset: 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+							use: true // 是否开启懒加载,默认false
+						}
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page) {
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData);
+					}, function() {
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+						mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData) {
+					var html = '';
+					//				var listDom=document.getElementById("dataList");
+					var dat = curPageData;
+					for(var i = 0; i < dat.length; i++) {
+						var even;
+//						if(i % 2 == 0){
+//							even = 'blue';
+//						}else{
+//							even = 'pink';
+//						}
+						if(dat[i].is_online == 1){
+							even = 'blue';
+						}else if (dat[i].is_online == 0) {
+							even = 'pink';
+						}
+						var equip_name  = dat[i].name || dat[i].equip_id;
+						html += '<li class="jkitem" data-id ="'+dat[i].equip_id+'"><div class="jkmsg">'+
+								'<div class="jkmsgTop"><p>设备:'+equip_name+'</p><h4>'+dat[i].equip_id+'</h4></div>'+
+								'<div class="jkmsgBottom '+even+'"><div class=""><img src="../images/jkListBj.png"/>'+
+								'</div>监控</div></div><div class="circleBj"><div></div><div></div><div></div><div>'+
+								'</div><div></div><div></div></div></li>';
+					}
+					$('#dataList').append(html);
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+					$.ajax({
+						type: 'POST',
+						url: 'http://120.27.222.26/app_moni_page',
+						timeout: 10000, //超时时间设置,单位毫秒
+						data: {
+							'page': pageNum,
+							'f_id': mui('#searchInp')[0].value,
+						},
+						dataType: 'json',
+						success: function(data) {
+							successCallback(data.ids, data.nums);
+						},
+						error: function() {
+							errorCallback();
+						}
+					});
+				}
+
+				var markingid = '' //用于记录点击的当前id 以便刷新
+				window.addEventListener('refresh', function(event) { //如果详情页面更改数据  才页面刷新
+					$('#dataList li').each(function() {
+						if(markingid == $(this).data('id')) {
+							$(this).find('.equipName').html(event.detail.markingEquipName);
+						}
+					})
+				})
+				//进入详情页面
+				mui('#dataList').on('tap', 'li', function() {
+					var imei = this.getAttribute('data-id');
+					var equipName = $(this).find('.equipName').html();
+					if(equipName == '无'){
+						equipName = '设备'+imei;
+					}
+//					console.log(equipName)
+					markingid = imei;
+					mui.openWindow({
+						url: 'equipManage_jk_detail.html',
+						id: 'equipManage_jk_detail',
+						extras: {
+							'equipId': imei,
+							'equipName':equipName
+						},
+					})
+				})
+
+				//搜索操作
+				$("#searchInp").on('keypress', function(e) {
+					var keycode = e.keyCode;
+					if(keycode == '13') {
+						e.preventDefault();
+						//请求搜索接口  
+						if(mui('#searchInp')[0].value) {
+							$('#dataList').html('');
+							getListData({
+								num: 1,
+								size: 10
+							})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+					}
+				})
+				
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({
+							num: 1,
+							size: 10
+						})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+			</script>
+	</body>
+
+</html>

+ 274 - 0
equipManage/equipManage_jk_detail.html

@@ -0,0 +1,274 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/reset.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipjk.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<script src="https://open.ys7.com/sdk/js/1.3/ezuikit.js"></script>
+		<style type="text/css">
+			.headRightIcon{
+				margin-top: 10px;
+			}
+			/*视频*/
+			
+			.videobox>video,
+			.videobox {
+				width: 100%;
+				height: 4.5rem;
+				background: #000;
+			}
+			/*控制*/
+			
+			.topCtrl {
+				text-align: center;
+			}
+			
+			.topCtrl>div {
+				display: inline-block;
+				width: 1.5rem;
+				height: 1.5rem;
+				background-size: 100%;
+			}
+			
+			.addBtn {
+				background: url(../images/jkadd.png);
+				margin-right: 4rem;
+			}
+			
+			.minusBtn {
+				background: url(../images/jkminus.png);
+			}
+			.topCtrl{
+				left: 0;
+			    right: 0;
+			    bottom: 6rem;
+			    height: 1.5rem;
+			    /*background: red;*/
+			}
+			.bottomCtrl {
+				position: absolute;
+				left: 0;
+				right: 0;
+				top: 5rem;
+				bottom: 0;
+				height: 6rem;
+				background-size: 5.5rem 5.5rem;
+			}
+			
+			.bottomCtrl div {
+				position: absolute;
+				width: 1.2rem;
+				height: 1.2rem;
+				left: 50%;
+			}
+			
+			.upBtn {
+				top: 1.45rem;
+				margin-left: -0.6rem;
+			}
+			
+			.dowmBtn {
+				left: 50%;
+				bottom: 1.65rem;
+				margin-left: -0.6rem;
+			}
+			
+			.leftBtn {
+				top: 2.8rem;
+				margin-left: -2rem;
+			}
+			
+			.rightBtn {
+				top: 2.8rem;
+				margin-left: 0.8rem;
+			}
+			
+			.lookImg {
+				position: absolute;
+    			left: 0;
+    			top: 11rem;
+    			width: 100%;
+			}
+			.lookImg_img {
+				margin-left: 1.3rem;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="equip_name"></h1>
+			<!--<a class="headRightIcon fa fa-file-image-o mui-pull-right" id="lookPhotoBtn"></a>-->
+		</header>
+		<div class="mui-content">
+			<div class="videobox">
+				<!--<video id="myPlayer" poster="" controls playsInline webkit-playsinline autoplay>
+					<source src="rtmp://rtmp01open.ys7.com/openlive/fce902662a5a4acc86bc4ae771b45c92.hd" type="" />
+					<source src="http://hls01open.ys7.com/openlive/fce902662a5a4acc86bc4ae771b45c92.hd.m3u8" type="application/x-mpegURL" />
+				</video>-->
+			</div>
+			<div class="controlPanel">
+				<div class="topCtrl">
+					<div class="addBtn"></div>
+					<div class="minusBtn"></div>
+					<!--<div></div>-->
+				</div>
+				<div class="bottomCtrl">
+					<div class="upBtn"></div>
+					<div class="dowmBtn"></div>
+					<div class="leftBtn"></div>
+					<div class="rightBtn"></div>
+				</div>
+				<div class="lookImg" id="lookPhotoBtn">
+					<img src="../images/jk_image.png" alt="" class="lookImg_img" />
+				</div>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mui.min.js"></script>
+			<script src="https://open.ys7.com/sdk/js/1.3/ezuikit.js"></script>
+
+			<script type="text/javascript">
+				mui.init({
+				  gestureConfig:{
+				   tap: true, //默认为true
+				   doubletap: true, //默认为false
+				   longtap: true, //默认为false
+				   swipe: true, //默认为true
+				   drag: true, //默认为true
+				   hold:true,//默认为false,不监听
+				   release:true//默认为false,不监听
+				  }
+				});
+				var equipId;
+				mui.plusReady(function() {
+					var self = plus.webview.currentWebview();
+					equipId = self.equipId;
+					$('#equip_name').html('设备:'+equipId);
+					mui.ajax('http://120.27.222.26/app_moni', {
+						data: {
+							id: equipId
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 100000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						success: function(data) {
+							console.log(JSON.stringify(data))
+							if(data[0].code == 200) {
+								StartPlay(data[0].data[0]);
+							} else {
+								mui.toast('请求失败');
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							mui.toast('请求失败');
+						}
+					});
+
+					
+				})
+				
+				$('.addBtn').on('longtap',function(){
+					configCamera('move',8)
+				})
+				$('.addBtn').on('release',function(){
+					configCamera('stop')
+				})
+				$('.minusBtn').on('hold',function(){
+					configCamera('move',9)						
+				})
+				$('.minusBtn').on('release',function(){
+					configCamera('stop')
+				})
+				$('.upBtn').on('hold',function(){
+					configCamera('move',0)
+				})
+				$('.upBtn').on('release',function(){
+					configCamera('stop')
+				})
+				$('.dowmBtn').on('hold',function(){
+					configCamera('move',1)
+				})
+				$('.dowmBtn').on('release',function(){
+					configCamera('stop')
+				})
+				$('.leftBtn').on('hold',function(){
+					configCamera('move',2)
+				})
+				$('.leftBtn').on('release',function(){
+					configCamera('stop')
+				})
+				$('.rightBtn').on('hold',function(){
+					configCamera('move',3)
+				})
+				$('.rightBtn').on('release',function(){
+					configCamera('stop')
+				})
+				function configCamera(ctrl, movenum) {
+						console.log(111111)
+						$.ajax({
+//							url: 'http://120.27.222.26/equipmanage_jk',
+							url: 'http://120.27.222.26/jk_view',
+							type: 'post',
+							dataType: 'json',
+							data: {
+								id: equipId,
+								ctrl: ctrl,
+								movenum: movenum
+							},
+							beforeSend: function() {
+								if(ctrl == 'takephoto') {
+									loadFlage = layer.load();
+								}
+							},
+							success: function(data) {
+//								console.log(data)
+							},
+							error: function(xhr, type, errorThrown) {
+								mui.toast('请求失败');
+							}
+						})
+					}
+				
+				//预览函数
+				function StartPlay(dat) {
+					var jkmsg = dat
+					var playHtml = "<video id='myPlayer' class='videoNum' poster='' controls playsinline webkit-playsinline autoplay>";
+					playHtml += "<source src='" + jkmsg.hlsHd + "' type='' />";
+					playHtml += "</video>";
+
+					var script = document.createElement("script");
+					script.type = "text/javascript";
+					script.appendChild(document.createTextNode(" new EZUIPlayer('myPlayer');"));
+
+					$(".videobox").html(playHtml);
+					$(".videobox").append(script);
+				}
+				//进入定时拍照页面
+				document.getElementById('lookPhotoBtn').addEventListener('tap', function() {
+					mui.openWindow({
+						url: 'lookImage_jk.html',
+						id: 'lookImage_jk',
+						extras: {
+							'equipId': equipId,
+//							'equipName':equipName
+						},
+					})
+				})
+			</script>
+	</body>
+
+</html>

+ 175 - 0
equipManage/equipManage_qxz.html

@@ -0,0 +1,175 @@
+<!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 rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">环境监测</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+						<input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+
+				</ul>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/mui.min.js"></script>
+
+			<script type="text/javascript">
+				mui.init()
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop: { //配置回到顶部按钮
+							src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset: 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+							use: true // 是否开启懒加载,默认false
+						}
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page) {
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData);
+					}, function() {
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+						mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData) {
+					var html = '';
+					//				var listDom=document.getElementById("dataList");
+					var dat = curPageData;
+					for(var i = 0; i < dat.length; i++) {
+						var equip_name = dat[i].equip_name || '无';
+						html += '<li data-id="' + dat[i].equip_id + '"><div class="equipItem"><div class="equipItem_top">' +
+							'<div class="equipTitle"><img class="equipIdIcon" src="../images/IDicon.png" width="22"/>' +
+							'<span class="">' + dat[i].equip_id + '</span>' +
+							'</div><div class="equipItem_line"></div></div><div class="equipItem_bottom">' +
+							'<div class="equipMsg"><label>设备名称</label><div class="equipVal equipName">' + equip_name + '</div></div>' +
+							'<div class="equipMsg"><label>上报时间</label><div class="equipVal">' + dat[i].upl_time + '</div>' +
+							'</div></div></div></li>';
+					}
+					$('#dataList').append(html);
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+					$.ajax({
+						type: 'POST',
+						url: 'http://120.27.222.26/app_equipmanage',
+						timeout: 10000, //超时时间设置,单位毫秒
+						data: {
+							'etype': 'qxz',
+							'page': pageNum,
+							'filter': mui('#searchInp')[0].value,
+						},
+						dataType: 'json',
+						success: function(data) {
+							successCallback(data.dat, data.nums);
+						},
+						error: function() {
+							errorCallback();
+						}
+					});
+				}
+
+				var markingid = '' //用于记录点击的当前id 以便刷新
+				window.addEventListener('refresh', function(event) { //如果详情页面更改数据  才页面刷新
+					$('#dataList li').each(function() {
+						if(markingid == $(this).data('id')) {
+							$(this).find('.equipName').html(event.detail.markingEquipName);
+						}
+					})
+				})
+				//进入详情页面
+				mui('#dataList').on('tap', 'li', function() {
+					var imei = this.getAttribute('data-id');
+					var equipName = $(this).find('.equipName').html();
+					if(equipName == '无'){
+						equipName = '设备'+imei;
+					}
+					console.log(equipName)
+					markingid = imei;
+					mui.openWindow({
+						url: 'equipManage_qxz_detail.html',
+						id: 'equipManage_qxz_detail',
+						extras: {
+							'equipId': imei,
+							'equipName':equipName
+						},
+					})
+				})
+
+				//搜索操作
+				$("#searchInp").on('keypress', function(e) {
+					var keycode = e.keyCode;
+					if(keycode == '13') {
+						e.preventDefault();
+						//请求搜索接口  
+						if(mui('#searchInp')[0].value) {
+							$('#dataList').html('');
+							getListData({
+								num: 1,
+								size: 10
+							})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+					}
+				})
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({
+							num: 1,
+							size: 10
+						})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+			</script>
+	</body>
+
+</html>

+ 278 - 0
equipManage/equipManage_qxz_data24.html

@@ -0,0 +1,278 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/reset.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<link href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			/*body,.mui-content {
+				background: #fff;
+			}*/
+			
+			.qxMsg {
+				margin: 10px 20px;
+				/*background: pink;*/
+			}
+			.qxMsg >li{
+				margin-bottom: .2rem;
+			}
+			
+			.qxitem>div {
+				display: inline-block;
+			}
+			.aisleNum{
+				width: .4rem;
+				margin-right: .5rem;
+			}
+			
+			.cutline {
+				display: inline-block;
+				width: 10px;
+				height: 10px;
+				border-radius: 50%;
+				background: #00aaea;
+				position: relative;
+				margin: 0 3% 0 1%;
+			}
+			
+			.cutline:after {
+				position: absolute;
+				content: '';
+				width: 2px;
+				height: 43px;
+				background: #00aaea;
+				left: 44%;
+				top: 10px;
+			}
+			
+			.qxdetail {
+				vertical-align: top;
+				width: 80%;
+				line-height: 34px;
+			}
+			
+			.aisleName {
+				background: #fff;
+				border-radius: 3px;
+				position: relative;
+			}
+			
+			.mui-navigate-right {
+				padding-left: 10px;
+			}
+			
+			.valueNum {
+				display: none;
+			}
+			
+			.valueNum>div {
+				margin-top: 15px;
+				background: #c5c5c5;
+				border-radius: 3px;
+				padding-left: 10px;
+				color: #fff;
+			}
+			
+			.inputRow {
+				line-height: 14px;
+				font-size: 12px;
+				padding: 3px 2px 3px 10px;
+				position: relative;
+			}
+			
+			.uptime {
+				position: absolute;
+				right: 3px;
+				top: 30%;
+			}
+			
+			.mui-navigate-right:after {
+				content: '\e581';
+			}
+			
+			.mui-navigate-top:after {
+				content: '\e580';
+			}
+			/**/
+			
+			
+			.aisleName:before {
+				position: absolute;
+				content: '';
+				width: 2px;
+				height: 38px;
+				background: #00aaea;
+				left: -7.5%;
+				top: -18px;
+			}
+			.aisleNamefirat:before {
+			    position: absolute;
+			    content: '';
+			    width: 0;
+			    height: 0;
+			    background: #00aaea;
+			    left: -7.5%;
+			    top: 0;
+			}
+			
+			.aisleName:after {
+				width: 10px;
+				height: 10px;
+				border-radius: 50%;
+				background: #c5c5c5;
+				position: absolute;
+				content: '';
+				left: -9%;
+				top: 16px;
+				background: #00aaea;
+			}
+			
+			.inputRow:before {
+				position: absolute;
+				content: '';
+				width: 2px;
+				height: 84px;
+				background: #c5c5c5;
+				left: -7.5%;
+				top: -23px;
+				z-index: 999;
+			}
+			
+			.inputRow:after {
+				width: 10px;
+				height: 10px;
+				border-radius: 50%;
+				background: #c5c5c5;
+				position: absolute;
+				content: '';
+				left: -9%;
+				top: 16px;
+				/* background: #00aaea; */
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title"></h1>
+		</header>
+		<div class="mui-content">
+			<ul class="qxMsg">
+				<!--<li class="qxitem">
+					<div class="aisleNum">e1</div>
+					<div class="qxdetail">
+						<div class="aisleName">
+							<div class="mui-navigate-right">风速(m/s)</div>
+						</div>
+						<div class="valueNum">
+							<div class="inputRow">
+								<div>最大值</div>
+								<div>23</div>
+								<div class="uptime">2019-11-12 12:56:23</div>
+							</div>
+							<div class="inputRow">
+								<div>最小值</div>
+								<div>0</div>
+								<div class="uptime">2019-11-12 12:57:23</div>
+							</div>
+						</div>
+					</div>
+				</li>
+				<li class="qxitem">
+					<div class="aisleNum">e21</div>
+					<div class="qxdetail">
+						<div class="aisleName">
+							<div class="mui-navigate-right">风速(m/s)</div>
+						</div>
+						<div class="valueNum">
+							<div class="inputRow">
+								<div>最大值</div>
+								<div>23</div>
+								<div class="uptime">2019-11-12 12:56:23</div>
+							</div>
+							<div class="inputRow">
+								<div>最小值</div>
+								<div>0</div>
+								<div class="uptime">2019-11-12 12:57:23</div>
+							</div>
+						</div>
+					</div>
+				</li>-->
+			</ul>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			var equipId;
+			mui.init();
+			var allData = [];
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				$('#title').html('设备ID:' + equipId);
+				$.ajax({
+					type: 'post',
+					url: 'http://120.27.222.26/qxz_day_data',
+					timeout: 10000, //超时时间设置,单位毫秒
+					data: {
+						'e_id': equipId,
+					},
+					beforeSend: function() {
+						plus.nativeUI.showWaiting("加载中...");
+					},
+					complete: function() {
+						plus.nativeUI.closeWaiting();
+					},
+					dataType: 'json',
+					success: function(data) {
+						var dat = data.data;
+						var conf = data.conf;
+						var html = '';
+						
+						if(!dat.length){
+							html = '<div style="text-align:center">暂无数据</div>'
+							$('.qxMsg').html(html);
+						}else{
+							for(var i = 0;i<dat.length;i++){
+								html += '<li class="qxitem"><div class="aisleNum">'+dat[i].ekey+'</div>'+
+										'<div class="qxdetail"><div class="aisleName"><div class="mui-navigate-right">'+conf[dat[i].ekey].split('#')[0]+'('+dat[i].enum[2]+')</div>'+
+										'</div><div class="valueNum"><div class="inputRow"><div>最大值</div><div>'+dat[i].max+'</div>'+
+										'<div class="uptime">'+dat[i].maxtime+'</div></div><div class="inputRow">'+
+										'<div>最小值</div><div>'+dat[i].min+'</div><div class="uptime">'+dat[i].mintime+'</div>'+
+										'</div></div></div></li>';
+								if(i == dat.length-1){
+									$('.qxMsg').html(html);
+								}		
+							}
+						}
+						
+					},
+					error: function() {
+						mui.toast('请求失败')
+					}
+				});
+			})
+			$('body').on('tap', '.aisleName', function() {
+				var _this = this;
+				$(_this).next().slideToggle(function() {
+					if($(this).is(":visible")) {
+						$(_this).children().addClass('mui-navigate-top')
+					} else {
+						$(_this).children().removeClass('mui-navigate-top')
+					}
+				});
+			})
+		</script>
+	</body>
+
+</html>

+ 258 - 0
equipManage/equipManage_qxz_data24Old.html

@@ -0,0 +1,258 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/reset.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<link href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			/*body,.mui-content {
+				background: #fff;
+			}*/
+			
+			.qxMsg {
+				margin: 10px 20px;
+				/*background: pink;*/
+			}
+			.qxMsg >li{
+				margin-bottom: .2rem;
+			}
+			
+			.qxitem>div {
+				display: inline-block;
+			}
+			.aisleNum{
+				width: .4rem;
+				margin-right: .5rem;
+			}
+			
+			.cutline {
+				display: inline-block;
+				width: 10px;
+				height: 10px;
+				border-radius: 50%;
+				background: #00aaea;
+				position: relative;
+				margin: 0 3% 0 1%;
+			}
+			
+			.cutline:after {
+				position: absolute;
+				content: '';
+				width: 2px;
+				height: 43px;
+				background: #00aaea;
+				left: 44%;
+				top: 10px;
+			}
+			
+			.qxdetail {
+				vertical-align: top;
+				width: 80%;
+				line-height: 34px;
+			}
+			
+			.aisleName {
+				background: #fff;
+				border-radius: 3px;
+				position: relative;
+			}
+			
+			.mui-navigate-right {
+				padding-left: 10px;
+			}
+			
+			.valueNum {
+				display: none;
+			}
+			
+			.valueNum>div {
+				margin-top: 15px;
+				background: #c5c5c5;
+				border-radius: 3px;
+				padding-left: 10px;
+				color: #fff;
+			}
+			
+			.inputRow {
+				line-height: 14px;
+				font-size: 12px;
+				padding: 3px 2px 3px 10px;
+				position: relative;
+			}
+			
+			.uptime {
+				position: absolute;
+				right: 3px;
+				top: 30%;
+			}
+			
+			.mui-navigate-right:after {
+				content: '\e581';
+			}
+			
+			.mui-navigate-top:after {
+				content: '\e580';
+			}
+			/**/
+			
+			
+			.aisleName:before {
+				position: absolute;
+				content: '';
+				width: 2px;
+				height: 38px;
+				background: #00aaea;
+				left: -7.5%;
+				top: -18px;
+			}
+			.aisleNamefirat:before {
+			    position: absolute;
+			    content: '';
+			    width: 0;
+			    height: 0;
+			    background: #00aaea;
+			    left: -7.5%;
+			    top: 0;
+			}
+			
+			.aisleName:after {
+				width: 10px;
+				height: 10px;
+				border-radius: 50%;
+				background: #c5c5c5;
+				position: absolute;
+				content: '';
+				left: -9%;
+				top: 16px;
+				background: #00aaea;
+			}
+			
+			.inputRow:before {
+				position: absolute;
+				content: '';
+				width: 2px;
+				height: 84px;
+				background: #c5c5c5;
+				left: -7.5%;
+				top: -23px;
+				z-index: 999;
+			}
+			
+			.inputRow:after {
+				width: 10px;
+				height: 10px;
+				border-radius: 50%;
+				background: #c5c5c5;
+				position: absolute;
+				content: '';
+				left: -9%;
+				top: 16px;
+				/* background: #00aaea; */
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">环境监测</h1>
+		</header>
+		<div class="mui-content">
+			<ul class="qxMsg">
+				<li class="qxitem">
+					<div class="aisleNum">e1</div>
+					<div class="qxdetail">
+						<div class="aisleName">
+							<div class="mui-navigate-right">风速(m/s)</div>
+						</div>
+						<div class="valueNum">
+							<div class="inputRow">
+								<div>最大值</div>
+								<div>23</div>
+								<div class="uptime">2019-11-12 12:56:23</div>
+							</div>
+							<div class="inputRow">
+								<div>最小值</div>
+								<div>0</div>
+								<div class="uptime">2019-11-12 12:57:23</div>
+							</div>
+						</div>
+					</div>
+				</li>
+				<li class="qxitem">
+					<div class="aisleNum">e21</div>
+					<div class="qxdetail">
+						<div class="aisleName">
+							<div class="mui-navigate-right">风速(m/s)</div>
+						</div>
+						<div class="valueNum">
+							<div class="inputRow">
+								<div>最大值</div>
+								<div>23</div>
+								<div class="uptime">2019-11-12 12:56:23</div>
+							</div>
+							<div class="inputRow">
+								<div>最小值</div>
+								<div>0</div>
+								<div class="uptime">2019-11-12 12:57:23</div>
+							</div>
+						</div>
+					</div>
+				</li>
+			</ul>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			var equipId;
+			mui.init();
+			var allData = [];
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				equipName = self.equipName
+				data = self.data
+				$('#title').html('设备ID:' + equipId);
+				$('#equipName').html('项目名称:' + equipName);
+				console.log(JSON.stringify(data));
+				var html = '';
+				for(var i = 0;i<data.length;i++){
+					var min_time = data[i].min_time;
+					var minlength = min_time.length-1;
+					var max_time = data[i].max_time;
+					var maxlength = max_time.length-1;
+					html += '<li class="qxitem"><div class="aisleNum">'+data[i].ekey+'</div>'+
+							'<div class="qxdetail"><div class="aisleName"><div class="mui-navigate-right">'+data[i].unit[1]+'('+data[i].unit[2]+')</div>'+
+							'</div><div class="valueNum"><div class="inputRow"><div>最大值</div><div>'+data[i].max+'</div>'+
+							'<div class="uptime">'+max_time.substring(1,maxlength)+'</div></div><div class="inputRow">'+
+							'<div>最小值</div><div>'+data[i].min+'</div><div class="uptime">'+min_time.substring(1,minlength)+'</div>'+
+							'</div></div></div></li>';
+					if(i == data.length-1){
+						$('.qxMsg').html(html);
+					}
+				}
+			})
+
+			$('body').on('tap', '.aisleName', function() {
+				var _this = this;
+				$(_this).next().slideToggle(function() {
+					if($(this).is(":visible")) {
+						$(_this).children().addClass('mui-navigate-top')
+					} else {
+						$(_this).children().removeClass('mui-navigate-top')
+					}
+				});
+			})
+		</script>
+	</body>
+
+</html>

+ 342 - 0
equipManage/equipManage_qxz_detail.html

@@ -0,0 +1,342 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/common.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<style type="text/css">
+			/*.mui-content {
+				background: #fff;
+			}*/
+			
+			body,
+			.mui-content,
+			#dataList {
+				background: #0088e5;
+			}
+			/*设备信息*/
+			
+			.equipScope {
+				margin: 4% 6% 0 6%;
+				background: rgba(255, 255, 255, 0.4);
+				padding: 5px;
+				border-radius: 7px;
+				position: relative;
+			}
+			
+			.equipmsg {
+				/*position:relative;*/
+			}
+			
+			.qxzImg {
+				/*background-image: url('../images/qxz.jpg');*/
+				/*background-image: url(http://120.27.222.26/qxz_photo/default.png);*/
+				height: 200px;
+				background-size: cover;
+				border-radius: 7px;
+			}
+			
+			.qxzDescribe {
+				position: absolute;
+				right: 10px;
+				bottom: 5px;
+			}
+			
+			.qxzDescribe>div {
+				font-size: 12px;
+				background: rgba(57, 160, 230, 0.7);
+				line-height: 22px;
+				color: #fff;
+				padding-left: 8px;
+				padding-right: 8px;
+				margin-bottom: 5px;
+				border-radius: 10px;
+			}
+			/*实时状态*/
+			
+			.sensor {
+				position: relative;
+				float: left;
+				width: 41%;
+				height: 180px;
+				background: rgba(255, 255, 255, 0.3);
+				border-radius: 10px;
+				margin-left: 6%;
+				margin-top: 20px;
+			}
+			
+			.sensorIcon {
+				background: rgba(255, 255, 255, 0.35);
+				border-radius: 50%;
+				position: absolute;
+				width: 2.5em;
+				height: 2.5em;
+				top: 10px;
+				left: 10px;
+				line-height: 3.8em;
+				text-align: center;
+				vertical-align: middle;
+			}
+			
+			.sensorIcon>img {
+				width: 74%;
+			}
+			
+			.sensorAisle {
+				position: absolute;
+				top: 45px;
+				left: 14px;
+				color: rgba(255, 255, 255, 0.76);
+				font-size: 12px;
+				letter-spacing: 1px;
+			}
+			
+			.sensorResult {
+				color: #ffffff;
+				font-size: 16px;
+				line-height: 200px;
+				text-align: center;
+			}
+			
+			.sensorUnit {
+				position: absolute;
+				bottom: 10px;
+				right: 10px;
+				color: rgba(255, 255, 255, 0.76);
+				font-size: 12px;
+				letter-spacing: 1px;
+			}
+			/*24小时数据*/
+			
+			.seeMore {
+				text-align: center;
+			}
+			
+			.seeMore>button {
+				background: rgba(255, 255, 255, 0.4);
+				border: none;
+				border-radius: 30px;
+				color: #fff;
+				padding: 10px 40px;
+				margin: 15px 0;
+			}
+			
+			.seeMore>button:active {
+				background: #005b99;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">环境监测</h1>
+			<a id="setAstrict" class="mui-icon mui-icon-gear mui-pull-right" onclick="setAstrictFun()"></a>
+		</header>
+		<div class="mui-content">
+			<div class="equipmsg">
+				<div class="equipScope">
+					<div class="qxzImg" id="qxzImg"></div>
+					<div class="qxzDescribe">
+						<div id="equipName">项目名称:设备16061203</div>
+						<div id="equipId">设备ID:16061203</div>
+						<div id="updataTime">更新时间:2019-04-10 15:51:24</div>
+					</div>
+				</div>
+			</div>
+			<div id="dataList">
+				<!--最新数据-->
+				<div class="clearfix" id="newResultDat">
+					<!--<div class="sensor">
+						<div class="sensorIcon">
+							<img src="../images/dev/icon_101.png"/>
+						</div>
+						<div class="sensorAisle">
+							通道1
+						</div>
+						<div class="sensorResult">
+							0°
+						</div>
+						<div class="sensorUnit">温度</div>
+					</div>-->
+				</div>
+			</div>
+			<div class="seeMore">
+				<button type="button" onclick="setTimingFun()" class="">定时控制</button>
+				 
+				<button type="button" onclick="manualCtrl()" class="">手动控制</button>
+			</div>
+			<div class="seeMore">
+				<button type="button" onclick="lookMore()" class="">查看24小时数据</button>
+			</div>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/mescroll.min.js" charset="utf-8"></script>
+		<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			
+			var equipId,equipName,qxz_switch,switch_name,timing_list,auto_list,conf,qxzDat;
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				equipName = self.equipName
+				$('#equipId').html('设备ID:' + equipId);
+				$('#equipName').html('项目名称:' + equipName);
+				$.ajax({
+					type: 'post',
+					url: 'http://120.27.222.26/qxz_status',
+					timeout: 10000, //超时时间设置,单位毫秒
+					data: {
+						'e_id': equipId,
+					},
+					beforeSend: function() {
+						plus.nativeUI.showWaiting("加载中...");
+					},
+					complete: function() {
+						plus.nativeUI.closeWaiting();
+					},
+					dataType: 'json',
+					success: function(data) {
+						console.log(JSON.stringify(data))
+						if(data.qxz_switch.length>2){
+							qxz_switch = eval('('+data.qxz_switch+')');
+						}else{
+							qxz_switch = {}
+						}
+						if(data.switch_name.length>2){
+							switch_name = eval('('+data.switch_name+')');
+						}else{
+							switch_name = {}
+						}
+						if(data.timing_list.length>2){
+							timing_list = eval('('+data.timing_list+')');
+						}else{
+							timing_list = {}
+						}
+						if(data.auto_list.length>2){
+							auto_list = eval('('+data.auto_list+')');
+						}else{
+							auto_list = {}
+						}
+						conf = data.conf;
+						qxzDat = data.dat;
+
+						$('#updataTime').html('数据更新时间:' + data.base.upl_time);
+						var path = 'http://120.27.222.26/' + data.base.qxz_picture;
+						$('#qxzImg').css('background-image', 'url(' + path + ')');
+						var dat = data.dat;
+						var datlen = Object.keys(dat).length;
+						var html = '';
+						for(var i = 1;i<=datlen;i++){
+							var key = 'e'+ i;
+							if(dat[key]){
+								if(dat[key].split('#')[0] == -99.99){
+									var val = 'N/A';
+								}else{
+									var val = dat[key].split('#')[0];
+								}
+								var eNum = dat[key].split('#')[1];
+								var unitTxt = data.conf[key].split('#')[0];
+								var unit = data.conf[key].split('#')[1];
+								html += '<div class="sensor"><div class="sensorIcon"><img src="../images/dev/icon_' + eNum + '.png"/>' +
+									'</div><div class="sensorAisle">通道' + i + '</div>' +
+									'<div class="sensorResult">' + val + unit + '</div><div class="sensorUnit">' + unitTxt + '</div></div>'
+							}
+							if(i == datlen){
+								if(!html){
+									html = '<div class="sensor" style="width: 88%;"><div class="sensorResult">暂无数据</div></div>';
+								}
+									$('#newResultDat').html(html);
+							}
+						}
+					},
+					error: function() {
+						mui.toast('请求失败')
+					}
+				});
+			})
+			//查看24小时数据
+			function lookMore() {
+				mui.openWindow({
+					url: 'equipManage_qxz_data24.html',
+					id: 'equipManage_qxz_data24',
+					extras: {
+						'equipId': equipId,
+						'equipName': equipName,
+					},
+				})
+
+			}
+			//手动控制
+			function manualCtrl() {
+				if(qxz_switch.length) {
+					mui.openWindow({
+						url: 'equipManage_qxz_manualCtrl.html',
+						id: 'equipManage_qxz_manualCtrl',
+						extras: {
+							'equipId': equipId,
+							'equipName': equipName,
+							'qxz_switch': qxz_switch,
+							'switch_name': JSON.stringify(switch_name)
+						},
+					})
+				} else {
+					mui.toast('暂无开关设置功能')
+				}
+
+			}
+			//阈值设置
+			function setAstrictFun() {
+				if(auto_list.length) {
+					mui.openWindow({
+						url: 'equipManage_qxz_setAstrict.html',
+						id: 'equipManage_qxz_setAstrict',
+						extras: {
+							'equipId': equipId,
+							'equipName': equipName,
+							'qxz_switch': qxz_switch,
+							'switch_name': switch_name,
+							'auto_list':auto_list,
+							'conf':conf,
+							'qxzDat':qxzDat
+						},
+					})
+				} else {
+					mui.toast('暂无阈值设置功能')
+				}
+			}
+			//定时控制
+			function setTimingFun() {
+				if(timing_list.length) {
+					mui.openWindow({
+						url: 'equipManage_qxz_setTiming.html',
+						id: 'equipManage_qxz_setTiming',
+						extras: {
+							'equipId': equipId,
+							'equipName': equipName,
+							'qxz_switch': qxz_switch,
+							'switch_name': switch_name,
+							'timing_list':timing_list,
+							'conf':conf,
+							'qxzDat':qxzDat
+						},
+					})
+				} else {
+					mui.toast('暂无定时设置功能')
+				}
+			}
+		</script>
+	</body>
+
+</html>

+ 345 - 0
equipManage/equipManage_qxz_detailOld.html

@@ -0,0 +1,345 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/common.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<style type="text/css">
+			/*.mui-content {
+				background: #fff;
+			}*/
+			
+			body,
+			.mui-content,
+			#dataList {
+				background: #0088e5;
+			}
+			/*设备信息*/
+			
+			.equipScope {
+				margin: 4% 6% 0 6%;
+				background: rgba(255, 255, 255, 0.4);
+				padding: 5px;
+				border-radius: 7px;
+				position: relative;
+			}
+			
+			.equipmsg {
+				/*position:relative;*/
+			}
+			
+			.qxzImg {
+				/*background-image: url('../images/qxz.jpg');*/
+				/*background-image: url(http://120.27.222.26/qxz_photo/default.png);*/
+				height: 200px;
+				background-size: cover;
+				border-radius: 7px;
+			}
+			
+			.qxzDescribe {
+				position: absolute;
+				right: 10px;
+				bottom: 5px;
+			}
+			
+			.qxzDescribe>div {
+				font-size: 12px;
+				background: rgba(57, 160, 230, 0.7);
+				line-height: 22px;
+				color: #fff;
+				padding-left: 8px;
+				padding-right: 8px;
+				margin-bottom: 5px;
+				border-radius: 10px;
+			}
+			/*实时状态*/
+			
+			.sensor {
+				position: relative;
+				float: left;
+				width: 41%;
+				height: 180px;
+				background: rgba(255, 255, 255, 0.3);
+				border-radius: 10px;
+				margin-left: 6%;
+				margin-top: 20px;
+			}
+			
+			.sensorIcon {
+				background: rgba(255, 255, 255, 0.35);
+				border-radius: 50%;
+				position: absolute;
+				width: 2.5em;
+				height: 2.5em;
+				top: 10px;
+				left: 10px;
+				line-height: 3.8em;
+				text-align: center;
+				vertical-align: middle;
+			}
+			
+			.sensorIcon>img {
+				width: 74%;
+			}
+			
+			.sensorAisle {
+				position: absolute;
+				top: 45px;
+				left: 14px;
+				color: rgba(255, 255, 255, 0.76);
+				font-size: 12px;
+				letter-spacing: 1px;
+			}
+			
+			.sensorResult {
+				color: #ffffff;
+				font-size: 16px;
+				line-height: 200px;
+				text-align: center;
+			}
+			
+			.sensorUnit {
+				position: absolute;
+				bottom: 10px;
+				right: 10px;
+				color: rgba(255, 255, 255, 0.76);
+				font-size: 12px;
+				letter-spacing: 1px;
+			}
+			/*24小时数据*/
+			
+			.seeMore {
+				text-align: center;
+			}
+			
+			.seeMore>button {
+				background: rgba(255, 255, 255, 0.4);
+				border: none;
+				border-radius: 30px;
+				color: #fff;
+				padding: 10px 40px;
+				margin: 15px 0;
+			}
+			
+			.seeMore>button:active {
+				background: #005b99;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">环境监测</h1>
+			<a id="setAstrict" class="mui-icon mui-icon-gear mui-pull-right" onclick="setAstrictFun()"></a>
+		</header>
+		<div class="mui-content">
+			<div class="equipmsg">
+				<div class="equipScope">
+					<div class="qxzImg" id="qxzImg"></div>
+					<div class="qxzDescribe">
+						<div id="equipName">项目名称:设备16061203</div>
+						<div id="equipId">设备ID:16061203</div>
+						<div id="updataTime">更新时间:2019-04-10 15:51:24</div>
+					</div>
+				</div>
+			</div>
+			<div id="dataList">
+				<!--最新数据-->
+				<div class="clearfix" id="newResultDat">
+					<!--<div class="sensor">
+						<div class="sensorIcon">
+							<img src="../images/dev/icon_101.png"/>
+						</div>
+						<div class="sensorAisle">
+							通道1
+						</div>
+						<div class="sensorResult">
+							0°
+						</div>
+						<div class="sensorUnit">温度</div>
+					</div>-->
+				</div>
+			</div>
+			<div class="seeMore">
+				<button type="button" onclick="setTimingFun()" class="">定时控制</button>
+				 
+				<button type="button" onclick="manualCtrl()" class="">手动控制</button>
+			</div>
+			<div class="seeMore">
+				<button type="button" onclick="lookMore()" class="">查看24小时数据</button>
+			</div>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/mescroll.min.js" charset="utf-8"></script>
+		<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			
+			var equipId;
+			mui.init();
+			var allData = [];
+			var qxz_switch = [];
+			var switch_name = [];
+			var auto_list = [];
+			var timing_list = [];
+			var new_data = [];
+			var qxz_auto = false;
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				equipName = self.equipName
+				$('#equipId').html('设备ID:' + equipId);
+				$('#equipName').html('项目名称:' + equipName);
+				console.log(equipName);
+				$.ajax({
+					type: 'GET',
+					url: 'http://120.27.222.26/qxz_detail',
+					timeout: 10000, //超时时间设置,单位毫秒
+					data: {
+						'id': equipId,
+					},
+					beforeSend: function() {
+						plus.nativeUI.showWaiting("加载中...");
+					},
+					complete: function() {
+						plus.nativeUI.closeWaiting();
+					},
+					dataType: 'json',
+					success: function(data) {
+						console.log(JSON.stringify(data))
+						allData = data.all_data;
+						if(data.qxz_switch.length){							
+							qxz_switch = eval('(' + data.qxz_switch + ')');
+							if(data.switch_name >2){								
+								switch_name = eval('(' + data.switch_name + ')');
+							}else{
+								switch_name = []
+							}
+						}
+						if(data.auto_list.length){							
+							auto_list = eval('('+data.auto_list+')');
+						}else{
+							auto_list = []
+						}
+						
+						if(data.timing_list.length){							
+							timing_list = eval('('+ data.timing_list +')');
+						}else{
+							timing_list = []
+						}
+						new_data = data.new_data;
+						var newData = data.new_data;
+						if(data.auto_list.length >2){
+							qxz_auto = true;
+						}
+						if(newData.length) {
+							var path = 'http://120.27.222.26/' + newData[0].qxz_picture
+							$('#qxzImg').css('background-image', 'url(' + path + ')')
+							console.log($('#qxzImg').css('background-image'))
+							for(var i = 0; i < newData.length; i++) {
+								var unit = newData[i].unit;
+								var html = '<div class="sensor"><div class="sensorIcon"><img src="../images/dev/icon_' + unit[0] + '.png"/>' +
+									'</div><div class="sensorAisle">通道' + newData[i].eKey.substr(1) + '</div>' +
+									'<div class="sensorResult">' + newData[i].eValue + unit[2] + '</div><div class="sensorUnit">' + unit[1] + '</div></div>'
+								$('#newResultDat').append(html);
+							}
+						} else {
+							var html = '<div class="sensor" style="width: 88%;"><div class="sensorResult">暂无数据</div></div>';
+							$('#newResultDat').html(html);
+							$('#qxzImg').css('background-image', 'url(../images/qxz.jpg)')
+						}
+
+						$('#updataTime').html('数据更新时间:' + newData[0].upl_time);
+					},
+					error: function() {
+						mui.toast('请求失败')
+					}
+				});
+			})
+			//查看24小时数据
+			function lookMore() {
+				if(allData.length) {
+					mui.openWindow({
+						url: 'equipManage_qxz_data24.html',
+						id: 'equipManage_qxz_data24',
+						extras: {
+							'equipId': equipId,
+							'equipName': equipName,
+							'data': allData,
+						},
+					})
+				} else {
+					mui.toast('暂无更多数据')
+				}
+
+			}
+			//手动控制
+			function manualCtrl() {
+				if(qxz_switch.length) {
+					mui.openWindow({
+						url: 'equipManage_qxz_manualCtrl.html',
+						id: 'equipManage_qxz_manualCtrl',
+						extras: {
+							'equipId': equipId,
+							'equipName': equipName,
+							'qxz_switch': qxz_switch,
+							'switch_name': switch_name
+						},
+					})
+				} else {
+					mui.toast('暂无开关设置功能')
+				}
+
+			}
+			//阈值设置
+			function setAstrictFun() {
+				if(qxz_auto) {
+					mui.openWindow({
+						url: 'equipManage_qxz_setAstrict.html',
+						id: 'equipManage_qxz_setAstrict',
+						extras: {
+							'equipId': equipId,
+							'equipName': equipName,
+							'qxz_switch': qxz_switch,
+							'switch_name': switch_name,
+							'auto_list':auto_list,
+							'new_data':new_data
+						},
+					})
+				} else {
+					mui.toast('暂无阈值设置功能')
+				}
+			}
+			//定时控制
+			function setTimingFun() {
+				if(timing_list.length) {
+					mui.openWindow({
+						url: 'equipManage_qxz_setTiming.html',
+						id: 'equipManage_qxz_setTiming',
+						extras: {
+							'equipId': equipId,
+							'equipName': equipName,
+							'qxz_switch': qxz_switch,
+							'switch_name': switch_name,
+							'timing_list':timing_list,
+							'new_data':new_data
+						},
+					})
+				} else {
+					mui.toast('暂无定时设置功能')
+				}
+			}
+		</script>
+	</body>
+
+</html>

+ 262 - 0
equipManage/equipManage_qxz_manualCtrl.html

@@ -0,0 +1,262 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/reset.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<link href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			/*body,.mui-content {
+				background: #fff;
+			}*/
+			
+			.mui-icon-undo {
+				display: none;
+			}
+			
+			.qxMsg {
+				margin: 10px 20px;
+				/*background: pink;*/
+			}
+			
+			.qxMsg>li {
+				margin-bottom: .2rem;
+			}
+			
+			.qxManualitem {
+				padding: 6px;
+				background: #fff;
+				border-radius: 3px;
+				/*line-height: 33px;*/
+			}
+			
+			.currName {
+				line-height: 33px;
+			}
+			
+			.switchName {
+				color: green;
+				display: none;
+			}
+			/*switch*/
+			
+			.switchParent {
+				float: right;
+				margin-top: 2px;
+				right: 3px;
+			}
+			
+			.mui-switch.mui-active:before {
+				content: '开启';
+				left: 8px;
+			}
+			
+			.mui-switch:before {
+				content: '关闭';
+			}
+			
+			.isonlineicon {
+				display: inline-block;
+				width: 8px;
+				height: 8px;
+				border-radius: 50%;
+				background: green;
+				margin-right: 3px;
+			}
+			
+			.isonlineicon.active {
+				background: green;
+				animation: 1s ease 0s infinite normal none running myfirst01;
+			}
+			
+			.isonlineicon {
+				background: #909090;
+				animation: 1s ease 0s infinite normal none running myfirst02;
+			}
+			
+			@keyframes myfirst01 {
+				0% {
+					-moz-box-shadow: 0px 0px 6px 1px green;
+					box-shadow: 0px 0px 6px 1px green;
+				}
+				100% {
+					-moz-box-shadow: 0px 0px 6px 1px green;
+					box-shadow: 0px 0px 6px 1px green;
+				}
+			}
+			
+			@keyframes myfirst02 {
+				0% {
+					-moz-box-shadow: 0px 0px 6px 1px #909090;
+					box-shadow: 0px 0px 6px 1px #909090;
+				}
+				100% {
+					-moz-box-shadow: 0px 0px 6px 1px #909090;
+					box-shadow: 0px 0px 6px 1px #909090;
+				}
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">手动控制</h1>
+			<a id="setAstrict" class="mui-icon mui-icon-compose mui-pull-right" onclick="showEdit(this)"></a>
+			<a id="setAstrict" class="mui-icon mui-icon-undo mui-pull-right" onclick="cantelEdit(this)"></a>
+		</header>
+		<div class="mui-content">
+			<ul class="qxMsg">
+				<!--<li class="qxitem">
+					<div class="qxManualitem">
+						<span class="isonlineicon"></span>
+						<span class="currName">施肥机</span>
+						<span class="mui-icon mui-icon-compose switchName" onclick="editName(this)"></span>
+						<input type="hidden" name="" id="" value="1" />
+						<div class="switchParent">
+							<div class="mui-switch mui-switch-blue mui-active">
+								<div class="mui-switch-handle"></div>
+							</div>
+						</div>
+					</div>
+				</li>-->
+			</ul>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			var equipId;
+			mui.init();
+			var qxz_switch = [];
+			var switch_name = [];
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				qxz_switch = self.qxz_switch;
+				switch_name = eval('('+self.switch_name+')');
+				data = self.data
+				$('#equipName').html('项目名称:' + qxz_switch);
+				var html = '';
+				for(var i = 0; i < qxz_switch.length; i++) {
+					if(switch_name[i].name) {
+						var name = switch_name[i].name;
+					} else {
+						var name = '开关' + qxz_switch[i].JK;
+					}
+					if(qxz_switch[i].status == 1) {
+						var check = 'mui-active';
+					} else {
+						var check = '';
+					}
+					html += '<li class="qxitem"><div class="qxManualitem">' +
+						'<span class="isonlineicon"></span><span class="currName">' + name + '</span>' +
+						'<span class="mui-icon mui-icon-compose switchName" onclick="editName(this)"></span>' +
+						'<input type="hidden" name="" id="" value="' + qxz_switch[i].JK + '" /><div class="switchParent">' +
+						'<div class="mui-switch mui-switch-blue ' + check + '">' +
+						'<div class="mui-switch-handle"></div></div></div></div></li>';
+					if(i == qxz_switch.length - 1) {
+						$('.qxMsg').html(html);
+						mui('.mui-switch')['switch']();
+						mui('.qxMsg').on('toggle', '.mui-switch', function(event) {
+							if(event.detail.isActive) {
+								console.log("你启动了开关");
+								var currStutas = 1;
+							} else {
+								console.log("你关闭了开关");
+								var currStutas = 0;
+							}
+							var currWay = $(this).parent().prev().val();
+							var _this = this;
+							$.ajax({
+								url: 'http://120.27.222.26/qxz_switch',
+								type: 'post',
+								data: {
+									'req': 'set',
+									'imei': equipId,
+									'way': currWay,
+									'switch': currStutas
+								},
+								success: function(data) {
+									if(currStutas == 1) {
+										$(_this).parents('.qxManualitem').find('.isonlineicon').addClass('active');
+									} else {
+										$(_this).parents('.qxManualitem').find('.isonlineicon').removeClass('active');
+									}
+									mui.toast('设置成功');
+								},
+								error: function(type) {
+									mui.toast('设置失败')
+								}
+							})
+						})
+					}
+				}
+			})
+
+			$('body').on('tap', '.aisleName', function() {
+				var _this = this;
+				$(_this).next().slideToggle(function() {
+					if($(this).is(":visible")) {
+						$(_this).children().addClass('mui-navigate-top')
+					} else {
+						$(_this).children().removeClass('mui-navigate-top')
+					}
+				});
+			})
+
+			function showEdit(obj) {
+				$(obj).hide();
+				$(obj).next().show();
+				$('.switchName').show();
+			}
+
+			function cantelEdit(obj) {
+				$(obj).hide();
+				$(obj).prev().show();
+				$('.switchName').hide();
+			}
+
+			function editName(obj) {
+				var title = $(obj).prev().html();
+				var currWay = $(obj).next().val();
+				mui.prompt('修改开关名称', '输入开关名称', title, ['取消', '确定'], function(e) {
+					if(e.index == 1) {
+						var text = e.value
+						if(text) {
+							$.ajax({
+								url: 'http://120.27.222.26/qxz_switch_name',
+								type: 'post',
+								data: {
+									'imei': equipId,
+									'way': currWay,
+									'sw_name': text
+								},
+								success: function(data) {
+									console.log(111111)
+									if(data == 0) {
+										$(obj).prev().html(text)
+									}
+								},
+								error: function(type) {
+	
+								}
+							})
+						}else{
+							return false;
+						}
+
+					}
+				}, 'div')
+			}
+		</script>
+	</body>
+
+</html>

+ 404 - 0
equipManage/equipManage_qxz_setAstrict.html

@@ -0,0 +1,404 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/reset.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<link href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			/*body,.mui-content {
+				background: #fff;
+			}*/
+			
+			.qxMsg {
+				margin: 10px 20px;
+				/*background: pink;*/
+			}
+			
+			.qxMsg>li {
+				margin-bottom: .4rem;
+			}
+			
+			.thresholdCtrl {
+				background: #4ab8e8;
+				border-radius: 5px;
+				color: #fff;
+				box-shadow: 1px 1px 4px 1px #98dbf8;
+				border: 1px solid #98dbf8;
+				padding: 5px 10px;
+				cursor: pointer;
+				position: relative;
+			}
+			
+			.thresholdCtrl::before {
+				position: absolute;
+				content: '';
+				bottom: 0;
+				left: 0;
+				right: 0;
+				height: 30%;
+				background: rgba(255, 255, 255, 0.5);
+			}
+			
+			.setthresholdBtn {
+				position: absolute;
+				right: 13px;
+				top: 12px;
+				font-size: 20px;
+			}
+			
+			.thresholdCtrlName {
+				line-height: 30px;
+			}
+			
+			.thresholdCtrlName p,
+			.maxminNum p {
+				color: #fff;
+				font-size: 16px;
+			}
+			
+			.thresholdCtrlShowDiv {
+				overflow: hidden;
+				margin: 11px 0;
+			}
+			
+			.thresholdCtrlShowDiv>div {
+				float: left;
+			}
+			
+			.qxys img {
+				width: 47px;
+			}
+			
+			.maxminNum {
+				font-size: 18px;
+				line-height: 30px;
+				padding-left: 7%;
+			}
+			
+			.equipCtrlInp {
+				margin-top: 20px;
+				text-align: right;
+			}
+			
+			.equipCtrlInp>div {
+				display: inline-block;
+			}
+			
+			.mui-switch:before {
+				content: '关闭';
+			}
+			
+			.mui-switch.mui-active:before {
+				content: '开启';
+				left: 9px;
+			}
+			/*设置阈值弹出框*/
+			
+			#setthresholdModel {
+				height: 0;
+				z-index: 999;
+				position: fixed;
+				left: 0;
+				right: 0;
+				bottom: 0;
+				background: #fff;
+				border-radius: 3px 3px 0 0;
+				transition: all .3s;
+			}
+			
+			#method {
+				height: 45px;
+			}
+			
+			#method>div {
+				width: 45%;
+				position: absolute;
+			}
+			
+			.secondInp {
+				left: 50%;
+			}
+			
+			#sendThreshold {
+				padding: 20px;
+				text-align: right;
+			}
+			
+			#setthresholdModel>h2 {
+				font-size: 16px;
+				line-height: 30px;
+				padding-left: 15px;
+				color: #24b2e7;
+			}
+			
+			.hint span {
+				color: red;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">阈值设置</h1>
+		</header>
+		<div class="mui-content">
+			<ul class="qxMsg">
+				<!--<li class="qxitem">
+					<div class="thresholdCtrl">
+						<div class="setthresholdBtn">
+							<span class="mui-icon mui-icon-gear"></span>
+						</div>
+						<input type="hidden" name="" class="currVal" value="{" JK ":1,"eKey ":1,"upper ":700,"lower ":300,"method ":1}" />
+						<div class="thresholdCtrlName">
+							<p>开关1(通道1)</p>
+						</div>
+						<div class="thresholdCtrlShowDiv">
+							<div class="qxys">
+								<div><img src="http://www.yfzhwlw.com/static/img/dev/icon_104.png" alt=""></div>
+								<div>雨量</div>
+							</div>
+							<div class="maxminNum">
+								<p>最大值:<span>700</span></p>
+								<p>最小值:<span>300</span></p>
+							</div>
+						</div>
+						<div class="equipCtrlInp">
+							<div class="">
+								<div class="mui-switch mui-switch-blue">
+									<div class="mui-switch-handle"></div>
+								</div>
+							</div>
+						</div>
+					</div>
+				</li>-->
+
+			</ul>
+			<div id="setthresholdModel" class="">
+				<h2>阈值设置</h2>
+				<ul class="mui-table-view" id="user">
+					<li class="mui-table-view-cell">
+						<span class="equipTitle">最大值</span>
+						<p id="upperInput">
+							<input type="number" name="" id="upperInp" value="" />
+						</p>
+					</li>
+					<li class="mui-table-view-cell">
+						<span class="equipTitle">最小值</span>
+						<p id="lowerInput">
+							<input type="number" name="" id="lowerInp" value="" />
+						</p>
+					</li>
+					<li class="mui-table-view-cell">
+						<span class="equipTitle">规则</span>
+						<div id="method">
+							<div class="mui-input-row mui-radio firstInp">
+								<label>程序一</label>
+								<input name="method" class="redioinp1" type="radio" onclick="switchoverFun(this)" checked="checked" value="1">
+							</div>
+							<div class="mui-input-row mui-radio secondInp">
+								<label>程序二</label>
+								<input name="method" class="redioinp1" type="radio" onclick="switchoverFun(this)" value="0">
+							</div>
+						</div>
+						<p class="hint">低于下限 <span>开启</span>,高于上限<span>关闭</span></p>
+					</li>
+				</ul>
+				<div id="sendThreshold">
+					<input type="hidden" name="jkcode" id="jkcode" value="" />
+					<input type="hidden" name="eKeycode" id="eKeycode" value="" />
+					<button type="button" class="mui-btn mui-btn-primary" onclick="sendData()">确定</button>
+					<button type="button" class="mui-btn" onclick="cancelFun()">取消</button>
+				</div>
+			</div>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script src="120.27.222.26/static/js/reportmanage/qxz_dict.js"></script>
+		<script type="text/javascript">
+			var equipId,autoList, conf,switch_name,qxz_switch,qxzDat;
+			mui.init();
+			var allData = [];
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				autoList = self.auto_list;
+				conf = self.conf;
+				qxz_switch = self.qxz_switch;
+				switch_name = self.switch_name;
+				qxzDat = self.qxzDat;
+				var html = '';
+				console.log(JSON.stringify(autoList));
+				for(var i = 0; i < autoList.length; i++) {
+					// 开关名 
+					if (autoList[i].JK == qxz_switch[i].JK) {
+						if(switch_name[i].name){							
+							var name = switch_name[i].name;
+						}else{
+							var name = '开关:'+qxz_switch[i].JK;
+						}
+					} else {
+						var name = autoList[i].JK;
+					}
+					if(autoList[i].JK != 255) {
+						var keyNum = autoList[i].eKey;
+						var ekey = 'e'+(keyNum+1);
+						var eNum = qxzDat[ekey].split('#')[1];
+						var uitTxt = conf[ekey].split('#')[0];
+						var unit = conf[ekey].split('#')[1];
+						html += '<li class="qxitem"><div class="thresholdCtrl">' +
+							'<div class="setthresholdBtn" onclick="setthresholdFun(this)"><span class="mui-icon mui-icon-gear"></span>' +
+							'</div><input type="hidden" name="" class="currVal" value=\'' + JSON.stringify(autoList[i]) + '\' />' +
+							'<div class="thresholdCtrlName"><p>' + name+ '(通道' + keyNum + ')</p></div>' +
+							'<div class="thresholdCtrlShowDiv"><div class="qxys">' +
+							'<div><img src="http://www.yfzhwlw.com/static/img/dev/icon_' + eNum + '.png" alt=""></div>' +
+							'<div>' + uitTxt+unit + '</div></div><div class="maxminNum"><p>最大值:<span>' + autoList[i].upper + '</span></p>' +
+							'<p>最小值:<span>' + autoList[i].lower + '</span></p></div></div><div class="equipCtrlInp">';
+						if(!(autoList[i].upper == 32767 || autoList[i].lower == 32767)) {
+							html += '<div class=""><div class="mui-switch mui-switch-blue mui-active">' +
+								'<div class="mui-switch-handle"></div></div></div></div></div></li>';
+						} else {
+							html += '<div class=""><div class="mui-switch mui-switch-blue">' +
+								'<div class="mui-switch-handle"></div></div></div></div></div></li>';
+						}
+
+						
+					}
+					console.log(html)
+					if(i == autoList.length - 1) {
+						$('.qxMsg').html(html);
+						console.log(html)
+						mui('.mui-switch')['switch']();
+					}
+				}
+
+			})
+			// 设置阈值
+			var currNextEle;
+			var currobjEle;
+
+			function setthresholdFun(ele) {
+				var obj = $(ele);
+				currobjEle = $(ele);
+				currNextEle = obj.next();
+				var currValstr = obj.next().val();
+				var currVal = eval('(' + currValstr + ')');
+				console.log(currValstr);
+				$('#upperInp').val(currVal.upper)
+				$('#lowerInp').val(currVal.lower)
+				$('#jkcode').val(currVal.JK)
+				$('#eKeycode').val(currVal.eKey)
+				if(currVal.method == 0) {
+					$("input[name='method'][value=0]").prop('checked', 'checked');
+					$('.hint').html('低于下限 <span>开启</span>,高于上限<span>关闭</span>');
+				} else {
+					$("input[name='method'][value=1]").prop('checked', 'checked');
+					$('.hint').html('低于下限 <span>关闭</span>,高于上限<span>开启</span>');
+				}
+				console.log($("input[name='method']"));
+				var mask = mui.createMask(function() {
+					$('#setthresholdModel').css('height', 0);
+				}); //callback为用户点击蒙版时自动执行的回调;
+				$('#setthresholdModel').css('height', '417px');
+				mask.show(); //显示遮罩
+
+			}
+
+			//发送设置阈值
+			function sendData() {
+				var upper = $('#upperInp').val();
+				var lower = $('#lowerInp').val();
+				var method = $("input[name='method']:checked").val();
+				var jkcode = $('#jkcode').val();
+				var eKeycode = $('#eKeycode').val();
+				var datajson = {
+					"JK": jkcode,
+					"eKey": eKeycode,
+					"upper": upper,
+					"lower": lower,
+					"method": method,
+					"equip_id":equipId
+				}
+
+				if(parseFloat(lower) > parseFloat(upper)) {
+					mui.toast('最小值不能大于最大值')
+					return false;
+				} else {
+					$.ajax({
+						url: 'http://120.27.222.26/qxz_value_mqtt',
+						type: 'post',
+						data: datajson,
+						success: function(data) {
+							currNextEle.val(JSON.stringify(datajson));
+							cancelFun()
+							mui.toast('设置成功');
+							currobjEle.parent().find('.maxminNum').find('p').eq(0).find('span').html(datajson.upper) //最大值
+							currobjEle.parent().find('.maxminNum').find('p').eq(1).find('span').html(datajson.lower) //最小值
+							currobjEle.parents('.thresholdCtrl').find('.mui-switch').addClass('mui-active'); //开启阈值
+							mui('.mui-switch')['switch']()
+						},
+						error: function(type) {
+							mui.toast('设置失败');
+						}
+					})
+				}
+
+			}
+
+			$('.qxMsg').on('toggle', '.mui-switch', function(event) {
+				//console.log(event);
+				var currobj = $(event.target);
+				var currVal = $(event.target).parents('li').find('.currVal').val();
+				var data = eval('(' + currVal + ')');
+				if(event.originalEvent.detail.isActive) {
+
+				} else {
+					//你关闭了开关
+					data.upper = 32767;
+					data.lower = 32767;
+				}
+				$.ajax({
+					url: 'http://120.27.222.26/qxz_value_mqtt',
+					type: 'post',
+					data: data,
+					success: function(data) {
+						mui.toast('设置成功');
+
+					},
+					error: function(type) {
+						mui.toast('设置失败');
+					}
+				})
+			})
+			//取消
+			function cancelFun() {
+				var mask = mui.createMask(function() {
+					$('#setthresholdModel').css('height', 0);
+					$('.mui-backdrop').remove();
+				});
+				mask.close();
+
+			}
+			//redio切换
+			function switchoverFun(obj) {
+				if($(obj).val() == 1) {
+					$("input[name='method'][value=1]").prop('checked', 'checked');
+					$('.hint').html('低于下限 <span>开启</span>,高于上限<span>关闭</span>');
+				} else {
+					$("input[name='method'][value=0]").prop('checked', 'checked');
+					$('.hint').html('低于下限 <span>关闭</span>,高于上限<span>开启</span>');
+				}
+			}
+		</script>
+	</body>
+
+</html>

+ 392 - 0
equipManage/equipManage_qxz_setTiming.html

@@ -0,0 +1,392 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/reset.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<link href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			/*body,.mui-content {
+				background: #fff;
+			}*/
+			
+			.qxMsg {
+				margin: 10px 20px;
+				/*background: pink;*/
+			}
+			
+			.qxMsg>li {
+				margin-bottom: .4rem;
+			}
+			
+			.thresholdCtrl {
+				background: #4ab8e8;
+				border-radius: 5px;
+				color: #fff;
+				box-shadow: 1px 1px 4px 1px #98dbf8;
+				border: 1px solid #98dbf8;
+				padding: 5px 10px;
+				cursor: pointer;
+				position: relative;
+				/*background: #65b83b;
+			    box-shadow: 1px 1px 4px 1px #d1ffba;
+			    border: 1px solid #65b83b;*/
+			}
+			
+			.thresholdCtrl::before {
+				position: absolute;
+				content: '';
+				bottom: 0;
+				left: 0;
+				right: 0;
+				height: 30%;
+				background: rgba(255, 255, 255, 0.5);
+			}
+			
+			.setthresholdBtn {
+				position: absolute;
+				right: 13px;
+				top: 12px;
+				font-size: 20px;
+			}
+			
+			.thresholdCtrlName {
+				line-height: 30px;
+			}
+			
+			.thresholdCtrlName p,
+			.maxminNum p {
+				color: #fff;
+				font-size: 16px;
+			}
+			
+			.thresholdCtrlShowDiv {
+				overflow: hidden;
+				margin: 11px 0;
+			}
+			
+			.thresholdCtrlShowDiv>div {
+				float: left;
+			}
+			
+			.qxys img {
+				width: 47px;
+			}
+			
+			.maxminNum {
+				font-size: 18px;
+				line-height: 30px;
+				padding-left: 7%;
+			}
+			
+			.equipCtrlInp {
+				margin-top: 20px;
+				text-align: right;
+			}
+			
+			.equipCtrlInp>div {
+				display: inline-block;
+			}
+			
+			.mui-switch:before {
+				content: '关闭';
+			}
+			
+			.mui-switch.mui-active:before {
+				content: '开启';
+				left: 9px;
+			}
+			/*设置阈值弹出框*/
+			
+			#setthresholdModel {
+				height: 0;
+				z-index: 999;
+				position: fixed;
+				left: 0;
+				right: 0;
+				bottom: 0;
+				background: #fff;
+				border-radius: 3px 3px 0 0;
+				transition: all .3s;
+			}
+			
+			#method {
+				height: 45px;
+			}
+			
+			#method>div {
+				width: 45%;
+				position: absolute;
+			}
+			
+			.secondInp {
+				left: 50%;
+			}
+			
+			#sendThreshold {
+				padding: 20px;
+				text-align: right;
+			}
+			
+			#setthresholdModel>h2 {
+				font-size: 16px;
+				line-height: 30px;
+				padding-left: 15px;
+				color: #24b2e7;
+			}
+			
+			.hint span ,.hinttxt{
+				color: red;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">定时设置</h1>
+		</header>
+		<div class="mui-content">
+			<ul class="qxMsg">
+				<!--<li class="qxitem">
+					<div class="thresholdCtrl">
+						<div class="setthresholdBtn">
+							<span class="mui-icon mui-icon-gear"></span>
+						</div>
+						<input type="hidden" name="" class="currVal" value="{" JK ":1,"eKey ":1,"upper ":700,"lower ":300,"method ":1}" />
+						<div class="thresholdCtrlName">
+							<p>开关1(通道1)</p>
+						</div>
+						<div class="thresholdCtrlShowDiv">
+							<div class="qxys">
+								<div><img src="http://www.yfzhwlw.com/static/img/dev/icon_104.png" alt=""></div>
+								<div>雨量</div>
+							</div>
+							<div class="maxminNum">
+								<p>最大值:<span>700</span></p>
+								<p>最小值:<span>300</span></p>
+							</div>
+						</div>
+						<div class="equipCtrlInp">
+							<div class="">
+								<div class="mui-switch mui-switch-blue">
+									<div class="mui-switch-handle"></div>
+								</div>
+							</div>
+						</div>
+					</div>
+				</li>-->
+
+			</ul>
+			<div id="setthresholdModel" class="">
+				<h2>定时设置</h2>
+				<ul class="mui-table-view" id="user">
+					<li class="mui-table-view-cell">
+						<span class="equipTitle">起始时间</span>
+						<p id="upperInput">
+							<input type="number" name="" id="starttime" value="" />
+						</p>
+						<p><span class="hinttxt">*</span>工作时长(0-23)</p>
+					</li>
+					<li class="mui-table-view-cell">
+						<span class="equipTitle">工作时长</span>
+						<p id="lowerInput">
+							<input type="number" name="" id="duration" value="" />
+						</p>
+						<p><span class="hinttxt">*</span>工作时长(1-24)</p>
+					</li>
+				</ul>
+				<div id="sendThreshold">
+					<input type="hidden" name="jkcode" id="jkcode" value="" />
+					<button type="button" class="mui-btn mui-btn-primary" onclick="sendData()">确定</button>
+					<button type="button" class="mui-btn" onclick="cancelFun()">取消</button>
+				</div>
+			</div>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script src="120.27.222.26/static/js/reportmanage/qxz_dict.js"></script>
+		
+		<script type="text/javascript">
+			var equipId, timingList, conf,switch_name,qxz_switch,qxzDat;
+			mui.init();
+			var allData = [];
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				timingList = self.timing_list;
+				conf = self.conf;
+				qxz_switch = self.qxz_switch;
+				switch_name = self.switch_name;
+				qxzDat = self.qxzDat;
+				var html = '';
+				for(var i = 0; i < timingList.length; i++) {
+					// 开关名 
+					if (timingList[i].JK == qxz_switch[i].JK) {
+						if(switch_name.length){							
+							var name = switch_name[i].name;
+						}else{
+							var name = '开关'+qxz_switch[i].name;
+						}
+					} else {
+						var name = timingList[i].JK;
+					}
+					if(timingList[i].JK != 255) {	
+						var ekeyNum = timingList[i].JK+1;
+						var ekey = 'e'+ ekeyNum;
+						var eNum = qxzDat[ekey].split('#')[1];
+						var unitTxt = conf[ekey].split('#')[0];
+						var unit = conf[ekey].split('#')[1];
+						html += '<li class="qxitem"><div class="thresholdCtrl">' +
+							'<div class="setthresholdBtn" onclick="setthresholdFun(this)"><span class="mui-icon mui-icon-gear"></span>' +
+							'</div><input type="hidden" name="" class="currVal" value=\'' + JSON.stringify(timingList[i]) + '\' />' +
+							'<div class="thresholdCtrlName"><p>' + name+ '(通道' + ekeyNum + ')</p></div>' +
+							'<div class="thresholdCtrlShowDiv"><div class="qxys">' +
+							'<div><img src="http://www.yfzhwlw.com/static/img/dev/icon_' + eNum + '.png" alt=""></div>';
+						if(!(timingList[i].StartTime == 32767 || timingList[i].Duration == 32767)) {
+							html += '<div>' + unitTxt+unit + '</div></div><div class="maxminNum"><p>起始时间:<span>' + timingList[i].StartTime + '</span></p>' +
+									'<p>工作时长:<span>' + timingList[i].Duration + '</span></p></div></div><div class="equipCtrlInp">'+
+									'<div class=""><div class="mui-switch mui-switch-blue mui-active">' +
+									'<div class="mui-switch-handle"></div></div></div></div></div></li>';
+						} else {
+							html += '<div>' + unitTxt+unit + '</div></div><div class="maxminNum"><p>起始时间:<span>--</span></p>' +
+									'<p>工作时长:<span>--</span></p></div></div><div class="equipCtrlInp">'+
+									'<div class=""><div class="mui-switch mui-switch-blue">' +
+									'<div class="mui-switch-handle"></div></div></div></div></div></li>';
+						}	
+						
+					}
+					
+					if(i == timingList.length - 1) {
+						$('.qxMsg').html(html);
+						console.log(html)
+						mui('.mui-switch')['switch']();
+					}
+				}
+
+			})
+			// 设置阈值
+			var currNextEle;
+			var currobjEle;
+
+			function setthresholdFun(ele) {
+				var obj = $(ele);
+				currobjEle = $(ele);
+				currNextEle = obj.next();
+				var currValstr = obj.next().val();
+				var currVal = eval('(' + currValstr + ')');
+				console.log(currValstr);
+				$('#starttime').val(currVal.StartTime)
+				$('#duration').val(currVal.Duration)
+				$('#jkcode').val(currVal.JK)
+
+				var mask = mui.createMask(function() {
+					$('#setthresholdModel').css('height', 0);
+				}); //callback为用户点击蒙版时自动执行的回调;
+				$('#setthresholdModel').css('height', '380px');
+				mask.show(); //显示遮罩
+
+			}
+
+			//发送设置阈值
+			function sendData() {
+				var starttime = $('#starttime').val();
+				var duration = $('#duration').val();
+				var jkcode = $('#jkcode').val();
+				var datajson = {
+					"JK": jkcode,
+					"StartTime": starttime,
+					"Duration": duration,
+					"equip_id":equipId
+				}
+				
+				if(0 > starttime || starttime > 23) {
+					mui.toast('起始时间不符!')
+					return false;
+				} else if(1 > duration || duration > 24) {
+					mui.toast('工作时长不符!')
+					return false;
+				} else {
+					$.ajax({
+						url: 'http://120.27.222.26/qxz_timing_mqtt',
+						type: 'post',
+						data: datajson,
+						success: function(data) {
+							currNextEle.val(JSON.stringify(datajson));
+							cancelFun()
+							mui.toast('设置成功');
+							currobjEle.parent().find('.maxminNum').find('p').eq(0).find('span').html(datajson.StartTime) //最大值
+							currobjEle.parent().find('.maxminNum').find('p').eq(1).find('span').html(datajson.Duration) //最小值
+							currobjEle.parents('.thresholdCtrl').find('.mui-switch').addClass('mui-active'); //开启阈值
+							currobjEle.parents('.thresholdCtrl').find('.mui-switch').children().css('transform','translate(42px, 0px)')
+							mui('.mui-switch')['switch']()
+						},
+						error: function(type) {
+							mui.toast('设置失败');
+						}
+					})
+				}
+
+			}
+
+			$('.qxMsg').on('toggle', '.mui-switch', function(event) {
+				//console.log(event);
+				var currobj = $(event.target);
+				var currVal = $(event.target).parents('li').find('.currVal').val();
+				var data = eval('(' + currVal + ')');
+				if(data.StartTime == 32767 || data.Duration == 32767){
+					if(event.originalEvent.detail.isActive) {
+						$(this).removeClass('mui-active');
+						$(this).children().css('transform','translate(0px, 0px)')
+					} else {
+						//你关闭了开关
+						data.upper = 32767;
+						data.lower = 32767;
+						$(this).addClass('mui-active');
+						$(this).children().css('transform','translate(42px, 0px)')
+					}
+					
+					setthresholdFun($(this).parents('.thresholdCtrl').find('.setthresholdBtn'))
+					return false;
+				}
+				if(event.originalEvent.detail.isActive) {
+
+				} else {
+					//你关闭了开关
+					data.StartTime = 32767;
+					data.Duration = 32767;
+				}
+				$.ajax({
+					url: 'http://120.27.222.26/qxz_timing_mqtt',
+					type: 'post',
+					data: data,
+					success: function(data) {
+						mui.toast('设置成功');
+
+					},
+					error: function(type) {
+						mui.toast('设置失败');
+					}
+				})
+			})
+			//取消
+			function cancelFun() {
+				var mask = mui.createMask(function() {
+					$('#setthresholdModel').css('height', 0);
+					$('.mui-backdrop').remove();
+				});
+				mask.close();
+
+			}
+		</script>
+	</body>
+
+</html>

+ 176 - 0
equipManage/equipManage_scd.html

@@ -0,0 +1,176 @@
+<!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 rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">杀虫灯设备</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+						<input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+
+				</ul>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/mui.min.js"></script>
+
+			<script type="text/javascript">
+				mui.init()
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop: { //配置回到顶部按钮
+							src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset: 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+							use: true // 是否开启懒加载,默认false
+						}
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page) {
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData);
+					}, function() {
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+						mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData) {
+					var html = '';
+					//				var listDom=document.getElementById("dataList");
+					var dat = curPageData;
+					for(var i = 0; i < dat.length; i++) {
+						var equip_name = dat[i].equip_name || '无';
+						var equipicon = '';
+						if(dat[i].is_online == 0) {
+							equipicon = '../images/red.png';
+						} else if(dat[i].is_online == 1) {
+							equipicon = '../images/green.png';
+						}
+						html += '<li data-id="' + dat[i].equip_id + '"><div class="equipItem"><div class="equipItem_top">' +
+							'<div class="equipTitle"><img class="equipIdIcon" src="../images/IDicon.png" width="22"/>' +
+							'<span class="">' + dat[i].equip_id + '</span><img class="equipType" src="' + equipicon + '" width="26"/>' +
+							'</div><div class="equipItem_line"></div></div><div class="equipItem_bottom">' +
+							'<div class="equipMsg"><label>设备名称</label><div class="equipVal equipName">' + equip_name + '</div></div>' +
+							'<div class="equipMsg"><label>上报时间</label><div class="equipVal">' + dat[i].upl_time + '</div>' +
+							'</div></div></div></li>';
+					}
+					$('#dataList').append(html);
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+					console.log(pageNum)
+					$.ajax({
+						type: 'POST',
+						url: 'http://120.27.222.26/app_equipmanage',
+						timeout: 10000, //超时时间设置,单位毫秒
+						data: {
+							'etype': 'scd',
+							'page': pageNum,
+							'filter': mui('#searchInp')[0].value,
+						},
+						dataType: 'json',
+						success: function(data) {
+							successCallback(data.dat, data.nums);
+						},
+						error: function() {
+							errorCallback();
+						}
+					});
+				}
+
+				var markingid = '' //用于记录点击的当前id 以便刷新
+				window.addEventListener('refresh', function(event) { //如果详情页面更改数据  才页面刷新
+					$('#dataList li').each(function() {
+						if(markingid == $(this).data('id')) {
+							$(this).find('.equipName').html(event.detail.markingEquipName);
+						}
+					})
+				})
+				//进入详情页面
+				mui('#dataList').on('tap', 'li', function() {
+					var imei = this.getAttribute('data-id');
+					markingid = imei;
+					mui.openWindow({
+						url: 'equipManage_scd_detail.html',
+						id: 'equipManage_scd_detail',
+						extras: {
+							'equipId': imei
+						},
+					})
+				})
+
+				//搜索操作
+				$("#searchInp").on('keypress', function(e) {
+					var keycode = e.keyCode;
+					if(keycode == '13') {
+						e.preventDefault();
+						//请求搜索接口  
+						if(mui('#searchInp')[0].value) {
+							$('#dataList').html('');
+							getListData({
+								num: 1,
+								size: 10
+							})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+					}
+				})
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({
+							num: 1,
+							size: 10
+						})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+			</script>
+	</body>
+
+</html>

+ 898 - 0
equipManage/equipManage_scd_detail.html

@@ -0,0 +1,898 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/common.css" rel="stylesheet" />
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<style type="text/css">
+			.mui-content {
+				background: #fff;
+			}
+			
+			.iconfont {
+				font-size: 35px;
+				color: #3bb9e7;
+				/*font-weight: bold;*/
+				line-height: 80px;
+				margin: 10px 10px 10px 20px;
+			}
+			
+			.equipState {
+				font-size: 18px;
+				margin-top: 14px;
+				color: #333;
+			}
+			
+			.conversion {
+				width: 110px;
+			}
+			
+			#detial>div {
+				border-bottom: 2px solid #eee;
+			}
+			
+			#detial>div:nth-of-type(odd) {
+				border-right: 2px solid #eee;
+			}
+			
+			.mui-table-view:after,
+			.mui-table-view:before {
+				height: 2px;
+				background-color: #eee;
+			}
+			
+			@media(max-width: 400px) {
+				.mui-col-sm-6 {
+					width: 50%;
+				}
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+			/*查看详情*/
+			
+			.areaTitle {
+				color: #424242;
+				padding-left: 5px;
+				border-left: 5px solid #5870f6;
+				font-weight: bold;
+				font-size: 16px;
+			}
+			
+			.detialBox .fa {
+				padding-right: 5px;
+				color: #ff6e00;
+			}
+			/**/
+			
+			.controlVal {
+				position: absolute;
+				top: 50%;
+				right: 35px;
+				-webkit-transform: translateY(-50%);
+				transform: translateY(-50%);
+			}
+			
+			#controlBtn {
+				width: 80%;
+				/*height: 0px;*/
+				background: white;
+				position: fixed;
+				top: 24%;
+				left: 50%;
+				margin-left: -40%;
+			}
+			/*移除底部或顶部三角,需要在删除此代码*/
+			
+			.mui-popover .mui-popover-arrow:after {
+				width: 0px;
+			}
+			/*定时模式控制*/
+			
+			.mask {
+				position: fixed;
+				top: 0;
+				right: 0;
+				bottom: 0;
+				left: 0;
+				color: #333;
+				background: rgba(0, 0, 0, .4);
+				z-index: 20;
+				display: none;
+			}
+			
+			.sidebar {
+				position: fixed;
+				width: 100%;
+				bottom: 0;
+				left: 0;
+				background: #fff;
+				border-radius: 10px 10px 0 0;
+				/*animation:slideUpIn .3s ease-in-out;*/
+			}
+			
+			.sidebar>div {
+				padding: 15px;
+			}
+			
+			.sidebar>div select {
+				border: 1px solid rgba(0, 0, 0, .2) !important;
+			}
+			
+			@keyframes slideUpIn {
+				0% {
+					-webkit-transform: translate3d(0, 90%, 0);
+					transform: translate3d(0, 90%, 0)
+				}
+				to {
+					-webkit-transform: translateZ(0);
+					transform: translateZ(0)
+				}
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">杀虫灯设备</h1>
+			<!--<a id="openPopover" class="mui-icon mui-icon-more mui-pull-right"></a>-->
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll">
+				<div id="dataList">
+					<ul class="mui-table-view" id="equip">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">设备信息</h1>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipId"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipName"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="upl_time"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="lat_lng"></p>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<li class="mui-table-view-cell" id="clock">
+							<a class="mui-navigate-right">
+								<i class="fa fa-clock-o" aria-hidden="true"></i> 定时模式
+								<span class="controlVal">光控</span>
+							</a>
+						</li>
+						<!--<li class="mui-table-view-cell" id="timingBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-clock-o" aria-hidden="true"></i> 定时时长
+								<span class="controlVal">4</span>
+							</a>
+						</li>-->
+						<li class="mui-table-view-cell" id="switchBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-power-off" aria-hidden="true"></i> 设备开关
+								<span class="controlVal">开</span>
+							</a>
+						</li>
+						<!--<li class="mui-table-view-cell" id="startBar">
+							<a class="mui-navigate-right">
+								<i class="fa fa-power-off" aria-hidden="true"></i> 起始时间
+								<span class="controlVal">3</span>
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="stopBar">
+							<a class="mui-navigate-right">
+								<i class="fa fa-power-off" aria-hidden="true"></i> 结束时间
+								<span class="controlVal">2</span>
+							</a>
+						</li>--> 
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="debugBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-wrench" aria-hidden="true"></i> 调试
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="refreshBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-refresh" aria-hidden="true"></i> 查询最新状态
+							</a>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<li class="mui-table-view-cell" id="clock">
+							<a class="mui-navigate-right">
+								<i class="fa fa-clock-o" aria-hidden="true"></i> 定时模式
+								<span class="controlVal">光控</span>
+							</a>
+						</li>
+						<!--<li class="mui-table-view-cell" id="timingBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-clock-o" aria-hidden="true"></i> 定时时长
+								<span class="controlVal">4</span>
+							</a>
+						</li>-->
+						<li class="mui-table-view-cell" id="switchBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-power-off" aria-hidden="true"></i> 设备开关
+								<span class="controlVal">开</span>
+							</a>
+						</li>
+						<!--<li class="mui-table-view-cell" id="startBar">
+							<a class="mui-navigate-right">
+								<i class="fa fa-power-off" aria-hidden="true"></i> 起始时间
+								<span class="controlVal">3</span>
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="stopBar">
+							<a class="mui-navigate-right">
+								<i class="fa fa-power-off" aria-hidden="true"></i> 结束时间
+								<span class="controlVal">2</span>
+							</a>
+						</li>--> 
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="debugBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-wrench" aria-hidden="true"></i> 调试
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="refreshBtn">
+							<a class="mui-navigate-right">
+								<i class="fa fa-refresh" aria-hidden="true"></i> 查询最新状态
+							</a>
+						</li>
+					</ul>
+					<div class="mui-row" id="detial">
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe698;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="ds">开</p>
+								<p class="equipFun">设备开关</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe60b;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="ws">待机</p>
+								<p class="equipFun">工作状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xeaae;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="tt">4</p>
+								<p class="equipFun">定时时长</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe64c;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="lps">正常</p>
+								<p class="equipFun">光控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe633;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="tps">正常</p>
+								<p class="equipFun">温控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe635;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="rps">正常</p>
+								<p class="equipFun">雨控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe622;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="tbs">正常</p>
+								<p class="equipFun">灯管状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe78d;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="dps">正常</p>
+								<p class="equipFun">倾倒状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe60a;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="csq">29</p>
+								<p class="equipFun">信号强度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe65f;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState conversion" id="dver">1.0.1</p>
+								<p class="equipFun">版本型号</p>
+							</div>
+						</div>
+					</div>
+					
+				</div>
+			</div>
+			<div class="mask" id="mask">
+				<div class="sidebar" id="sidebar">
+					<div>
+						<div>
+							定时模式:
+							<select name="" id="switchover">
+								<option value="0">光控</option>
+								<option value="1">时控</option>
+							</select>
+						</div>
+						<div id="durationParent">
+							定时时长:
+							<select name="" id="duration">
+								<option value="0">常亮</option>
+								<option value="1">1小时</option>
+								<option value="2">2小时</option>
+								<option value="3">3小时</option>
+								<option value="4">4小时</option>
+								<option value="5">5小时</option>
+								<option value="6">6小时</option>
+								<option value="7">7小时</option>
+							</select>
+						</div>
+						<div id="timeHourParent">
+							<p>定时时间:</p>
+							<select name="" id="begin" style="width: 47%;">
+								<option value="0">0点</option>
+								<option value="1">1点</option>
+								<option value="2">2点</option>
+								<option value="3">3点</option>
+								<option value="4">4点</option>
+								<option value="5">5点</option>
+								<option value="6">6点</option>
+								<option value="7">7点</option>
+								<option value="8">8点</option>
+								<option value="9">9点</option>
+								<option value="10">10点</option>
+								<option value="11">11点</option>
+								<option value="12">12点</option>
+								<option value="13">13点</option>
+								<option value="14">14点</option>
+								<option value="15">15点</option>
+								<option value="16">16</option>
+								<option value="17">17点</option>
+								<option value="18">18点</option>
+								<option value="19">19点</option>
+								<option value="20">20点</option>
+								<option value="21">21点</option>
+								<option value="22">22点</option>
+								<option value="23">23点</option>
+							</select>
+							至
+							<select name="" id="end" style="width: 47%;">
+								<option value="0">0点</option>
+								<option value="1">1点</option>
+								<option value="2">2点</option>
+								<option value="3">3点</option>
+								<option value="4">4点</option>
+								<option value="5">5点</option>
+								<option value="6">6点</option>
+								<option value="7">7点</option>
+								<option value="8">8点</option>
+								<option value="9">9点</option>
+								<option value="10">10点</option>
+								<option value="11">11点</option>
+								<option value="12">12点</option>
+								<option value="13">13点</option>
+								<option value="14">14点</option>
+								<option value="15">15点</option>
+								<option value="16">16</option>
+								<option value="17">17点</option>
+								<option value="18">18点</option>
+								<option value="19">19点</option>
+								<option value="20">20点</option>
+								<option value="21">21点</option>
+								<option value="22">22点</option>
+								<option value="23">23点</option>
+							</select>
+						</div>
+						<div class="">
+							<button type="button" id="saveStatus" data-loading-icon="mui-spinner mui-spinner-custom" class="mui-btn mui-btn-primary">确认</button>
+						</div>
+					</div>
+				</div>
+
+			</div>
+			
+			<div id="popover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 310px;background-color: #fff;">
+				<div class="mui-popover-arrow"></div>
+				<!--<div class="popoverheader">
+					<div class="text"></div>
+					<a href="#popover"><img src="../image/close.png" alt=""></a>
+				</div>-->
+				<div id="simDetial">
+					
+				</div>
+				<div class="mui-table-view mui-table-view-chevron next">
+					<a href="#popover" class="x-next add">我知道了</a>
+				</div>
+			</div>
+		</div>
+		<div id="map" style="display: none;"></div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
+		<script type="text/javascript">
+			var equipId;
+			var equiccID;
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				$('#equipId').html('设备ID:' + equipId);
+				console.log(equipId);
+				downCallback()
+				var map = new BMap.Map("map"); //
+				geoc = new BMap.Geocoder();
+				//定时时长
+				document.getElementById("switchover").addEventListener('change', function() {
+					console.log($(this).val())
+					if($(this).val() == 1) { //时控
+						$('#durationParent').hide();
+						$('#timeHourParent').show();
+					} else {
+						$('#durationParent').show();
+						$('#timeHourParent').hide();
+					}
+				})
+				document.getElementById("clock").addEventListener('tap', function() {
+					$('.mask').show();
+					$('#sidebar').css('animation', 'slideUpIn .1s ease-in-out')
+
+				})
+				$('#saveStatus').on('tap', function(e) {
+					mui(this).button('loading');
+					var id = [];
+					id.push(equipId);
+					mui.ajax('http://120.27.222.26/scd_mqtt', {
+						data: {
+							'sw': 'timer',
+							'topicid': JSON.stringify(id),
+							ts: $('#switchover').val(),
+							hours: $('#duration').val(),
+							begin: $('#begin').val(),
+							end: $('#end').val()
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							setTimeout(function(){
+								plus.nativeUI.closeWaiting();
+							},2000)
+						},
+						success: function(data) {
+							if(data == 0) {
+								mui.toast('设置成功');
+								setTimeout(function(){
+									window.location.reload();
+									$('#saveStatus').button('reset');
+								},2000)
+								
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							mui.toast('数据请求失败');
+						}
+					})
+				});
+				document.getElementById("sidebar").addEventListener('tap', function(event) {
+					event.stopPropagation()
+				})
+				document.getElementById("mask").addEventListener('tap', function(e) {
+					$('.mask').hide();
+				})
+				//下拉刷新的回调
+				function downCallback() {
+					$.ajax({
+						url: 'http://120.27.222.26/app_equipmanage_detail',
+						data: {
+							'etype': 'scd',
+							'equip_id': equipId,
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							console.log(JSON.stringify(data))
+							var equip_name = data.equip_name || '无';
+							$('#equipName').html('设备名称:' + equip_name);
+							$('#upl_time').html('上报时间:' + data.upl_time);
+							var stat = eval('(' + data.scd_status + ')');
+							var point = new BMap.Point(stat.lng, stat.lat);
+							geoc.getLocation(point, function (rs) {
+							    var addComp = rs.addressComponents;
+								$('#lat_lng').html('位置:'  + addComp.province + ", " + addComp.city + ", " + addComp.district);
+							});
+							equiccID = stat.iccid
+							var ds = stat.ds == 0 ? '关' : '开';
+							$('#ds').html(ds);
+							$('#switchBtn .controlVal').html(ds);
+							var ws = '';
+							if(stat.ws == 0) ws = "待机";
+							else if(stat.ws == 1) ws = "工作";
+							else if(stat.ws == 2) ws = "充电";
+							$('#ws').html(ws);
+							var tt = '';
+							if(stat.tcs == 1) {  //时控
+								$('#tt').html(stat.st + '-' + stat.et);
+//								$('#timingBtn').hide();
+//								$('#switchBtn').hide();
+//								$('#startBar').show();
+//								$('#stopBar').show();
+							} else {
+								if(stat.tt == 0) tt = "常亮";
+								else tt = stat.tt;
+								$('#tt').html(tt);
+//								$('#timingBtn').show();
+//								$('#switchBtn').show();
+//								$('#startBar').hide();
+//								$('#stopBar').hide();
+							}
+							
+							var lps = stat.lps == 0 ? '夜晚' : '白天';
+							$('#lps').html(lps);
+							var tps = stat.tps == 0 ? '正常' : '异常';
+							if(stat.tcs == 1) { //时控
+								$('#clock .controlVal').html('时控');
+								$('#durationParent').hide();
+								$('#timeHourParent').show();
+								$('#switchover').val(1)
+							} else {
+								$('#clock .controlVal').html('光控');
+								$('#timeHourParent').hide();
+								$('#durationParent').show();
+								$('#switchover').val(0)
+							}
+							$('#tps').html(tps);
+							var rps = stat.rps == 0 ? '正常' : '保护';
+							$('#rps').html(rps);
+							var tbs = stat.tbs == 0 ? '正常' : '异常';
+							$('#tbs').html(tbs);
+							var dps = stat.dps == 0 ? '正常' : '异常';
+							$('#dps').html(dps);
+							$('#csq').html(stat.csq);
+							$('#dver').html(stat.dver);
+						},
+						error: function(xhr, type, errorThrown) {
+							//联网失败的回调,隐藏下拉刷新的状态
+							mescroll.endErr();
+							mui.toast('数据请求失败');
+						}
+					});
+				}
+
+				//定时时长
+//				document.getElementById("timingBtn").addEventListener('tap', function() {
+//					var picker = new mui.PopPicker();
+//					picker.setData([{
+//						value: "0",
+//						text: "常亮"
+//					}, {
+//						value: "1",
+//						text: "1小时"
+//					}, {
+//						value: "2",
+//						text: "2小时"
+//					}, {
+//						value: "3",
+//						text: "3小时"
+//					}, {
+//						value: "4",
+//						text: "4小时"
+//					}, {
+//						value: "5",
+//						text: "5小时"
+//					}, {
+//						value: "6",
+//						text: "6小时"
+//					}, {
+//						value: "7",
+//						text: "7小时"
+//					}])
+//					picker.show(function(getSelectedItems) {
+//						console.log(getSelectedItems[0].value);
+//						var id = [];
+//						id.push(equipId);
+//						mui.ajax('http://120.27.222.26/scd_mqtt', {
+//							data: {
+//								'sw': 'tt',
+//								'topicid': JSON.stringify(id),
+//								'hours': getSelectedItems[0].value
+//							},
+//							dataType: 'json', //服务器返回json格式数据
+//							type: 'post', //HTTP请求类型
+//							timeout: 10000, //超时时间设置为10秒;
+//							beforeSend: function() {
+//								plus.nativeUI.showWaiting('请求中...');
+//							},
+//							complete: function() {
+//								plus.nativeUI.closeWaiting();
+//							},
+//							success: function(data) {
+//								if(data == 0) {
+//									mui.toast('设置成功');
+//								}
+//							},
+//							error: function(xhr, type, errorThrown) {
+//								$('#equiplist').empty();
+//								mui('.mui-content')[0].appendChild(netStyle('../images/error.png'));
+//								mui.toast('数据请求失败');
+//							}
+//						})
+//					})
+//					picker.hide = function() {
+//						var self = this;
+//						self.panel.classList.remove(mui.className('active'));
+//						self.mask.close();
+//						document.body.classList.remove(mui.className('poppicker-active-for-page'));
+//						//处理物理返回键
+//						mui.back = self.__back;
+//					}
+//				});
+
+				//设备开关
+				document.getElementById("switchBtn").addEventListener('tap', function() {
+					var picker = new mui.PopPicker();
+					picker.setData([{
+						value: "1",
+						text: "开启"
+					}, {
+						value: "0",
+						text: "关闭"
+					}])
+					picker.show(function(getSelectedItems) {
+						console.log(getSelectedItems[0].value)
+						var curSelect = getSelectedItems[0].value;
+						var id = [];
+						id.push(equipId);
+						mui.ajax('http://120.27.222.26/scd_mqtt', {
+							data: {
+								'sw': 'timer',
+								'topicid': JSON.stringify(id),
+								'ds': getSelectedItems[0].value
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								if(data == 0) {
+									mui.toast('设置成功');
+									if(curSelect) {
+										$('#switchBtn .controlVal').html('开')
+									} else {
+										$('#switchBtn .controlVal').html('关')
+									}
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								$('#equiplist').empty();
+								//								mui('.mui-content')[0].appendChild(netStyle('../images/error.png'));
+								mui.toast('数据请求失败');
+							}
+						})
+					})
+					picker.hide = function() {
+						var self = this;
+						self.panel.classList.remove(mui.className('active'));
+						self.mask.close();
+						document.body.classList.remove(mui.className('poppicker-active-for-page'));
+						//处理物理返回键
+						mui.back = self.__back;
+					}
+				});
+
+				//查询
+				$('#refreshBtn').on('tap', function() {
+					var id = [];
+					id.push(equipId);
+					mui.ajax('http://120.27.222.26/scd_mqtt', {
+						data: {
+							'sw': 'read',
+							'topicid': JSON.stringify(id),
+							'kind': 'status'
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							setTimeout(function() {
+								plus.nativeUI.closeWaiting();
+							}, 5000)
+						},
+						success: function(data) {
+							setTimeout(function() {
+								location.reload();
+							}, 5000)
+						},
+						error: function(xhr, type, errorThrown) {
+							mui.toast('请求失败!')
+						}
+					});
+				})
+				
+				//调试
+				$('#debugBtn').on('tap', function() {
+					var id = [];
+					id.push(equipId);
+					mui.ajax('http://120.27.222.26/scd_mqtt', {
+						data: {
+							'sw': 'test',
+							'topicid': JSON.stringify(id),
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							setTimeout(function() {
+//								plus.nativeUI.closeWaiting();
+								mui.toast('调试成功!')
+							}, 5000)
+						},
+						success: function(data) {
+							setTimeout(function() {
+								location.reload();
+							}, 5000)
+						},
+						error: function(xhr, type, errorThrown) {
+							mui.toast('调试失败!')
+						}
+					});
+				})
+				
+				//sim卡查新  
+				document.getElementById('simCodeSearch').addEventListener('tap', function() {
+					console.log(equiccID)
+					if(equiccID) {
+						$.ajax({
+							url: 'http://120.27.222.26/siminfo',
+							data: {
+								simid: equiccID,
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								var dat = data.data;
+								if(data.code == 0) {
+									var status;
+									if(dat.account_status == "0") {
+										status = "未知";
+									} else if(dat.account_status == "1") {
+										status = "测试期";
+									} else if(dat.account_status == "2") {
+										status = "沉默期";
+									} else if(dat.account_status == "3") {
+										status = "使用中";
+									} else if(dat.account_status == "4") {
+										status = "停机";
+									} else if(dat.account_status == "5") {
+										status = "停机保号";
+									} else if(dat.account_status == "6") {
+										status = "预销号";
+									} else if(dat.account_status == "7") {
+										status = "销号";
+									}
+									var usage;
+									if(dat.iccid) {
+										usage = dat.data_usage;
+									} else {
+										usage.innerHTML = '--';
+									}
+									var balance;
+									if(dat.iccid) {
+										balance = dat.data_balance;
+									} else {
+										balance = '--';
+									}
+									var time;
+									if(dat.iccid) {
+										var timestamp4 = new Date(dat.expiry_date * 1000); //直接用 new Date(时间戳) 格式转化获得当前时间
+										time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
+									} else {
+										time = '--';
+									}
+									html = '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + equiccID + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
+									$('#simDetial').html(html);
+									mui('.mui-popover').popover('show', document.getElementById("popover"));
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+
+					} else {
+						mui.toast('未查询到SIM卡号');
+					}
+				})
+			})
+		</script>
+	</body>
+
+</html>

+ 174 - 0
equipManage/equipManage_ybq.html

@@ -0,0 +1,174 @@
+<!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 rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">诱捕器设备</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+						<input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+
+				</ul>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/mui.min.js"></script>
+
+			<script type="text/javascript">
+				mui.init()
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop: { //配置回到顶部按钮
+							src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset: 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+							use: true // 是否开启懒加载,默认false
+						}
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page) {
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData);
+					}, function() {
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+						mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData) {
+					var html = '';
+					//				var listDom=document.getElementById("dataList");
+					var dat = curPageData;
+					for(var i = 0; i < dat.length; i++) {
+						var equip_name = dat[i].equip_name || '无';
+						var equipicon = '';
+						if(dat[i].is_online == 0) {
+							equipicon = '../images/red.png';
+						} else if(dat[i].is_online == 1) {
+							equipicon = '../images/green.png';
+						}
+						html += '<li data-id="' + dat[i].equip_id + '"><div class="equipItem"><div class="equipItem_top">' +
+							'<div class="equipTitle"><img class="equipIdIcon" src="../images/IDicon.png" width="22"/>' +
+							'<span class="">' + dat[i].equip_id + '</span><img class="equipType" src="' + equipicon + '" width="26"/>' +
+							'</div><div class="equipItem_line"></div></div><div class="equipItem_bottom">' +
+							'<div class="equipMsg"><label>设备名称</label><div class="equipVal equipName">' + equip_name + '</div></div>' +
+							'<div class="equipMsg"><label>上报时间</label><div class="equipVal">' + dat[i].upl_time + '</div>' +
+							'</div></div></div></li>';
+					}
+					$('#dataList').append(html);
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+					console.log(pageNum)
+					$.ajax({
+						type: 'POST',
+						url: 'http://120.27.222.26/app_equipmanage',
+						timeout: 10000, //超时时间设置,单位毫秒
+						data: {
+							'etype': 'ybq',
+							'page': pageNum,
+							'filter': mui('#searchInp')[0].value,
+						},
+						dataType: 'json',
+						success: function(data) {
+							successCallback(data.dat, data.nums);
+						},
+						error: function() {
+							errorCallback();
+						}
+					});
+				}
+
+				var markingid = '' //用于记录点击的当前id 以便刷新
+				window.addEventListener('refresh', function(event) { //如果详情页面更改数据  才页面刷新
+					$('#dataList li').each(function() {
+						if(markingid == $(this).data('id')) {
+							$(this).find('.equipName').html(event.detail.markingEquipName);
+						}
+					})
+				})
+				//进入详情页面
+				mui('#dataList').on('tap', 'li', function() {
+					var imei = this.getAttribute('data-id');
+					markingid = imei;
+					mui.openWindow({
+						url: 'equipManage_ybq_detail.html',
+						id: 'equipManage_ybq_detail',
+						extras: {
+							'equipId': imei
+						},
+					})
+				})
+
+				//搜索操作
+				$("#searchInp").on('keypress', function(e) {
+					var keycode = e.keyCode;
+					if(keycode == '13') {
+						e.preventDefault();
+						//请求搜索接口  
+						if(mui('#searchInp')[0].value) {
+							getListData({
+								num: 1,
+								size: 10
+							})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+					}
+				})
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						getListData({
+							num: 1,
+							size: 10
+						})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+			</script>
+	</body>
+
+</html>

+ 521 - 0
equipManage/equipManage_ybq_detail.html

@@ -0,0 +1,521 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/common.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<style type="text/css">
+			.mui-content {
+				background: #fff;
+			}
+			
+			.iconfont {
+				font-size: 35px;
+				color: #3bb9e7;
+				/*font-weight: bold;*/
+				line-height: 80px;
+				margin: 10px 10px 10px 20px;
+			}
+			
+			.equipState {
+				font-size: 18px;
+				margin-top: 14px;
+				color: #333;
+			}
+			
+			#detial>div {
+				border-bottom: 2px solid #eee;
+			}
+			
+			#detial>div:nth-of-type(odd) {
+				border-right: 2px solid #eee;
+			}
+			
+			.mui-table-view:after,
+			.mui-table-view:before {
+				height: 2px;
+				background-color: #eee;
+			}
+			
+			@media(max-width: 400px) {
+				.mui-col-sm-6 {
+					width: 50%;
+				}
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+			/*查看详情*/
+			.areaTitle {
+			    color: #424242;
+			    padding-left: 5px;
+			    border-left: 5px solid #5870f6;
+			    font-weight: bold;
+			    font-size: 16px;
+			}
+			.detialBox .fa{
+				padding-right: 5px;
+    			color: #ff6e00;
+			}
+			/**/
+			.controlVal{
+				position: absolute;
+			    top: 50%;
+			    right: 35px;
+			    -webkit-transform: translateY(-50%);
+			     transform: translateY(-50%); 
+			}
+			#controlBtn {
+				width: 80%;
+				/*height: 0px;*/
+				background: white;
+				position: fixed;
+				top: 24%;
+				left: 50%;
+				margin-left: -40%;
+			}
+			/*移除底部或顶部三角,需要在删除此代码*/
+			.mui-popover .mui-popover-arrow:after {
+				width: 0px;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title">杀虫灯设备</h1>
+			<!--<a id="openPopover" class="mui-icon mui-icon-more mui-pull-right"></a>-->
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll">
+				<div id="dataList">
+					<ul class="mui-table-view" id="equip">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">设备信息</h1>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipId"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipName"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="upl_time"></p>
+						</li>
+					</ul>
+					<div class="mui-row" id="detial">
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe698;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="ds">开</p>
+								<p class="equipFun">设备开关</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe60b;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="ws">待机</p>
+								<p class="equipFun">工作状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xeaae;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="tt">4</p>
+								<p class="equipFun">定时模式</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe64c;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="lps">正常</p>
+								<p class="equipFun">光控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe633;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="tps">正常</p>
+								<p class="equipFun">温控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe635;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="rps">正常</p>
+								<p class="equipFun">雨控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe622;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="tbs">正常</p>
+								<p class="equipFun">灯管状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe78d;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="dps">正常</p>
+								<p class="equipFun">倾倒状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe60a;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="csq">29</p>
+								<p class="equipFun">信号强度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-6">
+							<div class="mui-pull-left">
+								<i class="iconfont">&#xe65f;</i>
+							</div>
+							<div class="mui-pull-left ">
+								<p class="equipState" id="dver">1.0.1</p>
+								<p class="equipFun">版本型号</p>
+							</div>
+						</div>
+					</div>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+					    <li class="mui-table-view-cell" id="clock">
+					        <a class="mui-navigate-right">
+					        	<i class="fa fa-clock-o" aria-hidden="true"></i>
+					        	定时模式
+					        	<span class="controlVal">光控</span>
+					        </a>
+					    </li>
+					    <li class="mui-table-view-cell" id="timingBtn">
+					        <a class="mui-navigate-right">
+					        	<i class="fa fa-clock-o" aria-hidden="true"></i>
+					        	定时时长
+					        	<span class="controlVal">4</span>
+					        </a>
+					    </li>
+					    <li class="mui-table-view-cell" id="switchBtn">
+					        <a class="mui-navigate-right">
+					        	<i class="fa fa-power-off" aria-hidden="true"></i>
+					        	设备开关
+					        	<span class="controlVal">开</span>
+					        </a>
+					    </li>
+					    <li class="mui-table-view-cell" id="startBar">
+					        <a class="mui-navigate-right">
+					        	<i class="fa fa-power-off" aria-hidden="true"></i>
+					        	起始时间
+					        	<span class="controlVal">3</span>
+					        </a>
+					    </li>
+					    <li class="mui-table-view-cell" id="stopBar">
+					        <a class="mui-navigate-right">
+					        	<i class="fa fa-power-off" aria-hidden="true"></i>
+					        	结束时间
+					        	<span class="controlVal">2</span>
+					        </a>
+					    </li>
+					    <li class="mui-table-view-cell" id="refreshBtn">
+					        <a class="mui-navigate-right">
+					        	<i class="fa fa-refresh" aria-hidden="true"></i>
+					        	查询最新状态
+					        </a>
+					    </li>
+					</ul>
+				</div>
+			</div>
+		</div>
+		<div id="aaa" style="display: none;">
+			sdvsdvsdvsd
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/mescroll.min.js" charset="utf-8"></script>
+		<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript">
+			var equipId;
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				$('#equipId').html('设备ID:'+equipId);
+				console.log(equipId);
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					down: {
+						callback: downCallback //下拉刷新的回调,别写成downCallback(),多了括号就自动执行方法了
+					},
+				});
+				ws=plus.webview.currentWebview();
+
+				//修改操作
+				document.getElementById('openPopover').addEventListener('tap', function() {
+					mui('#popover').popover('toggle', document.getElementById('controlBtn'));
+				})
+				//定时时长
+				document.getElementById("clock").addEventListener('tap', function() {
+					// 显示遮罩层
+//					ws.setStyle({mask:"rgba(0,0,0,0.5)"});
+//					$('#aaa').show()
+					// 点击关闭遮罩层
+//					ws.addEventListener("maskClick",function(){
+//					  ws.setStyle({mask:"none"});
+//					},false);
+				})
+				//下拉刷新的回调
+				function downCallback() {
+					$.ajax({
+						url: 'http://120.27.222.26/app_equipmanage_detail',
+						data: {
+							'etype': 'scd',
+							'equip_id': equipId,
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							//联网成功的回调,隐藏下拉刷新的状态;
+							mescroll.endSuccess(); //无参. 注意结束下拉刷新是无参的
+							var equip_name = data.equip_name || '无';
+							$('#equipName').html('设备名称:' + equip_name);
+							$('#upl_time').html('上报时间:' + data.upl_time);
+							var stat = eval('(' + data.scd_status + ')');
+							var ds = stat.ds == 0 ? '关' : '开';
+							$('#ds').html(ds);
+							var ws = '';
+							if(stat.ws == 0) ws = "待机";
+							else if(stat.ws == 1) ws = "工作";
+							else if(stat.ws == 2) ws = "充电";
+							$('#ws').html(ws);
+							var tt = '';
+							if(stat.tt == 1){
+								$('#timingBtn').hide();
+								$('#switchBtn').hide();
+								$('#startBar').show();
+								$('#stopBar').show();
+							}else{
+								$('#timingBtn').show();
+								$('#switchBtn').show();
+								$('#startBar').hide();
+								$('#stopBar').hide();
+							}
+							if(stat.tt == 0) tt = "常亮";
+							else tt = stat.tt;
+							$('#tt').html(tt);
+							var lps = stat.lps == 0 ? '正常' : '异常';
+							$('#lps').html(lps);
+							var tps = stat.tps == 0 ? '正常' : '异常';
+							$('#tps').html(tps);
+							var rps = stat.rps == 0 ? '正常' : '异常';
+							$('#rps').html(rps);
+							var tbs = stat.tbs == 0 ? '正常' : '异常';
+							$('#tbs').html(tbs);
+							var dps = stat.dps == 0 ? '正常' : '异常';
+							$('#dps').html(dps);
+							$('#csq').html(stat.csq);
+							$('#dver').html(stat.dver);
+						},
+						error: function(xhr, type, errorThrown) {
+							//联网失败的回调,隐藏下拉刷新的状态
+							mescroll.endErr();
+							mui.toast('数据请求失败');
+						}
+					});
+				}
+				
+				//定时时长
+				document.getElementById("timingBtn").addEventListener('tap', function() {
+					var picker = new mui.PopPicker();
+					picker.setData([{
+						value: "0",
+						text: "常亮"
+					}, {
+						value: "1",
+						text: "1小时"
+					}, {
+						value: "2",
+						text: "2小时"
+					}, {
+						value: "3",
+						text: "3小时"
+					}, {
+						value: "4",
+						text: "4小时"
+					}, {
+						value: "5",
+						text: "5小时"
+					}, {
+						value: "6",
+						text: "6小时"
+					}, {
+						value: "7",
+						text: "7小时"
+					}])
+					picker.show(function(getSelectedItems) {
+						console.log(getSelectedItems[0].value);
+						var id = [];
+						id.push(equipId);
+						mui.ajax('http://120.27.222.26/scd_mqtt', {
+							data: {
+								'sw': 'tt',
+								'topicid': JSON.stringify(id),
+								'hours': getSelectedItems[0].value
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								if(data == 0){
+									mui.toast('设置成功');
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								$('#equiplist').empty();
+								mui('.mui-content')[0].appendChild(netStyle('../images/error.png'));
+								mui.toast('数据请求失败');
+							}
+						})
+					})
+					picker.hide = function(){
+						var self = this;
+						self.panel.classList.remove(mui.className('active'));
+						self.mask.close();
+						document.body.classList.remove(mui.className('poppicker-active-for-page'));
+						//处理物理返回键
+						mui.back=self.__back;
+					}
+				});
+
+
+				//设备开关
+				document.getElementById("switchBtn").addEventListener('tap', function() {
+					var picker = new mui.PopPicker();
+					picker.setData([{
+						value: "0",
+						text: "开启"
+					}, {
+						value: "1",
+						text: "关闭"
+					}])
+					picker.show(function(getSelectedItems) {
+						console.log(getSelectedItems[0].value)
+						var id = [];
+						id.push(equipId);
+						mui.ajax('http://120.27.222.26/scd_mqtt', {
+							data: {
+								'sw': 'ds',
+								'topicid': JSON.stringify(id),
+								'ds': getSelectedItems[0].value
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								if(data == 0){
+									mui.toast('设置成功');
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								$('#equiplist').empty();
+								mui('.mui-content')[0].appendChild(netStyle('../images/error.png'));
+								mui.toast('数据请求失败');
+							}
+						})
+					})
+					picker.hide = function(){
+						var self = this;
+						self.panel.classList.remove(mui.className('active'));
+						self.mask.close();
+						document.body.classList.remove(mui.className('poppicker-active-for-page'));
+						//处理物理返回键
+						mui.back=self.__back;
+					}
+				});
+				
+				//查询
+				$('#refreshBtn').on('tap',function(){
+					var id = [];
+					id.push(equipId);
+					mui.ajax('http://120.27.222.26/scd_mqtt',{
+						data:{
+							'sw': 'read',
+							'topicid': JSON.stringify(id),
+							'kind': 'status'
+						},
+						dataType:'json',//服务器返回json格式数据
+						type:'post',//HTTP请求类型
+						timeout: 10000,//超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							setTimeout(function () {
+			                    plus.nativeUI.closeWaiting();
+			                }, 5000)
+						},
+						success:function(data){
+							setTimeout(function () {
+			                    location.reload();
+			                }, 5000)
+						},
+						error:function(xhr,type,errorThrown){
+							mui.toast('请求失败!')
+						}
+					});
+				})
+				
+			})
+			
+
+		</script>
+	</body>
+
+</html>

+ 401 - 0
equipManage/lookImage_jk.html

@@ -0,0 +1,401 @@
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<title>Hello MUI</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<!--标准mui.css-->
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/iconfont.css">
+		<link rel="stylesheet" href="../css/reset.css">
+		<link rel="stylesheet" href="../css/common.css">
+		<!--App自定义的css-->
+		<style type="text/css">
+			.mui-preview-image.mui-fullscreen {
+				position: fixed;
+				z-index: 20;
+				background-color: #000;
+			}
+			
+			.mui-preview-header,
+			.mui-preview-footer {
+				position: absolute;
+				width: 100%;
+				left: 0;
+				z-index: 10;
+			}
+			
+			.mui-preview-header {
+				height: 44px;
+				top: 0;
+			}
+			
+			.mui-preview-footer {
+				height: 50px;
+				bottom: 0px;
+			}
+			
+			.mui-preview-header .mui-preview-indicator {
+				display: block;
+				line-height: 25px;
+				color: #fff;
+				text-align: center;
+				margin: 15px auto 4;
+				width: 70px;
+				background-color: rgba(0, 0, 0, 0.4);
+				border-radius: 12px;
+				font-size: 16px;
+			}
+			
+			.mui-preview-image {
+				display: none;
+				-webkit-animation-duration: 0.5s;
+				animation-duration: 0.5s;
+				-webkit-animation-fill-mode: both;
+				animation-fill-mode: both;
+			}
+			
+			.mui-preview-image.mui-preview-in {
+				-webkit-animation-name: fadeIn;
+				animation-name: fadeIn;
+			}
+			
+			.mui-preview-image.mui-preview-out {
+				background: none;
+				-webkit-animation-name: fadeOut;
+				animation-name: fadeOut;
+			}
+			
+			.mui-preview-image.mui-preview-out .mui-preview-header,
+			.mui-preview-image.mui-preview-out .mui-preview-footer {
+				display: none;
+			}
+			
+			.mui-zoom-scroller {
+				position: absolute;
+				display: -webkit-box;
+				display: -webkit-flex;
+				display: flex;
+				-webkit-box-align: center;
+				-webkit-align-items: center;
+				align-items: center;
+				-webkit-box-pack: center;
+				-webkit-justify-content: center;
+				justify-content: center;
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				width: 100%;
+				height: 100%;
+				margin: 0;
+				-webkit-backface-visibility: hidden;
+			}
+			
+			.mui-zoom {
+				-webkit-transform-style: preserve-3d;
+				transform-style: preserve-3d;
+			}
+			
+			.mui-slider .mui-slider-group .mui-slider-item img {
+				width: auto;
+				height: auto;
+				max-width: 100%;
+				max-height: 100%;
+			}
+			
+			.mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img {
+				width: 100%;
+			}
+			
+			.mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item {
+				display: inline-table;
+			}
+			
+			.mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img {
+				display: table-cell;
+				vertical-align: middle;
+			}
+			
+			.mui-preview-loading {
+				position: absolute;
+				width: 100%;
+				height: 100%;
+				top: 0;
+				left: 0;
+				display: none;
+			}
+			
+			.mui-preview-loading.mui-active {
+				display: block;
+			}
+			
+			.mui-preview-loading .mui-spinner-white {
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				margin-left: -25px;
+				margin-top: -25px;
+				height: 50px;
+				width: 50px;
+			}
+			
+			.mui-preview-image img.mui-transitioning {
+				-webkit-transition: -webkit-transform 0.5s ease, opacity 0.5s ease;
+				transition: transform 0.5s ease, opacity 0.5s ease;
+			}
+			
+			@-webkit-keyframes fadeIn {
+				0% {
+					opacity: 0;
+				}
+				100% {
+					opacity: 1;
+				}
+			}
+			
+			@keyframes fadeIn {
+				0% {
+					opacity: 0;
+				}
+				100% {
+					opacity: 1;
+				}
+			}
+			
+			@-webkit-keyframes fadeOut {
+				0% {
+					opacity: 1;
+				}
+				100% {
+					opacity: 0;
+				}
+			}
+			
+			@keyframes fadeOut {
+				0% {
+					opacity: 1;
+				}
+				100% {
+					opacity: 0;
+				}
+			}
+			
+			p img {
+				max-width: 100%;
+				height: auto;
+			}
+			
+			#dataList .item {
+				padding: 10px;
+				position: relative;
+			}
+			
+			#dataList .item .photoTxt {
+				color: #24b2e7;
+				padding: 5px 0;
+			}
+			
+			#dataList .item .delPhoto {
+				float: right;
+			}
+			
+			.mui-media-object {
+				width: 100%;
+			}
+			/*操作*/
+			
+			.mui-table-view.mui-grid-view .mui-table-view-cell.operateRight {
+				/*padding-left: 0;*/
+			}
+			
+			.mui-table-view-cell p {
+				text-align: left;
+				padding-left: 20px;
+				font-size: 16px;
+				line-height: 24px;
+				overflow: hidden;
+				white-space: nowrap;
+				text-overflow: ellipsis;
+			}
+			
+			.mui-table-view-cell p:last-child {
+				font-size: 15px;
+			}
+			
+			.activeBj {
+				background: #eee;
+			}
+			
+			.mui-table-view-cell p i {
+				margin-right: 15px;
+				color: #007AFF;
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+		</style>
+
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title"></h1>
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+					<!--<li class="item">
+						<div >
+							<img class="mui-media-object" src="../images/shuijiao.jpg" data-preview-src="" data-preview-group="1">
+						</div>
+						<div class="photoTxt">
+							<span>2017-6-12 10:09</span>
+							<span class="delPhoto"><i class="iconfont">&#xe65c;</i>删除</span>
+						</div>
+					</li>-->
+				</ul>
+			</div>
+		</div>
+	</body>
+	<script src="../js/jquery-2.1.0.js"></script>
+	<script src="../js/mui.min.js"></script>
+	<script src="../js/mui.zoom.js"></script>
+	<script src="../js/mescroll.min.js" charset="utf-8"></script>
+	<script src="../js/mui.previewimage.js"></script>
+	<script>
+		var equipId;
+		var startPage = 1;
+		var totalPage = 0;
+		var username;
+		mui.plusReady(function() {
+			var self = plus.webview.currentWebview();
+			equipId = self.equipId;
+			console.log(equipId)
+			$('#title').html('设备:' + equipId);
+			//默认第一次加载数据
+			//			requestData();
+			username = plus.storage.getItem('username');
+			mescroll = new MeScroll("scrollPlace", {
+				up: {
+					callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+					isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+					clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+					toTop: { //配置回到顶部按钮
+						src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+						offset: 700
+					},
+					empty: {
+						//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+						warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+						icon: "../images/listNull.png", //图标,默认null,支持网络图
+						tip: "暂无相关数据~" //提示
+					},
+					htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+					noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+					lazyLoad: {
+						use: true // 是否开启懒加载,默认false
+					}
+				}
+			});
+		})
+
+		/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+		function getListData(page) {
+			//联网加载数据
+			getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+				//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+				//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+				//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+				mescroll.endSuccess(totalSize);
+				//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+				setListData(curPageData);
+			}, function() {
+				//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+				mescroll.endErr();
+				mui.toast('数据请求失败');
+			});
+		}
+		/*设置列表数据*/
+		function setListData(curPageData) {
+			var html = '';
+			var dat = curPageData;
+			//				var dat = data.img;
+			for(var i = 0; i < dat.length; i++) {
+				html += '<li class="item"><div >' +
+					'<img class="mui-media-object" data-addr="'+dat[i].addr+'" src="http://120.27.222.26/' + dat[i].addr + '" data-preview-src="" data-preview-group="1">' +
+					'</div><div class="photoTxt"><span>' + dat[i].upl_time + '</span>' +
+					'<span class="delPhoto"><i class="iconfont">&#xe65c;</i>删除</span></div></li>';
+			}
+			$('#dataList').append(html)
+		}
+		/*联网加载列表数据*/
+		function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+			mui.ajax('http://120.27.222.26/app_jk_img', {
+				data: {
+					'page': pageNum,
+					'equip_id': equipId
+				},
+				dataType: 'json', //服务器返回json格式数据
+				type: 'post', //HTTP请求类型
+				timeout: 10000, //超时时间设置为10秒;
+				beforeSend: function() {
+					plus.nativeUI.showWaiting('请求中...');
+				},
+				complete: function() {
+					plus.nativeUI.closeWaiting();
+				},
+				success: function(data) {
+					successCallback(data.img, data.nums);
+				},
+				error: function(xhr, type, errorThrown) {
+
+				}
+			});
+		}
+
+		//图片轮播
+		mui.previewImage();
+
+		//删除
+		mui('#dataList').on('tap', '.delPhoto', function() {
+			var _this = this;
+			var path = $(_this).parents('.item').find('.mui-media-object').data('addr');
+			mui.confirm(' ', '是否删除?', ['取消', '确定'], function(e) {
+				if(e.index == 1) {
+					mui.ajax('http://120.27.222.26/jkimage_del', {
+						data: {
+							'addr': path,
+							'imei': equipId
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						success: function(data) {
+							if(data == 1) {
+								window.location.reload();
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							mui.toast('删除失败')
+						}
+					})
+				}
+			}, 'div')
+
+		})
+	</script>
+
+</html>

+ 193 - 0
equipManage/sex_trap.html

@@ -0,0 +1,193 @@
+<!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 rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<link rel="stylesheet" type="text/css" href="../css/equipList.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">性诱设备</h1>
+		</header>
+		<div class="mui-content">
+			<div class="searchBox">
+				<div class="searchControl">
+					<div class="mui-input-row mui-search">
+						<input type="search" id="searchInp" class="mui-input-clear" placeholder="请输入设备ID">
+					</div>
+					<button id="searchBtn" class="searchBtn">搜索</button>
+				</div>
+			</div>
+			<div id="scrollPlace" class="mescroll">
+				<!--id可以改,而"mescroll"的class不能删-->
+				<ul id="dataList">
+
+				</ul>
+			</div>
+			<script src="../js/jquery-2.1.0.js"></script>
+			<script src="../js/mescroll.min.js" charset="utf-8"></script>
+			<script src="../js/mui.min.js"></script>
+
+			<script type="text/javascript">
+				mui.init()
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				var mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop: { //配置回到顶部按钮
+							src: "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset: 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId: "dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+							use: true // 是否开启懒加载,默认false
+						}
+					}
+				});
+				/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+				function getListData(page) {
+					//联网加载数据
+					getListDataFromNet(page.num, page.size, function(curPageData, totalSize) {
+						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+						//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+						//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+						mescroll.endBySize(curPageData.length, totalSize); //必传参数(当前页的数据个数, 总数据量)
+						//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+						setListData(curPageData);
+					}, function() {
+						//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+						mescroll.endErr();
+						mui.toast('数据请求失败');
+					});
+				}
+				/*设置列表数据*/
+				function setListData(curPageData) {
+					var html = '';
+					//				var listDom=document.getElementById("dataList");
+					var dat = curPageData;
+					for(var i = 0; i < dat.length; i++) {
+						if(dat[i].type == 1){							
+							var type = 'I';
+						}else if(dat[i].type == 2){							
+							var type = 'II';
+						}
+						var equipicon = '';
+						if(dat[i].is_online == 0) {
+							equipicon = '../images/red.png';
+						} else if(dat[i].is_online == 1) {
+							equipicon = '../images/green.png';
+						}
+						var equip_code = dat[i].equip_code?dat[i].equip_code:'--';
+						html += '<li data-type="'+dat[i].type+'" data-id="' + dat[i].equip_id + '"><div class="equipItem"><div class="equipItem_top">' +
+							'<div class="equipTitle"><img class="equipIdIcon" src="../images/IDicon.png" width="22"/>' +
+							'<span class="">' + dat[i].equip_id + '</span><img class="equipType" src="' + equipicon + '" width="26"/>' +
+							'</div><div class="equipItem_line"></div></div><div class="equipItem_bottom">' +
+							'<div class="equipMsg"><label>设备类型</label><div class="equipVal equipName">' + type + '</div></div>' +
+							'<div class="equipMsg"><label>设备编号</label><div class="equipVal">' + equip_code + '</div>' +
+							'</div></div></div></li>';
+					}
+					$('#dataList').append(html);
+				}
+				/*联网加载列表数据*/
+				function getListDataFromNet(pageNum, pageSize, successCallback, errorCallback) {
+					console.log(pageNum)
+					$.ajax({
+						type: 'POST',
+						url: 'http://120.27.222.26/app_equipmanage',
+						timeout: 10000, //超时时间设置,单位毫秒
+						data: {
+							'etype': 'xycb',
+							'page': pageNum,
+							'filter': mui('#searchInp')[0].value,
+						},
+						dataType: 'json',
+						success: function(data) {
+							successCallback(data.dat, data.nums);
+						},
+						error: function() {
+							errorCallback();
+						}
+					});
+				}
+
+				var markingid = '' //用于记录点击的当前id 以便刷新
+				window.addEventListener('refresh', function(event) { //如果详情页面更改数据  才页面刷新
+					$('#dataList li').each(function() {
+						if(markingid == $(this).data('id')) {
+							$(this).find('.equipName').html(event.detail.markingEquipName);
+						}
+					})
+				})
+				//进入详情页面
+				mui('#dataList').on('tap', 'li', function() {
+					var imei = this.getAttribute('data-id');
+					var type = this.getAttribute('data-type');
+					markingid = imei;
+					if(type == 1){
+						mui.openWindow({
+							url: 'sex_trap_detail1.html',
+							id: 'sex_trap_detail1',
+							extras: {
+								'equipId': imei
+							},
+						})
+					}else if(type == 2){
+						mui.openWindow({
+							url: 'sex_trap_detail2.html',
+							id: 'sex_trap_detail2',
+							extras: {
+								'equipId': imei
+							},
+						})
+					}
+					
+				})
+
+				//搜索操作
+				$("#searchInp").on('keypress', function(e) {
+					var keycode = e.keyCode;
+					if(keycode == '13') {
+						e.preventDefault();
+						//请求搜索接口  
+						if(mui('#searchInp')[0].value) {
+							$('#dataList').html('');
+							getListData({
+								num: 1,
+								size: 10
+							})
+						} else {
+							mui.toast("请输入设备ID");
+						}
+					}
+				})
+				document.getElementById('searchBtn').addEventListener('tap', function() {
+					if(mui('#searchInp')[0].value) {
+						$('#dataList').html('');
+						getListData({
+							num: 1,
+							size: 10
+						})
+					} else {
+						mui.toast("请输入设备ID");
+					}
+				})
+			</script>
+	</body>
+
+</html>

+ 828 - 0
equipManage/sex_trap_detail1.html

@@ -0,0 +1,828 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link href="../css/common.css" rel="stylesheet" />
+
+		<style type="text/css">
+			.mui-content {
+				background: #fff;
+			}
+			
+			.iconfont {
+				font-size: 35px;
+				color: #3bb9e7;
+				/*font-weight: bold;*/
+				line-height: 80px;
+				margin: 10px 10px 10px 20px;
+			}
+			
+			.equipState {
+				font-size: 18px;
+				margin-top: 14px;
+				color: #333;
+				text-align: -webkit-center;
+				color: #21b2e7;
+			}
+			
+			#detial>div {
+				border-bottom: 2px solid #eee;
+			}
+			
+			#detial>div:nth-of-type(odd) {
+				/*border-right: 2px solid #eee;*/
+			}
+			
+			.mui-table-view:after,
+			.mui-table-view:before {
+				height: 2px;
+				background-color: #eee;
+			}
+			
+			@media(max-width: 400px) {
+				.mui-col-sm-6 {
+					width: 50%;
+				}
+			}
+			/*设置*/
+			
+			#detial .mui-navigate-right {
+				line-height: 80px;
+			}
+			
+			#detial .mui-navigate-right:after,
+			#detial .mui-push-right:after {
+				font-size: 33px;
+				color: #3bb9e7;
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+			
+			.areaTitle {
+				color: #424242;
+				padding-left: 5px;
+				border-left: 5px solid #5870f6;
+				font-weight: bold;
+				font-size: 16px;
+			}
+			
+			.detialBox .fa {
+				padding-right: 5px;
+				color: #ff6e00;
+			}
+			#adminOperate{
+				display: none;
+			}
+			.btns{
+				padding-top: 20px;
+				text-align: center;
+			}
+			.btns p{
+				margin: 10px 0;
+			}
+			.btns p button{
+				width: 120px;
+				border-radius: 50px;
+			}
+			.equipFun {
+			    text-align: -webkit-center;
+			}
+			/*设备数据*/
+			.equipmentBox {
+				margin: 80px 0 0 0;
+			}
+			.annular {
+				background: url(../images/annular.png);
+				background-repeat:no-repeat;
+				background-position: center;
+				height: 150px;
+				/*height: 100%;*/
+				width: 33%;
+				background-size: 100%;
+			}
+			.equipmentBox_val {
+
+			}
+			.unit {
+				font-size: 15px;
+			}
+			.stateList {
+				/*border: 1px solid #000;*/
+				width: 30%;
+			}
+			#detial {
+				margin-left: 16px;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">性诱设备</h1>
+			<a class="headRightIcon mui-icon mui-icon-loop mui-pull-right" onclick="location.reload();"></a>
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll">
+				<div id="dataList">
+					<ul class="mui-table-view" id="equip">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">设备信息</h1>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipId"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipName"></p>
+						</li>
+						<!--<li class="mui-table-view-cell">
+							<p id="equipCode"></p>
+						</li>-->
+						<li class="mui-table-view-cell">
+							<p id="equipType"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="upl_time"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="lat_lng"></p>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<li class="mui-table-view-cell" id="configuration">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cogs" aria-hidden="true"></i> 设备配置
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="lookHistoryData">
+							<a class="mui-navigate-right">
+								<i class="fa fa-list" aria-hidden="true"></i> 查看历史数据
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="debug">
+							<a class="mui-navigate-right">
+								<i class="fa fa-wrench" aria-hidden="true"></i> 调试
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="adminOperate">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cog" aria-hidden="true"></i> 操作
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+					</ul>
+					
+					
+					<div class="mui-table-view-cell">
+						<h1 class="areaTitle">设备状态</h1>
+					</div>
+					<!--测试-->
+						<div class="mui-row" id="detial">
+						<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState" id="ds"></p>
+								<p class="equipFun">设备开关</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState" id="onOff"></p>
+								<p class="equipFun">工作状态</p>
+							</div>
+						</div>
+						<!--<div class="mui-col-sm-3">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState" id="ws"></p>
+								<p class="equipFun">电池状态</p>
+							</div>
+						</div>-->
+						<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState" id="cs"></p>
+								<p class="equipFun">充电状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState" id="rps"></p>
+								<p class="equipFun">雨控状态</p>
+							</div>
+						</div>
+
+						<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState" id="tps"></p>
+								<p class="equipFun">温控状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState" id="dps"></p>
+								<p class="equipFun">倾倒状态</p>
+							</div>
+						</div>
+						<!--<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState">--</p>
+								<p class="equipFun">--</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="mui-pull-left">
+							</div>
+							<div class="">
+								<p class="equipState">--</p>
+								<p class="equipFun">--</p>
+							</div>
+						</div>-->
+					</div>
+					<!--测试-->
+					
+					
+					<!--设备数据测试-->
+					<div class="mui-table-view-cell">
+						<h1 class="areaTitle">设备数据</h1>
+					</div>
+					<div class="mui-row" id="detial">
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="cv"></p>
+								<p class="equipFun">充电电压</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="bv"></p>
+								<p class="equipFun">电池电压</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="at"></p>
+								<p class="equipFun">环境温度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="ah"></p>
+								<p class="equipFun">环境湿度</p>
+							</div>
+						</div>
+
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="infr_ct"></p>
+								<p class="equipFun">红外计数值</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="volt_ct"></p>
+								<p class="equipFun">高压计数值</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="wind_drec"></p>
+								<p class="equipFun">风向</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="wind_sped"></p>
+								<p class="equipFun">风速</p>
+							</div>
+						</div>
+						<!--<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="cs"></p>
+								<p class="equipFun">数据上传间隔</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="cs"></p>
+								<p class="equipFun">信号强度</p>
+							</div>
+						</div>-->
+					</div>
+					<!--设备数据测试-->
+					
+					
+				</div>
+			</div>
+			<!--调试框-->
+			<div id="debugPopover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 220px;background-color: #fff;border-radius: 10px 10px 0 0;">
+				<div class="mui-popover-arrow"></div>
+				<div class="btns">
+					<p><button type="button" onclick="popupFrame('开启设备',7)" class="mui-btn mui-btn-danger">开启</button></p>
+					<p><button type="button" onclick="popupFrame('关闭设备',8)" class="mui-btn mui-btn-danger">关闭</button></p>
+					<p><button type="button" onclick="popupFrame('重启设备',1)" class="mui-btn mui-btn-danger">重启</button></p>
+					<p><button type="button" onclick="popupFrame('进行清网',9)" class="mui-btn mui-btn-danger">清网</button></p>
+				</div>
+			</div>
+			<!--操作框-->
+			<div id="operatePopover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 300px;background-color: #fff;border-radius: 10px 10px 0 0;">
+				<div class="mui-popover-arrow">1</div>
+				<div class="btns">
+					<p><button type="button" onclick="popupFrame('开启设备',7)" class="mui-btn mui-btn-danger">开启</button></p>
+					<p><button type="button" onclick="popupFrame('关闭设备',8)" class="mui-btn mui-btn-danger">关闭</button></p>
+					<p><button type="button" onclick="popupFrame('重启设备',1)" class="mui-btn mui-btn-danger">重启</button></p>
+					<p><button type="button" onclick="popupFrame('进行清网',9)" class="mui-btn mui-btn-danger">清网</button></p>
+					<p><button type="button" onclick="popupFrame('升级',2)" class="mui-btn mui-btn-danger">升级</button></p>
+					<p><button type="button" onclick="popupFrame('查询mqtt网络配置',3)" class="mui-btn mui-btn-danger">mqtt网络配置</button></p>
+				</div>
+			</div>
+			<!--sim卡-->
+			<div id="popover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 310px;background-color: #fff;">
+				<div class="mui-popover-arrow"></div>
+				<!--<div class="popoverheader">
+					<div class="text"></div>
+					<a href="#popover"><img src="../image/close.png" alt=""></a>
+				</div>-->
+				<div id="simDetial">
+					
+				</div>
+				<div class="mui-table-view mui-table-view-chevron next">
+					<a href="#popover" class="x-next add">我知道了</a>
+				</div>
+			</div>
+			<!--mqtt网络配置-->
+			<div id="mqttConf" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 310px;background-color: #fff;">
+				<div class="mui-popover-arrow"></div>
+				<!--<div class="popoverheader">
+					<div class="text"></div>
+					<a href="#popover"><img src="../image/close.png" alt=""></a>
+				</div>-->
+				<div id="mqttConfDetial">
+					
+				</div>
+				<div class="mui-table-view mui-table-view-chevron next">
+					<a href="#mqttConf" class="x-next add">我知道了</a>
+				</div>
+			</div>
+		</div>
+		<div id="map" style="display: none;"></div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
+		<script type="text/javascript">
+			var equipId;
+			var iccid;
+			//配置需要参数
+			var confDatF;
+			var confTurnT;
+			var confPicT;
+			var confPicF;
+			var confSt;
+			var confEt;
+			var confTs;
+			
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				$('#equipId').html('设备ID:' + equipId);
+				console.log(equipId);
+				downCallback()
+				var isuser = plus.storage.getItem('isuser');
+				if(isuser == 'admin'){
+					$('#adminOperate').show();
+				}
+				var map = new BMap.Map("map"); //
+				geoc = new BMap.Geocoder();
+				function downCallback() {
+					$.ajax({
+						url: 'http://120.27.222.26/app_equipmanage_detail',
+						data: {
+							'etype': 'xycb',
+							'equip_id': equipId,
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						success: function(data) {
+							var equip_name = data.equip_name || '无';
+							$('#equipName').html('设备名称:' + equip_name);
+							$('#upl_time').html('上报时间:' + data.upl_time);
+							var stat = eval('(' + data.ybq_status + ')');
+							var point = new BMap.Point(stat.lng, stat.lat);
+							geoc.getLocation(point, function (rs) {
+							    var addComp = rs.addressComponents;
+								$('#lat_lng').html('位置:'  + addComp.province + ", " + addComp.city + ", " + addComp.district);
+							});
+							$('#equipCode').html('设备编号:' + stat.dev_num);
+							if(stat.proj == "SEX_TRAP_1"){								
+								$('#equipType').html('设备型号:I');
+							}else if(stat.proj == "SEX_TRAP_2"){								
+								$('#equipType').html('设备型号:II');
+							}
+							var ds = stat.ds == 0 ? '关闭' : '开机';
+							$('#ds').html(ds);
+							var onOff = data.is_online == 0 ? '离线' : '在线';
+							$('#onOff').html(onOff);
+							var ws = stat.ws == 0 ? '待机' : '工作';
+							$('#ws').html(ws);
+							if(stat.bs != ''){
+								if(stat.bs == 0){
+									var bs = '正常';
+								}else if(stat.bs == 1){
+									var bs = '欠压';
+								}else if(stat.bs == 2){
+									var bs = '过压';
+								}
+								$('#bs').html(bs);
+							}else{
+								$('#bs').html('--');
+							}
+							
+							if(stat.bv != ''){
+								$('#bv').html(stat.bv/1000 + '<span class="unit">v</span>');
+							}else{
+								$('#bv').html('--');
+							}
+							if(stat.cv !== ''){								
+								$('#cv').html(stat.cv/1000 + '<span class="unit">v</span>');
+							}else{
+								$('#cv').html('--');
+							}
+							$('#dver').html(stat.dver);
+							if(stat.cs !== ''){		
+								var cs = stat.cs == 0 ? '未充电' : '充电';
+							}else{
+								var cs = '--';
+							}
+							if (stat.rps !== '') {
+									var rps = stat.rps == 0 ? '正常' : '雨控'
+							} else {
+								var rps = '--'
+							}
+							if (stat.tps !== '') {
+								var tps = stat.tps == 0 ? '正常' : '温控'
+							} else {
+								var tps = '--'
+							}
+							if (stat.dps !== '') {
+								var dps = stat.dps == 0 ? '正常' : '倾倒'
+							} else {
+								var dps = '--'
+							}
+							if (stat.infr_ct !== '') {
+								var infr_ct = stat.infr_ct
+							} else {
+								var infr_ct = '--'
+							}
+							if (stat.volt_ct !== '') {
+								var volt_ct = stat.volt_ct
+							} else {
+								var volt_ct = '--'
+							}
+							if (stat.wind_drec !== '') {
+								var wind_drec = stat.wind_drec
+							} else {
+								var wind_drec = '--'
+							}
+							if (stat.wind_sped !== '') {
+								var wind_sped = stat.wind_sped
+							} else {
+								var wind_sped = '--'
+							}
+							$('#wind_sped').html(wind_sped + '<span class="unit">M/S</span>')
+							$('#wind_drec').html(wind_drec)
+ 							$('#volt_ct').html(volt_ct)
+							$('#infr_ct').html(infr_ct)
+							$('#dps').html(dps)
+							$('#tps').html(tps)
+							$('#rps').html(rps)
+							$('#cs').html(cs);
+							$('#dat_f').html(stat.dat_f);
+							$('#cpu_tmp').html(stat.cpu_tmp/1000);
+							$('#csq').html(stat.csq);
+							if(stat.at != ''){								
+								$('#at').html(stat.at + '<span class="unit">°C</span>');
+							}else{
+								$('#at').html('-');
+							}
+							if(stat.ah != ''){
+								$('#ah').html(stat.ah + '<span class="unit">RH</span>');								
+							}else{
+								$('#ah').html('--');	
+							}
+							iccid = stat.iccid;
+							confDatF = stat.dat_f;
+							confTurnT = stat.turn_t;
+							confPicT = stat.pic_t;
+							confPicF = stat.pic_f;
+							confSt = stat.st
+							confEt = stat.et
+							confTs = stat.ts
+						},
+						error: function(xhr, type, errorThrown) {
+							//联网失败的回调,隐藏下拉刷新的状态
+							mescroll.endErr();
+							mui.toast('数据请求失败');
+						}
+					});
+				}
+				
+				//查看图片
+//				document.getElementById('lookImg').addEventListener('tap', function() {
+//					mui.openWindow({
+//						url: 'sex_trap_photo2.html',
+//						id: 'sex_trap_photo2',
+//						extras: {
+//							equipId: equipId,
+//						}
+//					})
+//				})
+				//配置
+				document.getElementById('configuration').addEventListener('tap', function() {
+					console.log(confDatF)
+					console.log(confEt)
+					console.log(confDatF)
+					console.log(confSt)
+					mui.openWindow({
+						url: 'sex_trap_detail1_config.html',
+						id: 'sex_trap_detail1_config',
+						extras: {
+							equipId: equipId,
+							confDatF: confDatF,
+							confTurnT: confTurnT,
+							confPicT: confPicT,
+							confPicF: confPicF,
+							confSt: confSt,
+							confEt: confEt,
+							confTs: confTs,
+							
+						}
+					})
+				})
+				//sim卡查新  
+				document.getElementById('simCodeSearch').addEventListener('tap', function() {
+					if(iccid) {
+						$.ajax({
+							url: 'http://120.27.222.26/siminfo',
+							data: {
+								simid: iccid,
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								var dat = data.data;
+								if(data.code == 0) {
+									var status;
+									if(dat.account_status == "0") {
+										status = "未知";
+									} else if(dat.account_status == "1") {
+										status = "测试期";
+									} else if(dat.account_status == "2") {
+										status = "沉默期";
+									} else if(dat.account_status == "3") {
+										status = "使用中";
+									} else if(dat.account_status == "4") {
+										status = "停机";
+									} else if(dat.account_status == "5") {
+										status = "停机保号";
+									} else if(dat.account_status == "6") {
+										status = "预销号";
+									} else if(dat.account_status == "7") {
+										status = "销号";
+									}
+									var usage;
+									if(dat.iccid) {
+										usage = dat.data_usage;
+									} else {
+										usage.innerHTML = '--';
+									}
+									var balance;
+									if(dat.iccid) {
+										balance = dat.data_balance;
+									} else {
+										balance = '--';
+									}
+									var time;
+									if(dat.iccid) {
+										var timestamp4 = new Date(dat.expiry_date * 1000); //直接用 new Date(时间戳) 格式转化获得当前时间
+										time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
+									} else {
+										time = '--';
+									}
+									html = '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + iccid + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
+									$('#mqttConfDetial').html(html);
+									mui('.mui-popover').popover('show', document.getElementById("popover"));
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+
+					} else {
+						mui.toast('未查询到SIM卡号');
+					}
+				})
+				//统计详情
+//				document.getElementById('lookStatsData').addEventListener('tap', function() {
+//					mui.openWindow({
+//						url: 'sex_trap_detail_echart.html',
+//						id: 'sex_trap_detail_echart',
+//						extras: {
+//							equipId: equipId
+//						}
+//					})
+//				})
+				//历史数据
+				document.getElementById('lookHistoryData').addEventListener('tap', function() {
+					mui.openWindow({
+						url: 'sex_trap_detail_list.html',
+						id: 'sex_trap_detail_list',
+						extras: {
+							equipId: equipId
+						}
+					})
+				})
+				//调试
+				document.getElementById('debug').addEventListener('tap', function() {
+					mui('#debugPopover').popover('show', document.getElementById("debug"));
+				})
+				//操作
+				document.getElementById('adminOperate').addEventListener('tap', function() {
+					mui('#operatePopover').popover('show', document.getElementById("adminOperate"));
+				})
+			})
+			
+			function popupFrame(txt,flag){
+				var txtMsg = '是否'+ txt +'?';
+				mui.confirm(txtMsg,'控制',['取消','确定'],function(e){
+					if(e.index == 0){
+//						alert(0)
+					}else if(e.index == 1){
+						if(flag == 1){
+			                var data = {
+			                  ext:'reboot',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 2){
+			                var data = {
+			                  ext:'update',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 3){
+			                var data = {
+			                  ext:'mqttconf',
+			                }
+			                var fun = function(){
+				                setTimeout(function(){
+				                    mui.ajax('http://120.27.222.26/sex_mqtt_detail', {
+					                    type:'post',
+					                    data:{
+					                        e_id:equipId
+					                    },
+				                      	dataType:'json',
+					                    beforeSend: function() {
+											plus.nativeUI.showWaiting("分配中...");
+										},
+										complete: function() {											
+											plus.nativeUI.closeWaiting();
+										},
+				                      	success:function(data){
+				                          var content='<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">ip:'+data.ip+'<br />port:'+data.port+'<br />sub:'+data.sub+'<br />pub:'+data.pub+'<br />lastwill:'+data.lastwill+'<br />keepalive:'+data.keepalive+'<br />username:'+data.username+'<br />stamp:'+data.stamp+'</div>';
+				                          $('#mqttConfDetial').html(content);
+				                          mui('.mui-popover').popover('toggle',document.getElementById("mqttConf"));
+				                      	},
+				                      	error:function(type){
+				                        	console.log(type)
+				                      	}
+				                    })
+				                },500)
+			                };
+			            }else if(flag == 4){
+			                var data = {
+			                  ext:'takephoto',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 5){
+			                var data = {
+			                  ext:'turn',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 6){
+			                var data = {
+			                  ext:'repower',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 7){
+			                var data = {
+			                  ext:'ds1',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 8){
+			                var data = {
+			                  ext:'ds0',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 9){
+			                var data = {
+			                  ext:'clearnet',
+			                }
+			                var fun = function(){};
+			            }
+			            sendCtrlFun(data,fun)
+					}
+				},'div')
+			}
+			
+			function sendCtrlFun(data,callback){
+		        data.e_id = equipId;
+		        mui.ajax('http://120.27.222.26/sex_mqtt_v1', {
+		          type:'post',
+		          data:data,
+		           beforeSend: function() {
+						plus.nativeUI.showWaiting("分配中...");
+					},
+					complete: function() {
+						plus.nativeUI.closeWaiting();
+					},
+		          success:function(data){
+		            if(data == 0){
+		              callback();
+		              mui.toast('下发成功',{ duration:'long', type:'div' }) 
+		            }
+		          },
+		          error:function(type){
+		            console.log(type)
+		          }
+		        })
+		    }
+		</script>
+	</body>
+
+</html>

+ 470 - 0
equipManage/sex_trap_detail1_config.html

@@ -0,0 +1,470 @@
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<title>Hello MUI</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<!--标准mui.css-->
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+
+		<link rel="stylesheet" href="../css/common.css">
+		<link rel="stylesheet" href="../css/iconfont.css">
+		<!--<link rel="stylesheet" href="../css/rangeslider.css">-->
+		<link rel="stylesheet" href="http://www.yfzhwlw.com/static/lib/css/jquery-ui.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.poppicker.css" />
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<!--App自定义的css-->
+		<style type="text/css">
+			.mui-table-view-cell.mui-active {
+				background-color: #fff;
+			}
+			
+			.mui-input-range .mui-tooltip {
+				display: none;
+			}
+			
+			.mui-radio input[type=radio] {
+				top: -2px;
+			}
+			
+			.equipOption {
+				color: #21B2E7 !important;
+				margin-bottom: 15px;
+			}
+			
+			.mui-checkbox input[type=checkbox]:before,
+			.mui-radio input[type=radio]:before {
+				font-size: 22px;
+			}
+			/*提交按钮*/
+			
+			.equipTitle {
+				color: #21b2e7;
+				font-size: 14px;
+			}
+			
+			.mui-table-view-cell p {
+				color: #333;
+				font-size: 16px;
+				margin-top: 4px;
+			}
+			/*单选按钮*/
+			
+			.mui-radio label {
+				padding-right: 37px;
+			}
+			/*滑块*/
+			.sliderParent{
+				display: flex;
+				align-items: center;
+			}
+			.sliderParent >div{
+				flex: 1;
+				margin: 0 10px;
+			}
+			
+			/*.sliderDiv {
+				width: 80%;
+				display: inline-block;
+			}*/
+			
+			.rangeslider--horizontal {
+				height: 12px;
+			}
+			
+			.rangeslider__fill {
+				background: #7ed7ff;
+			}
+			
+			.rangeslider__handle {
+				width: 20px;
+				height: 20px;
+			}
+			
+			.rangeslider--horizontal .rangeslider__handle {
+				top: -5px;
+			}
+			
+			.rangeslider__handle:after {
+				width: 8px;
+				height: 8px;
+			}
+			
+			.equipOptionInitVal {
+				display: inline-block;
+				width: 15px;
+				text-align: right;
+			}
+			/*滑块颜色*/
+			.ui-widget-content{
+				background: #e0e0e0;
+			}
+			.ui-widget-header{
+				background: #21b2e7;
+			}
+			/*开始结束时间选择*/
+			
+			.timeItem {
+				border: 1px solid #e6e6e6;
+				margin-bottom: 5px;
+				line-height: 30px;
+				border-radius: 5px;
+				margin-top: 5px;
+			}
+			
+			.timeItem>button {
+				border: none;
+				background: #e6e6e6;
+				margin-right: 10px;
+			}
+		</style>
+
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title"></h1>
+			<!--<a class="headRightIcon fa fa-cloud-upload mui-pull-right" onclick="sendData()">提交</a>-->
+		</header>
+		<div class="mui-content">
+			<ul class="mui-table-view">
+				<li class="mui-table-view-cell">
+					<p class="equipOption">数据上传时间间隔:</p>
+					<div class="sliderParent">
+						<span class="equipOptionInitVal">10</span>
+							<div class="sliderDiv">
+								<div class="slider" id="dropTime-slider"></div>
+							</div>
+						<span id="dropTime">120</span>
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<div>时控开关</div>
+					<div class="mui-switch mui-switch-mini mui-switch-blue" id="ReceiveNews">
+						<div class="mui-switch-handle"></div>
+					</div>
+				</li>
+				<li class="mui-table-view-cell" id="timePattern">
+					<p class="equipOption">时控开始和结束时间:</p>
+					<div class="">
+						<div class="timeItem">
+							<button id='pickTimeBtn' type="button" class="mui-btn">开始时间</button><span id="begin"></span>
+						</div>
+						<div class="timeItem">
+							<button id='pickTimeBtn2' type="button" class="mui-btn">结束时间</button><span id="end"></span>
+						</div>
+					</div>
+				</li>
+			</ul>
+		</div>
+	</body>
+	<script src="../js/mui.min.js"></script>
+	<script src="../js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
+	<!--<script src="../js/rangeslider.js"></script>-->
+	<script src="http://www.yfzhwlw.com/static/lib/js/jquery-ui.min.js"></script>
+	<script src="http://www.yfzhwlw.com/static/lib/js/jquery.ui.touch-punch.min.js"></script>
+	<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+	<script src="../js/common.js"></script>
+	<script>
+		mui.init();
+		var equipId;
+		var confDatF;
+		var confTurnT;
+		var confPicT;
+		var confPicF;
+		var confSt;
+		var confEt;
+		var confTs;
+		mui.plusReady(function() {
+			var self = plus.webview.currentWebview();
+			equipId = self.equipId;
+			confDatF = self.confDatF || 10;
+			confTurnT = self.confTurnT || 0;
+			confPicT = self.confPicT || 0;
+			confPicF = self.confPicF || 1;
+			confSt = self.confSt
+			confEt = self.confEt
+			confTs = self.confTs
+			document.getElementById("title").innerHTML = equipId;
+			// 数据上传时间间隔
+		     $("#dropTime-slider").css('width', '100%').slider({
+		        value: confDatF,
+		        range: "min",
+		        min: 10,
+		        max: 120,
+		        step: 10,
+		        slide: function (event, ui) {
+		          	var val = parseInt(ui.value);
+		          	$('#dropTime').html(val);
+		        },
+		        stop: function( event, ui ) {
+			        console.log(ui.value)
+			        $('#dropTime').html(ui.value);
+			        mui.confirm('是否修改数据上传时间?','上报时间',['取消','确定'],function(e){
+			        	console.log(e.index)
+			        	if (e.index == 1) {
+			        		//数据上传时间间隔
+	                        var data = {
+				                ext:'data_tim',
+				                dat_f:ui.value,
+				            }
+		                    sendCtrlFun(data,function(){
+				                confDatF = ui.value;
+				            })
+	                    }else{
+	                    	$("#dropTime-slider").slider('value', confDatF); 
+				      		$('#dropTime').html(confDatF);
+	                    }
+			        },'div')
+		        	
+		        }
+		    });
+		    $('#dropTime').html(confDatF);
+		  
+
+			mui('#begin')[0].innerHTML = confSt;
+			mui('#end')[0].innerHTML = confEt;
+		})
+		
+		function sendCtrlFun(data,callback){
+	        data.e_id = equipId;
+	        mui.ajax('http://120.27.222.26/sex_mqtt_v1', {
+	          type:'post',
+	          data:data,
+	          success:function(data){
+	            if(data == 0){
+	              callback();
+	            }
+	          },
+	          error:function(type){
+	            console.log(type)
+	          }
+	        })
+	    }
+
+
+		// 将对应值写入对应文本框
+		function valueOutput(element) {
+			var value = element.value;
+			var output = element.parentNode.nextElementSibling;
+			output.innerHTML = value;
+		}
+		//自定义时间值
+		var picker;
+
+		function PopPicker() {
+			picker = new mui.PopPicker();
+			picker.setData([{
+				value: "0",
+				text: "0"
+			}, {
+				value: "1",
+				text: "1"
+			}, {
+				value: "2",
+				text: "2"
+			}, {
+				value: "3",
+				text: "3"
+			}, {
+				value: "4",
+				text: "4"
+			}, {
+				value: "5",
+				text: "5"
+			}, {
+				value: "6",
+				text: "6"
+			}, {
+				value: "7",
+				text: "7"
+			}, {
+				value: "8",
+				text: "8"
+			}, {
+				value: "9",
+				text: "9"
+			}, {
+				value: "10",
+				text: "10"
+			}, {
+				value: "11",
+				text: "11"
+			}, {
+				value: "12",
+				text: "12"
+			}, {
+				value: "13",
+				text: "13"
+			}, {
+				value: "14",
+				text: "14"
+			}, {
+				value: "15",
+				text: "15"
+			}, {
+				value: "16",
+				text: "16"
+			}, {
+				value: "17",
+				text: "17"
+			}, {
+				value: "18",
+				text: "18"
+			}, {
+				value: "19",
+				text: "19"
+			}, {
+				value: "20",
+				text: "20"
+			}, {
+				value: "21",
+				text: "21"
+			}, {
+				value: "22",
+				text: "22"
+			}, {
+				value: "23",
+				text: "23"
+			}, ])
+		}
+		function PopPicker2() {
+			picker = new mui.PopPicker();
+			picker.setData([{
+				value: "1",
+				text: "1"
+			},{
+				value: "2",
+				text: "2"
+			}, {
+				value: "3",
+				text: "3"
+			}, {
+				value: "4",
+				text: "4"
+			}, {
+				value: "6",
+				text: "6"
+			}, {
+				value: "8",
+				text: "8"
+			}, {
+				value: "12",
+				text: "12"
+			}, {
+				value: "24",
+				text: "24"
+			}])
+		}
+		//开始时间选择器
+		document.getElementById("pickTimeBtn").addEventListener('tap', function() {
+			PopPicker()
+			picker.show(function(getSelectedItems) {
+				document.getElementById('begin').innerHTML = getSelectedItems[0].value;
+				var begin = mui('#begin')[0].innerHTML;
+				var end = mui('#end')[0].innerHTML;
+				if(begin && end){
+					var data = {
+			            ext:'work_tim1',
+			            st:begin,
+			            et:end,
+			       }
+			        timeData(data,function(){
+			          	confPicT = begin
+			          	confPicF = end
+			        })
+				}
+			})
+		});
+		//结束时间选择器
+		document.getElementById("pickTimeBtn2").addEventListener('tap', function() {
+			PopPicker2()
+			picker.show(function(getSelectedItems) {
+				document.getElementById('end').innerHTML = getSelectedItems[0].value;
+				var begin = mui('#begin')[0].innerHTML;
+				var end = mui('#end')[0].innerHTML;
+				if(begin && end){
+					var data = {
+			            ext:'work_tim1',
+			            st:begin,
+			            et:end,
+			        }
+			        timeData(data,function(){
+			          	confPicT = begin
+			          	confPicF = end
+			        })
+				}
+			})
+		});
+		
+		//时控开关
+			function timeData(data,callback){
+				document.getElementById("ReceiveNews").addEventListener("toggle", function(event) {
+					if(event.detail.isActive) {
+						console.log("你启动了开关");
+							mui.confirm('是否修改时控开始和结束时间?','时控开始和结束时间',['取消','确定'],function(e){
+				        	console.log(e.index)
+				        	if (e.index == 1) {
+			                    sendCtrlFunA(data,function(){
+					              
+					            })
+		                   }else{
+								console.log('取消了')
+		                    }
+				        },'div')
+					} else {
+						mui.confirm('是否关闭时控开关?','关闭时控开关',['取消','确定'],function(e){
+				        	console.log(e.index)
+				        	if (e.index == 1) {
+			                    offTime(data,function(){
+					              
+					            })
+		                   }else{
+								console.log('取消了')
+		                    }
+				        },'div')
+						console.log("你关闭了开关");
+					}
+				})
+	    }
+			function sendCtrlFunA(data,callback){
+				data.e_id = equipId;
+				console.log(data)
+		         mui.ajax('http://120.27.222.26/sex_mqtt_v1', {
+		          type:'post',
+		          data:data,
+		          success:function(data){
+		            if(data == 0){
+		              callback();
+		            }
+		          },
+		          error:function(type){
+		            console.log(type)
+		          }
+		        })
+	    }
+			function offTime(data,callback) {
+				delete data.st
+				delete data.et
+				data.e_id = equipId;
+				data.ext = "work_tim0"
+		         mui.ajax('http://120.27.222.26/sex_mqtt_v1', {
+		          type:'post',
+		          data:data,
+		          success:function(data){
+		            if(data == 0){
+		              callback();
+		            }
+		          },
+		          error:function(type){
+		            console.log(type)
+		          }
+		        })
+			}
+	</script>
+
+</html>

+ 737 - 0
equipManage/sex_trap_detail2.html

@@ -0,0 +1,737 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<link href="../css/mui.min.css" rel="stylesheet" />
+		<link href="../css/common.css" rel="stylesheet" />
+
+		<style type="text/css">
+			.mui-content {
+				background: #fff;
+			}
+			
+			.iconfont {
+				font-size: 35px;
+				color: #3bb9e7;
+				/*font-weight: bold;*/
+				line-height: 80px;
+				margin: 10px 10px 10px 20px;
+			}
+			
+			.equipState {
+				font-size: 18px;
+				margin-top: 14px;
+				color: #333;
+				text-align: -webkit-center;
+				color: #21b2e7;
+			}
+			
+			#detial>div {
+				border-bottom: 2px solid #eee;
+			}
+			
+			#detial>div:nth-of-type(odd) {
+				/*border-right: 2px solid #eee;*/
+			}
+			
+			.mui-table-view:after,
+			.mui-table-view:before {
+				height: 2px;
+				background-color: #eee;
+			}
+			
+			@media(max-width: 400px) {
+				.mui-col-sm-6 {
+					width: 50%;
+				}
+			}
+			/*设置*/
+			
+			#detial .mui-navigate-right {
+				line-height: 80px;
+			}
+			
+			#detial .mui-navigate-right:after,
+			#detial .mui-push-right:after {
+				font-size: 33px;
+				color: #3bb9e7;
+			}
+			
+			.nullData {
+				top: 45px;
+			}
+			
+			.areaTitle {
+				color: #424242;
+				padding-left: 5px;
+				border-left: 5px solid #5870f6;
+				font-weight: bold;
+				font-size: 16px;
+			}
+			
+			.detialBox .fa {
+				padding-right: 5px;
+				color: #ff6e00;
+			}
+			#adminOperate{
+				display: none;
+			}
+			.btns{
+				padding-top: 20px;
+				text-align: center;
+			}
+			.btns p{
+				margin: 10px 0;
+			}
+			.btns p button{
+				width: 120px;
+				border-radius: 50px;
+			}
+			.equipFun {
+			    text-align: -webkit-center;
+			}
+			/*设备数据*/
+			.equipmentBox {
+				margin: 80px 0 0 0;
+			}
+			.annular {
+				background: url(../images/annular.png);
+				background-repeat:no-repeat;
+				background-position: center;
+				height: 150px;
+				/*height: 100%;*/
+				width: 33%;
+				background-size: 100%;
+			}
+			.equipmentBox_val {
+
+			}
+			.stateList {
+				/*border: 1px solid #000;*/
+				width: 30%;
+			}
+			#detial {
+				margin-left: 16px;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">性诱设备</h1>
+			<a class="headRightIcon mui-icon mui-icon-loop mui-pull-right" onclick="location.reload();"></a>
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll">
+				<div id="dataList">
+					<ul class="mui-table-view" id="equip">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">设备信息</h1>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipId"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipName"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipCode"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="equipType"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="upl_time"></p>
+						</li>
+						<li class="mui-table-view-cell">
+							<p id="lat_lng"></p>
+						</li>
+					</ul>
+					<ul class="mui-table-view detialBox">
+						<li class="mui-table-view-cell">
+							<h1 class="areaTitle">配置设备操作</h1>
+						</li>
+						<li class="mui-table-view-cell" id="lookImg">
+							<a class="mui-navigate-right">
+								<i class="fa fa-file-image-o" aria-hidden="true"></i> 查看图片
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="configuration">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cogs" aria-hidden="true"></i> 设备配置
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="simCodeSearch">
+							<a class="mui-navigate-right">
+								<i class="fa fa-search" aria-hidden="true"></i> SIM卡查询
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="lookStatsData">
+							<a class="mui-navigate-right">
+								<i class="fa fa-bar-chart-o" aria-hidden="true"></i> 统计详情
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="lookHistoryData">
+							<a class="mui-navigate-right">
+								<i class="fa fa-list" aria-hidden="true"></i> 历史数据
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="debug">
+							<a class="mui-navigate-right">
+								<i class="fa fa-wrench" aria-hidden="true"></i> 调试
+							</a>
+						</li>
+						<li class="mui-table-view-cell" id="adminOperate">
+							<a class="mui-navigate-right">
+								<i class="fa fa-cog" aria-hidden="true"></i> 操作
+							</a>
+						</li>
+						<!--<li class="mui-table-view-cell" id="downInquire">
+							<a class="mui-navigate-right">
+								<i class="fa fa-refresh" aria-hidden="true"></i> 查询最近状态
+							</a>
+						</li>-->
+					</ul>
+					
+					<!-- 测试设备状态 -->
+					<div class="mui-table-view-cell">
+						<h1 class="areaTitle">设备状态</h1>
+					</div>
+					<div class="mui-row" id="detial">
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState" id="ds"></p>
+								<p class="equipFun">设备开关</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState" id="onOff"></p>
+								<p class="equipFun">在线状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState" id="ws"></p>
+								<p class="equipFun">工作状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState" id="bs"></p>
+								<p class="equipFun">电池状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState" id="bv"></p>
+								<p class="equipFun">电池电压</p>
+							</div>
+						</div>
+
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState" id="cv"></p>
+								<p class="equipFun">充电电压</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState" id="dver"></p>
+								<p class="equipFun">版本号</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 stateList">
+							<div class="">
+							</div>
+							<div class="">
+								<p class="equipState">--</p>
+								<p class="equipFun">--</p>
+							</div>
+						</div>
+					</div>
+					<!-- 测试设备状态 -->
+					
+					<!-- 测试设备数据 -->
+					<div class="mui-table-view-cell">
+						<h1 class="areaTitle">设备数据</h1>
+					</div>
+					<div class="mui-row" id="detial">
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="cs"></p>
+								<p class="equipFun">充电状态</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="dat_f"></p>
+								<p class="equipFun">数据上传间隔</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="cpu_tmp"></p>
+								<p class="equipFun">CPU温度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="csq"></p>
+								<p class="equipFun">信号强度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="at"></p>
+								<p class="equipFun">环境温度</p>
+							</div>
+						</div>
+						<div class="mui-col-sm-4 annular">
+							<div class="mui-pull-left">
+							</div>
+							<div class="equipmentBox">
+								<p class="equipState equipmentBox_val" id="ah"></p>
+								<p class="equipFun">环境湿度</p>
+							</div>
+						</div>
+					</div>
+					<!-- 测试设备数据 -->
+					
+					
+				</div>
+			</div>
+			<!--调试框-->
+			<div id="debugPopover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 260px;background-color: #fff;border-radius: 10px 10px 0 0;">
+				<div class="mui-popover-arrow"></div>
+				<div class="btns">
+					<p><button type="button" onclick="popupFrame('开启设备',7)" class="mui-btn mui-btn-danger">开启</button></p>
+					<p><button type="button" onclick="popupFrame('关闭设备',8)" class="mui-btn mui-btn-danger">关闭</button></p>
+					<p><button type="button" onclick="popupFrame('重启设备',1)" class="mui-btn mui-btn-danger">重启</button></p>
+					<p><button type="button" onclick="popupFrame('开启卷粘虫带',5)" class="mui-btn mui-btn-danger">卷粘虫带</button></p>
+					<p><button type="button" onclick="popupFrame('进行拍照',4)" class="mui-btn mui-btn-danger">拍照</button></p>
+				</div>
+			</div>
+			<!--操作框-->
+			<div id="operatePopover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 300px;background-color: #fff;border-radius: 10px 10px 0 0;">
+				<div class="mui-popover-arrow">1</div>
+				<div class="btns">
+					<p><button type="button" onclick="popupFrame('重启',1)" class="mui-btn mui-btn-danger">重启</button></p>
+					<p><button type="button" onclick="popupFrame('升级',2)" class="mui-btn mui-btn-danger">升级</button></p>
+					<p><button type="button" onclick="popupFrame('重新上电',6)" class="mui-btn mui-btn-danger">重新上电</button></p>
+					<p><button type="button" onclick="popupFrame('查询mqtt网络配置',3)" class="mui-btn mui-btn-danger">mqtt网络配置</button></p>
+					<p><button type="button" onclick="popupFrame('开启卷粘虫带',5)" class="mui-btn mui-btn-danger">卷粘虫带</button></p>
+					<p><button type="button" onclick="popupFrame('进行拍照',4)" class="mui-btn mui-btn-danger">拍照</button></p>
+				</div>
+			</div>
+			<!--sim卡-->
+			<div id="popover" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 310px;background-color: #fff;">
+				<div class="mui-popover-arrow"></div>
+				<!--<div class="popoverheader">
+					<div class="text"></div>
+					<a href="#popover"><img src="../image/close.png" alt=""></a>
+				</div>-->
+				<div id="simDetial">
+					
+				</div>
+				<div class="mui-table-view mui-table-view-chevron next">
+					<a href="#popover" class="x-next add">我知道了</a>
+				</div>
+			</div>
+			<!--mqtt网络配置-->
+			<div id="mqttConf" class="box mui-popover mui-poppicker mui-popover-action mui-popover-bottom" style="height: 310px;background-color: #fff;">
+				<div class="mui-popover-arrow"></div>
+				<!--<div class="popoverheader">
+					<div class="text"></div>
+					<a href="#popover"><img src="../image/close.png" alt=""></a>
+				</div>-->
+				<div id="mqttConfDetial">
+					
+				</div>
+				<div class="mui-table-view mui-table-view-chevron next">
+					<a href="#mqttConf" class="x-next add">我知道了</a>
+				</div>
+			</div>
+		</div>
+		<div id="map" style="display: none;"></div>
+		
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/common.js"></script>
+		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
+		<script type="text/javascript">
+			var equipId;
+			var iccid;
+			//配置需要参数
+			var confDatF;
+			var confTurnT;
+			var confPicT;
+			var confPicF;
+			
+			mui.init();
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				$('#equipId').html('设备ID:' + equipId);
+				console.log(equipId);
+				downCallback()
+				var isuser = plus.storage.getItem('isuser');
+				if(isuser == 'admin'){
+					$('#adminOperate').show();
+				}
+				var map = new BMap.Map("map"); //
+				geoc = new BMap.Geocoder();
+				function downCallback() {
+					$.ajax({
+						url: 'http://120.27.222.26/app_equipmanage_detail',
+						data: {
+							'etype': 'xycb',
+							'equip_id': equipId,
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						success: function(data) {
+							var equip_name = data.equip_name || '无';
+							$('#equipName').html('设备名称:' + equip_name);
+							$('#upl_time').html('上报时间:' + data.upl_time);
+							var stat = eval('(' + data.ybq_status + ')');
+							var point = new BMap.Point(stat.lng, stat.lat);
+							geoc.getLocation(point, function (rs) {
+							    var addComp = rs.addressComponents;
+								$('#lat_lng').html('位置:'  + addComp.province + ", " + addComp.city + ", " + addComp.district);
+							});
+							$('#equipCode').html('设备编号:' + stat.dev_num);
+							if(stat.proj == "SEX_TRAP_1"){								
+								$('#equipType').html('设备型号:I');
+							}else if(stat.proj == "SEX_TRAP_2"){								
+								$('#equipType').html('设备型号:II');
+							}
+							var ds = stat.ds == 0 ? '关闭' : '开机';
+							$('#ds').html(ds);
+							var onOff = data.is_online == 0 ? '离线' : '在线';
+							$('#onOff').html(onOff);
+							var ws = stat.ws == 0 ? '待机' : '工作';
+							$('#ws').html(ws);
+							if(stat.bs != ''){
+								if(stat.bs == 0){
+									var bs = '正常';
+								}else if(stat.bs == 1){
+									var bs = '欠压';
+								}else if(stat.bs == 2){
+									var bs = '过压';
+								}
+								$('#bs').html(bs);
+							}else{
+								$('#bs').html('--');
+							}
+							
+							if(stat.bv != ''){
+								$('#bv').html(stat.bv/1000);
+							}else{
+								$('#bv').html('--');
+							}
+							if(stat.cv != ''){								
+								$('#cv').html(stat.cv/1000);
+							}else{
+								$('#cv').html('--');
+							}
+							$('#dver').html(stat.dver);
+							if(stat.cs != ''){								
+								var cs = stat.cs == 0 ? '未充电' : '充电';
+							}else{
+								var cs = '--';
+							}
+							$('#cs').html(cs);
+							$('#dat_f').html(stat.dat_f);
+							$('#cpu_tmp').html(stat.cpu_tmp/1000);
+							$('#csq').html(stat.csq);
+							if(stat.at != ''){								
+								$('#at').html(stat.at);
+							}else{
+								$('#at').html('-');
+							}
+							if(stat.ah != ''){
+								$('#ah').html(stat.ah);								
+							}else{
+								$('#ah').html('--');	
+							}
+							iccid = stat.iccid;
+							confDatF = stat.dat_f;
+							confTurnT = stat.turn_t;
+							confPicT = stat.pic_t;
+							confPicF = stat.pic_f;
+						},
+						error: function(xhr, type, errorThrown) {
+							//联网失败的回调,隐藏下拉刷新的状态
+							mescroll.endErr();
+							mui.toast('数据请求失败');
+						}
+					});
+				}
+				
+				//查看图片
+				document.getElementById('lookImg').addEventListener('tap', function() {
+					mui.openWindow({
+						url: 'sex_trap_photo2.html',
+						id: 'sex_trap_photo2',
+						extras: {
+							equipId: equipId,
+						}
+					})
+				})
+				//配置
+				document.getElementById('configuration').addEventListener('tap', function() {
+					mui.openWindow({
+						url: 'sex_trap_detail2_config.html',
+						id: 'sex_trap_detail2_config',
+						extras: {
+							equipId: equipId,
+							confDatF: confDatF,
+							confTurnT: confTurnT,
+							confPicT: confPicT,
+							confPicF: confPicF
+						}
+					})
+				})
+				//sim卡查新  
+				document.getElementById('simCodeSearch').addEventListener('tap', function() {
+					if(iccid) {
+						$.ajax({
+							url: 'http://120.27.222.26/siminfo',
+							data: {
+								simid: iccid,
+							},
+							dataType: 'json', //服务器返回json格式数据
+							type: 'post', //HTTP请求类型
+							timeout: 10000, //超时时间设置为10秒;
+							beforeSend: function() {
+								plus.nativeUI.showWaiting('请求中...');
+							},
+							complete: function() {
+								plus.nativeUI.closeWaiting();
+							},
+							success: function(data) {
+								var dat = data.data;
+								if(data.code == 0) {
+									var status;
+									if(dat.account_status == "0") {
+										status = "未知";
+									} else if(dat.account_status == "1") {
+										status = "测试期";
+									} else if(dat.account_status == "2") {
+										status = "沉默期";
+									} else if(dat.account_status == "3") {
+										status = "使用中";
+									} else if(dat.account_status == "4") {
+										status = "停机";
+									} else if(dat.account_status == "5") {
+										status = "停机保号";
+									} else if(dat.account_status == "6") {
+										status = "预销号";
+									} else if(dat.account_status == "7") {
+										status = "销号";
+									}
+									var usage;
+									if(dat.iccid) {
+										usage = dat.data_usage;
+									} else {
+										usage.innerHTML = '--';
+									}
+									var balance;
+									if(dat.iccid) {
+										balance = dat.data_balance;
+									} else {
+										balance = '--';
+									}
+									var time;
+									if(dat.iccid) {
+										var timestamp4 = new Date(dat.expiry_date * 1000); //直接用 new Date(时间戳) 格式转化获得当前时间
+										time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
+									} else {
+										time = '--';
+									}
+									html = '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + iccid + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
+									$('#mqttConfDetial').html(html);
+									mui('.mui-popover').popover('show', document.getElementById("popover"));
+								}
+							},
+							error: function(xhr, type, errorThrown) {
+								//联网失败的回调,隐藏下拉刷新的状态
+								mescroll.endErr();
+								mui.toast('数据请求失败');
+							}
+						});
+
+					} else {
+						mui.toast('未查询到SIM卡号');
+					}
+				})
+				//统计详情
+				document.getElementById('lookStatsData').addEventListener('tap', function() {
+					mui.openWindow({
+						url: 'sex_trap_detail_echart.html',
+						id: 'sex_trap_detail_echart',
+						extras: {
+							equipId: equipId
+						}
+					})
+				})
+				//历史数据
+				document.getElementById('lookHistoryData').addEventListener('tap', function() {
+					mui.openWindow({
+						url: 'sex_trap_detail_list.html',
+						id: 'sex_trap_detail_list',
+						extras: {
+							equipId: equipId
+						}
+					})
+				})
+				//调试
+				document.getElementById('debug').addEventListener('tap', function() {
+					mui('#debugPopover').popover('show', document.getElementById("debug"));
+				})
+				//操作
+				document.getElementById('adminOperate').addEventListener('tap', function() {
+					mui('#operatePopover').popover('show', document.getElementById("adminOperate"));
+				})
+			})
+			
+			function popupFrame(txt,flag){
+				var txtMsg = '是否'+ txt +'?';
+				mui.confirm(txtMsg,'控制',['取消','确定'],function(e){
+					if(e.index == 0){
+//						alert(0)
+					}else if(e.index == 1){
+						if(flag == 1){
+			                var data = {
+			                  ext:'reboot',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 2){
+			                var data = {
+			                  ext:'update',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 3){
+			                var data = {
+			                  ext:'mqttconf',
+			                }
+			                var fun = function(){
+				                setTimeout(function(){
+				                    mui.ajax('http://120.27.222.26/sex_mqtt_detail', {
+					                    type:'post',
+					                    data:{
+					                        e_id:equipId
+					                    },
+				                      	dataType:'json',
+					                    beforeSend: function() {
+											plus.nativeUI.showWaiting("分配中...");
+										},
+										complete: function() {											
+											plus.nativeUI.closeWaiting();
+										},
+				                      	success:function(data){
+				                          var content='<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">ip:'+data.ip+'<br />port:'+data.port+'<br />sub:'+data.sub+'<br />pub:'+data.pub+'<br />lastwill:'+data.lastwill+'<br />keepalive:'+data.keepalive+'<br />username:'+data.username+'<br />stamp:'+data.stamp+'</div>';
+				                          $('#mqttConfDetial').html(content);
+				                          mui('.mui-popover').popover('toggle',document.getElementById("mqttConf"));
+				                      	},
+				                      	error:function(type){
+				                        	console.log(type)
+				                      	}
+				                    })
+				                },500)
+			                };
+			            }else if(flag == 4){
+			                var data = {
+			                  ext:'takephoto',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 5){
+			                var data = {
+			                  ext:'turn',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 6){
+			                var data = {
+			                  ext:'repower',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 7){
+			                var data = {
+			                  ext:'ds1',
+			                }
+			                var fun = function(){};
+			            }else if(flag == 8){
+			                var data = {
+			                  ext:'ds0',
+			                }
+			                var fun = function(){};
+			            }
+			            sendCtrlFun(data,fun)
+					}
+				},'div')
+			}
+			
+			function sendCtrlFun(data,callback){
+		        data.e_id = equipId;
+		        mui.ajax('http://120.27.222.26/sex_mqtt', {
+		          type:'post',
+		          data:data,
+		           beforeSend: function() {
+						plus.nativeUI.showWaiting("分配中...");
+					},
+					complete: function() {
+						plus.nativeUI.closeWaiting();
+					},
+		          success:function(data){
+		            if(data == 0){
+		              callback();
+		              mui.toast('下发成功',{ duration:'long', type:'div' }) 
+		            }
+		          },
+		          error:function(type){
+		            console.log(type)
+		          }
+		        })
+		    }
+		</script>
+	</body>
+
+</html>

+ 442 - 0
equipManage/sex_trap_detail2_config.html

@@ -0,0 +1,442 @@
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<title>Hello MUI</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<!--标准mui.css-->
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+
+		<link rel="stylesheet" href="../css/common.css">
+		<link rel="stylesheet" href="../css/iconfont.css">
+		<!--<link rel="stylesheet" href="../css/rangeslider.css">-->
+		<link rel="stylesheet" href="http://www.yfzhwlw.com/static/lib/css/jquery-ui.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.poppicker.css" />
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<!--App自定义的css-->
+		<style type="text/css">
+			.mui-table-view-cell.mui-active {
+				background-color: #fff;
+			}
+			
+			.mui-input-range .mui-tooltip {
+				display: none;
+			}
+			
+			.mui-radio input[type=radio] {
+				top: -2px;
+			}
+			
+			.equipOption {
+				color: #21B2E7 !important;
+				margin-bottom: 15px;
+			}
+			
+			.mui-checkbox input[type=checkbox]:before,
+			.mui-radio input[type=radio]:before {
+				font-size: 22px;
+			}
+			/*提交按钮*/
+			
+			.equipTitle {
+				color: #21b2e7;
+				font-size: 14px;
+			}
+			
+			.mui-table-view-cell p {
+				color: #333;
+				font-size: 16px;
+				margin-top: 4px;
+			}
+			/*单选按钮*/
+			
+			.mui-radio label {
+				padding-right: 37px;
+			}
+			/*滑块*/
+			.sliderParent{
+				display: flex;
+				align-items: center;
+			}
+			.sliderParent >div{
+				flex: 1;
+				margin: 0 10px;
+			}
+			
+			/*.sliderDiv {
+				width: 80%;
+				display: inline-block;
+			}*/
+			
+			.rangeslider--horizontal {
+				height: 12px;
+			}
+			
+			.rangeslider__fill {
+				background: #7ed7ff;
+			}
+			
+			.rangeslider__handle {
+				width: 20px;
+				height: 20px;
+			}
+			
+			.rangeslider--horizontal .rangeslider__handle {
+				top: -5px;
+			}
+			
+			.rangeslider__handle:after {
+				width: 8px;
+				height: 8px;
+			}
+			
+			.equipOptionInitVal {
+				display: inline-block;
+				width: 15px;
+				text-align: right;
+			}
+			/*滑块颜色*/
+			.ui-widget-content{
+				background: #e0e0e0;
+			}
+			.ui-widget-header{
+				background: #21b2e7;
+			}
+			/*开始结束时间选择*/
+			
+			.timeItem {
+				border: 1px solid #e6e6e6;
+				margin-bottom: 5px;
+				line-height: 30px;
+				border-radius: 5px;
+				margin-top: 5px;
+			}
+			
+			.timeItem>button {
+				border: none;
+				background: #e6e6e6;
+				margin-right: 10px;
+			}
+		</style>
+
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title"></h1>
+			<!--<a class="headRightIcon fa fa-cloud-upload mui-pull-right" onclick="sendData()">提交</a>-->
+		</header>
+		<div class="mui-content">
+			<ul class="mui-table-view">
+				<li class="mui-table-view-cell">
+					<p class="equipOption">数据上传时间间隔:</p>
+					<div class="sliderParent">
+						<span class="equipOptionInitVal">10</span>
+							<div class="sliderDiv">
+								<div class="slider" id="dropTime-slider"></div>
+							</div>
+						<span id="dropTime">120</span>
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<p class="equipOption">卷粘虫板时间:</p>
+					<div class="sliderParent">
+						<span class="equipOptionInitVal">0</span>
+							<div class="sliderDiv">
+								<div class="slider" id="armyworm-slider"></div>
+							</div>
+						<span id="armyworm">23</span>
+					</div>
+				</li>
+				
+				<!--<li class="mui-table-view-cell">
+					<p class="equipOption">卷粘虫板时间:</p>
+					<span class="equipOptionInitVal">0</span>
+					<div class="sliderDiv">
+						<input type="range" min="0" max="23" step="1" data-rangeslider>
+					</div>
+					<span id="calefactionTime">0</span>
+				</li>-->
+				<li class="mui-table-view-cell" id="timePattern">
+					<p class="equipOption">定时拍照循环工作时间:</p>
+					<div class="">
+						<div class="timeItem">
+							<button id='pickTimeBtn' type="button" class="mui-btn">开始时间</button><span id="begin"></span>
+						</div>
+						<div class="timeItem">
+							<button id='pickTimeBtn2' type="button" class="mui-btn">拍照间隔</button><span id="end"></span>
+						</div>
+					</div>
+				</li>
+			</ul>
+		</div>
+	</body>
+	<script src="../js/mui.min.js"></script>
+	<script src="../js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
+	<!--<script src="../js/rangeslider.js"></script>-->
+	<script src="http://www.yfzhwlw.com/static/lib/js/jquery-ui.min.js"></script>
+	<script src="http://www.yfzhwlw.com/static/lib/js/jquery.ui.touch-punch.min.js"></script>
+	<script src="../js/mui.picker.min.js" type="text/javascript" charset="utf-8"></script>
+	<script src="../js/common.js"></script>
+	<script>
+		mui.init();
+		var equipId;
+		var confDatF;
+		var confTurnT;
+		var confPicT;
+		var confPicF;
+		mui.plusReady(function() {
+			var self = plus.webview.currentWebview();
+			equipId = self.equipId;
+			confDatF = self.confDatF || 10;
+			confTurnT = self.confTurnT || 0;
+			confPicT = self.confPicT || 0;
+			confPicF = self.confPicF || 1;
+			document.getElementById("title").innerHTML = equipId;
+			// 数据上传时间间隔
+		     $("#dropTime-slider").css('width', '100%').slider({
+		        value: confDatF,
+		        range: "min",
+		        min: 10,
+		        max: 120,
+		        step: 10,
+		        slide: function (event, ui) {
+		          	var val = parseInt(ui.value);
+		          	$('#dropTime').html(val);
+		        },
+		        stop: function( event, ui ) {
+			        console.log(ui.value)
+			        $('#dropTime').html(ui.value);
+			        mui.confirm('是否修改数据上传时间?','上报时间',['取消','确定'],function(e){
+			        	console.log(e.index)
+			        	if (e.index == 1) {
+			        		//预留
+//	                        var data = {
+//				                ext:'turnset',
+//				                turn_t:ui.value,
+//				            }
+//		                    sendCtrlFun(data,function(){
+//				                confDatF = ui.value;
+//				            })
+	                    }else{
+	                    	$("#dropTime-slider").slider('value', confDatF); 
+				      		$('#dropTime').html(confDatF);
+	                    }
+			        },'div')
+		        	
+		        }
+		    });
+		    $('#dropTime').html(confDatF);
+		    // 卷粘虫板时间
+		     $("#armyworm-slider").css('width', '100%').slider({
+		        value: confTurnT,
+		        range: "min",
+		        min: 0,
+		        max: 23,
+		        step: 1,
+		        slide: function (event, ui) {
+		          var val = parseInt(ui.value);
+		          $('#armyworm').html(val);
+		        },
+		        stop: function( event, ui ) {
+		          	console.log(ui.value)
+		          	$('#armyworm').html(ui.value);
+		         	mui.confirm('是否修改卷粘虫板时间?','上报时间',['取消','确定'],function(e){
+			        	console.log(e.index)
+			        	if (e.index == 1) {
+	                        var data = {
+				                ext:'turnset',
+				                turn_t:ui.value,
+				            }
+		                    sendCtrlFun(data,function(){
+				                confTurnT = ui.value;
+				            })
+	                    }else{
+	                    	$("#armyworm-slider").slider('value', confTurnT); 
+				      		$('#armyworm').html(confTurnT);
+	                    }
+			        },'div')
+		        }
+		    });
+		    $('#armyworm').html(confTurnT);
+			mui('#begin')[0].innerHTML = confPicT;
+			mui('#end')[0].innerHTML = confPicF;
+		})
+		
+		function sendCtrlFun(data,callback){
+	        data.e_id = equipId;
+	        mui.ajax('http://120.27.222.26/sex_mqtt', {
+	          type:'post',
+	          data:data,
+	          success:function(data){
+	            if(data == 0){
+	              callback();
+	            }
+	          },
+	          error:function(type){
+	            console.log(type)
+	          }
+	        })
+	    }
+
+
+		// 将对应值写入对应文本框
+		function valueOutput(element) {
+			var value = element.value;
+			var output = element.parentNode.nextElementSibling;
+			output.innerHTML = value;
+		}
+		//自定义时间值
+		var picker;
+
+		function PopPicker() {
+			picker = new mui.PopPicker();
+			picker.setData([{
+				value: "0",
+				text: "0"
+			}, {
+				value: "1",
+				text: "1"
+			}, {
+				value: "2",
+				text: "2"
+			}, {
+				value: "3",
+				text: "3"
+			}, {
+				value: "4",
+				text: "4"
+			}, {
+				value: "5",
+				text: "5"
+			}, {
+				value: "6",
+				text: "6"
+			}, {
+				value: "7",
+				text: "7"
+			}, {
+				value: "8",
+				text: "8"
+			}, {
+				value: "9",
+				text: "9"
+			}, {
+				value: "10",
+				text: "10"
+			}, {
+				value: "11",
+				text: "11"
+			}, {
+				value: "12",
+				text: "12"
+			}, {
+				value: "13",
+				text: "13"
+			}, {
+				value: "14",
+				text: "14"
+			}, {
+				value: "15",
+				text: "15"
+			}, {
+				value: "16",
+				text: "16"
+			}, {
+				value: "17",
+				text: "17"
+			}, {
+				value: "18",
+				text: "18"
+			}, {
+				value: "19",
+				text: "19"
+			}, {
+				value: "20",
+				text: "20"
+			}, {
+				value: "21",
+				text: "21"
+			}, {
+				value: "22",
+				text: "22"
+			}, {
+				value: "23",
+				text: "23"
+			}, ])
+		}
+		function PopPicker2() {
+			picker = new mui.PopPicker();
+			picker.setData([{
+				value: "1",
+				text: "1"
+			},{
+				value: "2",
+				text: "2"
+			}, {
+				value: "3",
+				text: "3"
+			}, {
+				value: "4",
+				text: "4"
+			}, {
+				value: "6",
+				text: "6"
+			}, {
+				value: "8",
+				text: "8"
+			}, {
+				value: "12",
+				text: "12"
+			}, {
+				value: "24",
+				text: "24"
+			}])
+		}
+		//开始时间选择器
+		document.getElementById("pickTimeBtn").addEventListener('tap', function() {
+			PopPicker()
+			picker.show(function(getSelectedItems) {
+				document.getElementById('begin').innerHTML = getSelectedItems[0].value;
+				var begin = mui('#begin')[0].innerHTML;
+				var end = mui('#end')[0].innerHTML;
+				if(begin && end){
+					var data = {
+			            ext:'photoset',
+			            pic_t:begin,
+			            pic_f:end,
+			        }
+			        sendCtrlFun(data,function(){
+			          	confPicT = begin
+			          	confPicF = end
+			        })
+				}
+			})
+		});
+		//结束时间选择器
+		document.getElementById("pickTimeBtn2").addEventListener('tap', function() {
+			PopPicker2()
+			picker.show(function(getSelectedItems) {
+				document.getElementById('end').innerHTML = getSelectedItems[0].value;
+				var begin = mui('#begin')[0].innerHTML;
+				var end = mui('#end')[0].innerHTML;
+				if(begin && end){
+					var data = {
+			            ext:'photoset',
+			            pic_t:begin,
+			            pic_f:end,
+			        }
+			        sendCtrlFun(data,function(){
+			          	confPicT = begin
+			          	confPicF = end
+			        })
+				}
+			})
+		});
+	</script>
+
+</html>

+ 401 - 0
equipManage/sex_trap_detail_echart.html

@@ -0,0 +1,401 @@
+<!DOCTYPE html>
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<title>ECahrt 示例</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link rel="stylesheet" href="../css/mobiscroll.custom-3.0.0-beta6.min.css">
+		<link rel="stylesheet" href="../css/common.css">
+		<style>
+			/*body,
+			.mui-content {
+				background-color: #ffffff;
+			}
+			*/
+			.chart {
+				height: 250px;
+				margin: 0px;
+				padding: 0px;
+			}
+			
+			h5 {
+				margin-top: 30px;
+				font-weight: bold;
+			}
+			
+			h5:first-child {
+				margin-top: 0;
+				font-weight: 100;
+			}
+			/*tab*/
+			
+			.mui-segmented-control {
+				border: none;
+				display: inherit;
+				overflow: visible;
+				margin: 20px 0;
+				background-color: #fff;
+			}
+			
+			.mui-segmented-control .mui-control-item {
+				border-left: none;
+				color: #333;
+				overflow: visible;
+			}
+			
+			.mui-segmented-control .mui-control-item.mui-active {
+				color: #333;
+				background: transparent;
+				border-bottom: none;
+				position: relative;
+			}
+			
+			.mui-control-item.mui-active:before {
+				content: '';
+				position: absolute;
+				left: 50%;
+				bottom: -3px;
+				width: 70px;
+				background: #007aff;
+				height: 3px;
+				margin-left: -35px;
+			}
+			
+			.mui-control-item.mui-active:after {
+				content: '';
+				position: absolute;
+				left: 50%;
+				border: 26px solid #007aff;
+				bottom: -18px;
+				margin-left: -5px;
+				border-top: #007aff 5px solid;
+				border-left: transparent 5px solid;
+				border-bottom: transparent 10px solid;
+				border-right: transparent 5px solid;
+			}
+			
+			.mui-segmented-control .mui-control-item {
+				line-height: 30px;
+			}
+			
+
+			
+			.mui-control-item.mui-active {
+				color: #333;
+				border-bottom: 3px solid #007AFF;
+			}
+		</style>
+		<script src="../js/mui.min.js"></script>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">详情</h1>
+			<a class="mui-icon mui-icon-search mui-pull-right" id="date"></a>
+		</header>
+		<div class="mui-content">
+			<div class="mui-card">
+				<!--页眉,放置标题-->
+				<div class="mui-card-header">
+					<h5>温度(°C)湿度(%)</h5>
+				</div>
+				<!--内容区-->
+				<div class="mui-card-content">
+					<div class="chart" id="lineChart"></div>
+				</div>
+			</div>
+			<!--<h5>击虫次数</h5>-->
+			<div class="mui-card">
+				<!--页眉,放置标题-->
+				<div class="mui-card-header">
+					<h5>CPU温度(°C)</h5>
+				</div>
+				<!--内容区-->
+				<div class="mui-card-content">
+					<div class="chart" id="pieChart"></div>
+				</div>
+			</div>
+			<!--筛选日历-->
+			<!--<div class="searchHintBox">-->
+				<div class="calendarBox" style="display:none">
+					<p>开始时间:<input id="start" placeholder="Please Select ..." readonly /></p>
+					<p>结束时间:<input id="end" placeholder="Please Select ..." readonly /></p>
+				</div>
+			<!--</div>-->
+		</div>
+		<script src="../js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/mobiscroll.custom-3.0.0-beta6.min.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/echarts.min.js"></script>
+		<script>
+			var equipId;
+			// 1基于准备好的dom,初始化echarts实例
+			var lineChart = echarts.init(document.getElementById('lineChart'));
+			// 指定图表的配置项和数据
+			var lineOption = {
+				tooltip: {
+					trigger: 'axis',
+					formatter: function(params) {
+						if(params.length > 1) {
+							var returnData = '';
+							var time = '';
+							for(var g in params) {
+								time = params[g].axisValue;
+								if(params[g].seriesIndex == 0 || params[g].seriesIndex == 1) {
+									returnData += params[g].seriesName + ':' + params[g].value + '°C<br/>';
+								}
+								if(params[g].seriesIndex == 2 || params[g].seriesIndex == 3) {
+									returnData += params[g].seriesName + ':' + params[g].value + 'V<br/>';
+								}
+							}
+							return time + '<br/>' + returnData;
+						}
+					}
+				},
+				legend: {
+					y:15,
+					itemWidth: 15,
+			        itemHeight: 10,
+			        itemGap: 8,
+					data: ['环境温度', '环境湿度'],
+					textStyle: {
+			            fontSize: 12,
+		        	}
+				},
+				grid: {
+					left: '3%',
+					right: '4%',
+					bottom: '3%',
+					containLabel: true
+				},
+				toolbox: {
+					feature: {
+						// saveAsImage: {}
+					}
+				},
+				xAxis: {
+					type: 'category',
+					boundaryGap: false,
+					data: [1, 2, 3, 4, 5, 6, 7]
+				},
+				yAxis: {
+					type: 'value',
+					data: [20, 30, 52, 20, 64, 56, 80]
+				},
+				dataZoom: [{
+					type: 'inside',
+					backgroundColor: "rgba(47,69,84,0)",
+				}],
+				series: [{
+						name: '环境温度',
+						type: 'line',
+						data: [20, 30, 52, 20, 64, 56, 80],
+						itemStyle: {
+							normal: {
+								color: '#6ecdfe'
+							}
+						}
+					},
+					{
+						name: '环境湿度',
+						type: 'line',
+						data: [],
+						itemStyle: {
+							normal: {
+								color: '#5689f2'
+							}
+						}
+					}
+				]
+			};
+
+			// 2基于准备好的dom,初始化echarts实例
+			var barChart = echarts.init(document.getElementById('pieChart'));
+			// 指定图表的配置项和数据
+			var barOption = {
+				tooltip: {
+					trigger: 'axis',
+					formatter: function(params) {
+						var returnData = '';
+						var time = '';
+						for(var g in params) {
+							time = params[g].axisValue;
+							returnData += params[g].seriesName + ':' + params[g].value + '只';
+						}
+						return time + '<br/>' + returnData;
+					}
+				},
+				legend: {
+//					x: 'right', // 'center' | 'left' | {number},
+					y:15,
+					data: ['CUP温度'],
+					itemWidth: 15,
+			        itemHeight: 10,
+			        itemGap: 8,
+			        textStyle: {
+			            fontSize: 12,
+		        	}
+				},
+				grid: {
+					left: '3%',
+					right: '4%',
+					bottom: '3%',
+					containLabel: true
+				},
+				toolbox: {
+					feature: {
+						// saveAsImage: {}
+					}
+				},
+				xAxis: {
+					type: 'category',
+					boundaryGap: false,
+					data: []
+				},
+				yAxis: {
+					type: 'value',
+					data: []
+				},
+				dataZoom: [{
+					type: 'inside',
+					backgroundColor: "rgba(47,69,84,0)",
+				}],
+				series: [{
+					name: 'CUP温度',
+					type: 'line',
+					data: [],
+					itemStyle: {
+						normal: {
+							color: '#6ecdfe'
+						}
+					}
+				}]
+			};
+
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				//请求图表数据:
+				$.ajax({
+					url: 'http://120.27.222.26/sex_at_ah',
+					type: 'post',
+					data: {
+						begin: '',
+						end: '',
+						e_id: equipId
+					},
+					dataType:'json',
+					success: function(data) {
+						sessionStorage.setItem("scdData", data);
+						var temp = data;
+						var at = [],
+							ah = [],
+							time = [],
+							cpu_tmp = [];
+						for(var i = 0; i < temp.length; i++) {
+							at.unshift(Number(temp[i].at).toFixed(1));
+							ah.unshift(Number(temp[i].ah).toFixed(1));
+							cpu_tmp.unshift((Number(temp[i].cpu_tmp) / 1000).toFixed(1));
+							time.unshift(temp[i].tim);
+						}
+						lineOption.series[0].data = at;
+						lineOption.series[1].data = ah;
+						lineOption.xAxis.data = time;
+						
+						barOption.series[0].data = cpu_tmp;
+						barOption.xAxis.data = time;
+	
+						if(!temp.length) {
+							lineOption.series[0].data = [0];
+							lineOption.series[1].data = [0];
+							lineOption.xAxis.data = ['暂无数据'];
+							barOption.series[0].data = [0];
+							barOption.xAxis.data = ['暂无数据'];
+						}
+						
+						// 使用刚指定的配置项和数据显示图表。
+						setTimeout(function() {
+							lineChart.setOption(lineOption);
+							barChart.setOption(barOption);
+						})
+					}
+				})
+				//日历
+				mobiscroll.settings = {
+			        theme: 'ios'
+			        ,lang: 'zh',
+			    };
+				$('#date').mobiscroll().range({
+			        startInput: '#start',
+			        endInput: '#end',
+			        onSet: function (event, inst) {
+			            var start = getYMDHMS(inst.getVal()[0]);
+			            var end = getYMDHMS(inst.getVal()[1]);
+			            //请求图表数据:
+						$.ajax({
+							url: 'http://120.27.222.26/sex_at_ah',
+							type: 'post',
+							data: {
+								e_id: equipId,
+								begin: start,
+								end: end
+							},
+							success: function(data) {
+								sessionStorage.setItem("scdData", data);
+								var temp = data;
+								var at = [],
+									ah = [],
+									time = [],
+									cpu_tmp = [];
+								for(var i = 0; i < temp.length; i++) {
+									at.unshift(Number(temp[i].at).toFixed(1));
+									ah.unshift(Number(temp[i].ah).toFixed(1));
+									cpu_tmp.unshift((Number(temp[i].cpu_tmp) / 1000).toFixed(1));
+									time.unshift(temp[i].tim);
+								}
+								lineOption.series[0].data = at;
+								lineOption.series[1].data = ah;
+								lineOption.xAxis.data = time;
+								
+								barOption.series[0].data = cpu_tmp;
+								barOption.xAxis.data = time;
+			
+								if(!temp.length) {
+									lineOption.series[0].data = [0];
+									lineOption.series[1].data = [0];
+									lineOption.xAxis.data = ['暂无数据'];
+									barOption.series[0].data = [0];
+									barOption.xAxis.data = ['暂无数据'];
+								}
+								
+								// 使用刚指定的配置项和数据显示图表。
+								setTimeout(function() {
+									lineChart.setOption(lineOption);
+									barChart.setOption(barOption);
+								})
+							}
+						})
+			        },
+			    });
+			    function getYMDHMS(time) {
+			        var time = new Date(time);
+			        var year = time.getFullYear(),
+			            month = time.getMonth() + 1,
+			            date = time.getDate();
+			     
+			        if (month < 10) { month = '0' + month; }
+			        if (date < 10) { date = '0' + date; }
+			     
+			        return year+'/'+ month+'/'+ date //不想
+			    }
+				
+			})
+		</script>
+	</body>
+
+</html>

+ 212 - 0
equipManage/sex_trap_detail_list.html

@@ -0,0 +1,212 @@
+<!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 href="../css/common.css" rel="stylesheet" />
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/reset.css">
+		<link rel="stylesheet" href="../css/mobiscroll.custom-3.0.0-beta6.min.css">
+		<link rel="stylesheet" type="text/css" href="../css/mui.picker.min.css" />
+		<link rel="stylesheet" type="text/css" href="../css/timeLine.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+		    <h1 class="mui-title">性诱器列表</h1>
+		</header>
+		<div class="mui-content">
+			<div class="faxSearchBox">
+				<div class="mui-input-row mui-search">
+					<div id="timeSelect">请选择时间段</div>
+					<!--<input type="hidden" name="begin" id="begin" value="" />
+					<input type="hidden" name="end" id="end" value="" />-->
+				</div>
+				<!--<div class="searchBtnBox">
+					<span class="cutline">&nbsp;</span>
+					<button id="searchBtn">搜索</button>
+				</div>-->
+			</div>
+			<div id="scrollPlace" class="mescroll"> <!--id可以改,而"mescroll"的class不能删-->
+		   		<ul id="dataList">
+					<!--<li>
+		   				<div class="equipItem blue">
+		   					<div class="upl_time">2018-12-13 09:13:02</div>
+		   				</div>
+		   			</li>
+		   			<li>
+		   				<div class="equipItem purple">
+		   					<div class="upl_time">2018-12-13 09:13:02</div>
+		   				</div>
+		   			</li>-->
+				</ul>
+			</div>
+			<div class="calendarBox" style="display:none">
+				<p>开始时间:<input id="start" placeholder="Please Select ..." readonly /></p>
+				<p>结束时间:<input id="end" placeholder="Please Select ..." readonly /></p>
+			</div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/common.js"></script>
+		<script src="../js/mescroll.min.js" charset="utf-8"></script>
+		<script src="../js/mobiscroll.custom-3.0.0-beta6.min.js" type="text/javascript" charset="utf-8"></script>
+		<script src="../js/mui.picker.min.js"></script>
+		<script type="text/javascript">
+			var equipId;
+			var begin = '',
+				end = '',
+				flag = 1;
+				
+			mui.init();
+			var mescroll;
+			document.addEventListener('plusready',function () {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				//创建MeScroll对象,内部已默认开启下拉刷新,自动执行up.callback,重置列表数据;
+				mescroll = new MeScroll("scrollPlace", {
+					up: {
+						callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+						isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+						clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+						toTop:{ //配置回到顶部按钮
+							src : "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+							offset : 700
+						},
+						empty: {
+							//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+							warpId:	"dataList", //父布局的id (1.3.5版本支持传入dom元素)
+							icon: "../images/listNull.png", //图标,默认null,支持网络图
+							tip: "暂无相关数据~" //提示
+						},
+						htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+						noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+						lazyLoad: {
+				        	use: true // 是否开启懒加载,默认false
+				        }
+					}
+				});
+			},false);
+			/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+			function getListData(page){
+				//联网加载数据
+				getListDataFromNet(page.num, page.size, function(curPageData,totalSize){
+					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+					//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+					//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+					mescroll.endSuccess(curPageData.length);
+					//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+					setListData(curPageData);
+				}, function(){
+					//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+	                mescroll.endErr();
+					mui.toast('数据请求失败');
+				});
+			}
+			/*设置列表数据*/
+			function setListData(curPageData){
+				var html = '';
+				var dat = curPageData;
+				for(var i = 0; i < dat.length; i++) {
+					var className;
+					if(i%2 == 0){
+						className = 'blue';
+					}else{
+						className = 'purple';
+					}
+					html += '<li data-ybqData="'+dat[i].ybq_data+'" data-time="'+dat[i].upl_time+'">'+
+							'<div class="equipItem '+className+'"><div class="upl_time">'+dat[i].upl_time+'</div></div></li>';
+				}
+				$('#dataList').append(html);
+			}
+			/*联网加载列表数据*/
+			function getListDataFromNet(pageNum,pageSize,successCallback,errorCallback) {
+            	$.ajax({
+	                type: 'POST',
+		            url: 'http://120.27.222.26/app_reportmanage_detail',
+	                timeout : 10000, //超时时间设置,单位毫秒
+	                data:{
+	                	'etype': 'xycb',
+						'page': pageNum,
+						'equip_id': equipId,
+						'filter_begin':begin,
+						'filter_end':end
+	                },
+	                dataType: 'json',
+	                success: function(data){
+	                	successCallback(data.dat,data.nums);
+	                },
+	                error: function(){
+	                	errorCallback();
+	                	console.log(11111)
+	                }
+	            });
+			}
+
+			//页面跳转
+			mui('#dataList').on('tap', 'li', function() {
+				var time = this.getAttribute('data-time');
+				var ybq_data = this.getAttribute('data-ybqData');
+				console.log(ybq_data)
+				var stat = eval('(' + ybq_data + ')');
+				console.log(stat.proj)
+				if (stat.proj == 'SEX_TRAP_1') {
+					mui.openWindow({
+					url: 'sex_trap_detail_list_detail1.html',
+					id: 'sex_trap_detail_list_detail',
+					extras: {
+						equipId: equipId,
+							upl_time:time,
+							ybq_data:ybq_data,
+						}
+					})
+				} else if (stat.proj == 'SEX_TRAP_2') {
+					mui.openWindow({
+					url: 'sex_trap_detail_list_detail2.html',
+					id: 'sex_trap_detail_list_detail',
+					extras: {
+						equipId: equipId,
+							upl_time:time,
+							ybq_data:ybq_data,
+						}
+					})
+				}
+			})
+			
+			//日历
+			mobiscroll.settings = {
+		        theme: 'ios'
+		        ,lang: 'zh',
+		    };
+			$('.mui-search').mobiscroll().range({
+		        startInput: '#start',
+		        endInput: '#end',
+		        onSet: function (event, inst) {
+		            begin = getYMDHMS(inst.getVal()[0]);
+		            end = getYMDHMS(inst.getVal()[1]);
+		            $('#timeSelect').html(getYMDHMS(inst.getVal()[0])+' '+getYMDHMS(inst.getVal()[1]))
+		            //请求图表数据:
+		            $('#dataList').html('');
+					getListData({num:1, size:10})
+		        },
+		    });
+		    function getYMDHMS(time) {
+		        var time = new Date(time);
+		        var year = time.getFullYear(),
+		            month = time.getMonth() + 1,
+		            date = time.getDate();
+		     
+		        if (month < 10) { month = '0' + month; }
+		        if (date < 10) { date = '0' + date; }
+		     
+		        return year+'-'+ month+'-'+ date //不想
+		    }
+			
+		</script>
+	</body>
+
+</html>

+ 257 - 0
equipManage/sex_trap_detail_list_detail1.html

@@ -0,0 +1,257 @@
+<!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 rel="stylesheet" href="../css/reset.css" />
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<style type="text/css">
+			.mui-content,
+			body,
+			html {
+				background: #fff;
+			}
+			.mui-content{
+				padding-bottom: 60px;
+			}
+			
+			.innerDiv {
+				padding: .3rem;
+			}
+			
+			.equipInfo>ul>li {
+				line-height: 66px;
+				overflow: hidden;
+			}
+			
+			.equipInfo {
+				margin: .2rem .3rem 0;
+			}
+			
+			.equipInfo>ul>li>img {
+				width: 41px;
+				height: 41px;
+			}
+			
+			.titleItem {
+				margin-left: .4rem;
+				color: #999;
+				letter-spacing: .03rem;
+			}
+			
+			.rightVal {
+				float: right;
+				height: 50px;
+				line-height: 50px;
+			}
+		
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">详情</h1>
+		</header>
+		<div class="mui-content">
+			<div class="innerDiv">
+				<div class="equipInfo">
+					<ul>
+						<li>
+							<img src="../images/sex_trap/1.png" />
+							<span class="titleItem">设备开关</span>
+							<span class="rightVal" id="ds"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/2.png" />
+							<span class="titleItem">工作状态</span>
+							<span class="rightVal" id="ws"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/3.png" />
+							<span class="titleItem">环境温度</span>
+							<span class="rightVal" id="at"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/4.png" />
+							<span class="titleItem">环境湿度</span>
+							<span class="rightVal" id="ah"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/5.png" />
+							<span class="titleItem">充电电压</span>
+							<span class="rightVal" id="cv"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/6.png" />
+							<span class="titleItem">电池电压</span>
+							<span class="rightVal" id="bv"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/7.png" />
+							<span class="titleItem">充电状态</span>
+							<span class="rightVal" id="cs"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/19.png" />
+							<span class="titleItem">雨控状态</span>
+							<span class="rightVal" id="rps"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/18.png" />
+							<span class="titleItem">温控状态</span>
+							<span class="rightVal" id="tps"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/17.png" />
+							<span class="titleItem">倾倒状态</span>
+							<span class="rightVal" id="dps"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/16.png" />
+							<span class="titleItem">红外计数值</span>
+							<span class="rightVal" id="hjz"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/15.png" />
+							<span class="titleItem">高压计数值</span>
+							<span class="rightVal" id="gyz"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/14.png" />
+							<span class="titleItem">风向</span>
+							<span class="rightVal" id="drec"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/13.png" />
+							<span class="titleItem">风速</span>
+							<span class="rightVal" id="sped"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/10.png" />
+							<span class="titleItem">信号强度</span>
+							<span class="rightVal" id="csq"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/11.png" />
+							<span class="titleItem">版本号</span>
+							<span class="rightVal" id="dver"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/12.png" />
+							<span class="titleItem">上报时间</span>
+							<span class="rightVal" id="uplTime"></span>
+						</li>
+					</ul>
+				</div>
+			</div>
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="http://echarts.baidu.com/build/dist/echarts.js"></script>
+		<script type="text/javascript">
+			mui.init()
+			var equipId;
+			var ybq_data,upl_time;
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				upl_time = self.upl_time;
+				console.log(self.ybq_data)
+				ybq_data = eval('('+self.ybq_data+')');
+				console.log(ybq_data)
+				fullData(ybq_data);
+			})
+
+			function fullData(dat) {
+				$('#ds').html(dat.ds==1?'开启':'关闭');
+				$('#ws').html(dat.ws==1?'工作':'待机');
+				$('#at').html(dat.at);
+				$('#ah').html(dat.ah);
+				if(dat.cv !== null){					
+					$('#cv').html(dat.cv/1000);
+				}else{
+					$('#cv').html( '--');
+				}
+				if(dat.bv){					
+					$('#bv').html(dat.bv/1000);
+				}else{
+					$('#bv').html( '--');
+				}
+				if(dat.cs !== null){	
+					$('#cs').html(dat.cs == '1' ?'充电中':'未充电');
+				}else{
+					$('#cs').html('--');
+				}
+				if(dat.bs !== null){	
+					if(dat.bs == 0){						
+						$('#bs').html('正常');
+					}else if(dat.bs == 1){						
+						$('#bs').html('欠压');
+					}else if(dat.bs == 2){						
+						$('#bs').html('过压');
+					}
+				}else{
+					$('#bs').html('--');
+				}
+				if (dat.infr_ct !== null) {
+					$('#hjz').html(dat.infr_ct)
+				} else{
+					$('#hjz').html('--')
+				}
+				if (dat.volt_ct !== null) {
+					$('#gyz').html(dat.volt_ct)
+				} else{
+					$('#gyz').html('--')
+				}
+				if (dat.wind_drec !== null) {
+					$('#drec').html(dat.wind_drec)
+				} else{
+					$('#drec').html('--')
+				}
+				if (dat.wind_sped !== null) {
+					$('#sped').html(dat.wind_sped)
+				} else{
+					$('#sped').html('--')
+				}
+				if (dat.tps !== null) {
+					if(dat.tps == 0){						
+						$('#tps').html('正常');
+					}else if(dat.tps == 1){						
+						$('#tps').html('温控');
+					}
+				} else{
+					$('#tps').html('--')
+				}
+				if (dat.rps !== null) {
+					if(dat.rps == 0){						
+						$('#rps').html('正常');
+					}else if(dat.tps == 1){						
+						$('#rps').html('雨控');
+					}
+				} else{
+					$('#rps').html('--')
+				}
+				if (dat.dps !== null) {
+					if(dat.dps == 0){						
+						$('#dps').html('正常');
+					}else if(dat.tps == 1){						
+						$('#dps').html('倾倒');
+					}
+				} else{
+					$('#dps').html('--')
+				}
+//				$('#cpu_tmp').html(dat.cpu_tmp/1000);
+				$('#csq').html(dat.csq);
+				$('#dver').html(dat.dver);
+				$('#uplTime').html(upl_time)
+			}
+
+		</script>
+	</body>
+
+</html>

+ 184 - 0
equipManage/sex_trap_detail_list_detail2.html

@@ -0,0 +1,184 @@
+<!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 rel="stylesheet" href="../css/reset.css" />
+		<link rel="stylesheet" href="../css/mui.min.css" />
+		<link rel="stylesheet" href="../css/common.css" />
+		<script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
+		<style type="text/css">
+			.mui-content,
+			body,
+			html {
+				background: #fff;
+			}
+			.mui-content{
+				padding-bottom: 60px;
+			}
+			
+			.innerDiv {
+				padding: .3rem;
+			}
+			
+			.equipInfo>ul>li {
+				line-height: 66px;
+				overflow: hidden;
+			}
+			
+			.equipInfo {
+				margin: .2rem .3rem 0;
+			}
+			
+			.equipInfo>ul>li>img {
+				width: 41px;
+				height: 41px;
+			}
+			
+			.titleItem {
+				margin-left: .4rem;
+				color: #999;
+				letter-spacing: .03rem;
+			}
+			
+			.rightVal {
+				float: right;
+				height: 50px;
+				line-height: 50px;
+			}
+		
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">详情</h1>
+		</header>
+		<div class="mui-content">
+			<div class="innerDiv">
+				<div class="equipInfo">
+					<ul>
+						<li>
+							<img src="../images/sex_trap/1.png" />
+							<span class="titleItem">设备开关</span>
+							<span class="rightVal" id="ds"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/2.png" />
+							<span class="titleItem">工作状态</span>
+							<span class="rightVal" id="ws"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/3.png" />
+							<span class="titleItem">环境温度</span>
+							<span class="rightVal" id="at"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/4.png" />
+							<span class="titleItem">环境湿度</span>
+							<span class="rightVal" id="ah"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/5.png" />
+							<span class="titleItem">充电电压</span>
+							<span class="rightVal" id="cv"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/6.png" />
+							<span class="titleItem">电池电压</span>
+							<span class="rightVal" id="bv"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/7.png" />
+							<span class="titleItem">充电状态</span>
+							<span class="rightVal" id="cs"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/8.png" />
+							<span class="titleItem">电池状态</span>
+							<span class="rightVal" id="bs"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/9.png" />
+							<span class="titleItem">CPU温度</span>
+							<span class="rightVal" id="cpu_tmp"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/10.png" />
+							<span class="titleItem">信号强度</span>
+							<span class="rightVal" id="csq"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/11.png" />
+							<span class="titleItem">版本号</span>
+							<span class="rightVal" id="dver"></span>
+						</li>
+						<li>
+							<img src="../images/sex_trap/12.png" />
+							<span class="titleItem">上报时间</span>
+							<span class="rightVal" id="uplTime"></span>
+						</li>
+					</ul>
+				</div>
+			</div>
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script src="http://echarts.baidu.com/build/dist/echarts.js"></script>
+		<script type="text/javascript">
+			mui.init()
+			var equipId;
+			var ybq_data,upl_time;
+			mui.plusReady(function() {
+				var self = plus.webview.currentWebview();
+				equipId = self.equipId;
+				upl_time = self.upl_time;
+				console.log(self.ybq_data)
+				ybq_data = eval('('+self.ybq_data+')');
+				fullData(ybq_data);
+			})
+
+			function fullData(dat) {
+				$('#ds').html(dat.ds==1?'开启':'关闭');
+				$('#ws').html(dat.ws==1?'工作':'待机');
+				$('#at').html(dat.at);
+				$('#ah').html(dat.ah);
+				if(dat.cv){					
+					$('#cv').html(dat.cv/1000);
+				}else{
+					$('#cv').html( '--');
+				}
+				if(dat.bv){					
+					$('#bv').html(dat.bv/1000);
+				}else{
+					$('#bv').html( '--');
+				}
+				if(dat.cs){					
+					$('#cs').html(dat.cs==1?'充电中':'未充电');
+				}else{
+					$('#cs').html('--');
+				}
+				if(dat.bs){	
+					if(dat.bs == 0){						
+						$('#bs').html('正常');
+					}else if(dat.bs == 1){						
+						$('#bs').html('欠压');
+					}else if(dat.bs == 2){						
+						$('#bs').html('过压');
+					}
+				}else{
+					$('#bs').html('--');
+				}
+				$('#cpu_tmp').html(dat.cpu_tmp/1000);
+				$('#csq').html(dat.csq);
+				$('#dver').html(dat.dver);
+				$('#uplTime').html(upl_time)
+			}
+
+		</script>
+	</body>
+
+</html>

+ 448 - 0
equipManage/sex_trap_photo2.html

@@ -0,0 +1,448 @@
+<html>
+
+	<head>
+		<meta charset="utf-8">
+		<title>Hello MUI</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<!--标准mui.css-->
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link rel="stylesheet" href="../css/mescroll.min.css">
+		<link rel="stylesheet" href="../css/iconfont.css">
+		<link rel="stylesheet" href="../css/reset.css">
+		<link rel="stylesheet" href="../css/common.css">
+		<!--App自定义的css-->
+		<style type="text/css">
+			.mui-preview-image.mui-fullscreen {
+				position: fixed;
+				z-index: 20;
+				background-color: #000;
+			}
+			
+			.mui-preview-header,
+			.mui-preview-footer {
+				position: absolute;
+				width: 100%;
+				left: 0;
+				z-index: 10;
+			}
+			
+			.mui-preview-header {
+				height: 44px;
+				top: 0;
+			}
+			
+			.mui-preview-footer {
+				height: 50px;
+				bottom: 0px;
+			}
+			
+			.mui-preview-header .mui-preview-indicator {
+				display: block;
+				line-height: 25px;
+				color: #fff;
+				text-align: center;
+				margin: 15px auto 4;
+				width: 70px;
+				background-color: rgba(0, 0, 0, 0.4);
+				border-radius: 12px;
+				font-size: 16px;
+			}
+			
+			.mui-preview-image {
+				display: none;
+				-webkit-animation-duration: 0.5s;
+				animation-duration: 0.5s;
+				-webkit-animation-fill-mode: both;
+				animation-fill-mode: both;
+			}
+			
+			.mui-preview-image.mui-preview-in {
+				-webkit-animation-name: fadeIn;
+				animation-name: fadeIn;
+			}
+			
+			.mui-preview-image.mui-preview-out {
+				background: none;
+				-webkit-animation-name: fadeOut;
+				animation-name: fadeOut;
+			}
+			
+			.mui-preview-image.mui-preview-out .mui-preview-header,
+			.mui-preview-image.mui-preview-out .mui-preview-footer {
+				display: none;
+			}
+			
+			.mui-zoom-scroller {
+				position: absolute;
+				display: -webkit-box;
+				display: -webkit-flex;
+				display: flex;
+				-webkit-box-align: center;
+				-webkit-align-items: center;
+				align-items: center;
+				-webkit-box-pack: center;
+				-webkit-justify-content: center;
+				justify-content: center;
+				left: 0;
+				right: 0;
+				bottom: 0;
+				top: 0;
+				width: 100%;
+				height: 100%;
+				margin: 0;
+				-webkit-backface-visibility: hidden;
+			}
+			
+			.mui-zoom {
+				-webkit-transform-style: preserve-3d;
+				transform-style: preserve-3d;
+			}
+			
+			.mui-slider .mui-slider-group .mui-slider-item img {
+				width: auto;
+				height: auto;
+				max-width: 100%;
+				max-height: 100%;
+			}
+			
+			.mui-android-4-1 .mui-slider .mui-slider-group .mui-slider-item img {
+				width: 100%;
+			}
+			
+			.mui-android-4-1 .mui-slider.mui-preview-image .mui-slider-group .mui-slider-item {
+				display: inline-table;
+			}
+			
+			.mui-android-4-1 .mui-slider.mui-preview-image .mui-zoom-scroller img {
+				display: table-cell;
+				vertical-align: middle;
+			}
+			
+			.mui-preview-loading {
+				position: absolute;
+				width: 100%;
+				height: 100%;
+				top: 0;
+				left: 0;
+				display: none;
+			}
+			
+			.mui-preview-loading.mui-active {
+				display: block;
+			}
+			
+			.mui-preview-loading .mui-spinner-white {
+				position: absolute;
+				top: 50%;
+				left: 50%;
+				margin-left: -25px;
+				margin-top: -25px;
+				height: 50px;
+				width: 50px;
+			}
+			
+			.mui-preview-image img.mui-transitioning {
+				-webkit-transition: -webkit-transform 0.5s ease, opacity 0.5s ease;
+				transition: transform 0.5s ease, opacity 0.5s ease;
+			}
+			
+			@-webkit-keyframes fadeIn {
+				0% {
+					opacity: 0;
+				}
+				100% {
+					opacity: 1;
+				}
+			}
+			
+			@keyframes fadeIn {
+				0% {
+					opacity: 0;
+				}
+				100% {
+					opacity: 1;
+				}
+			}
+			
+			@-webkit-keyframes fadeOut {
+				0% {
+					opacity: 1;
+				}
+				100% {
+					opacity: 0;
+				}
+			}
+			
+			@keyframes fadeOut {
+				0% {
+					opacity: 1;
+				}
+				100% {
+					opacity: 0;
+				}
+			}
+			
+			p img {
+				max-width: 100%;
+				height: auto;
+			}
+			.mui-media-object{
+				max-height: 260px;
+				height: 260px;
+				border: 1px solid #E0E0E0;
+			}
+			/*操作*/
+			.mui-table-view.mui-grid-view .mui-table-view-cell.operateRight >div{
+				display: flex;
+				justify-content: space-around;
+			}
+			.mui-table-view-cell p {
+				text-align: left;
+				padding-left: 20px;
+				font-size: 16px;
+				line-height: 24px;
+				overflow: hidden;
+				white-space: nowrap;
+				text-overflow: ellipsis;
+			}
+			.mui-table-view-cell p:last-child {
+				font-size: 15px;
+			}
+			.activeBj{
+				background: #eee;
+			}
+			
+			.mui-table-view-cell p i {
+				margin-right: 15px;
+				color: #007AFF;
+			}
+			.nullData {
+				top: 45px;
+			}
+			.photoMsg,.photoMsg i{
+				color: #21b2e7;
+			}
+			#scrollPlace{
+				padding-bottom: 60px;
+				background: #fff;
+			}
+		</style>
+
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title" id="title"></h1>
+		</header>
+		<div class="mui-content">
+			<div id="scrollPlace" class="mescroll"> <!--id可以改,而"mescroll"的class不能删-->
+		   		<ul id="dataList"  class="mui-table-view mui-grid-view">
+					<!--<li class="item">
+						<div class="mui-table-view-cell mui-col-xs-12">
+							<img class="mui-media-object" src="../images/shuijiao.jpg" data-preview-src="" data-preview-group="1">
+						</div>
+						<div class="mui-table-view-cell mui-col-xs-12 operateRight">
+							<div>
+								<span>2017-6-12 10:09</span>
+								<span><i class="iconfont">&#xe65c;</i>删除</span>
+							</div>
+						</div>
+					</li>-->
+				</ul>
+			</div>
+		</div>
+	</body>
+	<script src="../js/jquery-2.1.0.js"></script>
+	<script src="../js/mui.min.js"></script>
+	<script src="../js/mui.zoom.js"></script>
+	<script src="../js/mescroll.min.js" charset="utf-8"></script>
+	<script src="../js/mui.previewimage.js"></script>
+	<script>
+		var equipId;
+		var startPage = 1;
+		var totalPage = 0;
+		var username;
+		mui.plusReady(function() {
+			var self = plus.webview.currentWebview();
+			equipId = self.equipId;
+			console.log(equipId)
+			//默认第一次加载数据
+//			requestData();
+			username = plus.storage.getItem('username');
+			mescroll = new MeScroll("scrollPlace", {
+				up: {
+					callback: getListData, //上拉回调,此处可简写; 相当于 callback: function (page) { getListData(page); }
+					isBounce: false, //此处禁止ios回弹,解析(务必认真阅读,特别是最后一点): http://www.mescroll.com/qa.html#q10
+					clearEmptyId: "dataList", //1.下拉刷新时会自动先清空此列表,再加入数据; 2.无任何数据时会在此列表自动提示空
+					toTop:{ //配置回到顶部按钮
+						src : "../images/totop.png", //默认滚动到1000px显示,可配置offset修改
+						offset : 700
+					},
+					empty: {
+						//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
+						warpId:	"dataList", //父布局的id (1.3.5版本支持传入dom元素)
+						icon: "../images/listNull.png", //图标,默认null,支持网络图
+						tip: "暂无相关数据~" //提示
+					},
+					htmlNodata: '<p class="upwarp-nodata">-- 没有更多内容了 --</p>',
+					noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据;
+					lazyLoad: {
+			        	use: true // 是否开启懒加载,默认false
+			        }
+				}
+			});
+		})
+
+		/*联网加载列表数据  page = {num:1, size:10}; num:当前页 从1开始, size:每页数据条数 */
+		function getListData(page){
+			//联网加载数据
+			getListDataFromNet(page.num, page.size, function(curPageData,totalSize){
+				//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+				//mescroll会根据传的参数,自动判断列表如果无任何数据,则提示空;列表无下一页数据,则提示无更多数据;
+				//方法二(推荐): 后台接口有返回列表的总数据量 totalSize
+				mescroll.endSuccess(totalSize);
+				//设置列表数据,因为配置了emptyClearId,第一页会清空dataList的数据,所以setListData应该写在最后;
+				setListData(curPageData);
+			}, function(){
+				//联网失败的回调,隐藏下拉刷新和上拉加载的状态;
+                mescroll.endErr();
+				mui.toast('数据请求失败');
+			});
+		}
+		/*设置列表数据*/
+		function setListData(curPageData){
+			var html = '';
+			var dat = curPageData;
+//				var dat = data.img;
+			for(var i = 0; i<dat.length; i++){
+//				html += '<li class="item" data-path="'+dat[i].addr+'"><div class="mui-table-view-cell mui-col-xs-6">' +
+//						'<img class="mui-media-object" src="http://120.27.222.26/'+dat[i].addr+'" data-preview-src="" data-preview-group="1">' +
+//						'</div><div class="mui-table-view-cell mui-col-xs-6 operateRight"><p class="delBtn"><i class="iconfont" >&#xe65c;</i>删除' +
+//						'</p><p class="lookDetial"><i class="iconfont" >&#xe723;</i>查看描述</p><p class="discern"><i class="iconfont" >&#xe62d;</i>识别</p><p class="addDetial">' +
+//						'<i class="iconfont" >&#xe69b;</i>添加描述</p><p class="itemTime">'+dat[i].upl_time+'</p></div></li>';
+				html += '<li class="item" data-path="'+dat[i].addr+'"><div class="mui-table-view-cell mui-col-xs-12">'+
+						'<img class="mui-media-object" src="http://120.27.222.26/'+dat[i].addr+'" data-preview-src="" data-preview-group="1">'+
+						'</div><div class="mui-table-view-cell mui-col-xs-12 operateRight"><div class="photoMsg">'+
+						'<span>'+dat[i].upl_time+'</span><span class="delBtn"><i class="iconfont">&#xe65c;</i>删除</span>'+
+						'</div></div></li>'
+			}
+			$('#dataList').append(html)
+		}
+		/*联网加载列表数据*/
+		function getListDataFromNet(pageNum,pageSize,successCallback,errorCallback) {
+        	mui.ajax('http://120.27.222.26/app_ybq_img', {
+				data: {
+					'page': pageNum,
+					'equip_id': equipId
+				},
+				dataType: 'json', //服务器返回json格式数据
+				type: 'post', //HTTP请求类型
+				timeout: 10000, //超时时间设置为10秒;
+				beforeSend: function() {
+					plus.nativeUI.showWaiting('请求中...');
+				},
+				complete: function() {
+					plus.nativeUI.closeWaiting();
+				},
+				success: function(data) {
+					$('#title').html(data.equip_id)
+					successCallback(data.img,data.nums);
+				},
+				error: function(xhr, type, errorThrown) {
+
+				}
+			});
+		}
+
+		//图片轮播
+		mui.previewImage();
+
+		//删除
+		mui('#dataList').on('tap', '.delBtn', function() {
+			var _this = this;
+			$(_this).addClass("activeBj"); // 追加样式 
+			setTimeout(function(){
+				$(_this).removeClass("activeBj"); //移除p元素中值为"high"的class
+			},30)
+			var path = $(_this).parents('.item').data('path');
+			mui.ajax('http://120.27.222.26/ybq_delete_img', {
+				data: {
+					'addr': path,
+					'imei': equipId
+				},
+				dataType: 'json', //服务器返回json格式数据
+				type: 'post', //HTTP请求类型
+				timeout: 10000, //超时时间设置为10秒;
+				beforeSend: function() {
+					plus.nativeUI.showWaiting('请求中...');
+				},
+				complete: function() {
+					plus.nativeUI.closeWaiting();
+				},
+				success: function(data) {
+					if(data == 0){
+						window.location.reload();
+					}
+				},
+				error: function(xhr, type, errorThrown) {
+					mui.toast('删除失败')
+				}
+			})
+		})
+		//识别
+		mui('#dataList').on('tap', '.discern', function() {
+			var _this = this;
+			$(_this).addClass("activeBj"); // 追加样式 
+			setTimeout(function(){
+				$(_this).removeClass("activeBj"); //移除p元素中值为"high"的class
+			},30)
+			var path = $(_this).parents('.item').data('path');
+			mui.openWindow({
+				url: 'cbd_image_discern_resule.html',
+				id: 'cbd_image_discern_resule',
+				extras: {
+					equipId: equipId,
+					addr: path
+				}
+			})
+		})
+		//查看详情
+		mui('#dataList').on('tap', '.lookDetial', function() {
+			var _this = this;
+			$(_this).addClass("activeBj"); // 追加样式 
+			setTimeout(function(){
+				$(_this).removeClass("activeBj"); //移除p元素中值为"high"的class
+			},30)
+			var path = $(_this).parents('.item').data('path');
+			mui.openWindow({
+				url: 'lookWormDetial.html',
+				id: 'lookWormDetial',
+				extras: {
+					equipId: equipId,
+					addr: path
+				}
+			})
+		})
+		//添加详情
+		mui('#dataList').on('tap', '.addDetial', function() {
+			var _this = this;
+			$(_this).addClass("activeBj"); // 追加样式 
+			setTimeout(function(){
+				$(_this).removeClass("activeBj"); //移除p元素中值为"high"的class
+			},30)
+			var path = $(_this).parents('.item').data('path');
+			mui.openWindow({
+				url: 'wormDescribe.html',
+				id: 'wormDescribe',
+				extras: {
+					equipId: equipId,
+					addr: path
+				}
+			})
+		})
+	</script>
+
+</html>

BIN
fonts/iconfont.eot


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 0
fonts/iconfont.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 364 - 0
fonts/iconfont.svg


BIN
fonts/iconfont.ttf


BIN
fonts/iconfont.woff


BIN
fonts/iconfont.woff2


BIN
fonts/mui.ttf


+ 34 - 0
helpcenter/copy---feedback.html

@@ -0,0 +1,34 @@
+<!doctype html>
+<html lang="en" class="feedback">
+	<head>
+		<meta charset="UTF-8" />
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<title>问题反馈</title>
+		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
+		<link rel="stylesheet" type="text/css" href="../css/feedback.css" />
+		<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" type="text/css" href="../css/common.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">问题反馈</h1>
+			<a id="submit" class="mui-icon fa fa-cloud-upload mui-pull-right"></a>
+		</header>
+		<div class="mui-content">
+			<div class="row mui-input-row">
+				<textarea id='question' class="mui-input-clear question" placeholder="请详细描述你的问题和意见..."></textarea>
+			</div>
+			<p>图片(选填,提供问题截图,总大小10M以下)</p>
+			<div id='image-list' class="row image-list"></div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/feedback.js" type="text/javascript" charset="utf-8"></script>
+		<script type="text/javascript">
+			mui.init();
+			mui('.mui-scroll-wrapper').scroll();
+		</script>
+	</body>
+
+</html>

+ 34 - 0
helpcenter/feedback.html

@@ -0,0 +1,34 @@
+<!doctype html>
+<html lang="en" class="feedback">
+	<head>
+		<meta charset="UTF-8" />
+		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
+		<title>问题反馈</title>
+		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
+		<link rel="stylesheet" type="text/css" href="../css/feedback.css" />
+		<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<link rel="stylesheet" type="text/css" href="../css/common.css"/>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">问题反馈</h1>
+			<a id="submit" class="mui-icon fa fa-cloud-upload mui-pull-right"></a>
+		</header>
+		<div class="mui-content">
+			<div class="row mui-input-row">
+				<textarea id='question' class="mui-input-clear question" placeholder="请详细描述你的问题和意见..."></textarea>
+			</div>
+			<p>图片(选填,提供问题截图,总大小10M以下)</p>
+			<div id='image-list' class="row image-list"></div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/feedback.js" type="text/javascript" charset="utf-8"></script>
+		<script type="text/javascript">
+			mui.init();
+			mui('.mui-scroll-wrapper').scroll();
+		</script>
+	</body>
+
+</html>

+ 157 - 0
helpcenter/help_detail.html

@@ -0,0 +1,157 @@
+<!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" />
+		<style type="text/css">
+			body,
+			.mui-content {
+				background: #fff;
+				margin-top: 5px;
+			}
+			
+			.mui-card-footer:before,
+			.mui-card-header:after {
+				background: transparent;
+			}
+			
+			.mui-card-content-inner img {
+				width: 48%;
+			}
+			
+			.mui-card-header .mui-icon-chatboxes {
+				color: #777;
+			}
+			
+			.mui-card-content:after,.commentBody:after {
+				position: absolute;
+				bottom: 0;
+				right: 0;
+				left: 0;
+				height: 1px;
+				content: '';
+				-webkit-transform: scaleY(.5);
+				transform: scaleY(.5);
+				background-color: #c8c7cc;
+			}
+			.mui-card-content-inner{
+				padding-top: 0;
+			}
+			/*评论*/
+			
+			.commentHead{
+				padding: 15px 15px 0 15px;
+			}
+			.commentBody{
+				padding: 15px;
+				position: relative;
+			}
+			
+			.commentHead a {
+				color: #777;
+				font-size: 22px;
+				vertical-align: middle;
+				margin-right: 5px;
+			}
+			
+			.commentHead span {
+				font-size: 16px;
+			}
+			
+			.commentBody>img {
+				font-size: 0;
+				line-height: 0;
+				float: left;
+				width: 34px;
+				height: 34px;
+			}
+			
+			.commentBody .mui-media-body {
+				font-size: 14px;
+				font-weight: 500;
+				line-height: 17px;
+				margin-bottom: 0;
+				margin-left: 44px;
+				color: #333;
+			}
+			
+			.commentBody .mui-media-body p {
+				font-size: 18px;
+				margin-bottom: 5px;
+				color: #111111;
+				line-height: 27px;
+			}
+			.describeTxt{
+				letter-spacing: 3px;
+			}
+			.describeTxt img{
+				width: 48%;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">问题详情</h1>
+		</header>
+		<div class="mui-content">
+			<div class="mui-card-header mui-card-media">
+				<img src="../img/logo.png">
+				<div class="mui-media-body">
+					小M
+					<p>发表于 2016-06-30 15:30</p>
+				</div>
+			</div>
+			<div class="mui-card-content">
+				<div class="mui-card-content-inner">
+					<div>
+						包含页眉页脚的卡片,页眉常用来显示面板标题,页脚用来显示额外信息或支持的操作(比如点赞、评论等)
+					</div>
+					<img src="../images/cbd.jpg" />
+					<img src="../images/cbd.jpg" />
+				</div>
+			</div>
+			<div id="comment">
+				<div class="commentHead">
+					<a class="mui-icon mui-icon-chatboxes"></a>
+					<span>评论(2)</span>
+				</div>
+				
+				<div class="commentBody">
+					<img src="../img/logo.png">
+					<div class="mui-media-body">
+						<p>小M</p>
+						<div class="describeTxt">
+							<div >
+								描述描述描述描述描述描述描述描述
+								描述描述描述描述描述描述描述描述
+								描述描述描述描述描述描述描述描述
+								描述描述描述描述描述描述描述描述
+							</div>
+							<img src="../images/cbd.jpg"/>
+						</div>
+					</div>
+				</div>
+				<div class="commentBody">
+					<img src="../img/logo.png">
+					<div class="mui-media-body">
+						<p>小M</p>
+						<div class="describeTxt">
+							小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M小M
+						</div>
+					</div>
+				</div>
+				
+			</div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init()
+		</script>
+	</body>
+
+</html>

+ 94 - 0
helpcenter/help_list.html

@@ -0,0 +1,94 @@
+<!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" />
+		<style type="text/css">
+			body,
+			.mui-content {
+				background: #fff;
+			}
+			
+			.mui-card-header.mui-card-media .mui-media-body {
+				margin-left: 8px;
+			}
+			
+			.mui-card-footer:before,
+			.mui-card-header:after {
+				background: transparent;
+			}
+			
+			.mui-card-content-inner img {
+				width: 48%;
+			}
+			
+			.mui-card-header .mui-icon-chatboxes {
+				color: #777;
+			}
+			
+			.mui-card-content:after {
+				position: absolute;
+				bottom: 0;
+				right: 0;
+				left: 0;
+				height: 1px;
+				content: '';
+				-webkit-transform: scaleY(.5);
+				transform: scaleY(.5);
+				background-color: #c8c7cc;
+			}
+		</style>
+	</head>
+
+	<body>
+		<div class="mui-content">
+			<div class="mui-card-header mui-card-media">
+				<img src="../img/logo.png">
+				<div class="mui-media-body mui-pull-left">
+					小M
+					<p>发表于 2016-06-30 15:30</p>
+				</div>
+				<a class="mui-icon mui-icon-chatboxes mui-pull-right"></a>
+			</div>
+			<div class="mui-card-content">
+				<div class="mui-card-content-inner">
+					<div>
+						包含页眉页脚的卡片,页眉常用来显示面板标题,页脚用来显示额外信息或支持的操作(比如点赞、评论等)
+					</div>
+					<img src="../images/cbd.jpg" />
+					<img src="../images/cbd.jpg" />
+				</div>
+			</div>
+			<div class="mui-card-header mui-card-media">
+				<img src="../img/logo.png">
+				<div class="mui-media-body mui-pull-left">
+					小M
+					<p>发表于 2016-06-30 15:30</p>
+				</div>
+				<a class="mui-icon mui-icon-chatboxes mui-pull-right"></a>
+			</div>
+			<div class="mui-card-content">
+				<div class="mui-card-content-inner">
+					<div>
+						包含页眉页脚的卡片,页眉常用来显示面板标题,页脚用来显示额外信息或支持的操作(比如点赞、评论等)
+					</div>
+					<img src="../images/loginBj.jpg" />
+				</div>
+			</div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init();
+			mui(".mui-card-header").on("tap", "a", function(e) {
+				mui.openWindow({
+					url:'help_detail.html',
+					id:'help_detail'
+				})
+			})
+		</script>
+	</body>
+
+</html>

+ 113 - 0
helpcenter/useDirection.html

@@ -0,0 +1,113 @@
+<!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/common.css" />
+		<style type="text/css">
+			.useHead{
+				margin-bottom: 10px;
+			}
+			.number {
+				position: absolute;
+				left: 10px;
+				width: 25px;
+				height: 25px;
+				border-radius: 50%;
+				background: #46c1ed;
+				top: 9px;
+				text-align: center;
+				line-height: 25px;
+				color: #fff;
+			}
+			
+			.questionTit {
+				font-size: 16px;
+				padding-left: 35px;
+			}
+			
+			.useBody {
+				padding-left: 35px;
+			}
+			.mui-content>.mui-table-view:first-child{
+				margin-top: 0;;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">使用说明</h1>
+		</header>
+		<div class="mui-content">
+			<ul class="mui-table-view">
+				<li class="mui-table-view-cell">
+					<div class="useHead">
+						<div class="number">1</div>
+						<div class="questionTit">频振式杀虫灯的技术参数?</div>
+					</div>
+					<div class="useBody">
+						<p>诱虫光源:频振灯管,波长为320~680nm </p>
+						<p>符合GB/T 24689.2-2009标准</p>
+						<p>撞击面积:≥0.15㎡</p>
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<div class="useHead">
+						<div class="number">2</div>
+						<div class="questionTit">杀虫灯的使用、设置方法:</div>
+					</div>
+					<div class="useBody">
+						<p>设备开机/关机:短按开关键;</p>
+						<p>恢复到出厂默认设置:长按开关键;</p>
+						<p>光控功能:光控模块检测到环境光线明暗程度到设定值时,延时10min后,重新检测一次,两次检测一致,杀虫灯开始正常工作,否则不工作。</p>
+						<p>时控功能:根据不同种类害虫的活动时间规律,设定10个工作时间段智能控制模块:</p>
+						<p>出厂默认工作时长4个小时,开机后状态指示灯慢闪4次。</p>
+						<p>每长按测试键一次,杀虫灯工作时间增加1小时。</p>
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<div class="useHead">
+						<div class="number">3</div>
+						<div class="questionTit">杀虫灯状态指示说明:</div>
+					</div>
+					<div class="useBody">
+						<p>注:指示灯慢闪的次数指示当前的定时小时数,当定时结束,红灯慢闪不停,进入待机模式,等待充电。</p>
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<div class="useHead">
+						<div class="number">4</div>
+						<div class="questionTit">杀虫灯的温控说明:</div>
+					</div>
+
+					<div class="useBody">
+						<p>温度保护:工作的环境温度为10°C~70°C。环境温度低于10°C,杀虫灯停止工作,蓄电池进入充电维护状态。环境温度高于70°C时,电路自动进入保护状态,杀虫灯停止工作。</p>
+					</div>
+				</li>
+				<li class="mui-table-view-cell">
+					<div class="useHead">
+						<div class="number">5</div>
+						<div class="questionTit">杀虫灯自动保护功能下,状态灯显示模式:</div>
+					</div>
+					<div class="useBody">
+						<p>当环境温度大于75℃或小于10℃,温度保护:红灯快闪1次停2s;</p>
+						<p>倾倒保护:红灯快闪1次停2s;</p>
+						<p>电池电压大于14.2V:蓄电池过压保护:红灯快闪2次停2s;</p>
+						<p>工作电压小于:11.6V:蓄电池欠压保护:红灯快闪2次停2s</p>
+						<p>湿度保护:红灯快闪3次停2s;</p>
+					</div>
+				</li>
+			</ul>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init()
+		</script>
+	</body>
+
+</html>

+ 217 - 0
home/autoDiscern.html

@@ -0,0 +1,217 @@
+<!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">	
+			.innerBox{
+				width: 80%;
+				margin: 10% auto;
+				border-radius: 10px;
+				background: #fff;
+				position: relative;
+    			padding-bottom: 30px;
+			}
+			.discernImg >img{
+				border-radius: 10px 10px 0 0;
+			}
+			.detailsBox{
+				padding: 0 10%;
+			}
+			.detailsBox h1{
+				font-size: 20px;
+				line-height: 50px;
+				border-bottom: 1px solid #d3d3d3;
+			}
+			.detailsBox >div{
+				color: #626262;
+				text-indent: 30px;
+			}
+			/*上传按钮*/
+			.upfileBox{
+				position: absolute;
+			    left: 0;
+			    right: 0;
+			    text-align: center;
+			    bottom: -27px;
+			}
+			.upfileBox:after{
+				position: absolute;
+			    bottom: -23px;
+			    content: '上传图片可识别昆虫,获取昆虫资料';
+			    left: 0;
+			    right: 0;
+			    color: #d0cece;
+			}
+			#upFile{
+				width: 150px;
+			    height: 50px;
+			    border-radius: 27px;
+			    background: url(../images/upfilebj.png) no-repeat;
+			    background-size: cover;
+			    border: none;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">拍照识别</h1>
+		</header>
+		<div class="mui-content">
+			<div class="innerBox">
+				<div class="introduceBox">
+					<div class="discernImg">
+						<img src="../images/ant.jpg" width="100%"/>
+					</div>
+					<div class="detailsBox">
+						<h1>蚂蚁</h1>
+						<div class="">
+							蚂蚁是一种昆虫,别名蚁、玄驹、昆蜉、蚍蜉蚂,属节肢动物门,昆虫纲,膜翅目,蚁科。蚂蚁的种类繁多,世界上已知有11700多种,有21亚科283属,中国境内已确定的蚂蚁种类有600多种。 
+						</div>
+					</div>
+				</div>
+				<div class="upfileBox">
+					<button id="upFile"></button>
+				</div>
+			</div>
+		</div>
+
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			//上传
+			document.getElementById('upFile').addEventListener('tap', function() {
+				if(mui.os.plus) {
+					var a = [{
+						title: '拍照'
+					}, {
+						title: '从手机相册选择'
+					}];
+					plus.nativeUI.actionSheet({
+						title: '识别图片',
+						cancel: '取消',
+						buttons: a
+					}, function(b) {
+						console.log(b.index)
+						switch(b.index) {
+							case 0:
+								break;
+							case 1:
+								//拍照
+								getImages();
+								break;
+							case 2:
+								//打开相册
+								galleryImages();
+								break;
+							default:
+								break;
+						}
+					}, false);
+				}
+			});
+
+			//拍照
+			function getImages() {
+				var mobileCamera = plus.camera.getCamera();
+				mobileCamera.captureImage(function(e) {
+					plus.io.resolveLocalFileSystemURL(e, function(entry) {
+						var path = entry.toLocalURL() + '?version=' + new Date().getTime();
+						uploadHeadImg(path);
+					}, function(e) {
+						console.log("读取拍照文件错误");
+					});
+				}, function(e) {
+					console.log("er", e);
+				}, function() {
+					filename: '_doc/head.png';
+				});
+			}
+
+			//从本地相册选择
+			function galleryImages() {
+				console.log("你选择了从相册选择");
+				plus.gallery.pick(function(a) {
+					plus.io.resolveLocalFileSystemURL(a, function(entry) {
+						plus.io.resolveLocalFileSystemURL('_doc/', function(root) {
+							root.getFile('head.png', {}, function(file) {
+								//文件已经存在
+								file.remove(function() {
+									console.log("文件移除成功");
+									entry.copyTo(root, 'head.png', function(e) {
+										var path = e.fullPath + '?version=' + new Date().getTime();
+										uploadHeadImg(path);
+									}, function(err) {
+										console.log("copy image fail: ", err);
+									});
+								}, function(err) {
+									console.log("删除图片失败:(" + JSON.stringify(err) + ")");
+								});
+							}, function(err) {
+								//打开文件失败
+								entry.copyTo(root, 'head.png', function(e) {
+									var path = e.fullPath + '?version=' + new Date().getTime();
+									uploadHeadImg(path);
+								}, function(err) {
+
+									console.log("上传图片失败:(" + JSON.stringify(err) + ")");
+								});
+							});
+						}, function(e) {
+							console.log("读取文件夹失败:(" + JSON.stringify(err) + ")");
+						});
+					});
+				}, function(err) {
+					console.log("读取拍照文件失败: ", err);
+				}, {
+					filter: 'image'
+				});
+			};
+
+			//上传图片
+			function uploadHeadImg(imgPath) {
+				//服务端接口路径
+				var server = "http://120.27.222.26/app_insect_discern";
+				//获取图片元素
+				var wt = plus.nativeUI.showWaiting('上传中...');
+				var task = plus.uploader.createUpload(server, {
+						method: "POST",
+						//							timeout:10
+					},
+					function(t, status) { //上传完成
+						if(status == 200) {
+//							alert("上传成功:" + t.responseText);
+							wt.close(); //关闭等待提示按钮
+							mui.openWindow({
+								url:'autoDiscernResult.html',
+								id:'autoDiscernResult',
+								extras: {
+									responseText: t.responseText
+								},
+
+							})
+						} else {
+							alert("上传失败");
+							wt.close(); //关闭等待提示按钮
+						}
+					}
+				);
+				//添加其他参数
+				//					task.addData("name", "test");
+				task.addData("req", "change_photo");
+				task.addFile(imgPath, {
+					key: "imagefile"
+				});
+				task.start();
+			}
+		</script>
+	</body>
+
+</html>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 338 - 0
home/autoDiscernResult.html


+ 126 - 0
home/bottonTab.html

@@ -0,0 +1,126 @@
+<!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" />
+		<style type="text/css">
+			body {
+				background: #fff;
+			}
+			
+			.mui-bar {
+				-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
+				box-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
+				padding-top: 6px;
+			}
+		</style>
+	</head>
+
+	<body>
+		<nav class="mui-bar mui-bar-tab">
+			<a class="mui-tab-item mui-active" data-id="firstPage">
+				<img class="mui-icon" src="../images/home-active.png" />
+				<span class="mui-tab-label">首页</span>
+			</a>
+			<a class="mui-tab-item" data-id="equip">
+				<img class="mui-icon" src="../images/equip.png" />
+				<span class="mui-tab-label">设备</span>
+			</a>
+			<a class="mui-tab-item" data-id="warning">
+				<img class="mui-icon" src="../images/warning.png" />
+				<span class="mui-tab-label">预警</span>
+			</a>
+			<a class="mui-tab-item" data-id="setting">
+				<img class="mui-icon" src="../images/my.png" />
+				<span class="mui-tab-label">我的</span>
+			</a>
+		</nav>
+		<div class="mui-content">
+
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init();
+			mui.plusReady(function() {
+				//关闭等待框
+				plus.nativeUI.closeWaiting();
+				//显示当前页面
+				mui.currentWebview.show();
+				plus.webview.hide('login');
+				plus.webview.close('login');
+				//预加载页面
+				var arr = document.getElementsByClassName("mui-tab-item");
+				var objYe = ["homePage.html", "equip.html", "../warning/warning.html", "personalinfo.html"];
+				var objStyle = {
+					top: "0px",
+					bottom: "51px",
+				};
+				var objs = [];
+				var self = plus.webview.currentWebview(); //取到当前的主页窗口
+				for(var i = 0; i < arr.length; i++) {
+					! function(i) {
+						var obj = plus.webview.create(objYe[i], objYe[i], objStyle);
+						objs.push(obj);
+
+						arr[i].addEventListener("tap", function() {
+							for(var j = 0; j < arr.length; j++) {
+								if(j != i) {
+									objs[j].hide()
+								} else {
+									objs[j].show()
+								}
+							}
+							self.append(objs[i])
+						})
+					}(i)
+				}
+				mui.trigger(arr[0], "tap");
+
+				//选项卡点击事件
+				mui(".mui-bar-tab").on("tap", "a", function(e) {
+					// 获取当前点击的选项
+					var targetTab = this.getAttribute("href");
+					//当前选项值传到父webview
+					var currWs = plus.webview.currentWebview();
+					var targetTitle = this.querySelector(".mui-tab-label").innerHTML;
+
+					/**
+					 * 用图片作为图标而不用字体图标。
+					 */
+
+					// 获取图标对象
+
+					var targetIcon = mui(this.children[0])[0];
+					//初始化
+					mui(".mui-bar-tab .mui-tab-item img").each(function(index, item) {
+						var itemSrc = item.getAttribute("src");
+						if(itemSrc.indexOf("active")) {
+							item.src = itemSrc.replace("-active.png", ".png");
+						}
+					});
+					//设置当前的图标
+					targetIcon.src = targetIcon.getAttribute("src").replace(".png", "-active.png");
+				});
+			})
+			//退出应用
+			mui.oldback = mui.back;
+			var clickNum = 0;
+			mui.back = function(event) {
+				clickNum++;
+				if(clickNum > 1) {
+					plus.runtime.quit();
+				} else {
+					mui.toast("再按一次退出应用");
+				}
+				setTimeout(function() {
+					clickNum = 0
+				}, 1000);
+				return false;
+			}
+		</script>
+	</body>
+
+</html>

+ 133 - 0
home/copy-equip.html

@@ -0,0 +1,133 @@
+<!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">
+			.equitIconBox {
+				width: 150px;
+				height: 150px;
+				background: pink;
+				border-radius: 50%;
+				margin: 19px auto;
+				text-align: center;
+			}
+			
+			.mui-content {
+				background: #fff;
+			}
+			
+			.borderRight {
+				border-right: 2px solid #efeff4;
+			}
+			
+			.borderbottom {
+				border-bottom: 2px solid #efeff4;
+			}
+			/*.equitIconBox>i{
+				display: block;
+				font-size: 61px;
+				padding: 53px 0 20px 10px;
+				color: #8f8f94;
+			}*/
+			
+			.equitIconBox>img {
+				width: 100%;
+			}
+			
+			.categoryTitle {
+				text-align: center;
+				font-size: 18px;
+			}
+			
+			@media (max-width: 400px) {
+				.mui-col-sm-6 {
+					width: 50%;
+				}
+			}
+
+			#category .mui-col-sm-6:active{
+				background-color: #eee !important;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<h1 class="mui-title">设备中心</h1>
+		</header>
+		<div class="mui-content">
+			<div class="mui-row" id="category">
+				<div class="mui-col-sm-6 borderRight borderbottom" >
+					<div id="scdEquip">
+						<div class="equitIconBox">
+							<img src="../images/equipIndicate2.png" />
+						</div>
+						<p class="categoryTitle">设备管理</p>
+					</div>
+				</div>
+				<div class="mui-col-sm-6 borderbottom" id="">
+					<div id="cbdEquip">
+						<div class="equitIconBox">
+							<img src="../images/equipIndicate4.png" />
+						</div>
+						<p class="categoryTitle">设备管理</p>
+					</div>
+				</div>
+				<div class="mui-col-sm-6 borderRight borderbottom" id="">
+					<div id="scdReport">
+						<div class="equitIconBox">
+							<img src="../images/equipIndicate3.png" />
+						</div>
+						<p class="categoryTitle">报表管理</p>
+					</div>
+				</div>
+				<div class="mui-col-sm-6  borderbottom">
+					<div id="cbdReport">
+						<div class="equitIconBox">
+							<img src="../images/equipIndicate1.png" />
+						</div>
+						<p class="categoryTitle">报表管理</p>
+					</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();
+			document.getElementById('scdEquip').addEventListener('tap',function(){
+				mui.openWindow({
+					url: '../equipManage/equipManage_scd.html',
+					id: 'equipManage_scd'
+				})
+			})
+			document.getElementById('cbdEquip').addEventListener('tap',function(){
+				mui.openWindow({
+					url: '../equipManage/equipManage_cbd.html',
+					id: 'equipManage_cbd'
+				})
+			})
+			document.getElementById('scdReport').addEventListener('tap',function(){
+				mui.openWindow({
+					url: '../reportManage/reprotManage_scd.html',
+					id: 'reprotManage_scd'
+				})
+			})
+			document.getElementById('cbdReport').addEventListener('tap',function(){
+				mui.openWindow({
+					url: '../reportManage/reprotManage_cbd.html',
+					id: 'reprotManage_cbd'
+				})
+			})
+		</script>
+	</body>
+
+</html>

+ 325 - 0
home/copyhomePage.html

@@ -0,0 +1,325 @@
+<!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 href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			body,
+			.mui-content,
+			.mui-grid-view.mui-grid-9 {
+				background: #fff;
+			}
+			.mui-slider .mui-slider-group .mui-slider-item img{
+				height: 200px;
+			}
+			/*分类*/
+			/*.mui-col-xs-2_5 {
+				width: 20%;
+			}*/
+			
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell {
+				padding: 4px 2px;
+			}
+			
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell a>img {
+				width: 55%;
+			}
+			
+			.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body{
+				font-size: .8em;
+    			margin-top: 5px;
+			}
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn){
+				padding: 2px 0;
+			}
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell {
+				border: none;
+			}
+			.mui-grid-view.mui-grid-9{
+				padding: 5px 0;
+			}
+			/*产品介绍*/
+			
+			.introduceHead {
+				text-align: center;
+				background: #eee;
+				line-height: 35px;
+			}
+			
+			.introduceHead h1 {
+				font-size: 18px;
+				font-weight: 100;
+				display: inline-block;
+				position: relative;
+			}
+			
+			.introduceHead h1:after {
+				position: absolute;
+				width: 30px;
+				height: 1px;
+				background: #bebebe;
+				content: '';
+				top: 8px;
+				right: -60px;
+			}
+			
+			.introduceHead h1:before {
+				position: absolute;
+				width: 30px;
+				height: 1px;
+				background: #bebebe;
+				content: '';
+				top: 8px;
+				left: -60px;
+			}
+			/*产品列表*/
+			
+			.item {
+				position: relative;
+				padding-bottom: 15px;
+				padding-top: 20px;
+				overflow: hidden;
+				clear: both;
+			}
+			
+			.equipList .item>img {
+				width: 38%;
+				float: left;
+				margin-left: 4px;
+				margin-top: 10px;
+			}
+			
+			.equipList .item>.itemInfo {
+				margin-left: 44%;
+			}
+			
+			.itemInfo h1 {
+				font-size: 18px;
+				color: #21b2e7;
+			}
+			
+			.itemInfo .itemTxt {
+				color: #9a9999;
+				font-size: 12px;
+				line-height: 22px;
+				letter-spacing: 2px;
+			}
+			
+			.item:after {
+				position: absolute;
+				right: 0;
+				bottom: 0;
+				left: 0px;
+				height: 1px;
+				content: '';
+				-webkit-transform: scaleY(.5);
+				transform: scaleY(.5);
+				background-color: #c8c7cc;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<h1 class="mui-title">首页</h1>
+		</header>
+		<div class="mui-content" id="app">
+			<!--轮播-->
+			<div id="slider" class="mui-slider" style="height: 200px;">
+				<div class="mui-slider-group">
+					<!-- 额外增加的一个节点(循环轮播:第一个节点是最后一张轮播) -->
+					<div class="mui-slider-item mui-slider-item-duplicate" v-for="(slider, index) in sliders">
+						<a href="#">
+							<img class="guide-img" :src="slider.src">
+							<p class="mui-slider-title">{{slider.text}}</p>
+						</a>
+					</div>
+					<!-- 第一张 -->
+					<!--<div class="mui-slider-item">
+						<a href="page1.html">
+							<img class="guide-img" src="../images/cbd.jpg">
+							<p class="mui-slider-title">静静看这世界1</p>
+						</a>
+					</div>-->
+					<!-- 第二张 -->
+					<!--<div class="mui-slider-item">
+						<a href="#">
+							<img class="guide-img" src="../images/shuijiao.jpg">
+							<p class="mui-slider-title">静静看这世界2</p>
+						</a>
+					</div>-->
+					<!-- 第三张 -->
+					<!--<div class="mui-slider-item">
+						<a href="#">
+							<img class="guide-img" src="../images/muwu.jpg">
+							<p class="mui-slider-title">静静看这世界3</p>
+						</a>
+					</div>-->
+					<!-- 第四张 -->
+					<!--<div class="mui-slider-item">
+						<a href="#">
+							<img class="guide-img" src="../images/yuantiao.jpg">
+							<p class="mui-slider-title">静静看这世界4</p>
+						</a>
+					</div>-->
+					<!-- 额外增加的一个节点(循环轮播:最后一个节点是第一张轮播) -->
+					<!--<div class="mui-slider-item">
+						<a href="#">
+							<img class="guide-img" src="../images/cbd.jpg">
+							<p class="mui-slider-title">静静看这世界1</p>
+						</a>
+					</div>-->
+				</div>
+				<div class="mui-slider-indicator mui-text-right">
+					<div class="mui-indicator" v-for="(slider, index) in sliders" v-bind:class="index==0?'mui-active':''"></div>
+				</div>
+			</div>
+			<!--轮播结束-->
+			<!--分类-->
+			<ul class="mui-table-view mui-grid-view mui-grid-9" id="kind">
+				<li class="mui-table-view-cell mui-media mui-col-xs-3" v-for="(menu, index) in menus" @click="goPage(index)">
+					<!--<a v-bind:href="menu.link">-->
+					<a href="#">
+						<img :src="'../images/'+menu.icon"/>
+						<div class="mui-media-body">{{ menu.text }}</div>
+					</a>
+				</li>
+			</ul>
+			<!--分类结束-->
+			<!--产品介绍-->
+			<div class="equipIntroduce">
+				<div class="introduceHead">
+					<h1>产品介绍</h1>
+				</div>
+				<div class="equipList">
+					<div class="item" src='#'>
+						<img src="../images/scd_equip.jpg" />
+						<div class="itemInfo">
+							<h1>智慧物联网杀虫灯</h1>
+							<div class="itemTxt">
+								智慧物联网杀虫灯是利用太阳能电池板作为用电来源,其将白天太阳能发的电贮存起来,晚上放电给杀虫灯具,供其工作。太阳能杀虫灯无需市电,不用挖沟拉线,天黑灯亮,天亮灯熄,并且对人畜安全。
+							</div>
+						</div>
+					</div>
+					<div class="item" src='#'>
+						<img src="../images/cbd_equip.jpg" />
+						<div class="itemInfo">
+							<h1>远程拍照式虫情测报灯</h1>
+							<div class="itemTxt">
+								远程拍照式虫情测报灯可对昆虫的发生、发展进行实时自动拍照、实现图像采集和监测分析,自动上传到远端的云飞物联网监控服务平台,为农业现代化提供服务,满足虫情预测预报、采集标本的需要。
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<!--产品介绍结束-->
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			var app = new Vue({
+				el:'#app',
+				data:{
+					menus:[
+						{text:'设备分配',icon:'categoryIcon1.png',link:'map.html'},
+						{text:'设备列表',icon:'categoryIcon2.png',link:'1.html'},
+						{text:'使用说明',icon:'categoryIcon3.png',link:'2.html'},
+						{text:'SIM信息',icon:'categoryIcon4.png',link:'3.html'},
+						{text:'5',icon:'categoryIcon5.png',link:'4.html'},
+						{text:'6',icon:'categoryIcon6.png',link:'5.html'},
+						{text:'7',icon:'categoryIcon7.png',link:'6.html'},
+						{text:'8',icon:'categoryIcon8.png',link:'7.html'},
+					],
+					sliders:[
+//						{text:'轮播图3',src:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1537267033948&di=e716ddf4ff6792a2459f737dafcd2f54&imgtype=0&src=http%3A%2F%2Fpic.qiantucdn.com%2F58pic%2F17%2F56%2F27%2F12S58PIC89m_1024.jpg',link:'2.html'},
+						{text:'轮播图1',src:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1537266763355&di=db97ddd4933fe21744c9e5bb85a059ad&imgtype=0&src=http%3A%2F%2Fpic.qiantucdn.com%2F58pic%2F25%2F97%2F64%2F40b58PICBQm_1024.jpg',link:'map.html'},
+						{text:'轮播图2',src:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1537266763355&di=b32ea16e48059e606833e553c360aaeb&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F016ad958eddb0ba8012049ef9f8413.jpg%40900w_1l_2o_100sh.jpg',link:'1.html'},
+						{text:'轮播图3',src:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1537267033948&di=e716ddf4ff6792a2459f737dafcd2f54&imgtype=0&src=http%3A%2F%2Fpic.qiantucdn.com%2F58pic%2F17%2F56%2F27%2F12S58PIC89m_1024.jpg',link:'2.html'},
+//						{text:'轮播图1',src:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1537266763355&di=db97ddd4933fe21744c9e5bb85a059ad&imgtype=0&src=http%3A%2F%2Fpic.qiantucdn.com%2F58pic%2F25%2F97%2F64%2F40b58PICBQm_1024.jpg',link:'map.html'},
+					]
+				},
+				methods:{
+					goPage:function(subscript){
+						console.log(this.menus)
+						mui.openWindow({
+							url:this.menus[subscript].link,
+							id:this.menus[subscript].link
+						})
+					}
+				}
+			})
+//			mui.init();
+//			mui('#slider').slider({
+//				interval: 5000
+//			});
+//			
+//			$('.mui-content').hide()
+			
+//			mui.plusReady(function(){
+//				mui.ajax('http://120.27.222.26/app_login', {
+//					data: {
+//						'username': 'admin',
+//						'password': 'yunfeiadmin'
+//					},
+//					dataType: 'json', //服务器返回json格式数据
+//					type: 'post', //HTTP请求类型
+//					timeout: 10000, //超时时间设置为10秒;
+//					beforeSend: function() {
+//						plus.nativeUI.showWaiting();
+//					},
+//					complete: function() {
+//						plus.nativeUI.closeWaiting();
+//						$('.mui-content').show()
+//					},
+//					success: function(data) {
+//						console.log(data)
+//						$('#kind li').eq(4).hide();
+//						$('#kind li').eq(5).hide();
+//						$('#kind li').eq(6).hide();
+//						$('#kind li').eq(7).hide();
+//					},
+//					error: function(xhr, type, errorThrown) {
+//						console.log(type)
+//						console.log(errorThrown)
+//						mui.toast('登录请求失败');
+//					}
+//				});
+//				轮播图
+//				mui('#slider').on('tap', 'a', function() {
+//					console.log(this.href);
+//					//获取最后一位反斜杠之后的元素 ++ 取点之前的元素
+//					var id = (this.href.substr(this.href.lastIndexOf('/') + 1)).split('.')[0]
+//					mui.openWindow({
+//						url:this.href,
+//						id:id
+//					})
+//				});
+//				//种类
+//				mui('#kind').on('tap', 'a', function() {
+//					//获取最后一位反斜杠之后的元素 ++ 取点之前的元素
+//					var id = (this.href.substr(this.href.lastIndexOf('/') + 1)).split('.')[0]
+//					mui.openWindow({
+//						url:this.href,
+//						id:id
+//					})
+//				});
+//				//产品
+//				mui('.equipList').on('tap', '.item', function() {
+//					var src = this.getAttribute('src');
+//					var id = (src.substr(src.lastIndexOf('/') + 1)).split('.')[0]
+//					mui.openWindow({
+//						url:src,
+//						id:id
+//					})
+//				});
+//			})
+			
+		</script>
+	</body>
+
+</html>

+ 244 - 0
home/equip.html

@@ -0,0 +1,244 @@
+<!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>

+ 156 - 0
home/guide.html

@@ -0,0 +1,156 @@
+<!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" />
+		<style type="text/css">
+			body {
+				background-color: #fff;
+			}
+			
+			.guide-img {
+				width: 100%;
+			}
+			
+			#start {
+				position: absolute;
+			    bottom: 1.8em;
+			    border-radius: 30px;
+			    width: 99px;
+			    left: 50%;
+			    margin-left: -54px;
+			}
+			.mui-slider-indicator{
+				bottom: 1.8em;
+			}
+			.mui-slider-indicator .mui-indicator,.mui-indicator.mui-active,.mui-slider-indicator .mui-active.mui-indicator{
+				background: #1895cd;
+				box-shadow:none;
+			}
+			.mui-slider-indicator .mui-indicator{
+				width: 10px;
+				height: 10px;
+			}
+			.mui-indicator.mui-active{
+				width: 30px;
+				border-radius: 30px;
+			}
+			.mui-btn-green{
+				color: #1c9acd;
+    			border: 1px solid #1c9acd;
+			}
+			.mui-btn-green:enabled:active{
+				color: #fff;
+    			border: 1px solid #1c9acd;
+    			background-color: #1c9acd;
+			}
+			.mui-btn-outlined.mui-btn-green{
+				color: #1c9acd;
+			}
+		</style>
+	</head>
+
+	<body>
+		<div class="mui-content">
+			<div class="mui-slider mui-fullscreen">
+				<div class="mui-slider-group">
+					<div class="mui-slider-item">
+						<a href="javascript:;">
+							<img class="guide-img" src="../images/guidePage1.jpg">
+						</a>
+					</div>
+					<div class="mui-slider-item">
+						<a href="javascript:;">
+							<img class="guide-img" src="../images/guidePage2.jpg">
+						</a>
+					</div>
+					<div class="mui-slider-item">
+						<a href="javascript:;">
+							<img class="guide-img" src="../images/guidePage3.jpg">
+							<button class="mui-btn mui-btn-green mui-btn-outlined" type="button" id="start">开始体验</button>
+						</a>
+					</div>
+				</div>
+				<div class="mui-slider-indicator" id="sliderIndicator">
+					<div class="mui-indicator mui-active"></div>
+					<div class="mui-indicator"></div>
+					<div class="mui-indicator"></div>
+				</div>
+			</div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init();
+			mui.plusReady(function() {
+				/**
+				 * 获取系统状态栏高度
+				 * http://www.html5plus.org/doc/zh_cn/navigator.html#plus.navigator.getStatusbarHeight
+				 */
+				var sh = plus.navigator.getStatusbarHeight();
+				/**
+				 * 获取设备屏幕高度分辨率以及宽度分辨率
+				 * http://www.html5plus.org/doc/zh_cn/device.html#plus.screen.resolutionHeight
+				 * http://www.html5plus.org/doc/zh_cn/device.html#plus.screen.resolutionWidth
+				 */
+				var h = plus.screen.resolutionHeight;
+				var w = plus.screen.resolutionWidth;
+				/**
+				 * 设置图片高度,这里图片并不规范;
+				 * 实际开发中,建议大家制作iphone6plus规格的图片;
+				 */
+				var imgs = document.querySelectorAll(".guide-img");
+				for(var i = 0, len = imgs.length; i < len; i++) {
+					imgs[i].style.height = (h - sh) + "px";
+					imgs[i].style.width = w + "px";
+				}
+				/**
+				 * 手动关闭启动页
+				 * http://www.html5plus.org/doc/zh_cn/navigator.html#plus.navigator.closeSplashscreen
+				 */
+				plus.navigator.closeSplashscreen();
+				document.getElementById("start").addEventListener("tap", function() {
+					/**
+					 * 向本地存储中设置launchFlag的值,即启动标识;
+					 * http://www.html5plus.org/doc/zh_cn/storage.html#plus.storage.setItem
+					 */
+					plus.storage.setItem("launchFlag", "true");
+					mui.openWindow({
+						url: "login.html",
+						id: "login",
+						extras: {
+							mark: "gudie" //同样,这里也只是个标识,实际开发中并不用;
+						}
+					});
+				});
+			});
+			//最后一页不显示指示器
+			document.querySelector('.mui-slider').addEventListener('slide', function(event) {
+				if(event.detail.slideNumber == 2){
+					document.getElementById('sliderIndicator').style.display = 'none';
+				}else{
+					document.getElementById('sliderIndicator').style.display = 'block';
+				}
+			});
+			/**
+			 * 重写mui.back(),什么都不执行,反之用户返回到入口页;
+			 */
+			var clickNum = 0;
+			mui.back = function() {
+				clickNum++;
+				if(clickNum > 1) {
+					plus.runtime.quit();
+				} else {
+					mui.toast("再按一次退出应用");
+				}
+				setTimeout(function() {
+					clickNum = 0
+				}, 1000);
+				return false;
+			};
+		</script>
+	</body>
+
+</html>

+ 573 - 0
home/homePage.html

@@ -0,0 +1,573 @@
+<!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 href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			body,
+			.mui-content,
+			.mui-grid-view.mui-grid-9 {
+				background: #fff;
+			}
+			
+			.mui-slider .mui-slider-group .mui-slider-item img {
+				height: 200px;
+			}
+			/*分类*/
+			/*.mui-col-xs-2_5 {
+				width: 20%;
+			}*/
+			
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell {
+				padding: 4px 2px;
+			}
+			
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell a>img {
+				width: 55%;
+			}
+			
+			.mui-table-view.mui-grid-view .mui-table-view-cell .mui-media-body {
+				font-size: .8em;
+				margin-top: 5px;
+			}
+			
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell>a:not(.mui-btn) {
+				padding: 2px 0;
+			}
+			
+			.mui-grid-view.mui-grid-9 .mui-table-view-cell {
+				border: none;
+			}
+			
+			.mui-grid-view.mui-grid-9 {
+				padding: 5px 0;
+			}
+			/*产品介绍*/
+			
+			.introduceHead {
+				text-align: center;
+				background: #eee;
+				line-height: 35px;
+			}
+			
+			.introduceHead h1 {
+				font-size: 18px;
+				font-weight: 100;
+				display: inline-block;
+				position: relative;
+			}
+			
+			.introduceHead h1:after {
+				position: absolute;
+				width: 30px;
+				height: 1px;
+				background: #bebebe;
+				content: '';
+				top: 8px;
+				right: -60px;
+			}
+			
+			.introduceHead h1:before {
+				position: absolute;
+				width: 30px;
+				height: 1px;
+				background: #bebebe;
+				content: '';
+				top: 8px;
+				left: -60px;
+			}
+			/*产品列表*/
+			
+			.item {
+				position: relative;
+				padding-bottom: 15px;
+				padding-top: 20px;
+				overflow: hidden;
+				clear: both;
+			}
+			
+			.equipList .item .equipImg {
+				width: 38%;
+				float: left;
+				margin-left: 8px;
+				/*margin-top: 10px;*/
+				padding-top: 4px;
+				text-align: center;
+				border: 1px solid #eee;
+			}
+			
+			.equipList .item>.itemInfo {
+				margin-left: 44%;
+				width: 55%;
+			}
+			
+			.itemInfo h1 {
+				font-size: 18px;
+				color: #21b2e7;
+			}
+			
+			.itemInfo .itemTxt {
+				color: #9a9999;
+				font-size: 12px;
+				line-height: 22px;
+				letter-spacing: 2px;
+			}
+			
+			.item:after {
+				position: absolute;
+				right: 0;
+				bottom: 0;
+				left: 0px;
+				height: 1px;
+				content: '';
+				-webkit-transform: scaleY(.5);
+				transform: scaleY(.5);
+				background-color: #c8c7cc;
+			}
+			/*mui蒙版样式*/
+			
+			.mui-backdrop {
+				position: fixed;
+				top: 0;
+				right: 0;
+				bottom: 0;
+				left: 0;
+				z-index: 998;
+				background-color: rgba(0, 0, 0, .3);
+			}
+			/*自定义弹出用户权限*/
+			
+			#notAuthority,
+			#updateDver {
+				display: none;
+				position: fixed;
+				left: 15%;
+				right: 15%;
+				top: 10%;
+				z-index: 999;
+				height: 330px;
+				margin: 20% auto;
+				background: url(../images/notAuthorityBj.png) no-repeat;
+				background-size: 100% 100%;
+				/*border: 1px solid #0062CC;*/
+			}
+			
+			#updateDver {
+				background: url(../images/updateDver.png) no-repeat;
+				background-size: 100% 100%;
+			}
+			
+			#notAuthority>button,
+			#updateDver>button {
+				position: absolute;
+				bottom: 20px;
+				left: 27%;
+				right: 27%;
+				width: 46%;
+				height: 40px;
+				color: #fff;
+				border: none;
+				background: url(../images/notAuthorityBtn.png) no-repeat;
+				background-size: 100% 100%;
+			}
+			
+			#updateDver>button {
+				background: url(../images/updateDverBtn.png) no-repeat;
+				background-size: 100% 100%;
+				width: 70%;
+				left: 15%;
+				right: 15%;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<h1 class="mui-title">首页</h1>
+		</header>
+		<div class="mui-content">
+			<!--轮播-->
+			<div id="slider" class="mui-slider" style="height: 200px;">
+				<div class="mui-slider-group mui-slider-loop" id="sliderGroup">
+					<!-- 额外增加的一个节点(循环轮播:第一个节点是最后一张轮播) -->
+					<!--<div class="mui-slider-item mui-slider-item-duplicate">
+						<a href="#">
+							<img class="guide-img" src="../images/autoDiscern.jpg">
+						</a>
+					</div>-->
+					<!-- 第一张 -->
+					<!--<div class="mui-slider-item">
+						<a href="#">
+							<img class="guide-img" src="../images/banner1.jpg">
+						</a>
+					</div>-->
+					<!-- 额外增加的一个节点(循环轮播:最后一个节点是第一张轮播) -->
+					<!--<div class="mui-slider-item">
+						<a href="#">
+							<img class="guide-img" src="../images/banner1.jpg">
+						</a>
+					</div>-->
+				</div>
+				<div class="mui-slider-indicator" id="sliderIndicator">
+					<!--<div class="mui-indicator mui-active"></div>
+					<div class="mui-indicator"></div>
+					<div class="mui-indicator"></div>
+					<div class="mui-indicator"></div>
+					<div class="mui-indicator"></div>-->
+				</div>
+			</div>
+			<!--轮播结束-->
+			<!--分类-->
+			<ul class="mui-table-view mui-grid-view mui-grid-9" id="kind">
+				<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a href="map.html">
+						<img src="../images/categoryIcon1.png" />
+						<div class="mui-media-body">设备分布</div>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a href="../equipList/equip_list.html">
+						<img src="../images/categoryIcon2.png" />
+						<div class="mui-media-body">设备列表</div>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a href="../simInfo/siminfo.html">
+						<img src="../images/categoryIcon7.png" />
+						<div class="mui-media-body">SIM卡数据</div>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a>
+						<img src="../images/categoryIcon9.png" />
+						<div class="mui-media-body">管理员权限</div>
+					</a>
+				</li>
+				<!--<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a href="../systemmanage/systemmanage_user.html">
+						<img src="../images/categoryIcon5.png" />
+						<div class="mui-media-body">用户管理</div>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a href="../systemmanage/systemmanage_log.html">
+						<img src="../images/categoryIcon6.png" />
+						<div class="mui-media-body">日志管理</div>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a href="../helpcenter/feedback.html">
+						<img src="../images/categoryIcon77.png" />
+						<div class="mui-media-body">问题反馈</div>
+					</a>
+				</li>
+				<li class="mui-table-view-cell mui-media mui-col-xs-3">
+					<a href="../equipAllot/equip_allot_list.html">
+						<img src="../images/categoryIcon8.png" />
+						<div class="mui-media-body">分配设备</div>
+					</a>
+				</li>-->
+			</ul>
+			<!--分类结束-->
+			<!--产品介绍-->
+			<div class="equipIntroduce">
+				<div class="introduceHead">
+					<h1>产品介绍</h1>
+				</div>
+				<div class="equipList" id="equipList">
+					<div class="item" src='#'>
+						<div class="equipImg">
+							<img src="../images/scd_equip.png" />
+						</div>
+						<div class="itemInfo">
+							<h1>智慧物联网杀虫灯</h1>
+							<div class="itemTxt">
+								智慧物联网杀虫灯是利用太阳能电池板作为用电来源,其将白天太阳能发的电贮存起来,晚上放电给杀虫灯具,供其工作。太阳能杀虫灯无需市电,不用挖沟拉线,天黑灯亮,天亮灯熄,并且对人畜安全。
+							</div>
+						</div>
+					</div>
+					<div class="item" src='#'>
+						<div class="equipImg">
+							<img src="../images/cbd_equip.png" />
+						</div>
+						<div class="itemInfo">
+							<h1>物联网虫情测报灯</h1>
+							<div class="itemTxt">
+								物联网虫情测报灯集害虫诱捕和拍照、环境信息采集、数据传输、数据分析于一体,实现了害虫的诱集、分类统计、实时报传、远程检测、虫害预警和防治指导的自动化、智能化。
+							</div>
+						</div>
+					</div>
+					<div class="item" src='#'>
+						<div class="equipImg">
+							<img src="../images/bzy_equip.png" />
+						</div>
+						<div class="itemInfo">
+							<h1>拍照式孢子捕捉仪</h1>
+							<div class="itemTxt">
+								拍照式孢子捕捉仪内含高倍显微拍照装置,采用了气流定量、定时采集、自动加热、自动培养、自动拍照、无线传输等功能,全天候实时采集分析病原菌孢子图像,分析其数量的变化,预测病害发生的时间、程度和传播路线。
+							</div>
+						</div>
+					</div>
+					<div class="item" src='#'>
+						<div class="equipImg">
+							<img src="../images/qxz_equip.png" />
+						</div>
+						<div class="itemInfo">
+							<h1>自动气象监测站</h1>
+							<div class="itemTxt">
+								自动气象监测站由气象传感器,气象数据记录仪,气象环境监测软件三部分组成。广泛应用于农、林行业的植保推广、科研和教学单位病虫研究和病虫测报领域。
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<!--产品介绍结束-->
+		</div>
+		<!--管理员权限-->
+		<div id="notAuthority">
+			<button id="notAuthorityBtn"></button>
+		</div>
+		<!--新版本提示-->
+		<div id="updateDver">
+			<button id="updateDverBtn"></button>
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init();
+			var wgtVer;
+			mui('#slider').slider({
+				interval: 5000
+			});
+
+			mui.plusReady(function() {
+				var main = plus.webview.getWebviewById('main')
+				var mask;
+				var maskflag;
+				//获取当前版本号
+				plus.runtime.getProperty(plus.runtime.appid, function(inf) {
+					wgtVer = inf.version; //获取版本号
+					getuserinfo()
+				});
+				var banner = [
+					{"imgUrl":"app_file/app_img/banner1.jpg","path":""},
+					{"imgUrl":"app_file/app_img/banner2.jpg","path":""},
+					{"imgUrl":"app_file/app_img/banner4.jpg","path":""},
+					{"imgUrl":"app_file/app_img/autoDiscern","path":"autoDiscern.htm"},
+				]
+				//请求轮播图
+				mui.ajax('http://120.27.222.26/display_photo_common', {
+						data: {
+
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							console.log(JSON.stringify(data))
+//							if(data.length){
+								bannerRender(data)
+//							}else{
+//								bannerRender(banner)
+//							}
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(type)
+							bannerRender(banner)
+						}
+
+					});
+				function bannerRender(banner){
+					var html ='';
+					var sliderIndicator = '';
+					for(var i= 0;i<banner.length;i++){
+						var imgUrl = banner[i].imgUrl;
+						var path = banner[i].path;
+						console.log(imgUrl)
+						if(i == 0){
+							html += '<div class="mui-slider-item mui-slider-item-duplicate">'+
+									'<a href="#"><img class="guide-img" src="http://120.27.222.26/'+banner[banner.length-1].imgUrl+'"></a></div>';
+						}
+						html += '<div class="mui-slider-item" data-path="'+path+'"><a href="#">'+
+								'<img class="guide-img" src="http://120.27.222.26/'+imgUrl+'"></a></div>';
+						if(i == 0){
+							sliderIndicator += '<div class="mui-indicator mui-active"></div>';
+						}else{						
+							sliderIndicator += '<div class="mui-indicator"></div>';
+						}
+						if(i == banner.length-1){
+							html += '<div class="mui-slider-item"><a href="#">'+
+									'<img class="guide-img" src="http://120.27.222.26/'+banner[0].imgUrl+'"></a></div>';
+							$('#sliderGroup').html(html);
+							$('#sliderIndicator').html(sliderIndicator);
+							mui('#slider').slider({
+								interval: 5000
+							});
+						}
+					}
+				}
+				
+				
+
+				//轮播图
+				mui('#slider').on('tap', '.mui-slider-item', function() {
+					var path = $(this).data('path');
+					console.log(path)
+					if(path){
+						var id = (path.substr(path.lastIndexOf('/') + 1)).split('.')[0]
+						mui.openWindow({
+							url: path,
+							id: id
+						})
+					}
+					//获取最后一位反斜杠之后的元素 ++ 取点之前的元素
+					
+				});
+				
+				//请求产品介绍图
+				mui.ajax('http://120.27.222.26/product_view', {
+						data: {
+
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							console.log(JSON.stringify(data))
+							randerProductHtml(data)
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(type)
+							bannerRender(banner)
+						}
+
+					});
+				function randerProductHtml(data){
+					var arr = {
+						2:['../images/scd_equip.png','智慧物联网杀虫灯','智慧物联网杀虫灯是利用太阳能电池板作为用电来源,其将白天太阳能发的电贮存起来,晚上放电给杀虫灯具,供其工作。太阳能杀虫灯无需市电,不用挖沟拉线,天黑灯亮,天亮灯熄,并且对人畜安全。'],
+						3:['../images/cbd_equip.png','物联网虫情测报灯','物联网虫情测报灯集害虫诱捕和拍照、环境信息采集、数据传输、数据分析于一体,实现了害虫的诱集、分类统计、实时报传、远程检测、虫害预警和防治指导的自动化、智能化。'],
+						7:['../images/bzy_equip.png','拍照式孢子捕捉仪','拍照式孢子捕捉仪内含高倍显微拍照装置,采用了气流定量、定时采集、自动加热、自动培养、自动拍照、无线传输等功能,全天候实时采集分析病原菌孢子图像,分析其数量的变化,预测病害发生的时间、程度和传播路线。'],
+						5:['../images/qxz_equip.png','自动气象监测站','自动气象监测站由气象传感器,气象数据记录仪,气象环境监测软件三部分组成。广泛应用于农、林行业的植保推广、科研和教学单位病虫研究和病虫测报领域。'],
+					}
+					var html = '';
+					for(var i = 0;i<data.length;i++){
+						if(arr[parseInt(data[i])]){							
+							html += '<div class="item" src="#">'+
+									'<div class="equipImg">'+
+										'<img src="'+arr[parseInt(data[i])][0]+'" />'+
+									'</div>'+
+									'<div class="itemInfo">'+
+										'<h1>'+arr[parseInt(data[i])][1]+'</h1>'+
+										'<div class="itemTxt">'+arr[parseInt(data[i])][2]+
+										'</div></div></div>';
+						}
+						if(i == data.length-1){
+							$('#equipList').html(html);
+						}
+					}
+				}
+				//种类
+				mui('#kind').on('tap', 'a', function() {
+					//获取最后一位反斜杠之后的元素 ++ 取点之前的元素
+					var id = (this.href.substr(this.href.lastIndexOf('/') + 1)).split('.')[0]
+					console.log(id)
+					if(id) {
+						mui.openWindow({
+							url: this.href,
+							id: id
+						})
+					} else {
+						var isuser = plus.storage.getItem('isuser');
+						console.log(isuser)
+						if(isuser == 'user') {
+							$('.mui-content').css('position', 'fixed')
+							$('.mui-content').css('overflow', 'hidden')
+							//普通用户
+							mui.fire(main, 'openMask', {}); //父级蒙版
+							maskflag = false;
+							mask = mui.createMask(function() { //遮罩层callback事件
+								return maskflag; //返回true关闭mask
+							});
+							$('#notAuthority').show();
+							mask.show()
+						} else {
+							//管理员
+							mui.openWindow({
+								url: 'permission.html',
+								id: 'permission'
+							})
+						}
+					}
+
+				});
+				$('#notAuthorityBtn').on('tap', function() {
+					$('.mui-content').css('position', 'relative')
+					$('.mui-content').css('overflow', 'visible')
+					maskflag = true;
+					mask.close();
+					mui.fire(main, 'closeMask', {});
+					$('#notAuthority').hide();
+				})
+
+				function getuserinfo() {
+					mui.ajax('http://120.27.222.26/edition', {
+						data: {
+
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+
+							var currNum = 0,
+								newsNum = 0;
+							var currdver = wgtVer.split('.');
+							for(var i = 0; i < currdver.length; i++) {
+								currNum += parseInt(currdver[i]);
+							}
+							var newsdver = data.edition_num.split('.');
+							for(var i = 0; i < newsdver.length; i++) {
+								newsNum += parseInt(newsdver[i]);
+							}
+							if(currNum != newsNum) {
+								mui.fire(main, 'openMask', {}); //父级蒙版
+								maskflag = false;
+								mask = mui.createMask(function() { //遮罩层callback事件
+									return maskflag; //返回true关闭mask
+								});
+								$('#updateDver').show();
+								mask.show()
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(type)
+						}
+
+					});
+				}
+				$('#updateDverBtn').on('tap', function() {
+					$('.mui-content').css('position', 'relative')
+					$('.mui-content').css('overflow', 'visible')
+					maskflag = true;
+					mask.close();
+					mui.fire(main, 'closeMask', {});
+					$('#updateDver').hide();
+				})
+				//产品
+				//				mui('.equipList').on('tap', '.item', function() {
+				//					var src = this.getAttribute('src');
+				//					var id = (src.substr(src.lastIndexOf('/') + 1)).split('.')[0]
+				//					mui.openWindow({
+				//						url:src,
+				//						id:id
+				//					})
+				//				});
+			})
+		</script>
+	</body>
+
+</html>

+ 387 - 0
home/login.html

@@ -0,0 +1,387 @@
+<!DOCTYPE html>
+<html lang="en">
+
+	<head>
+		<meta charset="UTF-8">
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
+		<title>FrozenUI Demo</title>
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link rel="stylesheet" type="text/css" href="../css/reset.css" />
+		<link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
+		<style type="text/css">
+			html {
+				height: 100%;
+			}
+			
+			body {
+				height: 100%;
+				background: #fff;
+			}
+			
+			.page {
+				height: 100%;
+				overflow: hidden;
+			}
+			
+			.logo {
+				text-align: center;
+				margin: 6rem 0 4.5rem;
+			}
+			.logo >img{
+				width: 50%;
+			}
+			.logo h1{
+				color: #2DADF6;
+				font-size: 24px;
+			}
+			
+			.logoCover {
+				width: 80%;
+				margin: 0 auto;
+			}
+			
+			.logoItem {
+				border-bottom: 1px solid #bbb;
+				position: relative;
+				height: 40px;
+				margin-bottom: 15px;
+			}
+			
+			.logoItem .inputicon {
+				font-size: 22px;
+				color: #22ace1;
+				vertical-align: middle;
+				position: absolute;
+				left: 0;
+				bottom: 8px;
+			}
+			#recordPwdIcon{
+				color: #22ace1;
+			}
+			.logoItem input {
+				background: transparent;
+				border: none;
+				padding: 0 0 4px 35px;
+				position: absolute;
+				left: 0;
+				bottom: 0;
+				margin: 0;
+			}
+			
+			.logoItem .unlock {
+				font-size: 29px;
+			}
+			
+			input::-webkit-input-placeholder {
+				color: #969696;
+			}
+			
+			input::-moz-placeholder {
+				/* Mozilla Firefox 19+ */
+				color: #969696;
+			}
+			
+			input:-moz-placeholder {
+				/* Mozilla Firefox 4 to 18 */
+				color: #969696;
+			}
+			
+			input:-ms-input-placeholder {
+				/* Internet Explorer 10-11 */
+				color: #969696;
+			}
+			
+			#forgetPwd,
+			#registerBtn,
+			.recordPwdLabel,
+			.logoItem input {
+				color: #bbb;
+			}
+			
+			#loginBtn {
+				width: 100%;
+				/*line-height: 30px;*/
+				font-size: 18px;
+				letter-spacing: 6px;
+				border-radius: 6px;
+				margin: 20px 0 13px;    
+				color: #bbb;
+			}
+			#loginBtn:enabled:active{
+				color: #fff;
+    			border: 1px solid #39c7fc;
+    			background-color: #39c7fc !important;
+			}
+			
+			#loginBtn.btn-primary{
+				background-color: #05a0db;
+				border: 1px solid #12a5dc;
+				color: #fff;
+			}
+			/*记住密码*/
+			
+			.checkbox {
+				display: none;
+			}
+			
+			#addUser {
+				position: fixed;
+				left: 0;
+				right: 0;
+				bottom: 10px;
+				text-align: center;
+			}
+			/**/
+			.lookpsd{
+				position: absolute;
+			    right: 6px;
+			    bottom: 8px;
+			    font-size: 27px;
+			    color: #c1c1c1;
+			}
+			#lookpsdBox,#openeye{
+				display: none;
+			}
+		</style>
+	</head>
+
+	<body>
+		<div class="page">
+			<div class="logo">
+				<img src="../images/commonLogoTxt.png" alt="云飞智能科技" />
+				<!--<h1>智慧农业物联网</h1>-->
+			</div>
+			<div class="logoCover">
+				<div class="logoInner">
+					<form action="" method="post">
+						<ul>
+							<li class="logoItem">
+								<i class="iconfont inputicon">&#xe636;</i>
+								<input type="text" id="username" placeholder="请输入用户名" />
+							</li>
+							<li class="logoItem">
+								<i class="iconfont inputicon">&#xe689;</i>
+								<input type="password" id="password" placeholder="请输入密码" />
+								<span id="lookpsdBox">
+									<i class="iconfont lookpsd" id="openeye" onclick="openpsd()">&#xe62d;</i> <!--看-->
+									<i class="iconfont lookpsd" id="closeeye" onclick="closepsd()">&#xe61d;</i> <!--闭-->
+								</span>
+								
+							</li>
+						</ul>
+						<input type="button" id="loginBtn" value="登录" />
+					</form>
+				</div>
+				<div class="otherBtns">
+					<div class="mui-row">
+						<div class="mui-col-xs-6">
+							<!--<i class="iconfont" id="recordPwdIcon">&#xe614;</i>-->
+							<label class="recordPwdLabel" for="recordPwd">
+								<i class="iconfont" id="recordPwdIcon">&#xe614;</i>
+								<input type="checkbox" class="checkbox" id="recordPwd" />
+								<span>自动登录</span>
+							</label>
+
+						</div>
+						<div class="mui-col-xs-6" style="text-align: right;">
+							<a href="" id="forgetPwd">忘记密码?</a>
+						</div>
+					</div>
+				</div>
+				<div id="addUser">
+					<!--<a href="javascript:;" id="registerBtn">创建新账户+</a>-->
+				</div>
+			</div>
+		</div>
+
+	</body>
+	<script src="../js/mui.min.js"></script>
+	<script>
+		mui.init();
+		mui.plusReady(function() {
+			var all = plus.webview.all();
+            var current = plus.webview.currentWebview().id;
+            var index = plus.runtime.appid;
+            console.log(all)
+            for (var i = 0, len = all.length; i < len; i++) {
+                if (all[i].id !== current && all[i].id != index) {
+					all[i].hide();
+					all[i].close();
+                }
+            }
+			autoLogin()
+			var windowInnerHeight = window.innerHeight;
+			//解决fixed问题
+			window.onresize = function() {
+				if(window.innerHeight < windowInnerHeight) {
+					document.getElementById("addUser").style.position = 'static';
+				} else {
+					document.getElementById("addUser").style.position = 'fixed';
+				}
+			}
+			var username = document.getElementById('username'),
+				password = document.getElementById('password');
+
+			//登录颜色
+			password.addEventListener('keyup', function() {
+				var passwordVal = this.value;
+				var usernameVal = username.value;
+				//查看密码
+				if(passwordVal.length >= 1) {
+					document.getElementById('lookpsdBox').style.display = 'block';
+				}else{
+					document.getElementById('lookpsdBox').style.display = 'none';
+				}
+				//是否能登录
+				if(passwordVal.length >= 6 && usernameVal != '') {
+					document.getElementById("loginBtn").classList.add("btn-primary");
+				} else {
+					document.getElementById("loginBtn").classList.remove("btn-primary");
+				}
+				//键盘确定登录
+				if(event.keyCode ==13){  
+			        login(usernameVal, passwordVal);
+			    }  
+			})
+			
+			//监听查看密码
+//			password.addEventListener('input', function() {
+//				alert(1);;
+//			})
+
+			//记住密码  
+			mui(".otherBtns").on('tap', ".recordPwdLabel", function() {
+				remFun()
+			})
+			function remFun() {
+				if(!document.getElementById("recordPwd").checked) {
+					document.getElementById('recordPwdIcon').innerHTML = '&#xe656;';
+					plus.storage.setItem('remState', 'true'); //设置本地存储
+
+				} else {
+					document.getElementById('recordPwdIcon').innerHTML = '&#xe614;';
+					plus.storage.setItem('remState', 'false'); //设置本地存储
+				}
+			}
+
+			function autoLogin() {
+				var username = plus.storage.getItem('username');
+				var password = plus.storage.getItem('password');
+				var remState = plus.storage.getItem('remState');
+				
+				console.log(plus.storage.getItem('username'))
+				console.log(plus.storage.getItem('password'))
+				console.log(plus.storage.getItem('remState'))
+
+				if(remState == 'true' || remState == true) {
+					login(username, password);
+				}
+			}
+
+			//登录
+			document.getElementById("loginBtn").addEventListener('tap', function() {
+				if(this.className == 'btn-primary') {
+					login(username.value, password.value)
+				} else {
+					mui.toast('请将信息填写完整');
+				}
+			})
+
+			function login(name, pwd) {
+				if(plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
+					mui.toast("网络异常,请检查网络设置!");
+				} else {
+					mui.ajax('http://120.27.222.26/app_login', {
+						data: {
+							'username': name,
+							'password': pwd
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						success: function(data) {
+							plus.storage.setItem('username', name); //设置本地存储
+							plus.storage.setItem('password', pwd); //设置本地存储
+							if(data.code == 0) {
+								if(data.role == 'user'){
+									plus.storage.setItem('isuser', 'user'); //普通用户
+								}else if(data.role == 'agency'){
+									plus.storage.setItem('isuser', 'agency'); //代理商
+								}else{
+									plus.storage.setItem('isuser', 'admin'); //管理员
+								}
+								mui.openWindow({
+									url: 'main.html',
+									id: 'main',
+									extras: {
+										name: 'mui' //扩展参数
+									},
+								})
+							} else if(data.code == 1) {
+								mui.toast('用户不存在');
+							} else if(data.code == 2) {
+								mui.toast('用户不可用');
+							} else if(data.code == 3) {
+								mui.toast('密码错误');
+							}
+						},
+						error: function(xhr, type, errorThrown) {
+//							console.log(type)
+							console.log(errorThrown)
+							mui.toast('登录请求失败');
+						}
+					});
+				}
+			}
+
+		})
+		
+		
+		//查看密码
+		function openpsd(){
+			document.getElementById('openeye').style.display = 'none';
+			document.getElementById('closeeye').style.display = 'block';
+			document.getElementById('password').setAttribute('type','password');
+		}
+		
+		//隐藏密码
+		function closepsd(){
+			document.getElementById('openeye').style.display = 'block';
+			document.getElementById('closeeye').style.display = 'none';
+			document.getElementById('password').setAttribute('type','text');
+		}
+		
+		//注册
+		mui('#addUser').on('tap','#registerBtn',function(){
+			mui.openWindow({
+				url:'register.html',
+				id:'register'
+			})
+		})
+
+		//退出应用
+		mui.oldback = mui.back;
+		var clickNum = 0;
+		mui.back = function(event) {
+			clickNum++;
+			if(clickNum > 1) {
+				plus.runtime.quit();
+			} else {
+				mui.toast("再按一次退出应用");
+			}
+			setTimeout(function() {
+				clickNum = 0
+			}, 1000);
+			return false;
+		}
+		//测试网络
+		//		document.addEventListener("netchange", networkinfo, false);
+		function networkinfo() {
+			if(plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
+				mui.toast("网络异常,请检查网络设置!");
+			}
+		}
+	</script>
+
+</html>

+ 171 - 0
home/main.html

@@ -0,0 +1,171 @@
+<!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" />
+		<style type="text/css">
+			.mui-bar{
+				background: #fff;
+				touch-action: none;
+			}
+			/*.mui-bar {
+				-webkit-box-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
+				box-shadow: 0 0 1px rgba(0, 0, 0, 0.6);
+				padding-top: 6px;
+			}*/
+		</style>
+	</head>
+
+	<body>
+		<nav class="mui-bar mui-bar-tab">
+			<a class="mui-tab-item mui-active" data-id="home">
+				<img class="mui-icon" src="../images/home-active.png" />
+				<span class="mui-tab-label">首页</span>
+			</a>
+			<a class="mui-tab-item" data-id="equip">
+				<img class="mui-icon" src="../images/equip.png" />
+				<span class="mui-tab-label">设备</span>
+			</a>
+			<!--<a class="mui-tab-item" data-id="warning">
+				<img class="mui-icon" src="../images/warning.png" />
+				<span class="mui-tab-label">预警</span>
+			</a>-->
+			<a class="mui-tab-item" data-id="personalinfo">
+				<img class="mui-icon" src="../images/my.png" />
+				<span class="mui-tab-label">我的</span>
+			</a>
+		</nav>
+		<div class="mui-content">
+
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init();
+			mui.plusReady(function() {
+				//关闭等待框
+				plus.nativeUI.closeWaiting();
+				//显示当前页面
+				mui.currentWebview.show();
+				plus.webview.hide('login');
+				plus.webview.close('login');
+				//预加载页面
+				var subInfos = [{
+					    url: 'homePage.html',
+					    id: 'home'
+					}, {
+					    url: 'equip.html',
+					    id: 'equip',
+					},
+//					{
+//					    url: '../warning/warning.html',
+//					    id: 'warning'
+//					}, 
+					{
+					    url: 'personalinfo.html',
+					    id: 'personalinfo'
+					}];
+					
+				var objStyle = {
+					top: "0px",
+					bottom: "52px",
+				};
+				
+				var self = plus.webview.currentWebview(); //取到当前的主页窗口
+				var activeTab = '';		
+				
+				// 默认只加载首页webview
+				var homeWv = plus.webview.create(subInfos[0].url, subInfos[0].id, objStyle);
+				self.append(homeWv);
+				activeTab = subInfos[0].id;
+				
+				// 根据id查询子页面的信息
+				var getSubInfoById = function(infoList, id) {
+				    var result = null;
+				    for(var i = 0, len = infoList.length; i < len; i++) {
+				        var _info = infoList[i];
+				        if(_info.id === id) {
+				            result = _info;
+				            break;
+				        }
+				    }
+				    return result;
+				};
+				//选项卡点击事件
+				mui(".mui-bar-tab").on("tap", "a", function(e) {
+					var _self = this;
+				    var targetTab = _self.getAttribute('data-id');
+				    if(targetTab === activeTab) {
+				        return;
+				    }
+				    var _subWv = plus.webview.getWebviewById(targetTab);
+				    
+				    // 若webview不存在,则创建;
+				    if(!_subWv) {
+				        var _subInfo = getSubInfoById(subInfos, targetTab);
+				        _subWv = plus.webview.create(_subInfo.url, _subInfo.id, objStyle);
+				        self.append(_subWv);
+				    }
+				    _subWv.show();
+				    
+				    // 隐藏之前的webview
+				    plus.webview.getWebviewById(activeTab).hide('none');
+				    activeTab = targetTab;
+
+					/**
+					 * 用图片作为图标而不用字体图标。
+					 */
+
+					// 获取图标对象
+
+					var targetIcon = mui(this.children[0])[0];
+					//初始化
+					mui(".mui-bar-tab .mui-tab-item img").each(function(index, item) {
+						var itemSrc = item.getAttribute("src");
+						if(itemSrc.indexOf("active")) {
+							item.src = itemSrc.replace("-active.png", ".png");
+						}
+					});
+					//设置当前的图标
+					targetIcon.src = targetIcon.getAttribute("src").replace(".png", "-active.png");
+				});
+			})
+			//退出应用
+			mui.oldback = mui.back;
+			var clickNum = 0;
+			mui.back = function(event) {
+				clickNum++;
+				if(clickNum > 1) {
+					plus.runtime.quit();
+				} else {
+					mui.toast("再按一次退出应用");
+				}
+				setTimeout(function() {
+					clickNum = 0
+				}, 1000);
+				return false;
+			}
+			var flag = false;
+			//创建遮罩蒙板
+			var mask = mui.createMask(function() {
+			    //设置点击蒙板不会自动消失
+			    //但调用close方法关闭mask时,必须返回true
+			    return flag;
+			}); 
+			//监听自定事件
+			//打开遮罩蒙板
+			window.addEventListener("openMask", function(e) {
+			        flag = false;
+			        mask.show(); //显示遮罩
+			});
+			//关闭遮罩蒙板
+			window.addEventListener("closeMask", function(e) {
+			        flag = true;
+			        mask.close();
+			});
+		</script>
+	</body>
+
+</html>

+ 436 - 0
home/map.html

@@ -0,0 +1,436 @@
+<!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">
+			.mui-content {
+				position: absolute;
+				left: 0;
+				top: 0;
+				bottom: 0;
+				right: 0;
+			}
+			
+			.mapCover {
+				position: absolute;
+				left: 0;
+				top: 96px;
+				bottom: 0;
+				right: 0;
+			}
+			
+			#map {
+				width: 100%;
+				position: fixed;
+				top: 96px;
+				bottom: 0px;
+				line-height: 200px;
+				text-align: center;
+				background: #FFFFFF;
+			}
+			
+			#btn {
+				margin-top: 50px;
+				width: 80%;
+				left: 10%;
+			}
+			
+			#NativewUI {
+				margin-top: 50px;
+				width: 80%;
+				left: 10%;
+			}
+			
+			.mui-popover {
+				width: 160px;
+			}
+			
+			/*#popover {
+				display: block;
+				top: 57px;
+				left: 165px;
+			}*/
+			/*搜索框*/
+			
+			.searchBox {
+				background-color: #eee;
+				padding: 0px 8px;
+				position: relative;
+				margin-top: 10px;
+			}
+			
+			.mui-search .mui-placeholder {
+				text-align: left;
+				left: 5px;
+			}
+			
+			input[type=search] {
+				background: #fff;
+			}
+			
+			.mui-search .mui-placeholder .mui-icon {
+				color: #777;
+			}
+			
+			.searchBtnBox {
+				position: absolute;
+				right: 8px;
+				top: 0px;
+				z-index: 3;
+			}
+			
+			#searchBtn {
+				letter-spacing: 3px;
+				line-height: 1.6;
+				border: none;
+			}
+			
+			.cutline {
+				display: inline-block;
+				border-left: .08em dashed #777;
+				margin-top: 6px;
+			}
+			/*分类*/
+			
+			.mui-table-view-cell i {
+				font-size: 18px;
+				margin-right: 5px;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+			<h1 class="mui-title">设备分布图</h1>
+			<a id="openPopover" class="mui-icon mui-icon-more mui-pull-right"></a>
+			<!--<a class="fa fa-search mui-pull-right" id="searchBtn">搜索</a>-->
+		</header>
+		<div class="mui-content">
+			<div class="faxSearchBox">
+				<div class="mui-input-row mui-search">
+					<input type="search" id="searchInp" placeholder="请输入设备ID">
+				</div>
+				<div class="searchBtnBox">
+					<span class="cutline">&nbsp;</span>
+					<button id="searchBtn">搜索</button>
+				</div>
+			</div>
+
+			<div class="mapCover">
+				<div id="map"></div>
+			</div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script src="../js/jquery-2.1.0.js"></script>
+		 <script src="../js/coordOffset.js"></script><!--坐标偏移 -->
+		<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=La58N63t7hPhafQ7Eror2kon"></script>
+		<script type="text/javascript">
+			var em = null,
+				map = null;
+			var floatw = null;
+			// H5 plus事件处理
+			window.addEventListener('requestPerson',function(event){
+				//获得事件参数
+				var id = event.detail.id;
+				requestPerson = id;
+				getdata(id)
+			})
+			function getdata(type){
+				// mui('#popover').popover('toggle'); //show hide toggle
+				var dtype = '';
+				map.clearOverlays(); //清除全部
+				if(type == 2 || type == 3 || type == 5  || type == 7 || type == 8) {
+					if(type == 2) {
+						dtype = 'scd';
+					} else if(type == 3) {
+						dtype = 'cbd';
+					}else if(type == 5) {
+						dtype = 'qxz';
+					}else if(type == 7) {
+						dtype = 'bzy';
+					}else if(type == 8) {
+						dtype = 'xyq';
+					}
+					$.ajax({
+						type: "post",
+						url: "http://120.27.222.26/home_map/map_locat",
+						data: {
+							req: dtype
+						},
+						timeout: 10000, //超时时间:30秒
+						beforeSend: function() {
+							plus.nativeUI.showWaiting("加载中...");
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						dataType: "json",
+						success: function(data) {
+							// console.log(JSON.stringify(data))
+							setmarker(data)
+						},
+						error:function(type){
+							mui.toast('网络超时!')
+						}
+					});
+				} else {
+					$.ajax({
+						type: "post",
+						url: "http://120.27.222.26/home_map/map_locat",
+						data: {
+							req: 'scd'
+						},
+						timeout: 10000, //超时时间:30秒
+						beforeSend: function() {
+							plus.nativeUI.showWaiting("加载中...");
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						dataType: "json",
+						success: function(data) {
+							// console.log(JSON.stringify(data))
+							setmarker(data)
+						},
+						error:function(type){
+							mui.toast('网络超时!')
+						}
+					});
+					$.ajax({
+						type: "post",
+						url: "http://120.27.222.26/home_map/map_locat",
+						data: {
+							req: 'cbd'
+						},
+						timeout: 10000, //超时时间:30秒
+						beforeSend: function() {
+							plus.nativeUI.showWaiting("加载中...");
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						dataType: "json",
+						success: function(data) {
+							// console.log(JSON.stringify(data))
+							setmarker(data)
+						},
+						error:function(type){
+							mui.toast('网络超时!')
+						}
+					});
+					$.ajax({
+						type: "post",
+						url: "http://120.27.222.26/home_map/map_locat",
+						data: {
+							req: 'qxz'
+						},
+						timeout: 10000, //超时时间:30秒
+						beforeSend: function() {
+							plus.nativeUI.showWaiting("加载中...");
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						dataType: "json",
+						success: function(data) {
+							// console.log(JSON.stringify(data))
+							setmarker(data)
+						},
+						error:function(type){
+							mui.toast('网络超时!')
+						}
+					});
+					$.ajax({
+						type: "post",
+						url: "http://120.27.222.26/home_map/map_locat",
+						data: {
+							req: 'bzy'
+						},
+						timeout: 10000, //超时时间:30秒
+						beforeSend: function() {
+							plus.nativeUI.showWaiting("加载中...");
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						dataType: "json",
+						success: function(data) {
+							// console.log(JSON.stringify(data))
+							setmarker(data)
+						},
+						error:function(type){
+							mui.toast('网络超时!')
+						}
+					});
+					$.ajax({
+						type: "post",
+						url: "http://120.27.222.26/home_map/map_locat",
+						data: {
+							req: 'xyq'
+						},
+						timeout: 10000, //超时时间:30秒
+						beforeSend: function() {
+							plus.nativeUI.showWaiting("加载中...");
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						dataType: "json",
+						success: function(data) {
+							// console.log(JSON.stringify(data))
+							setmarker(data)
+						},
+						error:function(type){
+							mui.toast('网络超时!')
+						}
+					});
+				}
+			}
+			function setmarker(data){
+				for(var i = 0;i<data.length;i++){
+					if(data[i].equip_type == 2){
+						var iconurl = '../images/2.png';
+						var title = '杀虫灯设备';
+					}else if(data[i].equip_type == 3){
+						var iconurl = '../images/3.png';
+						var title = '测报灯设备';
+					}else if(data[i].equip_type == 5){
+						var iconurl = '../images/1.png';
+						var title = '环境监测设备';
+					}else if(data[i].equip_type == 7){
+						var iconurl = '../images/7.png';
+						var title = '孢子仪设备';
+					}else if(data[i].equip_type == 4){
+						var iconurl = '../images/8.png';
+						var title = '性诱设备';
+					}
+					if(data[i].equip_type == 2||data[i].equip_type == 3|| data[i].equip_type==4){
+						if(data[i].gps == 0){
+							var point = new plus.maps.Point(data[i].lng, data[i].lat);
+						}else if(data[i].gps == 1){
+							var GCj02 = wgs84togcj02(data[i].lng, data[i].lat); //gps转火星定位
+							var baidulnglat = gcj02tobd09(GCj02[0],GCj02[1]) //火星转百度定位
+							var point = new plus.maps.Point(baidulnglat[0], baidulnglat[1]);
+						}else if(data[i].gps == 2){
+							var baidulnglat = gcj02tobd09(data[i].lng, data[i].lat) //火星转百度定位
+							var point = new plus.maps.Point(baidulnglat[0], baidulnglat[1]);
+						}
+					}else{
+						var point = new plus.maps.Point(data[i].lng, data[i].lat);
+					}
+					var txt = title+'\n名称:'+data[i].equip_name+'\n设备号:'+data[i].equip_id;
+					addMarker(point,iconurl,txt);
+				}
+			}
+			function plusReady() {
+				// 确保DOM解析完成
+				if(!em || !window.plus || map) {
+					return
+				};
+				map = new plus.maps.Map("map");
+				map.centerAndZoom(new plus.maps.Point(105.740332,34.038286), 4);
+				map.showZoomControls( true );
+				
+				//顶部右上角按钮menu触发弹出菜单
+				document.getElementById('openPopover').addEventListener('tap', function() {
+					floatWebview()
+				})
+				
+				// 创建悬浮窗口
+				function floatWebview() {
+					if(floatw) { // 避免快速多次点击创建多个窗口
+						floatw.show("fade-in");
+					} else {
+						floatw = plus.webview.create("map_nav.html", "map_nav", {
+							background: 'transparent',
+							zindex: 10,
+						});
+						floatw.show("fade-in");
+					}
+				}
+				
+			}
+			if(window.plus) {
+				plusReady();
+			} else {
+				document.addEventListener("plusready", plusReady, false);
+			}
+			// DOMContentloaded事件处理
+			document.addEventListener("DOMContentLoaded", function() {
+				em = document.getElementById("map");
+				plusReady();
+			}, false);
+			
+			// 编写自定义函数,创建标注
+			function addMarker(point,iconurl,txt){
+			  	var marker = new plus.maps.Marker(point);
+				marker.setIcon(iconurl);
+				var bubble = new plus.maps.Bubble(txt); 
+				marker.setBubble(bubble);
+			  	map.addOverlay(marker);
+				map.setZoom(4);
+				map.setCenter(105.740332,34.038286);
+			}
+	
+
+			//搜索
+			$("#searchInp").on('keypress',function(e) {  
+				var keycode = e.keyCode;  
+				var searchName = $(this).val();  
+				if(keycode=='13') {  
+					e.preventDefault();    
+					//请求搜索接口  
+					searchFun(searchName)  
+				}
+			});  
+			document.getElementById('searchBtn').addEventListener('tap', function() {
+				var imei = document.getElementById('searchInp').value;
+				searchFun(imei)
+			})
+			
+			function searchFun(imei){
+				if(imei) {
+					$.ajax({
+						type: "post",
+						url: "http://120.27.222.26/home_map/map_locat",
+						data: {
+							req: "imei",
+							equip_id: imei
+						},
+						timeout: 10000, //超时时间:30秒
+						dataType: "json",
+						beforeSend: function() {
+							plus.nativeUI.showWaiting("加载中...");
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						success: function(data) {
+							if(data == '0') {
+								mui.toast("没有找到该设备,请核对设备id!");
+								map.clearOverlays(); //清除全部
+							} else {
+								map.clearOverlays(); //清除全部
+								setmarker(data)
+							}
+						},
+						error:function(type){
+							mui.toast('网络超时!')
+						}
+					});
+				} else {
+					mui.toast("请输入设备IMEI");
+				}
+			}
+			
+		</script>
+	</body>
+
+</html>

+ 122 - 0
home/map_nav.html

@@ -0,0 +1,122 @@
+<!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="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
+		<style type="text/css">
+			html {
+				width: 100%;
+				height: 100%;
+			}
+			
+			body {
+				height: 100%;
+				background-color: transparent;
+			}
+			
+			.mui-popover .mui-popover-arrow {
+				left: auto;
+				right: 10px!important;
+			}
+			
+			.mui-popover {
+				display: block;
+				width: auto;
+				opacity: 1;
+				text-align: center;
+			}
+			
+			.mui-table-view-cell>a:not(.mui-btn) {
+				color: #000;
+			}
+			
+			.fa {
+				margin-right: 8px;
+				color: #535353;
+			}
+			
+			.mui-table-view-cell>a:not(.mui-btn) {
+				color: #535353;
+			}
+			#userGroup{
+				display: none;
+			}
+			#menu{
+				text-align: left;
+				font-size: 14px;
+			}
+		</style>
+	</head>
+
+	<body>
+		<div id="topPopover" class="mui-popover" style="position:fixed ;top: 55px;right:5px;">
+			<div class="mui-popover-arrow" style="top: -30px;"></div>
+			<ul class="mui-table-view" style="color: #fff; top: -4px;right: 0;" id="menu">
+				<li class="mui-table-view-cell" data-id="1">
+					<a href="#">
+						<i class="iconfont">&#xe71e;</i>全部
+					</a>
+				</li>
+				<li class="mui-table-view-cell" data-id="2">
+					<a href="#">
+						<i class="iconfont">&#xe621;</i>杀虫灯
+					</a>
+				</li>
+				<li class="mui-table-view-cell" data-id="3">
+					<a href="#">
+						<i class="iconfont">&#xe71f;</i>虫情测报
+					</a>
+				</li>
+				<li class="mui-table-view-cell" data-id="5">
+					<a href="#">
+						<i class="iconfont">&#xe6a7;</i>环境监测
+					</a>
+				</li>
+				<li class="mui-table-view-cell" data-id="7">
+					<a href="#">
+						<i class="iconfont">&#xe64e;</i>孢子仪
+					</a>
+				</li>
+				<li class="mui-table-view-cell" data-id="8">
+					<a href="#">
+						<i class="iconfont">&#xe623;</i>性诱器
+					</a>
+				</li>
+			</ul>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init({
+				beforeback: function() {     //获得父页面的webview
+					plus.webview.currentWebview().hide()
+					return false;
+				}
+			})
+			mui.plusReady(function() {
+				ws = plus.webview.currentWebview();
+				ws.setStyle({
+					mask: "none"
+				});
+				window.addEventListener("tap", function() {
+					ws.hide();
+				})
+				window.addEventListener("dragstart", function() {
+					ws.hide();
+				})
+				mui("#menu").on('tap','li',function(){
+					var id = this.getAttribute('data-id');
+					var new_request = plus.webview.getWebviewById('map');
+					mui.fire(new_request,'requestPerson',{id:id});
+					ws.hide();
+				})
+			})
+			
+		</script>
+	</body>
+
+</html>

+ 72 - 0
home/permission.html

@@ -0,0 +1,72 @@
+<!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 href="../css/common.css" rel="stylesheet" />
+		<style type="text/css">
+			.warningIcon,.mui-card-content >p{
+				text-align: center;
+			}
+			.mui-card-content >p{
+				font-size: 16px;
+				color: #333;
+			}
+			.mui-card-content{
+				padding: 10px 0;
+			}
+			
+			.mui-content .mui-card:active{
+				background-color: #eee !important;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav">
+			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
+		    <h1 class="mui-title">管理员权限</h1>
+		</header>
+		<div class="mui-content">
+		    <div class="mui-card" data-href='../systemmanage/systemmanage_user.html'>
+				<div class="mui-card-content">
+					<div class="warningIcon">
+						<img src="../images/usermanage.png" alt="" width="100" />
+					</div>
+					<p>用户管理</p>
+				</div>
+			</div>
+			<div class="mui-card" data-href='../equipAllot/equip_allot_list.html'>
+				<div class="mui-card-content">
+					<div class="warningIcon">
+						<img src="../images/allotEqueip.png" alt="" width="100" />
+					</div>
+					<p>分配设备</p>
+				</div>
+			</div>
+		</div>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init();
+//			mui('.mui-content').on('touchstart','.mui-card',function(){
+//				this.classList.add("mui-active");
+//			})
+//			mui('.mui-content').on('touchend','.mui-card',function(){
+//				this.classList.remove("mui-active");
+//			})
+			mui('.mui-content').on('tap','.mui-card',function(){
+				var url = this.getAttribute('data-href');
+				//获取最后一位反斜杠之后的元素 ++ 取点之前的元素
+				var id = (url.substr(url.lastIndexOf('/') + 1)).split('.')[0]
+				mui.openWindow({
+					url:url,
+					id:id
+				})
+			})
+		</script>
+	</body>
+
+</html>

+ 405 - 0
home/personalinfo.html

@@ -0,0 +1,405 @@
+<!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 rel="stylesheet" type="text/css" href="../css/common.css" />
+		<style type="text/css">
+			#account {
+				height: 200px;
+				background: #82c0fa;
+				position: relative;
+			}
+			
+			.userMsg {
+				text-align: center;
+			}
+			
+			.userMsg img {
+				border-radius: 50%;
+				margin: 30px 0 0;
+			}
+			
+			#username {
+				color: #fff;
+				line-height: 32px;
+				font-size: 18px;
+			}
+			.waveWrapper{
+				background: url(../images/shadow.png);
+				height: 52px;
+			    background-color: #82c0fa;
+			    position: absolute;
+			    left: 0;
+			    right: 0;
+			    bottom: 0;
+			    background-size: cover;
+			}
+			
+			.option{
+				margin-bottom:17px;
+			}
+			
+			.option .iconfont {
+				font-size: 16px;
+				color: #666;
+			}
+			
+			.option span {
+				color: #666;
+				font-size: 16px;
+				margin-left: 10px;
+			}
+			#userImg{
+				width: 70px;
+				height: 70px;
+			}
+			.failed{
+				display: none;
+				position: absolute;
+			    left: 0;
+			    right: 0;
+			    top: 0;
+			    bottom: 0;
+			    z-index: 10;
+			}
+			.failed img{
+				width: 70%;
+			    position: absolute;
+				top: 21%;
+			    left: 50%;
+			    margin-left: -35%;
+			}
+			.failed p{
+				width: 100%;
+				font-size: 16px;
+				text-align: center;
+			    position: absolute;
+			    top: 54%;
+			    left: 0;
+			    right: 0;
+			}
+			.failed button{
+				width: 34%;
+			    position: absolute;
+			    top: 61%;
+			    left: 50%;
+			    margin-left: -15%;
+			}
+			.header{
+				display: none;
+			}
+			.mui-bar-nav~.mui-content {
+			    padding-top: 0;
+			}
+		</style>
+	</head>
+
+	<body>
+		<header class="mui-bar mui-bar-nav header">
+			<h1 class="mui-title">我的</h1>
+		</header>
+		<div class="mui-content">
+			<div id="account">
+				<div class="userMsg">
+					<a class="" id="" href="#">
+						<img id="userImg" src="" />
+					</a>
+					<p id="username"></p>
+				</div>
+				<div class="waveWrapper"></div>
+			</div>
+			<ul class="mui-table-view option">
+				<li class="mui-table-view-cell">
+					<a class="mui-navigate-right" href="../personalinfo/userinfo.html">
+						<i class="iconfont">&#xe620;</i>
+						<span>个人信息</span>
+					</a>
+				</li>
+				<li class="mui-table-view-cell">
+					<a class="mui-navigate-right" href="../personalinfo/feedback.html">
+						<i class="iconfont">&#xe62c;</i>
+						<span>反馈</span>
+					</a>
+				</li>
+				<!--<li class="mui-table-view-cell">
+					<a class="mui-navigate-right" href="../personalinfo/about.html">
+						<i class="iconfont">&#xe608;</i>
+						<span>关于</span>
+					</a>
+				</li>-->
+				<li class="mui-table-view-cell">
+					<a class="mui-navigate-right" href="../personalinfo/refresh.html">
+						<i class="iconfont">&#xe6f3;</i>
+						<span>系统</span>
+					</a>
+				</li>
+				<!--<li class="mui-table-view-cell">
+					<a class="mui-navigate-right" id="refresh">
+						<i class="iconfont">&#xe6f3;</i>
+						<span>更新</span>
+					</a>
+				</li>-->
+			</ul>
+			<ul class="mui-table-view option" style="margin-bottom: 0;">
+				<li class="mui-table-view-cell">
+					<a class="mui-navigate-right" href="../personalinfo/setting.html">
+						<i class="iconfont">&#xe607;</i>
+						<span>设置</span>
+					</a>
+				</li>
+			</ul>
+		</div>
+		<div class="failed">
+			<img src="../images/againLoad.png"/>
+			<p>数据加载失败</p>
+			<button id="loadBtn">重新加载</button>
+		</div>
+		<script src="../js/jquery-2.1.0.js"></script>
+		<script src="../js/mui.min.js"></script>
+		<script type="text/javascript">
+			mui.init();
+			$('.mui-content').hide();
+			var userinfoData;
+			mui.plusReady(function() {
+				var username = plus.storage.getItem('username');
+				console.log(username);
+				getuserinfo();
+				$('#loadBtn').on('tap',getuserinfo);
+				function getuserinfo(){
+					mui.ajax('http://120.27.222.26/app_user_info', {
+						data: {
+							req:'info'
+						},
+						dataType: 'json', //服务器返回json格式数据
+						type: 'post', //HTTP请求类型
+						timeout: 10000, //超时时间设置为10秒;
+						beforeSend: function() {
+							plus.nativeUI.showWaiting('请求中...');
+						},
+						complete: function() {
+							plus.nativeUI.closeWaiting();
+						},
+						success: function(data) {
+							userinfoData = data;
+							$('#userImg').attr('src','http://120.27.222.26/'+data.user_picture);
+							$('#username').html(data.username);
+							$('.failed').hide();
+							$('.header').hide();
+							$('.mui-content').show();
+						},
+						error: function(xhr, type, errorThrown) {
+							console.log(type)
+							console.log(errorThrown)
+							mui.toast('个人信息获取失败');
+							$('.mui-content').hide();
+							$('.failed').show();
+							$('.header').show();
+						}
+					});
+				}
+				
+				mui('.option').on('tap', 'a', function() {
+					var src = this.getAttribute('href');
+					var id = (this.href.substr(this.href.lastIndexOf('/') + 1)).split('.')[0];
+					console.log(id)
+
+					if(id){
+						if(id == 'userinfo'){
+							mui.openWindow({
+								url:src,
+								id:id,
+								extras: {
+									data: userinfoData //扩展参数
+								}
+							})
+						}else{
+							mui.openWindow({
+								url:src,
+								id:id
+							})
+						}
+					}else{
+						mui.openWindow({
+							url:src,
+							id:id
+						})
+					}
+					
+				})
+				//刷新
+//				document.getElementById('refresh').addEventListener('tap', function() {
+//					var btnArray = ['确定', '取消'];
+//					mui.confirm('确定更新到最新版本?', '版本更新', btnArray, function(e) {
+//						if(e.index == 0) {
+//							console.log('是');
+//						} else {
+//							console.log('否');
+//						}
+//					})
+
+					//获取当前版本号
+//					plus.runtime.getProperty(plus.runtime.appid, function(inf) {
+//					    wgtVer = inf.version;//获取版本号
+//					    console.log(wgtVer)
+//					    var wait = plus.nativeUI.showWaiting('下载更新中,请勿关闭');
+//					    //创建一个下载任务
+//					    var dtask = plus.downloader.createDownload( "", {method:"GET"}, function ( d, status ) {
+//					    	if ( status == 200 ) { 
+//								console.log( "Download success: " + d.filename );
+//					    		plus.runtime.install(d.filename); // 安装下载的apk文件
+//							}else{
+//								mui.alert('更新失败')
+////					    		plus.runtime.install('../H5B2852C7_0925104810.apk'); // 安装下载的apk文件
+//							}
+//							wait.close();
+//					    });
+//					    //开始下载
+//					    dtask.start(); 
+//					});
+//				})
+				//更换头像
+				document.getElementById('userImg').addEventListener('tap', function() {
+					if(mui.os.plus) {
+						var a = [{
+							title: '查看大图'
+						},{
+							title: '拍照'
+						}, {
+							title: '从手机相册选择'
+						}];
+						plus.nativeUI.actionSheet({
+							title: '修改头像',
+							cancel: '取消',
+							buttons: a
+						}, function(b) {
+							console.log(b.index)
+							switch(b.index) {
+								case 0:
+									break;
+								case 1:
+									lookBigImg();
+									break;
+								case 2:
+									//拍照
+									getImages();
+									break;
+								case 3:
+									//打开相册
+									galleryImages();
+									break;
+								default:
+									break;
+							}
+						}, false);
+					}
+				});
+				
+				//查看大图
+				function lookBigImg(){
+					var imgsrc = document.getElementById('userImg').getAttribute('src'); 
+					console.log(imgsrc)
+					plus.nativeUI.previewImage([
+						imgsrc
+					]);
+				}
+
+				//拍照
+				function getImages() {
+					var mobileCamera = plus.camera.getCamera();
+					mobileCamera.captureImage(function(e) {
+						plus.io.resolveLocalFileSystemURL(e, function(entry) {
+							var path = entry.toLocalURL() + '?version=' + new Date().getTime();
+							uploadHeadImg(path);
+						}, function(e) {
+							console.log("读取拍照文件错误");
+						});
+					}, function(e) {
+						console.log("er", e.message);
+					}, function() {
+						filename: '_doc/head.png';
+					});
+				}
+				
+
+				//从本地相册选择
+				function galleryImages() {
+					console.log("你选择了从相册选择");
+					plus.gallery.pick(function(a) {
+						plus.io.resolveLocalFileSystemURL(a, function(entry) {
+							plus.io.resolveLocalFileSystemURL('_doc/', function(root) {
+								root.getFile('head.png', {}, function(file) {
+									//文件已经存在
+									file.remove(function() {
+										console.log("文件移除成功");
+										entry.copyTo(root, 'head.png', function(e) {
+											var path = e.fullPath + '?version=' + new Date().getTime();
+											uploadHeadImg(path);
+										}, function(err) {
+											console.log("copy image fail: ", err);
+										});
+									}, function(err) {
+										console.log("删除图片失败:(" + JSON.stringify(err) + ")");
+									});
+								}, function(err) {
+									//打开文件失败
+									entry.copyTo(root, 'head.png', function(e) {
+										var path = e.fullPath + '?version=' + new Date().getTime();
+										uploadHeadImg(path);
+									}, function(err) {
+
+										console.log("上传图片失败:(" + JSON.stringify(err) + ")");
+									});
+								});
+							}, function(e) {
+								console.log("读取文件夹失败:(" + JSON.stringify(e) + ")");
+							});
+						});
+					}, function(err) {
+						console.log("读取拍照文件失败: ", err);
+					}, {
+						filter: 'image'
+					});
+				};
+
+				//上传图片
+				function uploadHeadImg(imgPath) {
+					//服务端接口路径
+					var server = "http://120.27.222.26/app_user_info";
+					//获取图片元素
+					var files = document.getElementById('userImg');
+					console.log(files.src);
+					var wt = plus.nativeUI.showWaiting('上传中...');
+					var task = plus.uploader.createUpload(server, {
+							method: "POST",
+//							timeout:10
+						},
+						function(t, status) { //上传完成
+							if(status == 200) {
+								alert("上传成功:" + t.responseText);
+								wt.close(); //关闭等待提示按钮
+								document.getElementById('userImg').src = imgPath;
+							} else {
+								alert("上传失败:" + status);
+								wt.close(); //关闭等待提示按钮
+							}
+						}
+					);
+					//添加其他参数
+//					task.addData("name", "test");
+					task.addData("req", "change_photo");
+					task.addFile(imgPath, {
+						key: "file"
+					});
+					task.start();
+				}
+
+			});
+		</script>
+	</body>
+
+</html>

+ 253 - 0
home/register.html

@@ -0,0 +1,253 @@
+<!DOCTYPE html>
+<html lang="en">
+
+	<head>
+		<meta charset="UTF-8">
+		<meta charset="utf-8">
+		<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
+		<title>FrozenUI Demo</title>
+		<link rel="stylesheet" href="../css/mui.min.css">
+		<link rel="stylesheet" type="text/css" href="../css/reset.css" />
+		<link rel="stylesheet" href="../css/iconfont.css" />
+		<style type="text/css">
+			html {
+				height: 100%;
+			}
+			
+			body {
+				height: 100%;
+				background: #fff;
+			}
+			
+			.page {
+				height: 100%;
+				overflow: hidden;
+			}
+			
+			.logo {
+				text-align: center;
+				margin: 7rem 0 4.5rem;
+			}
+			.logo >img{
+				width: 40%;
+			}
+			
+			.logoCover {
+				width: 80%;
+				margin: 0 auto;
+			}
+			
+			.logoItem {
+				border-bottom: 1px solid #bbb;
+				position: relative;
+				height: 40px;
+				margin-bottom: 15px;
+			}
+			
+			.logoItem i {
+				font-size: 22px;
+				color: #22ace1;
+				vertical-align: middle;
+				position: absolute;
+				left: 0;
+				bottom: 8px;
+			}
+			#recordPwdIcon{
+				color: #22ace1;
+			}
+			.logoItem input {
+				background: transparent;
+				border: none;
+				padding: 0 0 4px 35px;
+				position: absolute;
+				left: 0;
+				bottom: 0;
+				margin: 0;
+			}
+			
+			.logoItem .unlock {
+				font-size: 29px;
+			}
+			
+			input::-webkit-input-placeholder {
+				color: #969696;
+			}
+			
+			input::-moz-placeholder {
+				/* Mozilla Firefox 19+ */
+				color: #969696;
+			}
+			
+			input:-moz-placeholder {
+				/* Mozilla Firefox 4 to 18 */
+				color: #969696;
+			}
+			
+			input:-ms-input-placeholder {
+				/* Internet Explorer 10-11 */
+				color: #969696;
+			}
+			
+			#forgetPwd,
+			#registerBtn,
+			.recordPwdLabel,
+			.logoItem input {
+				color: #bbb;
+			}
+			
+			#loginBtn,#registerBtn {
+				width: 100%;
+				/*line-height: 30px;*/
+				font-size: 18px;
+				letter-spacing: 6px;
+				border-radius: 6px;
+				margin: 20px 0 13px;    
+				color: #bbb;
+			}
+			#loginBtn:enabled:active{
+				color: #fff;
+    			border: 1px solid #39c7fc;
+    			background-color: #39c7fc !important;
+			}
+			
+			#loginBtn.btn-primary{
+				background-color: #05a0db;
+				border: 1px solid #12a5dc;
+				color: #fff;
+			}
+			/*记住密码*/
+			
+			.checkbox {
+				display: none;
+			}
+			
+			#addUser {
+				position: fixed;
+				left: 0;
+				right: 0;
+				bottom: 10px;
+				text-align: center;
+			}
+			
+			#sendnum{
+				position:absolute;
+				top: 0;
+				right: 0;
+				font-size: 14px;
+				padding: 5px;
+				min-width: 80px;
+			}
+			#sendnum.active{
+				background: transparent;
+			    border: 1px solid #b1b1b1;
+			    color: #bbb;
+			}
+		</style>
+	</head>
+
+	<body>
+		<div class="page">
+			<div class="logo">
+				<img src="../images/logoTxt.png" alt="云飞智能科技" />
+			</div>
+			<div class="logoCover">
+				<div class="logoInner">
+					<form action="" method="post">
+						<ul>
+							<li class="logoItem">
+								<i class="iconfont">&#xe636;</i>
+								<input type="tel" maxlength="11" id="user_phone" placeholder="请输入手机号" />
+							</li>
+							<li class="logoItem">
+								<i class="iconfont">&#xe637;</i>
+								<input type="number" maxlength="4" id="codenum" placeholder="请输入验证码" />
+								<button type="button" class="active" onclick="settime(this)" id="sendnum">获取验证码</button>
+							</li>
+							<li class="logoItem">
+								<i class="iconfont">&#xe689;</i>
+								<input type="password" id="password" placeholder="密码" />
+							</li>
+						</ul>
+						<input type="button" id="registerBtn" value="注册" />
+						<input type="button" id="loginBtn" value="登录" />
+					</form>
+				</div>
+			</div>
+		</div>
+
+	</body>
+	<script src="../js/jquery-2.1.0.js"></script>
+	<script src="../js/mui.min.js"></script>
+	<script>
+		mui.init();
+		var telRegExp = /^[1][3,4,5,7,8,9][0-9]{9}$/;
+		var countdown=60; 
+		function settime(obj) {
+			var telnum = $('#user_phone').val()
+			if(telRegExp.test(telnum)){
+			    if (countdown == 0) { 
+			        obj.removeAttribute("disabled");    
+			        obj.innerHTML="获取验证码"; 
+			        countdown = 60; 
+			        return;
+			    } else { 
+			        obj.setAttribute("disabled", true); 
+			        obj.innerHTML="重新发送(" + countdown + ")"; 
+			        countdown--; 
+			    } 
+				setTimeout(function() { 
+				    settime(obj) 
+				},1000) 
+			}else{
+				mui.toast('请输入正确手机号');
+			}
+		}
+		
+		$('#password').on('keyup',function(){
+			var telnum = $('#user_phone').val()
+			var codenum = $('#codenum').val()
+			var password = $('#password').val()
+			if(telRegExp.test(telnum) && codenum && (password.length>6)){
+				$('#logonBtn').addClass('active');
+			}else{
+				$('#logonBtn').removeClass('active');
+			}
+		})
+		
+		$('.logoInner').on('tap','#logonBtn.active',function(){
+			alert(1)
+		})
+		
+		$('#loginBtn').on('tap',function(){
+			mui.openWindow({
+				url:'login.html',
+				id:'login'
+			})
+		})
+		
+
+
+		//退出应用
+		mui.oldback = mui.back;
+		var clickNum = 0;
+		mui.back = function(event) {
+			clickNum++;
+			if(clickNum > 1) {
+				plus.runtime.quit();
+			} else {
+				mui.toast("再按一次退出应用");
+			}
+			setTimeout(function() {
+				clickNum = 0
+			}, 1000);
+			return false;
+		}
+		//测试网络
+		function networkinfo() {
+			if(plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
+				mui.toast("网络异常,请检查网络设置!");
+			}
+		}
+	</script>
+
+</html>

BIN
images/1.png


BIN
images/11.png


BIN
images/2.png


BIN
images/3.png


BIN
images/7.png


BIN
images/8.png


BIN
images/IDicon.png


BIN
images/admin.png


BIN
images/againLoad.png


BIN
images/allotEqueip.png


BIN
images/annular.png


BIN
images/ant.jpg


BIN
images/autoDiscern.jpg


BIN
images/banner1.jpg


BIN
images/banner2.jpg


+ 0 - 0
images/banner3.jpg


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است