index.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  1. <template>
  2. <view>
  3. <view class="textbox">
  4. <view class="inputs">
  5. <u-search placeholder="请输入设备名称/编号" v-model="device_id" placeholder-color="#909696" :show-action="false"
  6. search-icon-color="#909696" @input="searchinput">
  7. </u-search>
  8. </view>
  9. <view class="tab">
  10. <view class="tab-content">
  11. <view class="tab-box tab-box-top">
  12. <view v-for="(item,index) in menuList" :key="index" @click="change(index,item)"
  13. v-if="isShow(item)"
  14. :class="['tab-item',current==index?'active':'']">
  15. <image class="img-icon" :src="item.app_menu_icon" mode=""></image>
  16. <view class="text">{{ getSlice(item.purview_name) }}</view>
  17. </view>
  18. </view>
  19. <u-empty v-if="!menuList.length && !loading" :image-size="100" text="暂无设备权限,请联系工作人员添加"></u-empty>
  20. </view>
  21. </view>
  22. <view class="listbox" v-if="menuList.length">
  23. <view class="second-tab">
  24. <view class="tab-box">
  25. <view
  26. v-for="(item,index) in list"
  27. :key="index"
  28. @click="changeDevice(item,index)"
  29. v-show="!item.url"
  30. :class="['tab-item',currents == index?'active':'']"
  31. >
  32. <text>{{item.purview_name}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="third-tab">
  37. <view
  38. class="third-tab-item"
  39. @click="changeStatus('')"
  40. :class="{'active-tab' : device_status == ''}"
  41. >总计{{ counts }}</view>
  42. <view
  43. class="third-tab-item"
  44. @click="changeStatus('1')"
  45. :class="{'active-tab' : device_status == '1'}"
  46. >在线{{ online_counts }}</view>
  47. <view
  48. class="third-tab-item"
  49. @click="changeStatus('0')"
  50. :class="{'active-tab' : device_status == '0'}"
  51. >离线{{ offline_counts }}</view>
  52. </view>
  53. <scroll-view
  54. :scroll-top="0"
  55. :scroll-y="true"
  56. class="list scroll-Y"
  57. @scrolltoupper="upper"
  58. @scrolltolower="lower"
  59. @scroll="scroll"
  60. >
  61. <view class="list_item" v-for="(item, index) in eqlistdata" :key="index" @click="historys(item)">
  62. <view class="list_item_top">
  63. <p class="p1">
  64. <span class="title">{{ (item.name || '--' )}}</span>
  65. <span class="sub-title" @click.stop="modification(item)">信息修改</span>
  66. </p>
  67. <p class="online-status"
  68. v-if="item.status == 1 || item.is_online" >
  69. <image
  70. :src="$imageURL+'/bigdata_app/newImg/home/online1.png'"
  71. mode=""
  72. ></image>
  73. <text class="status-text-online">在线</text>
  74. </p>
  75. <p
  76. v-else
  77. class="online-status"
  78. >
  79. <image
  80. :src="$imageURL+'/bigdata_app/newImg/home/offline.png'"
  81. mode=""
  82. ></image>
  83. <text class="status-text-offline">离线</text>
  84. </p>
  85. </view>
  86. <view class="list_item_text">
  87. <p v-if="item.imei">
  88. <span class="label">IMEI</span>{{ (item.dui || item.imei) }}
  89. </p>
  90. <p>
  91. <span class="label">设备ID</span>{{ item.only_for_show || item.id || item.device_id }}
  92. </p>
  93. <p>
  94. <span class="label">上报时间</span>{{ (item.report || item.uptime) | timeFormat() }}
  95. </p>
  96. <p style="display:flex;align-items: center;">
  97. <span class="label">设备位置</span>
  98. <span class="nav-label">{{ (item.address|| '无') }}</span>
  99. </p>
  100. </view>
  101. </view>
  102. </scroll-view>
  103. </view>
  104. </view>
  105. <view class="loading" v-if="loadingtf">
  106. <image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
  107. </view>
  108. <view class="top" v-if="isTop" @click="top">
  109. <image
  110. :src="
  111. $imageURL+'/bigdata_app' +
  112. '/image/6209a98f0cb3b5086f2ca36152c9269.png'
  113. " mode=""></image>
  114. </view>
  115. </view>
  116. </template>
  117. <script>
  118. import {
  119. Debounce,
  120. Throttle
  121. } from '../../util/anitthro.js';
  122. export default {
  123. data() {
  124. return {
  125. list: [],
  126. pur_id: '',
  127. loading: false,
  128. currentPur_id:'',
  129. device_status: '',
  130. counts:0,
  131. online_counts:0,
  132. offline_counts:0,
  133. current: 0,
  134. currents: 0,
  135. total: 0,
  136. refreshData:'',
  137. page: 1,
  138. size: 10,
  139. eqlistdata: [],
  140. isTop: false,
  141. device_model: '',
  142. infoalter: false, // 权限设置,
  143. type_id: 0, //设备类型,
  144. imgpath: [],
  145. loadingtf: false,
  146. width: 0, //顶部搜索栏宽度
  147. device_id: '', //搜索设备ID
  148. menuList: []
  149. };
  150. },
  151. methods: {
  152. isShow(item){
  153. return item.pur_id != 422
  154. },
  155. getSlice(name){
  156. return name.slice(0,4)
  157. },
  158. modification(item) {
  159. uni.navigateTo({
  160. url:
  161. './seabox/modification?data=' +
  162. JSON.stringify(item) +
  163. '&id=' +
  164. this.type_id,
  165. });
  166. },
  167. changeStatus(status){
  168. this.device_status = status;
  169. Debounce(() => {
  170. this.page = 1;
  171. this.eqlist();
  172. }, 500)();
  173. },
  174. async getUserlogin() {
  175. this.list = [];
  176. this.loading = true;
  177. const res = await this.$myRequest({
  178. url: '/api/api_gateway?method=user.login.user_login_info',
  179. method: 'POST',
  180. data: {
  181. is_app: 1,
  182. },
  183. });
  184. this.loading = false;
  185. res.forEach(item=>{
  186. item.icon = '/bigdata_app/newImg/home/sqjd.png'
  187. })
  188. const menulist = res || [];
  189. const menuItem = menulist.find(item => item.purview_name == '智慧物联')
  190. this.menuList = menuItem.children || [];
  191. if(this.menuList.length == 0){
  192. //提示暂无分配权限
  193. uni.showToast({
  194. title: '暂无分配权限,请联系工作人员',
  195. icon: 'none',
  196. });
  197. return
  198. }
  199. if(!this.pur_id){
  200. this.list = this.menuList[0].children || []
  201. this.pur_id = this.menuList[0].pur_id || '';
  202. this.current = 0;
  203. }else{
  204. this.list = this.menuList.find(item => item.pur_id == this.pur_id)?.children || []
  205. this.pur_id = this.menuList.find(item => item.pur_id == this.pur_id)?.pur_id || '';
  206. this.current = this.menuList.findIndex(item => item.pur_id == this.pur_id);
  207. }
  208. if(this.list.length > 1){
  209. if(this.list[0].purview_name != '全部'){
  210. this.list.unshift({
  211. device_type_id: '',
  212. purview_name: '全部'
  213. })
  214. }
  215. }
  216. const firstChild = this.list[0];
  217. this.type_id = firstChild.device_type_id;
  218. if(firstChild.device_type_id !== ''){
  219. this.device_model = firstChild?.device_model || '';
  220. }else{
  221. this.device_model = '';
  222. }
  223. this.initPage();
  224. },
  225. async eqlist(tf) {
  226. this.counts = 0;
  227. this.online_counts = 0;
  228. this.offline_counts = 0;
  229. this.loadingtf = true;
  230. let data = {
  231. device_type_id: this.type_id,
  232. page_num: this.page,
  233. page_size: this.size,
  234. pur_id: this.pur_id,
  235. device_status: this.device_status,
  236. device_id: this.device_id,
  237. device_model: this.device_model
  238. }
  239. const res = await this.$myRequest({
  240. url: '/api/api_gateway?method=device.app_device.app_device_list',
  241. data: data,
  242. });
  243. this.loadingtf = false;
  244. const status = res?.status || {};
  245. this.online_counts = status.online || 0;
  246. this.offline_counts = status.offline || 0;
  247. this.counts = (status.online || 0) + (status.offline || 0);
  248. this.total = res.total || 0;
  249. if (tf) {
  250. this.eqlistdata = this.eqlistdata.concat(res.data);
  251. } else {
  252. this.eqlistdata = res.data;
  253. }
  254. },
  255. change(index,itemData) {
  256. this.list = this.menuList[index].children || []
  257. const list = [];
  258. this.list.forEach(item=>{
  259. if(item.url){
  260. list.push(item)
  261. }
  262. })
  263. // if(list.length > 1){
  264. // if(this.list[0].purview_name != '全部'){
  265. // this.list.unshift({
  266. // device_type_id: '',
  267. // purview_name: '全部'
  268. // })
  269. // }
  270. // }
  271. this.current = index;
  272. const item = this.list[0];
  273. this.pur_id = itemData.pur_id || '';
  274. // this.changeDevice(item,0);
  275. },
  276. changeDevice(item,index){
  277. this.currents = index;
  278. this.currentPur_id = item.pur_id || '';
  279. const name = item.menu;
  280. if (name === 'cbd4') {
  281. this.device_model = 11;
  282. } else if(name === 'cbd1'){
  283. this.device_model = 12;
  284. } else if(name === 'cbd3'){
  285. this.device_model = '';
  286. } else if(name === 'cbd5'){
  287. this.device_model = 13;
  288. } else if(name === 'cbd6'){
  289. this.device_model = 14;
  290. }else if(name === 'gkcbd1'){
  291. this.device_model = 15;
  292. } else if(name === 'zhiCbd'){
  293. this.device_model = 16;
  294. } else {
  295. this.device_model = item.device_model || '';
  296. }
  297. this.page = 1;
  298. this.eqlistdata = [];
  299. this.type_id = item.device_type_id;
  300. Debounce(() => {
  301. this.eqlist();
  302. }, 500)();
  303. },
  304. top() {
  305. uni.pageScrollTo({
  306. scrollTop: 0,
  307. duration: 500,
  308. });
  309. },
  310. initPage(){
  311. this.eqlistdata = [];
  312. this.currents = 0;
  313. this.page = 1;
  314. Debounce(() => {
  315. this.eqlist();
  316. }, 500)();
  317. this.width = 0;
  318. },
  319. historys(item) {
  320. const type_id = item.type_id;
  321. switch (type_id) {
  322. // 水肥新设备
  323. case 22:
  324. var obj = {};
  325. obj.d_id = item.d_id;
  326. obj.device_id = item.id;
  327. obj.is_online = item.status;
  328. obj.lat = item.lat;
  329. obj.lng = item.lng;
  330. obj.equip_name = item.name;
  331. obj.uptime = item.uptime;
  332. uni.navigateTo({
  333. url: '../waterandfernew/details?shebei=' + JSON.stringify(obj),
  334. });
  335. break;
  336. // 病虫害可视监测
  337. case 14:
  338. item.addtime = item.uptime;
  339. uni.navigateTo({
  340. url: '../cb/sy/detail?detail=' + JSON.stringify(item),
  341. });
  342. break;
  343. case 2:
  344. item.addtime = item.uptime;
  345. // uni.navigateTo({
  346. // url: '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
  347. // });
  348. // uni.navigateTo({
  349. // url: '../scd/detail?info=' + JSON.stringify(item),
  350. // });
  351. if(item.device_model == 102){
  352. uni.navigateTo({
  353. url: '../scd/detail?info=' + JSON.stringify(item),
  354. });
  355. }else{
  356. uni.navigateTo({
  357. url: '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
  358. });
  359. }
  360. break;
  361. case 38:
  362. uni.navigateTo({
  363. url: `../deviceDetails/weatherStation1/index?devBid=${item.id}&devName=${item.name}&devStatus=${item.status}&address=${item.address}&uptime=${item.uptime}&d_id=${item.d_id}&deviceType=46`,
  364. });
  365. // var obj = {};
  366. // obj.d_id = item.d_id;
  367. // obj.equip_id = item.id;
  368. // obj.is_online = item.status;
  369. // obj.lat = item.lat;
  370. // obj.lng = item.lng;
  371. // obj.equip_name = item.name;
  372. // obj.uptime = item.uptime;
  373. // uni.navigateTo({
  374. // url: '../environment/equipment-new?shebei=' + JSON.stringify(obj),
  375. // });
  376. break;
  377. case 5:
  378. var obj = {};
  379. obj.d_id = item.d_id;
  380. obj.equip_id = item.id;
  381. obj.is_online = item.status;
  382. obj.lat = item.lat;
  383. obj.lng = item.lng;
  384. obj.equip_name = item.name;
  385. obj.uptime = item.uptime;
  386. uni.navigateTo({
  387. url: '../environment/equipment?shebei=' + JSON.stringify(obj),
  388. });
  389. break;
  390. case 6:
  391. uni.navigateTo({
  392. url: '/pages/webview?device_id=' +
  393. item.id +
  394. '&accessToken=' +
  395. this.accessToken,
  396. });
  397. break;
  398. case 44:
  399. uni.navigateTo({
  400. url:
  401. '/pages/webviewdgp?device_id=' +
  402. item.id +
  403. '&accessToken=' +
  404. uni.getStorageSync('session_key') +
  405. '&type=dgp',
  406. });
  407. break;
  408. case 3:
  409. item.addtime = item.uptime;
  410. item.type = item.type_id;
  411. uni.navigateTo({
  412. url: '../cbd/detail?info=' + JSON.stringify(item),
  413. });
  414. break;
  415. case 28:
  416. item.addtime = item.uptime;
  417. item.type = item.type_id;
  418. uni.navigateTo({
  419. url: '../cb/smallPest/smallPest?info=' + JSON.stringify(item),
  420. });
  421. break;
  422. case 4:
  423. item.addtime = item.uptime;
  424. item.type = item.type_id;
  425. uni.navigateTo({
  426. url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
  427. });
  428. break;
  429. case 32:
  430. case 35:
  431. item.addtime = item.uptime;
  432. item.type = item.type_id;
  433. uni.navigateTo({
  434. url: '../cb/equip-detail/equip-detail-new?info=' +
  435. JSON.stringify(item),
  436. });
  437. break;
  438. case 33:
  439. case 34:
  440. item.addtime = item.uptime;
  441. item.type = item.type_id;
  442. // uni.navigateTo({
  443. // url: '../cb/equip-detail/equip-detail-new?info=' +
  444. // JSON.stringify(item),
  445. // });
  446. let cmd = ''
  447. if(type_id == 34){
  448. cmd = 'sy1'
  449. }else if(type_id == 33){
  450. cmd = 'sy2'
  451. }
  452. uni.navigateTo({
  453. url: '../sy/detail?info=' +
  454. JSON.stringify(item) +
  455. '&cmd=' +
  456. cmd,
  457. });
  458. break;
  459. case 7:
  460. item.addtime = item.uptime;
  461. item.type = item.type_id;
  462. // uni.navigateTo({
  463. // url: '../bzy/detail?info=' + JSON.stringify(item),
  464. // });
  465. if(item.pur_id == 458){
  466. uni.navigateTo({
  467. url: '../bzy/detail?info=' + JSON.stringify(item),
  468. });
  469. }else{
  470. uni.navigateTo({
  471. url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
  472. });
  473. }
  474. break;
  475. case 8:
  476. uni.navigateTo({
  477. url: '../cb/thxydetail/thxydetail?imei=' + item.id,
  478. });
  479. break;
  480. case 29:
  481. uni.navigateTo({
  482. url: `../cb/nlNewXy/nlNewXy?imei=${item.id}&showId=${item.d_id}`,
  483. });
  484. break;
  485. case 24:
  486. uni.navigateTo({
  487. url: '../cb/zjxydetail/thxydetail?imei=' + item.id,
  488. });
  489. break;
  490. case 12:
  491. item.addtime = item.uptime;
  492. uni.navigateTo({
  493. url: '../cb/xctdetail/xctdetail?info=' + JSON.stringify(item),
  494. });
  495. break;
  496. case 13:
  497. var obj = {};
  498. obj.d_id = item.d_id;
  499. obj.device_id = item.id;
  500. obj.is_online = item.status;
  501. obj.lat = item.lat;
  502. obj.lng = item.lng;
  503. obj.equip_name = item.name;
  504. obj.uptime = item.uptime;
  505. uni.navigateTo({
  506. url: '../waterandfer/datails?shebei=' + JSON.stringify(obj),
  507. });
  508. break;
  509. case 15:
  510. var obj = {};
  511. obj.d_id = item.d_id;
  512. obj.device_id = item.id;
  513. obj.is_online = item.status;
  514. obj.lat = item.lat;
  515. obj.lng = item.lng;
  516. obj.equip_name = item.name;
  517. obj.uptime = item.uptime;
  518. obj.address = item.address || '无';
  519. uni.navigateTo({
  520. url: '../environment/gsequipment?shebei=' + JSON.stringify(obj),
  521. });
  522. break;
  523. case 17:
  524. break;
  525. case 18:
  526. var obj = {};
  527. obj.device_id = item.id;
  528. obj.is_online = item.status;
  529. uni.navigateTo({
  530. url: '../cb/shuifeiL/shuifeiL?detail=' + JSON.stringify(obj),
  531. });
  532. break;
  533. case 43:
  534. uni.navigateTo({
  535. url: "/pages/fmSys/details?info=" + JSON.stringify(item)
  536. })
  537. break;
  538. // case 44:
  539. // uni.navigateTo({
  540. // url: "/pages/webviewdgp/webview?device_id=" + item.id + "&accessToken=" + this.accessToken || uni
  541. // .getStorageSync('session_key') +
  542. // '&type=dgp'
  543. // })
  544. // break;
  545. case 11:
  546. var obj = {};
  547. obj.d_id = item.d_id;
  548. obj.device_id = item.id;
  549. obj.is_online = item.status;
  550. obj.lat = item.lat;
  551. obj.lng = item.lng;
  552. obj.equip_name = item.name;
  553. obj.uptime = item.uptime;
  554. obj.location = item.address;
  555. obj.type = 11;
  556. uni.navigateTo({
  557. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  558. });
  559. break;
  560. case 19:
  561. var obj = {};
  562. obj.d_id = item.d_id;
  563. obj.device_id = item.id;
  564. obj.is_online = item.status;
  565. obj.lat = item.lat;
  566. obj.lng = item.lng;
  567. obj.equip_name = item.name;
  568. obj.uptime = item.uptime;
  569. obj.location = item.address;
  570. obj.type = 19;
  571. uni.navigateTo({
  572. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  573. });
  574. break;
  575. case 20:
  576. var obj = {};
  577. obj.d_id = item.d_id;
  578. obj.device_id = item.id;
  579. obj.is_online = item.status;
  580. obj.lat = item.lat;
  581. obj.lng = item.lng;
  582. obj.equip_name = item.name;
  583. obj.uptime = item.uptime;
  584. obj.location = item.address;
  585. obj.type = 20;
  586. uni.navigateTo({
  587. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  588. });
  589. break;
  590. case 21:
  591. var obj = {};
  592. obj.d_id = item.d_id;
  593. obj.device_id = item.id;
  594. obj.is_online = item.status;
  595. obj.lat = item.lat;
  596. obj.lng = item.lng;
  597. obj.equip_name = item.name;
  598. obj.uptime = item.uptime;
  599. obj.location = item.address;
  600. obj.type = 21;
  601. uni.navigateTo({
  602. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  603. });
  604. break;
  605. case 26:
  606. var obj = {};
  607. obj.d_id = item.d_id;
  608. obj.device_id = item.id;
  609. obj.is_online = item.status;
  610. obj.lat = item.lat;
  611. obj.lng = item.lng;
  612. obj.equip_name = item.name;
  613. obj.uptime = item.uptime;
  614. obj.location = item.address;
  615. obj.type = 26;
  616. uni.navigateTo({
  617. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  618. });
  619. break;
  620. case 27:
  621. var obj = {};
  622. obj.d_id = item.d_id;
  623. obj.device_id = item.id;
  624. obj.is_online = item.status;
  625. obj.lat = item.lat;
  626. obj.lng = item.lng;
  627. obj.equip_name = item.name;
  628. obj.uptime = item.uptime;
  629. obj.location = item.address;
  630. obj.type = 26;
  631. uni.navigateTo({
  632. url: '../disease/mls/mls?shebei=' + JSON.stringify(obj),
  633. });
  634. break;
  635. case 25:
  636. item.addtime = item.uptime;
  637. uni.navigateTo({
  638. url: '../cb/xylps/detail?detail=' + JSON.stringify(item),
  639. });
  640. break;
  641. case 40:
  642. item.addtime = item.uptime;
  643. uni.navigateTo({
  644. url: `../cb/shuifeizs/shuifeizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  645. });
  646. break;
  647. case 42:
  648. item.addtime = item.uptime;
  649. uni.navigateTo({
  650. url: `../cb/wenshizs/wenshizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  651. });
  652. break;
  653. case 45:
  654. item.addtime = item.uptime;
  655. uni.navigateTo({
  656. url: `../cb/shuifeizsFirst/shuifeizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  657. });
  658. break;
  659. case 46:
  660. uni.navigateTo({
  661. url: `../deviceDetails/weatherStation/index?devBid=${item.id}&devName=${item.name}&devStatus=${item.status}&address=${item.address}&uptime=${item.uptime}&d_id=${item.d_id}&deviceType=46`,
  662. });
  663. break;
  664. case 47:
  665. uni.navigateTo({
  666. url: `../cb/zhamenFirst/zhamenzs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  667. });
  668. break;
  669. default:
  670. item.addtime = item.uptime;
  671. item.type = this.type_id;
  672. uni.navigateTo({
  673. url: '../cb/xy2.0/particulars?info=' + JSON.stringify(item),
  674. });
  675. break;
  676. }
  677. },
  678. searchinput() {
  679. Debounce(() => {
  680. this.eqlistdata = [];
  681. this.page = 1;
  682. this.eqlist();
  683. }, 1000)();
  684. },
  685. scrollTop(e) {},
  686. upper() {},
  687. lower() {
  688. if(this.eqlistdata.length >= this.total){
  689. return;
  690. }
  691. Debounce(() => {
  692. this.page++;
  693. this.eqlist(true);
  694. }, 500)();
  695. },
  696. scroll() {},
  697. },
  698. watch:{
  699. pur_id(){
  700. setTimeout(() => {
  701. this.getUserlogin();
  702. }, 100);
  703. },
  704. },
  705. onLoad() {
  706. const that = this;
  707. uni.$on('purId', (item) => {
  708. that.pur_id = item.purId;
  709. that.menu = item.menu;
  710. that.device_model = item.device_model;
  711. });
  712. uni.$on('refreshData', (refreshData) => {
  713. this.eqlist();
  714. });
  715. this.getUserlogin();
  716. },
  717. onShow() {
  718. // 监听刷新数据事件
  719. const refreshData = uni.getStorageSync('refreshData');
  720. if(!this.refreshData){
  721. this.refreshData = refreshData;
  722. // 如果发生改变,刷新数据
  723. if(refreshData){
  724. Debounce(() => {
  725. this.getUserlogin();
  726. }, 500)();
  727. }
  728. }else if(this.refreshData != refreshData){
  729. this.refreshData = refreshData;
  730. Debounce(() => {
  731. this.getUserlogin();
  732. }, 500)();
  733. }
  734. },
  735. onTabItemTap(e) {
  736. },
  737. onReachBottom() {
  738. if(this.eqlistdata.length >= this.total){
  739. return;
  740. }
  741. Debounce(() => {
  742. this.page++;
  743. this.eqlist(true);
  744. }, 500)();
  745. },
  746. onPageScroll(e) {
  747. //nvue暂不支持滚动监听,可用bindingx代替
  748. if (e.scrollTop > 200) {
  749. //距离大于200时显示
  750. this.isTop = true;
  751. } else {
  752. //距离小于200时隐藏
  753. this.isTop = false;
  754. }
  755. },
  756. };
  757. </script>
  758. <style lang="scss">
  759. page {
  760. background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  761. }
  762. /deep/.uni-icons {
  763. font-size: 40rpx !important;
  764. }
  765. input{
  766. background: transparent !important;
  767. }
  768. .textbox {
  769. width: 100%;
  770. height: calc(100vh - 82rpx);
  771. padding-top: 82rpx;
  772. box-sizing: border-box;
  773. }
  774. .inputs {
  775. width: 65%;
  776. margin-left: 12rpx;
  777. /deep/.u-content {
  778. background-color: #fff !important;
  779. }
  780. /deep/.uni-input-wrapper {
  781. background-color: #fff !important;
  782. }
  783. }
  784. .utabs_box {
  785. width: 100%;
  786. position: fixed;
  787. top: 88px;
  788. background-color: #ffffff;
  789. z-index: 100;
  790. .utabs {
  791. width: 95%;
  792. margin: 0 auto;
  793. }
  794. }
  795. .loading {
  796. position: fixed;
  797. top: 440px;
  798. width: 95%;
  799. left: 2.5%;
  800. text-align: center;
  801. .img {
  802. width: 300rpx;
  803. height: 40rpx;
  804. }
  805. }
  806. .active-tab{
  807. border-radius: 8rpx;
  808. background: linear-gradient(0deg, #0bbc580f 0%, #0bbc580f 100%), #00000005;
  809. }
  810. .tab-box {
  811. font-size: 30rpx;
  812. box-sizing: border-box;
  813. width: 100%;
  814. height: 100%;
  815. overflow-y: hidden;
  816. overflow-x: auto;
  817. white-space: nowrap;
  818. // 去掉滚动条
  819. -ms-overflow-style: none;
  820. scrollbar-width: none;
  821. .tab-item {
  822. cursor: pointer;
  823. position: relative;
  824. text-align: center;
  825. display: inline-block;
  826. padding: 16rpx 24rpx;
  827. box-sizing: border-box;
  828. span {
  829. display: inline-block;
  830. }
  831. }
  832. }
  833. .tab-box-top{
  834. .tab-item {
  835. width: 140rpx;
  836. text-align: center;
  837. }
  838. }
  839. .tab {
  840. // background-color: #0BBC58;
  841. margin-top: 42rpx;
  842. margin-bottom: 38rpx;
  843. padding: 0 32rpx;
  844. .img-icon {
  845. width: 80rpx;
  846. height: 80rpx;
  847. margin-bottom: 12rpx;
  848. }
  849. .text {
  850. color: #303133;
  851. font-size: 24rpx;
  852. }
  853. .tab-content {
  854. width: 100%;
  855. height: 162rpx;
  856. }
  857. .tab-item.active {
  858. border-radius: 24rpx;
  859. background: linear-gradient(0deg, #0bbc580f 0%, #0bbc580f 100%), #00000005;
  860. }
  861. }
  862. .second-tab {
  863. height: 80rpx;
  864. .tab-item{
  865. font-size: 28rpx;
  866. color: #999999;
  867. }
  868. .tab-item.active {
  869. color: #303133;
  870. font-weight: 700;
  871. }
  872. .tab-item.active::after {
  873. content: '';
  874. position: absolute;
  875. bottom: 0;
  876. left: 50%;
  877. transform: translateX(-50%);
  878. width: 18px; /* 比文字略宽 */
  879. height: 18px;
  880. border: 3px solid #0BBC58;
  881. border-radius: 50%;
  882. border-color: transparent; /* 隐藏其他部分 */
  883. border-bottom-color: #0BBC58; /* 组合成45度角 */
  884. // transform: rotate(0deg); /* 调整角度 */
  885. }
  886. }
  887. .third-tab {
  888. margin: 8rpx 0;
  889. height: 64rpx;
  890. line-height: 64rpx;
  891. display: flex;
  892. justify-content: space-between;
  893. .third-tab-item {
  894. flex: 1;
  895. text-align: center;
  896. }
  897. }
  898. .list {
  899. width: 100%;
  900. background-color: #F5F6FA;
  901. // margin-bottom: 100rpx;
  902. overflow-y: auto;
  903. padding: 0 32rpx;
  904. box-sizing: border-box;
  905. .list_item {
  906. width: 100%;
  907. margin: 0 auto 24rpx;
  908. padding: 32rpx;
  909. box-sizing: border-box;
  910. position: relative;
  911. background-color: #ffffff;
  912. border-radius: 16rpx;
  913. .list_item_top {
  914. .p1 {
  915. width: 86%;
  916. font-size: 28rpx;
  917. overflow: hidden;
  918. display: flex;
  919. align-items: center;
  920. .title{
  921. max-width: 75%;
  922. color: #333333;
  923. font-size: 28rpx;
  924. font-weight: 700;
  925. margin-right: 8rpx;
  926. overflow: hidden;
  927. text-overflow: ellipsis;
  928. white-space: nowrap;
  929. }
  930. .sub-title{
  931. border-radius: 32rpx;
  932. border:2rpx solid #0bbc58;
  933. padding: 4rpx 12rpx;
  934. font-size: 22rpx;
  935. font-weight: 400;
  936. overflow: hidden;
  937. text-overflow: ellipsis;
  938. white-space: nowrap;
  939. color:#0bbc58;
  940. margin-left: 20rpx;
  941. }
  942. }
  943. }
  944. .online-status{
  945. font-size: 28rpx;
  946. position: absolute;
  947. top:0rpx;
  948. text-align: center;
  949. right: 8rpx;
  950. top: 2rpx;
  951. width: 76px;
  952. height: 28px;
  953. // line-height: 28px;
  954. // border-radius: 0px 0px 0px 26px;
  955. // border: 1px solid #ffffff;
  956. image{
  957. width: 140rpx;
  958. height: 56rpx;
  959. }
  960. .status-text-online{
  961. color: #0BBC58;
  962. position: absolute;
  963. top: 0rpx;
  964. right: 0rpx;
  965. width: 120rpx;
  966. height: 56rpx;
  967. line-height: 56rpx;
  968. font-size: 26rpx;
  969. }
  970. .status-text-offline{
  971. color: #FB4E52;
  972. position: absolute;
  973. top: 0rpx;
  974. right: 0rpx;
  975. width: 120rpx;
  976. height: 56rpx;
  977. line-height: 56rpx;
  978. font-size: 26rpx;
  979. }
  980. }
  981. // .p2 {
  982. // color: #0BBC58;
  983. // background: #0bbc581a;
  984. // }
  985. // .p_out {
  986. // color: #FB4E52;
  987. // background: #fb4e521a;
  988. // }
  989. .list_item_text {
  990. margin-top: 20rpx;
  991. p {
  992. font-size: 24rpx;
  993. color: #303133;
  994. margin-top: 10rpx;
  995. word-break: break-all;
  996. }
  997. .label{
  998. color: #999999;
  999. text-align: left;
  1000. margin-right: 32rpx;
  1001. font-size: 24rpx;
  1002. min-width: 90rpx;
  1003. display: inline-block;
  1004. }
  1005. .nav-label{
  1006. //超出隐藏
  1007. display: inline-block;
  1008. width: 70%;
  1009. overflow: hidden;
  1010. text-overflow: ellipsis;
  1011. white-space: nowrap;
  1012. }
  1013. }
  1014. .list_item_btn {
  1015. width: 126rpx;
  1016. color: #42b983;
  1017. height: 40rpx;
  1018. text-align: center;
  1019. border: 1rpx solid #42b983;
  1020. border-radius: 25rpx;
  1021. font-size: 24rpx;
  1022. line-height: 35rpx;
  1023. position: absolute;
  1024. bottom: 15rpx;
  1025. right: 20rpx;
  1026. }
  1027. }
  1028. }
  1029. .top {
  1030. position: fixed;
  1031. right: 30px;
  1032. bottom: 100px;
  1033. z-index: 100;
  1034. image {
  1035. width: 100rpx;
  1036. height: 100rpx;
  1037. }
  1038. }
  1039. </style>