details.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. {% load staticfiles %}
  2. <!DOCTYPE html>
  3. <html lang="en">
  4. <head>
  5. <meta charset="UTF-8" />
  6. <link href="{% static '/lib/bootstrap-3.3.7/css/bootstrap.css' %}" rel="stylesheet">
  7. <link rel="stylesheet" href="{% static '/lib/font-awesome/4.5.0/css/font-awesome.css' %}">
  8. <link rel="stylesheet" href="{% static '/lib/css/ace.min.css' %}" />
  9. <link rel="stylesheet" href="{% static '/lib/css/ace-skins.min.css' %}">
  10. <link rel="stylesheet" href="{% static '/lib/css/ace-rtl.min.css' %}">
  11. <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
  12. <link rel="stylesheet" href="{% static '/css/loading.css' %}?versions=0.5.0" />
  13. <style type="text/css">
  14. body {
  15. background: #fff;
  16. }
  17. .content {
  18. overflow-x: scroll;
  19. }
  20. /* 返回 */
  21. .headerPlace {
  22. font-size: 22px;
  23. color: #418fbb;
  24. cursor: pointer;
  25. }
  26. .headerPlace img {
  27. vertical-align: middle;
  28. margin-right: 10px;
  29. margin-top: -4px;
  30. }
  31. * {
  32. margin: 0;
  33. padding: 0;
  34. }
  35. .row {
  36. margin: 0;
  37. }
  38. .equipInfo {
  39. margin: 20px 0;
  40. }
  41. .equipInfo .row {
  42. margin: 0 13px;
  43. box-shadow: 0 0 40px #eee;
  44. padding: 30px;
  45. }
  46. .equipInfo .row>div {
  47. height: 52px;
  48. text-align: center;
  49. border-left: 1px solid #eee;
  50. }
  51. .equipInfo .row .txt {
  52. position: absolute;
  53. left: 105px;
  54. }
  55. .equipInfo .row>div:first-child {
  56. border-left: none;
  57. }
  58. .typeResult {
  59. font-size: 18px;
  60. line-height: 30px;
  61. }
  62. @media (max-width: 1200px) {
  63. .col-xs-4.secondLine {
  64. border-left: none !important;
  65. }
  66. .col-xs-4 {
  67. margin-bottom: 10px;
  68. }
  69. }
  70. /* */
  71. .backStyle {
  72. background: #fff;
  73. box-shadow: 0 0 40px #eee;
  74. padding: 20px;
  75. }
  76. .backStyleA {
  77. background: #fff;
  78. box-shadow: 0 0 40px #eee;
  79. padding: 20px;
  80. overflow-y: scroll;
  81. overflow-x: scroll;
  82. height: 380px;
  83. }
  84. .backStyleB {
  85. background: #fff;
  86. box-shadow: 0 0 40px #eee;
  87. padding: 20px;
  88. height: 468px;
  89. }
  90. .backStyle h1 {
  91. font-size: 18px;
  92. margin-bottom: 15px;
  93. }
  94. .haloParent {
  95. position: absolute;
  96. width: 100px;
  97. height: 100px;
  98. float: left;
  99. margin-top: -23px;
  100. }
  101. .halo {
  102. position: absolute;
  103. width: 100px;
  104. height: 100px;
  105. border-radius: 50%;
  106. }
  107. .solidCircle {
  108. position: absolute;
  109. width: 50px;
  110. height: 50px;
  111. border-radius: 50%;
  112. left: 50%;
  113. top: 50%;
  114. margin-left: -25px;
  115. margin-top: -25%;
  116. }
  117. .solidCircle4 {
  118. background: #4ca1ff;
  119. }
  120. .solidCircle6 {
  121. background: #a597f8;
  122. }
  123. .solidCircle8 {
  124. background: #fc9558;
  125. }
  126. .halo4 {
  127. animation: haloFour 2s 3s infinite;
  128. }
  129. .halo6 {
  130. animation: haloSix 2s 3s infinite;
  131. }
  132. .halo8 {
  133. animation: haloEight 2s 3s infinite;
  134. }
  135. @keyframes haloFour {
  136. 0% {
  137. background: #4ca1ff;
  138. transform: scale(.3);
  139. opacity: 0
  140. }
  141. 20% {
  142. background: #1258a5;
  143. transform: scale(.5);
  144. opacity: .5
  145. }
  146. 100% {
  147. background: #1258a5;
  148. transform: scale(.8);
  149. opacity: 0
  150. }
  151. }
  152. @keyframes haloSix {
  153. 0% {
  154. background: #a597f8;
  155. transform: scale(.3);
  156. opacity: 0
  157. }
  158. 20% {
  159. background: #3d2aaf;
  160. transform: scale(.5);
  161. opacity: .5
  162. }
  163. 100% {
  164. background: #3d2aaf;
  165. transform: scale(.8);
  166. opacity: 0
  167. }
  168. }
  169. @keyframes haloEight {
  170. 0% {
  171. background: #f8bb97;
  172. transform: scale(.3);
  173. opacity: 0
  174. }
  175. 20% {
  176. background: #fa8845;
  177. transform: scale(.5);
  178. opacity: .5
  179. }
  180. 100% {
  181. background: #f27125;
  182. transform: scale(.8);
  183. opacity: 0
  184. }
  185. }
  186. .haloIcon {
  187. margin-top: 14px;
  188. width: 24px;
  189. height: 24px;
  190. }
  191. /* ul和li */
  192. .list {
  193. border-bottom: 1px dashed rgb(131, 129, 129);
  194. margin-top: 40px;
  195. }
  196. .hid {
  197. display: none;
  198. }
  199. .font18 {
  200. text-indent: 2em;
  201. text-align: left;
  202. font-size: 18px;
  203. line-height: 28px;
  204. }
  205. .font19 {
  206. margin: 0 0 0 -50px;
  207. width: 14rem;
  208. }
  209. .font20 {
  210. margin: 0 0 0 49px;
  211. }
  212. .imgHid {
  213. display: none;
  214. }
  215. .font18Box {
  216. display: flex;
  217. }
  218. #addrPhoto {
  219. /* width: 850px; */
  220. width: 760px;
  221. height: 590px;
  222. margin: 30px 0 0 35px;
  223. }
  224. .layui-carousel>[carousel-item]>* {
  225. display: inline-block;
  226. }
  227. </style>
  228. </head>
  229. <body>
  230. <div class="content">
  231. <div class="page-header">
  232. <!-- <span class="headerPlace" onclick="gobackA('equipmanage_cbd')"> -->
  233. <span class="headerPlace" onclick="gobackA()">
  234. <img src="{% static '/img/gobackIcon.png' %}" alt="">返回
  235. </span>
  236. </div>
  237. <!-- <div class="layui-carousel col-xs-12 col-md-6" id="test1" lay-filter="test1">
  238. <div carousel-item="" class="addrPhoto_box" id="addrPhoto_box">
  239. <img src="" alt="" class="" id="addrPhoto_img">
  240. <img src="" alt="" class="">
  241. <img src="" alt="" class="">
  242. </div>
  243. </div> -->
  244. <div class="col-xs-12 col-md-6" id="addrPhoto_box"></div>
  245. <!-- 轮播图 -->
  246. <!-- 右边 -->
  247. <!-- <div class="col-xs-12 col-md-6" style="padding-left: 0px;padding-right:0px;margin:-18px 0 0 15px;"> -->
  248. <div class="col-xs-12 col-md-6" style="padding-left: 0px;padding-right:0px;">
  249. <!-- 信息条 -->
  250. <div class="equipInfo">
  251. <div class="row" style="margin-left: 0;">
  252. <div class="col-xs-4">
  253. <div class="haloParent">
  254. <div class="halo halo6"></div>
  255. <div class="solidCircle solidCircle6">
  256. <img class="haloIcon" src="{% static '/img/haloIcon25.png' %}" alt="">
  257. </div>
  258. </div>
  259. <div class="txt">
  260. <span class="typeResult" id="userId"></span>
  261. <p class="typeResult" id="userIdName">测报员</p>
  262. </div>
  263. </div>
  264. <div class="col-xs-4">
  265. <div class="haloParent">
  266. <div class="halo halo4"></div>
  267. <div class="solidCircle solidCircle4">
  268. <img class="haloIcon" src="{% static '/img/haloIcon26.png' %}" alt="">
  269. </div>
  270. </div>
  271. <div class="txt">
  272. <span class="typeResult" id="time"></span>
  273. </div>
  274. </div>
  275. <div class="col-xs-4">
  276. <div class="haloParent">
  277. <div class="halo halo8"></div>
  278. <div class="solidCircle solidCircle8">
  279. <img class="haloIcon" src="{% static '/img/haloIcon1.png' %}" alt="">
  280. </div>
  281. </div>
  282. <div class="txt">
  283. <!-- <span class="typeResult" id="lng">经度:113.46655</span>
  284. <p class="typeResult" id="lat">纬度:48.121211</p> -->
  285. <!-- <span class="typeResult" id="lng">经度:113.46655</span> -->
  286. <!-- <span class="typeResult" id="userCityName">地址</span> -->
  287. <span class="typeResult" id="userCity">地址</span>
  288. <p class="typeResult" id="userMonth"></p>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. <div class="row">
  294. <div class="col-xs-6" style="padding-left: 0;">
  295. <div class="backStyleB" style="margin-bottom:20px">
  296. <ul class="">
  297. <li class="list">
  298. <span class="typeResult tempTitel" id="statisticalName">统计种类:</span>
  299. <span class="typeResult tempTitel" id="statistical"></span>
  300. </li>
  301. <li class="list">
  302. <span class="typeResult tempTitel" id="insectSortName">所属分类:</span>
  303. <span class="typeResult tempTitel" id="insectSort"></span>
  304. </li>
  305. <li class="list">
  306. <span class="typeResult tempTitel" id="namesName">病虫害名称:</span>
  307. <span class="typeResult tempTitel" id="names"></span>
  308. </li>
  309. <li class="list">
  310. <span class="typeResult tempTitel" id="statisticalMethodName">统计方法:</span>
  311. <span class="typeResult tempTitel" id="statisticalMethod"></span>
  312. </li>
  313. <li class="list" id="areaName">
  314. <span class="typeResult tempTitel">统计面积:</span>
  315. <span class="typeResult tempTitel" id="area"></span>
  316. </li>
  317. <li class="list">
  318. <span class="typeResult tempTitel" id="userCityName">生育期:</span>
  319. <span class="typeResult tempTitel" id="growthStages"></span>
  320. </li>
  321. </ul>
  322. </div>
  323. </div>
  324. <!-- 温控状态 -->
  325. <div class="col-xs-6" style="padding-left: 0;">
  326. <div class="backStyle" style="margin-bottom:20px">
  327. <span class="typeResult tempTitel" id="tpsName">病虫害值:</span>
  328. <span class="typeResult tempTitel" id="tps"></span>
  329. </div>
  330. <div class="backStyleA">
  331. <div class="temperatureKind">
  332. <div class="clearfix weatherType">
  333. <div class="tempTypeValue" id="tempTypeValue">
  334. <p class="font18" id="pestname"></p>
  335. </div>
  336. </div>
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. <!-- 右侧详情 -->
  343. </div>
  344. <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
  345. <script src="{% static '/lib/layui/layui.all.js' %}"></script>
  346. <script src="{% static '/js/common.js' %}?versions=0.5.0"></script>
  347. <script type="text/javascript">
  348. $.ajaxSetup({
  349. data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
  350. });
  351. </script>
  352. <script type="text/javascript">
  353. particulars();
  354. //详情数据
  355. function particulars() {
  356. //判断是已录还是识别
  357. if (sessionStorage.getItem('cordID') !== null) {
  358. var aa = new Array();
  359. aa = sessionStorage.getItem('cordID').split(',')
  360. var bb = 'cord'
  361. var ahAt = '2'
  362. } else if (sessionStorage.getItem('discID') !== null) {
  363. $("#addrPhoto_img").remove();
  364. aa = sessionStorage.getItem('discID').split(',')
  365. var bb = 'disc'
  366. var ahAt = '2'
  367. }
  368. // console.log(aa[1])
  369. $.ajax({
  370. url: 'check_account',
  371. type: 'post',
  372. data: {
  373. id: aa[0],
  374. // ret: aa[1],
  375. ret: ahAt,
  376. req: bb
  377. },
  378. dataType: 'json',
  379. success: function (data) {
  380. //判断是已录信息还是识别记录
  381. if (bb == 'cord') {
  382. $('#userId').html(data[0].user_name) //测报员
  383. $('#time').html(data[0].upl_time) //时间
  384. // if (data[0].lng == "null" && data[0].lat == "null") {
  385. // $('#lng').html('经度:' + '--') //经度
  386. // $('#lat').html('纬度:' + '--') //纬度
  387. // } else {
  388. // $('#lng').html('经度:' + data[0].lng) //经度
  389. // $('#lat').html('纬度:' + data[0].lat) //纬度
  390. // }
  391. if (data[0].lng == "null" && data[0].lat == "null") {
  392. $('#lng').html('经度:' + '--') //经度
  393. $('#lat').html('纬度:' + '--') //纬度
  394. } else {
  395. $('#lng').html('经度:' + data[0].lng) //经度
  396. $('#lat').html('纬度:' + data[0].lat) //纬度
  397. }
  398. if (data[0].city == "null") {
  399. $('#userCity').html('暂无地址') //地址
  400. } else {
  401. $('#userCity').html(data[0].city) //地址
  402. }
  403. if (data[0].statistical == '1') {
  404. $('#statistical').html('病害') //统计种类
  405. } else {
  406. $('#statistical').html('虫害')
  407. }
  408. if (data[0].crop_sort == '1') {
  409. $('#insectSort').html('粮食作物下的' + data[0].pest) //统计种类
  410. } else if (data[0].crop_sort == '2') {
  411. $('#insectSort').html('作物经济下的' + data[0].pest)
  412. } else if (data[0].crop_sort == '3') {
  413. $('#insectSort').html('林业下的' + data[0].pest)
  414. }
  415. $('#names').html(data[0].pest_name) //病虫害名称
  416. $('#growthStages').html(data[0].growth_stages) //生育期
  417. $('#userMonth').html(data[0].month + '月份') //月份
  418. $('#statisticalMethod').html(data[0].cens_method) //统计方法
  419. $('#area').html(data[0].area) //统计面积
  420. // $('#insectSort').html(data[0].insect_sort) //所属分类
  421. //病虫害值
  422. var insect = '';
  423. var insectAyn = data[0].pestname;
  424. for (var i in insectAyn) {
  425. var key = Object.keys(insectAyn[i])
  426. var values = insectAyn[i][key]
  427. insect += '<div class="font18Box">' + '<p class="font18 font19" id="pestname">' + key[0] + ":" + '<div class="font20">' + values[0] + '</div>' + '</p>' + '</div>'
  428. }
  429. document.getElementById('tempTypeValue').innerHTML = insect
  430. //轮播图
  431. var image = ''
  432. var img = data[0].addr_photo
  433. // for (var i = 0; i < img.length; i++) {
  434. // image += '<img src=' + img[i] + ' id="addrPhoto">'
  435. // console.log(img[i])
  436. // document.getElementById('addrPhoto_box').innerHTML = image
  437. // }
  438. image += '<img src=' + img[0] + ' id="addrPhoto">'
  439. document.getElementById('addrPhoto_box').innerHTML = image
  440. // document.getElementById('addrPhoto_box').innerHTML = image
  441. } else if (bb == 'disc') {
  442. //先将文本更改
  443. $('#statisticalMethodName').html('测报员:') //统计方法改为测报员
  444. $('#userIdName').html('所属用户') //测报员改为所属用户
  445. $('#area').html(data[0].area) //统计面积
  446. $('#tpsName').html('详情描述:') //统计面积
  447. $('#areaName').addClass('hid') //统计面积
  448. //填充数据
  449. if (data[0].ret == 'insect') {
  450. var fenlei = '虫害'
  451. } else if (data[0].ret == 'plant') {
  452. var fenlei = '病害'
  453. }
  454. if (data[0].course == '') {
  455. var kemu = '暂无'
  456. } else if (data[0].course !== '') {
  457. var kemu = data[0].course
  458. }
  459. if (data[0].img_urls !== '') {
  460. var image = data[0].img_urls
  461. }
  462. //切割详情字符串数据并渲染
  463. let Adata = data[0].prevention;
  464. var asj = Adata.replace(/]/g, ":");
  465. let Bdata = new Array();
  466. Bdata = asj.split("[");
  467. $('#userId').html(data[0].username) //所属用户
  468. $('#time').html(data[0].time) //时间
  469. if (data[0].lng == "null" && data[0].lat == "null") {
  470. $('#lng').html('经度:' + '--') //经度
  471. $('#lat').html('纬度:' + '--') //纬度
  472. } else {
  473. $('#lng').html('经度:' + data[0].lng) //经度
  474. $('#lat').html('纬度:' + data[0].lat) //纬度
  475. }
  476. if (data[0].addr == "null") {
  477. $('#userCity').html('暂无地址') //地址
  478. } else {
  479. $('#userCity').html(data[0].addr) //地址
  480. }
  481. // $('#lng').html('经度:' + data[0].lng) //经度
  482. // $('#lat').html('纬度:' + data[0].lat) //纬度
  483. // $('#userCity').html(data[0].addr) //地址
  484. $('#names').html(data[0].name) //病虫害名称
  485. $('#statistical').html(fenlei) //统计种类
  486. $('#statisticalMethod').html(data[0].reporter) //统计方法
  487. $('#area').html(data[0].area) //统计面积
  488. $('#insectSort').html(kemu) //所属分类
  489. $('#pestname').html(Bdata) //详情描述
  490. $('#addrPhoto').attr('src', image) //图片
  491. var image = ''
  492. var img = new Array();
  493. if (data[0].img_urls == '' || data[0].img_urls == null) {
  494. img.push(data[0].img)
  495. } else {
  496. img.push(data[0].img_urls)
  497. }
  498. // img.push(data[0].img_urls)
  499. // img.push(data[0].img_urls)
  500. // for (var i = 0; i < img.length; i++) {
  501. // image += '<img src=' + img[i] + ' id="addrPhoto">'
  502. // }
  503. image += '<img src=' + img[0] + ' id="addrPhoto">'
  504. document.getElementById('addrPhoto_box').innerHTML = image
  505. // ins.reload({ elem: '#test1' });//重置轮播图
  506. }
  507. scrollBar();
  508. },
  509. error: function (error) {
  510. console.log(error)
  511. }
  512. })
  513. }
  514. //返回功能
  515. function gobackA() {
  516. window.history.back(-1)
  517. }
  518. </script>
  519. </body>
  520. </html>