equip-detail.vue 21 KB

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