index.vue 25 KB

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