index.vue 25 KB

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