equip-detail.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. <template>
  2. <view>
  3. <view :class="['info',equipInfo.is_online==1?'on':'off']">
  4. <view class="" @click="copy(equipInfo)">
  5. 设备ID:{{equipInfo.imei||equipInfo.device_id}}
  6. <image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode="" class="tishi"></image>
  7. </view>
  8. <view class="">
  9. 设备名称:{{equipInfo.device_name}}
  10. </view>
  11. <view class="">
  12. 设备类型:{{equipInfo.type|equipType}}{{equipInfo.type_name}}
  13. </view>
  14. <view class="">
  15. 最新上报时间:{{equipInfo.addtime||equipInfo.uptime | timeFormat}}
  16. </view>
  17. <view class="">
  18. 设备地址:{{equipInfo.address?equipInfo.address:"--"}}
  19. </view>
  20. <view v-if="type==7" @click="setTime(equipInfo.d_id)">
  21. <text space="emsp">载玻片、培养液更换时间</text>
  22. <u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
  23. </view>
  24. <view v-if="type==4" @click="addYx(equipInfo.d_id)">
  25. <text space="emsp">添加诱芯</text>
  26. <u-icon name="edit-pen" color="#f0ad4e" size="28"></u-icon>
  27. </view>
  28. <u-popup v-model="setTimeShow" mode="center" width="600rpx">
  29. <u-field label="载玻片更换时间" placeholder="选择日期" label-width='240' required :error-message="glassErr" v-model="glass_slide_time"
  30. @click="glass_show=true" :field-style="fieldstyle">
  31. </u-field>
  32. <u-field label="培养液更换时间" placeholder="选择日期" label-width='240' required :error-message="culErr" v-model="cultivate_time"
  33. @click="cultivate_show=true" :field-style="fieldstyle">
  34. </u-field>
  35. <view class="btn-box">
  36. <u-button @click="setTimeSubmit" size="mini" type="success">确定</u-button>
  37. </view>
  38. <u-calendar v-model="glass_show" mode="date" @change="timeChange($event,'glass')"></u-calendar>
  39. <u-calendar v-model="cultivate_show" mode="date" @change="timeChange($event,'cultivate')"></u-calendar>
  40. </u-popup>
  41. <u-popup v-model="yxShow" mode="center" width="600rpx">
  42. <u-field label="监测害虫名称" label-width='240' required :error-message="xyErr" v-model="decoy" :field-style="fieldstyle">
  43. </u-field>
  44. <view class="btn-box">
  45. <u-button @click="yxSubmit" size="mini" type="success">确定</u-button>
  46. </view>
  47. </u-popup>
  48. <u-toast ref="toast" />
  49. </view>
  50. <view class="equip_part">
  51. <template v-if="equipInfo.type==7">
  52. <view class="item1" v-for="item in bzy" v-if="item.tf" @click="partClick(item.path)">
  53. <image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+item.icon" mode="widthFix"></image>
  54. <view class="">
  55. {{item.tex}}
  56. </view>
  57. </view>
  58. </template>
  59. <template v-else-if="equipInfo.type==3">
  60. <view class="item2" v-for="item in curEquip" v-if="item.tf" @click="partClick(item.path)">
  61. <image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+item.icon" mode="widthFix"></image>
  62. <view class="">
  63. {{item.tex}}
  64. </view>
  65. </view>
  66. </template>
  67. <template v-else>
  68. <view class="item3" v-for="item in curEquip" v-if="item.tf" @click="partClick(item.path)">
  69. <image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+item.icon" mode="widthFix"></image>
  70. <view class="">
  71. {{item.tex}}
  72. </view>
  73. </view>
  74. </template>
  75. </view>
  76. <view class="tit">
  77. <p>实时数据</p>
  78. <p class="span" @click="partClicks" v-if="equipInfo.type!=4">历史数据>>></p>
  79. </view>
  80. <view class="newtishi" v-if="!newtishitf">
  81. 暂无数据
  82. </view>
  83. <view class="newState" v-else>
  84. <view class="item" v-for="item in curState">
  85. <image :src="'http://www.hnyfwlw.com:8006/bigdata_app'+item.icon" mode="widthFix"></image>
  86. <view class="info-con">
  87. <view class="active">
  88. {{item.txt}}
  89. </view>
  90. <view class="val">
  91. {{item.value | formatValue(item.txt,type)}}
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. import equipState from "../../../static/js/equipState_dict.json"
  100. export default {
  101. data() {
  102. return {
  103. fieldstyle:{
  104. border:"2rpx solid #f6f6f6",
  105. "border-radius":"24px",
  106. "padding-left":"20rpx",
  107. "background-color":"#f6f6f6"
  108. },
  109. city:"",
  110. type: null, //设备类型
  111. device_status: null,
  112. equipInfo: {},
  113. cbd: [{
  114. icon: '/image/cb/1.png',
  115. tex: '查看图片',
  116. path: '/pages/cb/cbd/equip-set/imgpage',
  117. tf:false
  118. },
  119. // {
  120. // icon: '/image/cb/2.png',
  121. // tex: '历史数据',
  122. // path: '/pages/cb/cbd/equip-set/historyfile',
  123. // tf:false
  124. // },
  125. {
  126. icon: '/image/cb/3.png',
  127. tex: '害虫统计',
  128. path: '/pages/cb/cbd/equip-set/statistics',
  129. tf:false
  130. }, {
  131. icon: '/image/cb/4.png',
  132. tex: '设备控制',
  133. path: '/pages/cb/cbd/equip-set/equip-set',
  134. tf:false
  135. }, {
  136. icon: '/image/cb/5.png',
  137. tex: '短信预警',
  138. path: '/pages/cb/cbd/equip-set/note',
  139. tf:false
  140. }, {
  141. icon: '/image/cb/6.png',
  142. tex: 'sim卡详情',
  143. path: '/pages/cb/sim/sim',
  144. tf:true
  145. },{
  146. icon: '/image/environment/7.png',
  147. tex: '一键报修',
  148. path: '/pages/afterSale/addafter',
  149. tf:true
  150. }],
  151. bzy: [{
  152. icon: '/image/cb/4.png',
  153. tex: '设备控制',
  154. path: '/pages/cb/bzy/equip-set/equip-set',
  155. tf:false
  156. }, {
  157. icon: '/image/cb/1.png',
  158. tex: '查看图片',
  159. path: '/pages/cb/cbd/equip-set/imgpage',
  160. tf:false
  161. },
  162. // {
  163. // icon: '/image/cb/2.png',
  164. // tex: '历史数据',
  165. // path: '/pages/cb/bzy/equip-set/bzyhistoryile',
  166. // tf:false
  167. // },
  168. {
  169. icon: '/image/cb/6.png',
  170. tex: 'sim卡详情',
  171. path: '/pages/cb/sim/sim',
  172. tf:false
  173. },{
  174. icon: '/image/environment/7.png',
  175. tex: '一键报修',
  176. path: '/pages/afterSale/addafter',
  177. tf:true
  178. }],
  179. xy: [{
  180. icon: '/image/cb/4.png',
  181. tex: '设备控制',
  182. path: '/pages/cb/xy/equip-set/equip-set',
  183. tf:false
  184. }, {
  185. icon: '/image/cb/6.png',
  186. tex: 'sim卡详情',
  187. path: '/pages/cb/sim/sim',
  188. tf:false
  189. }, {
  190. icon: '/image/cb/2.png',
  191. tex: '历史数据',
  192. path: '/pages/cb/xy/equip-set/xyhistoryile',
  193. tf:false
  194. },{
  195. icon: '/image/environment/7.png',
  196. tex: '一键报修',
  197. path: '/pages/afterSale/addafter',
  198. tf:true
  199. }],
  200. newState: {}, //设备最新状态
  201. setTimeShow: false,
  202. glass_show: false,
  203. cultivate_show: false,
  204. cultivate_time: "",
  205. glass_slide_time: "",
  206. glassErr: '',
  207. culErr: '',
  208. yxShow: false, //诱芯弹框
  209. xyErr: '',
  210. decoy: '',
  211. newtishitf:false,
  212. }
  213. },
  214. computed: {
  215. curEquip() {
  216. switch (this.type) {
  217. case 3:
  218. return this.cbd;
  219. case 7:
  220. return this.bzy;
  221. case 4:
  222. return this.xy
  223. }
  224. },
  225. curState() {
  226. switch (this.type) {
  227. case 3:
  228. let blbs = "" //灯管状态
  229. if (this.newState.lamp != undefined) {
  230. if (this.newState.ws == 1) {
  231. if (this.newState.lamp == 1) {
  232. blbs = "工作中";
  233. } else if (equipState.lux == 0) {
  234. blbs = "N/A(未检测到传感器)";
  235. } else {
  236. blbs = "异常";
  237. }
  238. } else {
  239. blbs = "关闭";
  240. }
  241. } else {
  242. blbs = "--";
  243. }
  244. return [{
  245. icon: '/image/cb/icon02.png',
  246. txt: '在线状态',
  247. value: Number(this.device_status) == 1 ? '在线' : '离线',
  248. },
  249. {
  250. icon: '/image/cb/icon05.png',
  251. txt: '开关状态',
  252. value: Number(this.newState.ds) == 1 ? '开机' : '关机'
  253. },
  254. {
  255. icon: '/image/cb/icon13.png',
  256. txt: '通道状态',
  257. value: Number(this.newState.upds) == 1 ? '落虫' : '排水'
  258. },
  259. {
  260. icon: '/image/cb/icon10.png',
  261. txt: '加热状态',
  262. value: Number(this.newState.hs) == 1 ? '加热' : '正常'
  263. }, {
  264. icon: '/image/cb/icon08.png',
  265. txt: '环境温度(℃)',
  266. value: this.newState.at=="2.5"||this.newState.at=="25"||this.newState.at==""?this.newState.new_tem:this.newState.at
  267. }, {
  268. icon: '/image/cb/icon07.png',
  269. txt: '环境湿度(%)',
  270. value:this.newState.ah=="30"||this.newState.ah=="3.0"||this.newState.ah==""?this.newState.new_hum:this.newState.ah
  271. }, {
  272. icon: '/image/cb/icon16.png',
  273. txt: '信号强度',
  274. value: this.newState.csq
  275. }, {
  276. icon: '/image/cb/icon12.png',
  277. txt: '设备版本',
  278. value: this.newState.dver
  279. },
  280. {
  281. icon: '/image/cb/icon17.png',
  282. txt: '雨控状态',
  283. value: Number(this.newState.rps) == 1 ? "雨控" : '正常'
  284. }, {
  285. icon: '/image/cb/icon14.png',
  286. txt: '温控状态',
  287. value: Number(this.newState.tps) == 1 ? "温控" : '正常'
  288. }, {
  289. icon: '/image/cb/icon06.png',
  290. txt: '光控状态',
  291. value: Number(this.newState.lps) == 1 ? "光控" : '正常'
  292. }, {
  293. icon: '/image/cb/icon01.png',
  294. txt: '灯管状态',
  295. value: blbs
  296. }, {
  297. icon: '/image/cb/icon11.png',
  298. txt: '上仓门',
  299. value: Number(this.newState.upds) == 1 ? "打开" : '关闭'
  300. }, {
  301. icon: '/image/cb/icon15.png',
  302. txt: '下仓门',
  303. value: Number(this.newState.dnds) == 1 ? "打开" : '关闭'
  304. }
  305. ]
  306. case 7:
  307. return [{
  308. icon: '/image/cb/icon02.png',
  309. txt: '在线状态',
  310. value: Number(this.device_status) == 1 ? '在线' : '离线',
  311. },
  312. {
  313. icon: '/image/cb/icon05.png',
  314. txt: '设备开关',
  315. value: Number(this.newState.ds) == 1 ? '开启' : '关闭'
  316. },
  317. {
  318. icon: '/image/cb/bzy/3.png',
  319. txt: '摄像头状态',
  320. value: this.newState.usb_sta == 1 ? '异常' : '正常'
  321. },
  322. {
  323. icon: '/image/prevention/44.png',
  324. txt: '当前电压',
  325. value: this.newState.v_bat
  326. }, {
  327. icon: '/image/cb/icon08.png',
  328. txt: '环境温度(℃)',
  329. value: this.newState.at=="2.5"||this.newState.at=="25"||this.newState.at==""?this.newState.new_tem:this.newState.at
  330. }, {
  331. icon: '/image/prevention/66.png',
  332. txt: '环境湿度(%)',
  333. value:this.newState.ah=="30"||this.newState.ah=="3.0"||this.newState.ah==""?this.newState.new_hum:this.newState.ah
  334. }, {
  335. icon: '/image/cb/icon16.png',
  336. txt: '信号强度',
  337. value: this.newState.csq
  338. }, {
  339. icon: '/image/cb/bzy/8.png',
  340. txt: '已培养时间',
  341. value: this.newState.staytime
  342. }, {
  343. icon: '/image/cb/icon12.png',
  344. txt: '设备版本',
  345. value: this.newState.dver
  346. }, {
  347. icon: '/image/cb/icon09.png',
  348. txt: '保温仓当前温度',
  349. value: this.newState.pre_temp
  350. }, {
  351. icon: '/image/cb/icon08.png',
  352. txt: '保温仓设定温度',
  353. value: this.newState.set_temp
  354. }
  355. ];
  356. case 4:
  357. return [{
  358. icon: '/image/cb/icon02.png',
  359. txt: '在线状态',
  360. value: Number(this.device_status) == 1 ? '在线' : '离线',
  361. },
  362. {
  363. icon: '/image/cb/icon05.png',
  364. txt: '设备开关',
  365. value: this.newState.ds == 1 ? '开启' : '关闭'
  366. },
  367. {
  368. icon: '/image/cb/icon02.png',
  369. txt: '工作状态',
  370. value: this.newState.ws == 1 ? '工作' : ' 待机'
  371. },
  372. {
  373. icon: '/image/cb/icon12.png',
  374. txt: '设备版本',
  375. value: this.newState.dver
  376. },
  377. {
  378. icon: '/image/cb/icon08.png',
  379. txt: '环境温度(℃)',
  380. value: this.newState.at=="2.5"||this.newState.at=="25"||this.newState.at==""?this.newState.new_tem:this.newState.at
  381. },
  382. {
  383. icon: '/image/cb/icon07.png',
  384. txt: '环境湿度(%)',
  385. value:this.newState.ah=="30"||this.newState.ah=="3.0"||this.newState.ah==""?this.newState.new_hum:this.newState.ah
  386. },
  387. {
  388. icon: '/image/prevention/105.png',
  389. txt: '充电电压',
  390. value: this.newState.cv
  391. },
  392. {
  393. icon: '/image/prevention/106.png',
  394. txt: '电池电压',
  395. value: this.newState.bv
  396. },
  397. {
  398. icon: '/image/cb/icon16.png',
  399. txt: '信号强度',
  400. value: this.newState.csq
  401. },
  402. {
  403. icon: '/image/cb/xy/9.png',
  404. txt: '充电状态',
  405. value: Number(this.newState.cs) == 1 ? '充电' : '正常'
  406. },
  407. {
  408. icon: '/image/cb/xy/10.png',
  409. txt: '电池状态',
  410. value: this.newState.bs
  411. },
  412. ]
  413. }
  414. }
  415. },
  416. filters: {
  417. equipType(type) {
  418. switch (type) {
  419. case 3:
  420. return "虫情测报灯";
  421. case 7:
  422. return "孢子仪";
  423. case 4:
  424. return "性诱测报"
  425. }
  426. },
  427. formatValue(val, a1, a2) {
  428. if (a2 == 4 && a1 == "电池状态") {
  429. switch (Number(val)) {
  430. case 0:
  431. return '正常';
  432. break;
  433. case 1:
  434. return '欠压';
  435. break;
  436. case 2:
  437. return '过压';
  438. break;
  439. }
  440. } else {
  441. return val ? val : '无'
  442. }
  443. }
  444. },
  445. onLoad(option) {
  446. this.equipInfo = JSON.parse(option.info)
  447. this.type = Number(this.equipInfo.type) || Number(this.equipInfo.equip_type)
  448. this.device_status = this.equipInfo.is_online
  449. this.getState()
  450. console.log(this.equipInfo)
  451. this.selectaddress(this.lat,this.lng)
  452. uni.getStorage({
  453. key:"jurisdiction",
  454. success:(res)=>{
  455. console.log(JSON.parse(res.data))
  456. let items = JSON.parse(res.data).filter((item)=>{
  457. return item.purview_name == "测报系统"
  458. })
  459. console.log(items)
  460. let items2 = items[0].children.filter((item)=>{
  461. return item.purview_name == "虫情测报灯"
  462. })
  463. let items3 = items[0].children.filter((item)=>{
  464. return item.purview_name == "性诱测报"
  465. })
  466. let items4 = items[0].children.filter((item)=>{
  467. return item.purview_name == "孢子仪"
  468. })
  469. console.log(items2)
  470. var arr = items2[0].children
  471. for(var i =0;i<arr.length;i++){
  472. switch (arr[i].purview_name){
  473. case "数据详情":
  474. this.cbd[1].tf = true
  475. break
  476. case "查看图片":
  477. this.cbd[0].tf = true
  478. break
  479. case "设备控制":
  480. this.cbd[3].tf = true
  481. break
  482. case "害虫统计":
  483. this.cbd[2].tf = true
  484. this.cbd[4].tf = true
  485. break
  486. case "SIM卡":
  487. this.cbd[5].tf = true
  488. break
  489. }
  490. }
  491. console.log(items3[0].children)
  492. var arr2 = items3[0].children
  493. for(var i =0;i<arr2.length;i++){
  494. switch (arr2[i].purview_name){
  495. case "设备控制":
  496. this.xy[0].tf = true
  497. break;
  498. case "SIM卡":
  499. this.xy[1].tf = true
  500. break;
  501. case "数据详情":
  502. this.xy[2].tf = true
  503. break;
  504. }
  505. }
  506. console.log(items4[0].children)
  507. var arr3 = items4[0].children
  508. for(var i =0;i<arr3.length;i++){
  509. switch (arr3[i].purview_name){
  510. case "设备控制":
  511. this.bzy[0].tf = true
  512. break;
  513. case "查看图片":
  514. this.bzy[1].tf = true
  515. break;
  516. case "数据详情":
  517. this.bzy[2].tf = true
  518. break;
  519. case "SIM卡":
  520. this.bzy[3].tf = true
  521. break;
  522. }
  523. }
  524. }
  525. })
  526. },
  527. methods: {
  528. async getState() {
  529. const res = await this.$myRequest({
  530. url: '/api/api_gateway?method=forecast.worm_lamp.device_history_data',
  531. data: {
  532. device_type_id: this.equipInfo.type || this.equipInfo.equip_type,
  533. device_id: this.equipInfo.imei || this.equipInfo.device_id,
  534. page: 1,
  535. page_size: 1,
  536. }
  537. })
  538. console.log(res)
  539. console.log(1222)
  540. if(res.counts!=0){
  541. this.newState = res.data[0].d_h_t
  542. this.newtishitf = true
  543. }else{
  544. this.newtishitf = false
  545. }
  546. },
  547. partClick(path) {
  548. console.log(path)
  549. var device_id = this.equipInfo.device_id || this.equipInfo.imei
  550. uni.navigateTo({
  551. url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + device_id + "&device_type="+this.type
  552. });
  553. },
  554. partClicks(){
  555. var path = ""
  556. var device_id = this.equipInfo.device_id || this.equipInfo.imei
  557. if(this.type==3){
  558. path="/pages/cb/cbd/equip-set/historyfile"
  559. }else if(this.type == 7){
  560. path="/pages/cb/bzy/equip-set/bzyhistoryile"
  561. }
  562. uni.navigateTo({
  563. url: path + '?d_id=' + this.equipInfo.d_id + "&device_id=" + device_id+ "&device_type="+this.type
  564. });
  565. },
  566. async setTime(d_id) {
  567. const res = await this.$myRequest({
  568. url: '/api/api_gateway?method=device.device_manage.get_spore_time',
  569. data: {
  570. device_type_id: this.type,
  571. d_id
  572. }
  573. })
  574. this.glass_slide_time = res.glass_slide_time ? this.formatTime(res.glass_slide_time * 1000, 'yyyy-MM-dd') : ''
  575. this.cultivate_time = res.cultivate_time ? this.formatTime(res.cultivate_time * 1000, 'yyyy-MM-dd') : ''
  576. this.setTimeShow = true
  577. },
  578. timeChange(e, a) {
  579. if (a == 'glass') {
  580. this.glass_slide_time = e.result
  581. this.glassErr = ''
  582. } else {
  583. this.cultivate_time = e.result
  584. this.culErr = ''
  585. }
  586. },
  587. async setTimeSubmit() {
  588. if (!this.glass_slide_time) {
  589. this.glassErr = "请填写载玻片更换时间"
  590. }
  591. if (!this.cultivate_time) {
  592. this.culErr = "请填写培养液更换时间"
  593. return
  594. }
  595. let glass = parseInt(
  596. new Date(this.glass_slide_time).getTime() / 1000
  597. );
  598. let cultivate = parseInt(
  599. new Date(this.cultivate_time).getTime() / 1000
  600. );
  601. const res = await this.$myRequest({
  602. url: '/api/api_gateway?method=device.device_manage.updata_spore_time',
  603. data: {
  604. device_type_id: this.type,
  605. d_id: this.equipInfo.d_id,
  606. glass_slide_time: glass,
  607. cultivate_time: cultivate
  608. }
  609. })
  610. if (res) {
  611. this.$refs.toast.show({
  612. title: '修改成功!',
  613. type: 'success',
  614. })
  615. }
  616. this.setTimeShow = false
  617. },
  618. async addYx(d_id) {
  619. const res = await this.$myRequest({
  620. url: '/api/api_gateway?method=device.device_manage.get_spore_time',
  621. data: {
  622. device_type_id: this.type,
  623. d_id
  624. }
  625. })
  626. this.decoy = res.decoy;
  627. this.yxShow = true
  628. },
  629. async yxSubmit() {
  630. if (!this.decoy) {
  631. this.xyErr = "请填写监测害虫名称";
  632. return false
  633. }
  634. const res = await this.$myRequest({
  635. url: '/api/api_gateway?method=device.device_manage.updata_spore_time',
  636. data: {
  637. device_type_id: this.type,
  638. d_id: this.equipInfo.d_id,
  639. decoy: this.decoy
  640. }
  641. })
  642. if (res) {
  643. this.xyErr = ""
  644. this.yxShow = false
  645. }
  646. },
  647. selectaddress(lat,lng) { //获取分布位置
  648. uni.request({
  649. url: '/dpc/ws/geocoder/v1/?location='+lat+","+lng+"&key=B2EBZ-2UW6P-RDJDG-LCMLE-AIQUS-CGFMJ",
  650. success: (res) => {
  651. if(res==0){
  652. this.city = res.data.result.address
  653. }
  654. }
  655. })
  656. },
  657. copy(item){
  658. console.log(item)
  659. uni.setClipboardData({
  660. data: item.imei||item.device_id,
  661. success: function () {
  662. console.log('success');
  663. }
  664. });
  665. },
  666. },
  667. }
  668. </script>
  669. <style lang='scss'>
  670. page {
  671. padding: 20rpx;
  672. box-sizing: border-box;
  673. .info {
  674. padding: 20rpx 40rpx;
  675. color: #fff;
  676. line-height: 50rpx;
  677. font-size: 26rpx;
  678. background-size: 100% auto;
  679. background-repeat: no-repeat;
  680. background-color: #0DC6B6;
  681. background-position: top left;
  682. box-sizing: border-box;
  683. width: 100%;
  684. .tishi{
  685. width: 28rpx;
  686. height: 28rpx;
  687. margin: 0rpx 0 0 20rpx;
  688. }
  689. }
  690. .on {
  691. background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png')
  692. }
  693. .off {
  694. background-image: url('http://www.hnyfwlw.com:8006/bigdata_app/image/cb/offBg.png')
  695. }
  696. .equip_part {
  697. display: flex;
  698. flex-wrap: wrap;
  699. text-align: center;
  700. font-size: 28rpx;
  701. color: #666;
  702. line-height: 50rpx;
  703. image {
  704. width: 52rpx;
  705. }
  706. .item1 {
  707. padding: 20rpx 0;
  708. box-sizing: border-box;
  709. flex-basis: 25%;
  710. }
  711. .item2 {
  712. padding: 20rpx 10rpx;
  713. box-sizing: border-box;
  714. flex-basis: 33%;
  715. /* flex-grow: 1; */
  716. }
  717. .item3{
  718. padding: 20rpx 0;
  719. box-sizing: border-box;
  720. flex-basis: 25%;
  721. }
  722. }
  723. .tit {
  724. font-weight: 800;
  725. height: 50rpx;
  726. font-size: 30rpx;
  727. margin-bottom: 20rpx;
  728. display: flex;
  729. justify-content: space-between;
  730. .span{
  731. color: #6e6c76;
  732. font-size: 24rpx;
  733. display: flex;
  734. justify-content: space-between;
  735. /* margin-top: 12rpx; */
  736. }
  737. }
  738. .newtishi{
  739. width: 90%;
  740. margin: 0 auto;
  741. text-align: center;
  742. padding-top: 40rpx;
  743. font-size: 32rpx;
  744. }
  745. .newState {
  746. display: flex;
  747. flex-wrap: wrap;
  748. text-align: center;
  749. margin: 0 -10rpx;
  750. .item {
  751. display: flex;
  752. flex-wrap: nowrap;
  753. margin: 10rpx;
  754. width: 345rpx;
  755. justify-content: flex-start;
  756. padding: 20rpx 10rpx;
  757. box-sizing: border-box;
  758. border-radius: 4px;
  759. box-shadow: 0px 0px 5px 3px rgba(136, 136, 136, .1);
  760. font-size: 24rpx;
  761. .info-con {
  762. padding-left: 30rpx;
  763. text-align: left;
  764. line-height: 40rpx;
  765. }
  766. image {
  767. width: 70rpx;
  768. }
  769. }
  770. }
  771. .btn-box {
  772. text-align: center;
  773. padding: 30rpx;
  774. }
  775. .field {
  776. /deep/.uni-input-input {
  777. border: 2rpx solid #FF0000;
  778. border-radius: 24rpx;
  779. width: 140px;
  780. padding-left: 10rpx;
  781. box-sizing: border-box;
  782. }
  783. }
  784. }
  785. </style>