index.vue 26 KB

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