index.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564
  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. <view class="p1">
  64. <span class="title">{{ (item.name || '--' )}}</span>
  65. <span class="sub-title" @click.stop="modification(item)">信息修改</span>
  66. </view>
  67. <view 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. </view>
  75. <view
  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. </view>
  85. </view>
  86. <view class="list_item_text">
  87. <view v-if="item.imei" class="p1">
  88. <text class="label">IMEI</text>{{ (item.dui || item.imei) }}
  89. </view>
  90. <view class="p1">
  91. <text class="label">设备ID</text>{{ item.only_for_show || item.id || item.device_id }}
  92. </view>
  93. <view class="p1">
  94. <text class="label">上报时间</text>{{ (item.report || item.uptime || item.upload_time) | timeFormat() }}
  95. </view>
  96. <view class="p1" style="display:flex;align-items: center;">
  97. <text class="label">设备位置</text>
  98. <text class="nav-label">{{ (item.address|| '无') }}</text>
  99. </view>
  100. <view class="action-list" style="display:flex;align-items: center;" v-if="type_id == 49">
  101. <view class="action-item">
  102. <image :src="lightning" alt="" class="item-icon">
  103. </image>
  104. <text>{{getcharging_vol(item.sensor_params)}}v</text>
  105. </view>
  106. <view class="action-item">
  107. <image :src="getSignal(item.sensor_params)" alt="" class="item-icon">
  108. </image>
  109. <text>{{getrssl(item.sensor_params)}}</text>
  110. </view>
  111. <view class="action-item">
  112. <image :src="battery" alt="" class="item-icon">
  113. </image>
  114. <text>{{getopeningValue(item.sensor_params)}}%</text>
  115. </view>
  116. </view>
  117. <view class="action-container" v-if="type_id == 49">
  118. <view class="action-container-item" :class="n.switchValue?'action-container-container-item-active':''" v-for="(n,key) in getvalve_params(item)" :key="key">
  119. <view class="action-open">
  120. <view class="item-number" :class="n.switchValue?'item-number-active':''">{{n.name}}</view>
  121. <u-switch
  122. :value="n.switchValue"
  123. active-color="#0BBC58"
  124. @click.native="()=>changeSwitchStatus(n.value,n,item)"
  125. size="36"
  126. ></u-switch>
  127. </view>
  128. <view class="action-open-value" @click.stop="editHandle(n.value,n,item)" v-if="n.value != 0">
  129. <image :src="openingDegree" alt="" class="item-icon">
  130. </image>
  131. <text>{{n.value}}%</text>
  132. <u-icon name="edit-pen" color="#0BBC58"></u-icon>
  133. </view>
  134. </view>
  135. </view>
  136. </view>
  137. </view>
  138. </scroll-view>
  139. </view>
  140. </view>
  141. <view class="loading" v-if="loadingtf">
  142. <image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
  143. </view>
  144. <view class="top" v-if="isTop" @click="top">
  145. <image :src="$imageURL+'/bigdata_app' + '/image/6209a98f0cb3b5086f2ca36152c9269.png'" mode=""></image>
  146. </view>
  147. <u-popup v-model="showPopup" mode="bottom">
  148. <u-form :model="form" label-width="160rpx" :label-style="{marginLeft:'20rpx'}">
  149. <u-form-item label="开启状态">
  150. <u-radio-group v-model="value" @change="radioGroupChange">
  151. <u-radio
  152. @change="radioChange"
  153. v-for="(item, index) in radioList" :key="index"
  154. :name="item.value"
  155. active-color="#0BBC58"
  156. >
  157. {{item.name}}
  158. </u-radio>
  159. </u-radio-group>
  160. </u-form-item>
  161. <u-form-item label="开阀时间" v-if="value == 1">
  162. <view @click="show1 = true" class="hour">{{hour}} 小时</view>
  163. <view @click="show2 = true" class="minute">{{minute}} 分钟</view>
  164. </u-form-item>
  165. <u-form-item label="开度数值">
  166. <view class="slider-container">
  167. <view class="slider-min-value">10</view>
  168. <view
  169. class="custom-progress"
  170. @touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
  171. @touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
  172. @touchend.stop="onSliderTouchEnd"
  173. @tap.stop="onSliderTap($event, 'openingValue', 10, 100)"
  174. >
  175. <view class="progress-track">
  176. <view class="progress-fill" :style="{ width: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
  177. <view class="progress-thumb" :style="{ left: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
  178. </view>
  179. </view>
  180. <view class="slider-max-value">100</view>
  181. </view>
  182. <text style="margin-left: 20rpx">{{equipContrlForm.openingValue}}</text>
  183. </u-form-item>
  184. <u-button type="success" style="width: 94%;margin-left: 3%;margin-bottom: 40rpx" @click="submit">提交</u-button>
  185. </u-form>
  186. </u-popup>
  187. <u-popup v-model="showPopup2" mode="bottom">
  188. <u-form :model="form" label-width="160rpx" :label-style="{marginLeft:'20rpx'}">
  189. <u-form-item label="开度数值">
  190. <view class="slider-container">
  191. <view class="slider-min-value">10</view>
  192. <view
  193. class="custom-progress"
  194. @touchstart.stop="onSliderTouchStart($event, 'openingValue', 10, 100)"
  195. @touchmove.stop.prevent="onSliderTouchMove($event, 10, 100)"
  196. @touchend.stop="onSliderTouchEnd"
  197. @tap.stop="onSliderTap($event, 'openingValue', 10, 100)"
  198. >
  199. <view class="progress-track">
  200. <view class="progress-fill" :style="{ width: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
  201. <view class="progress-thumb" :style="{ left: getProgressWidth(equipContrlForm.openingValue, 10, 100) + '%' }"></view>
  202. </view>
  203. </view>
  204. <view class="slider-max-value">100</view>
  205. </view>
  206. <text style="margin-left: 20rpx">{{equipContrlForm.openingValue}}</text>
  207. </u-form-item>
  208. <u-button type="success" style="width: 94%;margin-left: 3%;margin-bottom: 40rpx" @click="submit2">提交</u-button>
  209. </u-form>
  210. </u-popup>
  211. <u-modal v-model="show3" :content="content" @confirm="confirmClose" @cancel="cancelClose"></u-modal>
  212. <u-select v-model="show1" :list="hours" @confirm="changeHour"></u-select>
  213. <u-select v-model="show2" :list="minutes" @confirm="changeMinute"></u-select>
  214. <u-popup v-model="show4" mode="center" width="80%" :mask-close-able="false">
  215. <view class="progress-container">
  216. <u-line-progress :percent="percentage" style="width: 90%;"></u-line-progress>
  217. </view>
  218. </u-popup>
  219. </view>
  220. </template>
  221. <script>
  222. import lightning from '../assets/lightning.png';
  223. import battery from '../assets/battery.png';
  224. import signal0 from '../assets/signal0.png';
  225. import signal1 from '../assets/signal1.png';
  226. import signal2 from '../assets/signal2.png';
  227. import signal3 from '../assets/signal3.png';
  228. import signal4 from '../assets/signal4.png';
  229. import signal5 from '../assets/signal5.png';
  230. import openingDegree from '../assets/openingDegree.png';
  231. import {
  232. Debounce,
  233. Throttle
  234. } from '../../util/anitthro.js';
  235. export default {
  236. data() {
  237. return {
  238. showPopup: false,
  239. showPopup2: false,
  240. show4: false,
  241. percentage: 0,
  242. openingValue: 60,
  243. show1: false,
  244. show2: false,
  245. show3: false,
  246. content:'确认关闭当前阀吗?',
  247. hours: [],
  248. value: 0,
  249. minutes: [],
  250. sensor_params:{},
  251. valve_params:[],
  252. currentRow: {},
  253. lightning,
  254. battery,
  255. radioList:[{
  256. name:'常开',
  257. value:0
  258. },
  259. {
  260. name:'定时',
  261. value:1
  262. }],
  263. form:{},
  264. openingDegree,
  265. signal0,
  266. signal1,
  267. signal2,
  268. signal3,
  269. signal4,
  270. signal5,
  271. list: [],
  272. hour: 1,
  273. minute: 0,
  274. pur_id: '',
  275. loading: false,
  276. currentPur_id:'',
  277. device_status: '',
  278. counts:0,
  279. online_counts:0,
  280. offline_counts:0,
  281. accessToken: '',
  282. current: 0,
  283. currents: 0,
  284. total: 0,
  285. refreshData:'',
  286. page: 1,
  287. size: 10,
  288. eqlistdata: [],
  289. isTop: false,
  290. device_model: '',
  291. infoalter: false, // 权限设置,
  292. type_id: 0, //设备类型,
  293. imgpath: [],
  294. loadingtf: false,
  295. width: 0, //顶部搜索栏宽度
  296. device_id: '', //搜索设备ID
  297. current_device_id: '', //当前设备ID
  298. menuList: [],
  299. sliderRect: {},
  300. equipContrlForm: {
  301. openingValue: 60,
  302. },
  303. sliderField: '',
  304. sliderMin: 0,
  305. sliderMax: 0,
  306. timer: null,
  307. valve_param_key: '',
  308. };
  309. },
  310. methods: {
  311. getvalve_params(item){
  312. return item?.valve_params || [];
  313. },
  314. getcharging_vol(item){
  315. return item?.charging_vol || 0;
  316. },
  317. getrssl(item){
  318. return item?.rssl || 0;
  319. },
  320. getopeningValue(item){
  321. return item?.kwh || 0;
  322. },
  323. getRadioValue(){
  324. return this.value;
  325. },
  326. setPercentage(msg){
  327. this.timer = setInterval(() => {
  328. this.percentage += 1;
  329. if(this.percentage >= 100){
  330. this.percentage = 100;
  331. uni.showToast({
  332. title: msg,
  333. icon: 'none',
  334. });
  335. clearInterval(this.timer);
  336. this.show4 = false;
  337. this.percentage = 0;
  338. this.eqlist();
  339. }
  340. }, 125);
  341. },
  342. getSignal(item){
  343. const val = item?.rssl || 0;
  344. if(val < 0){
  345. return this.signal0;
  346. }
  347. if(val > 5){
  348. return this.signal5;
  349. }
  350. return this['signal' + val];
  351. },
  352. confirmClose(){
  353. this.closeValve();
  354. },
  355. cancelClose(){
  356. this.show3 = false;
  357. },
  358. editHandle(openingValue,item,device){
  359. this.valve_param_key = item.key;
  360. this.current_device_id = device.id;
  361. this.showPopup2 = true;
  362. this.equipContrlForm.openingValue = openingValue;
  363. },
  364. changeHour(e){
  365. this.hour = e[0].value
  366. },
  367. changeMinute(e){
  368. this.minute = e[0].value
  369. },
  370. getProgressWidth(value, min, max) {
  371. if (max === min) return 0
  372. return ((value - min) / (max - min)) * 100
  373. },
  374. getModel(value){
  375. return value == 0 ? false : true
  376. },
  377. async closeValve(){
  378. const res = await this.$myRequest({
  379. url: '/api/api_gateway?method=irrigation_system.valvecontrol.close_valvecontrol_valve',
  380. method: 'POST',
  381. data: {
  382. device_id: this.current_device_id,
  383. valve_param_key: this.valve_param_key
  384. },
  385. });
  386. if(res.code == 0){
  387. this.show4 = true;
  388. this.setPercentage(res.message);
  389. }else{
  390. uni.showToast({
  391. title: res?.message,
  392. icon: 'none',
  393. });
  394. }
  395. },
  396. async setAction(data){
  397. const res = await this.$myRequest({
  398. url: '/api/api_gateway?method=irrigation_system.valvecontrol.open_valvecontrol_valve',
  399. method: 'POST',
  400. data,
  401. });
  402. if(res.code == 0){
  403. this.show4 = true;
  404. this.setPercentage(res.message);
  405. }else{
  406. uni.showToast({
  407. title: res?.message,
  408. icon: 'none',
  409. });
  410. }
  411. },
  412. async setEditAction(data){
  413. const res = await this.$myRequest({
  414. url: '/api/api_gateway?method=irrigation_system.valvecontrol.alter_valvecontrol_valve_percentage',
  415. method: 'POST',
  416. data,
  417. });
  418. if(res.code == 0){
  419. this.show4 = true;
  420. this.setPercentage(res.message);
  421. }else{
  422. uni.showToast({
  423. title: res?.message,
  424. icon: 'none',
  425. });
  426. }
  427. },
  428. onSliderTouchStart(e, field, min, max) {
  429. this.sliderField = field
  430. this.sliderMin = min
  431. this.sliderMax = max
  432. const query = uni.createSelectorQuery().in(this)
  433. query.select('.custom-progress').boundingClientRect(rect => {
  434. this.sliderRect = rect
  435. }).exec()
  436. this.updateSliderValue(e.touches[0].clientX, field, min, max)
  437. },
  438. onSliderTouchMove(e, min, max) {
  439. if (!this.sliderField || !this.sliderRect) return
  440. this.updateSliderValue(e.touches[0].clientX, this.sliderField, min, max)
  441. },
  442. onSliderTouchEnd() {
  443. this.sliderField = ''
  444. },
  445. onSliderTap(e, field, min, max) {
  446. const query = uni.createSelectorQuery().in(this)
  447. query.select('.custom-progress').boundingClientRect(rect => {
  448. this.sliderRect = rect
  449. this.updateSliderValue(e.detail.x + rect.left, field, min, max)
  450. }).exec()
  451. },
  452. updateSliderValue(clientX, field, min, max) {
  453. if (!this.sliderRect) return
  454. let ratio = (clientX - this.sliderRect.left) / this.sliderRect.width
  455. ratio = Math.max(0, Math.min(1, ratio))
  456. const value = Math.round(min + ratio * (max - min))
  457. this.$set(this.equipContrlForm, field, value)
  458. },
  459. submit(){
  460. this.setAction({
  461. device_id: this.current_device_id,
  462. valve_param_key: this.valve_param_key,
  463. var_value: this.equipContrlForm.openingValue,
  464. valve_delayed: this.value == 0 ? 0 : Number(this.hour) * 60 + Number(this.minute)
  465. })
  466. this.showPopup = false;
  467. },
  468. submit2(){
  469. this.setEditAction({
  470. device_id: this.current_device_id,
  471. valve_param_key: this.valve_param_key,
  472. var_value: this.equipContrlForm.openingValue,
  473. })
  474. this.showPopup2 = false;
  475. },
  476. getHours(){
  477. for(let i = 0; i < 24; i++){
  478. this.hours.push({
  479. label: i + ' 时',
  480. value: i,
  481. })
  482. }
  483. },
  484. getMinutes(){
  485. for(let i = 0; i < 60; i++){
  486. this.minutes.push({
  487. label: i + ' 分',
  488. value: i,
  489. })
  490. }
  491. },
  492. isShow(item){
  493. return item.pur_id != 422
  494. },
  495. getSlice(name){
  496. return name.slice(0,4)
  497. },
  498. modification(item) {
  499. uni.navigateTo({
  500. url:
  501. './seabox/modification?data=' +
  502. JSON.stringify(item) +
  503. '&id=' +
  504. this.type_id,
  505. });
  506. },
  507. changeSwitchStatus(status,item,device){
  508. this.valve_param_key = item.key;
  509. this.current_device_id = device.id;
  510. if(status == 0){
  511. this.equipContrlForm.openingValue = 40;
  512. this.showPopup = true;
  513. this.currentRow = item;
  514. }else{
  515. this.show3 = true;
  516. }
  517. },
  518. changeStatus(status){
  519. this.device_status = status;
  520. Debounce(() => {
  521. this.page = 1;
  522. this.eqlist();
  523. }, 500)();
  524. },
  525. async getUserlogin() {
  526. this.list = [];
  527. this.loading = true;
  528. const res = await this.$myRequest({
  529. url: '/api/api_gateway?method=user.login.user_login_info',
  530. method: 'POST',
  531. data: {
  532. is_app: 1,
  533. },
  534. });
  535. this.loading = false;
  536. res.forEach(item=>{
  537. item.icon = '/bigdata_app/newImg/home/sqjd.png'
  538. })
  539. const menulist = res || [];
  540. const menuItem = menulist.find(item => item.purview_name == '智慧物联')
  541. this.menuList = menuItem.children || [];
  542. if(this.menuList.length == 0){
  543. //提示暂无分配权限
  544. uni.showToast({
  545. title: '暂无分配权限,请联系工作人员',
  546. icon: 'none',
  547. });
  548. return
  549. }
  550. if(!this.pur_id){
  551. this.list = this.menuList[0].children || []
  552. this.pur_id = this.menuList[0].pur_id || '';
  553. this.current = 0;
  554. }else{
  555. this.list = this.menuList.find(item => item.pur_id == this.pur_id)?.children || []
  556. this.pur_id = this.menuList.find(item => item.pur_id == this.pur_id)?.pur_id || '';
  557. this.current = this.menuList.findIndex(item => item.pur_id == this.pur_id);
  558. }
  559. if(this.list.length > 1){
  560. if(this.list[0].purview_name != '全部'){
  561. this.list.unshift({
  562. device_type_id: '',
  563. purview_name: '全部'
  564. })
  565. }
  566. }
  567. const firstChild = this.list[0];
  568. this.type_id = firstChild.device_type_id;
  569. if(firstChild.device_type_id !== ''){
  570. this.device_model = firstChild?.device_model || '';
  571. }else{
  572. this.device_model = '';
  573. }
  574. this.initPage();
  575. },
  576. async eqlist(tf) {
  577. this.counts = 0;
  578. this.online_counts = 0;
  579. this.offline_counts = 0;
  580. this.loadingtf = true;
  581. let data = {
  582. device_type_id: this.type_id,
  583. page_num: this.page,
  584. page_size: this.size,
  585. pur_id: this.pur_id,
  586. device_status: this.device_status,
  587. device_id: this.device_id,
  588. device_model: this.device_model
  589. }
  590. const res = await this.$myRequest({
  591. url: '/api/api_gateway?method=device.app_device.app_device_list',
  592. data: data,
  593. });
  594. this.loadingtf = false;
  595. const status = res?.status || {};
  596. this.online_counts = status.online || 0;
  597. this.offline_counts = status.offline || 0;
  598. this.counts = (status.online || 0) + (status.offline || 0);
  599. this.total = res.total || 0;
  600. const resData = res?.data;
  601. resData.forEach(item=>{
  602. if(item.type_id == 49 && item.valve_params.length){
  603. item.valve_params.forEach(param=>{
  604. param.switchValue = param.value == 0 ? false : true;
  605. })
  606. }
  607. })
  608. if (tf) {
  609. this.eqlistdata = this.eqlistdata.concat(resData);
  610. } else {
  611. this.eqlistdata = resData;
  612. }
  613. },
  614. change(index,itemData) {
  615. this.list = this.menuList[index].children || []
  616. const list = [];
  617. this.list.forEach(item=>{
  618. if(item.url){
  619. list.push(item)
  620. }
  621. })
  622. // if(list.length > 1){
  623. // if(this.list[0].purview_name != '全部'){
  624. // this.list.unshift({
  625. // device_type_id: '',
  626. // purview_name: '全部'
  627. // })
  628. // }
  629. // }
  630. this.current = index;
  631. const item = this.list[0];
  632. this.pur_id = itemData.pur_id || '';
  633. // this.changeDevice(item,0);
  634. },
  635. changeDevice(item,index){
  636. this.currents = index;
  637. this.currentPur_id = item.pur_id || '';
  638. const name = item.menu;
  639. if (name === 'cbd4') {
  640. this.device_model = 11;
  641. } else if(name === 'cbd1'){
  642. this.device_model = 12;
  643. } else if(name === 'cbd3'){
  644. this.device_model = '';
  645. } else if(name === 'cbd5'){
  646. this.device_model = 13;
  647. } else if(name === 'cbd6'){
  648. this.device_model = 14;
  649. }else if(name === 'gkcbd1'){
  650. this.device_model = 15;
  651. } else if(name === 'zhiCbd'){
  652. this.device_model = 16;
  653. } else {
  654. this.device_model = item.device_model || '';
  655. }
  656. this.page = 1;
  657. this.eqlistdata = [];
  658. this.type_id = item.device_type_id;
  659. Debounce(() => {
  660. this.eqlist();
  661. }, 500)();
  662. },
  663. top() {
  664. uni.pageScrollTo({
  665. scrollTop: 0,
  666. duration: 500,
  667. });
  668. },
  669. initPage(){
  670. this.eqlistdata = [];
  671. this.currents = 0;
  672. this.page = 1;
  673. Debounce(() => {
  674. this.eqlist();
  675. }, 500)();
  676. this.width = 0;
  677. },
  678. historys(item) {
  679. const type_id = item.type_id;
  680. this.accessToken = uni.getStorageSync('session_key')
  681. switch (type_id) {
  682. // 水肥新设备
  683. case 49:
  684. return;
  685. case 22:
  686. var obj = {};
  687. obj.d_id = item.d_id;
  688. obj.device_id = item.id;
  689. obj.is_online = item.status;
  690. obj.lat = item.lat;
  691. obj.lng = item.lng;
  692. obj.equip_name = item.name;
  693. obj.uptime = item.uptime;
  694. uni.navigateTo({
  695. url: '../waterandfernew/details?shebei=' + JSON.stringify(obj),
  696. });
  697. break;
  698. // 病虫害可视监测
  699. case 14:
  700. item.addtime = item.uptime;
  701. uni.navigateTo({
  702. url: '../cb/sy/detail?detail=' + JSON.stringify(item),
  703. });
  704. break;
  705. case 2:
  706. item.addtime = item.uptime;
  707. if(item.device_model == 102){
  708. uni.navigateTo({
  709. url: '../scd/detail?info=' + JSON.stringify(item),
  710. });
  711. }else{
  712. uni.navigateTo({
  713. url: '../prevention/equipmentdetails?shebei=' + JSON.stringify(item),
  714. });
  715. }
  716. break;
  717. case 38:
  718. uni.navigateTo({
  719. 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`,
  720. });
  721. break;
  722. // var obj = {};
  723. // obj.d_id = item.d_id;
  724. // obj.equip_id = item.id;
  725. // obj.is_online = item.status;
  726. // obj.lat = item.lat;
  727. // obj.lng = item.lng;
  728. // obj.equip_name = item.name;
  729. // obj.uptime = item.uptime;
  730. // uni.navigateTo({
  731. // url: '../environment/equipment-new?shebei=' + JSON.stringify(obj),
  732. // });
  733. break;
  734. case 5:
  735. var obj = {};
  736. obj.d_id = item.d_id;
  737. obj.equip_id = item.id;
  738. obj.is_online = item.status;
  739. obj.lat = item.lat;
  740. obj.lng = item.lng;
  741. obj.equip_name = item.name;
  742. obj.uptime = item.uptime;
  743. uni.navigateTo({
  744. url: '../environment/equipment?shebei=' + JSON.stringify(obj),
  745. });
  746. break;
  747. case 6:
  748. uni.navigateTo({
  749. url: '/pages/webview/webview?device_id=' +
  750. item.id +
  751. '&accessToken=' +
  752. this.accessToken,
  753. });
  754. break;
  755. case 44:
  756. uni.navigateTo({
  757. url:
  758. '/pages/webviewdgp/webviewdgp?device_id=' +
  759. item.id +
  760. '&accessToken=' +
  761. uni.getStorageSync('session_key') +
  762. '&type=dgp',
  763. });
  764. break;
  765. case 3:
  766. item.addtime = item.uptime;
  767. item.type = item.type_id;
  768. uni.navigateTo({
  769. url: '../cbd/detail?info=' + JSON.stringify(item),
  770. });
  771. break;
  772. case 28:
  773. item.addtime = item.uptime;
  774. item.type = item.type_id;
  775. uni.navigateTo({
  776. url: '../cb/smallPest/smallPest?info=' + JSON.stringify(item),
  777. });
  778. break;
  779. case 4:
  780. item.addtime = item.uptime;
  781. item.type = item.type_id;
  782. uni.navigateTo({
  783. url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
  784. });
  785. break;
  786. case 32:
  787. case 35:
  788. item.addtime = item.uptime;
  789. item.type = item.type_id;
  790. uni.navigateTo({
  791. url: '../cb/equip-detail/equip-detail-new?info=' +
  792. JSON.stringify(item),
  793. });
  794. break;
  795. case 33:
  796. case 34:
  797. item.addtime = item.uptime;
  798. item.type = item.type_id;
  799. let cmd = ''
  800. if(type_id == 34){
  801. cmd = 'sy1'
  802. }else if(type_id == 33){
  803. cmd = 'sy2'
  804. }
  805. uni.navigateTo({
  806. url: '../sy/detail?info=' +
  807. JSON.stringify(item) + '&cmd=' + cmd,
  808. });
  809. break;
  810. case 7:
  811. item.addtime = item.uptime;
  812. item.type = item.type_id;
  813. // uni.navigateTo({
  814. // url: '../bzy/detail?info=' + JSON.stringify(item),
  815. // });
  816. if(item.pur_id == 458){
  817. uni.navigateTo({
  818. url: '../bzy/detail?info=' + JSON.stringify(item),
  819. });
  820. }else{
  821. uni.navigateTo({
  822. url: '../cb/equip-detail/equip-detail?info=' + JSON.stringify(item),
  823. });
  824. }
  825. break;
  826. case 8:
  827. uni.navigateTo({
  828. url: '../cb/thxydetail/thxydetail?imei=' + item.id,
  829. });
  830. break;
  831. case 29:
  832. uni.navigateTo({
  833. url: `../cb/nlNewXy/nlNewXy?imei=${item.id}&showId=${item.d_id}`,
  834. });
  835. break;
  836. case 24:
  837. uni.navigateTo({
  838. url: '../cb/zjxydetail/thxydetail?imei=' + item.id,
  839. });
  840. break;
  841. case 12:
  842. item.addtime = item.uptime;
  843. uni.navigateTo({
  844. url: '../cb/xctdetail/xctdetail?info=' + JSON.stringify(item),
  845. });
  846. break;
  847. case 13:
  848. var obj = {};
  849. obj.d_id = item.d_id;
  850. obj.device_id = item.id;
  851. obj.is_online = item.status;
  852. obj.lat = item.lat;
  853. obj.lng = item.lng;
  854. obj.equip_name = item.name;
  855. obj.uptime = item.uptime;
  856. uni.navigateTo({
  857. url: '../waterandfer/datails?shebei=' + JSON.stringify(obj),
  858. });
  859. break;
  860. case 15:
  861. var obj = {};
  862. obj.d_id = item.d_id;
  863. obj.device_id = item.id;
  864. obj.is_online = item.status;
  865. obj.lat = item.lat;
  866. obj.lng = item.lng;
  867. obj.equip_name = item.name;
  868. obj.uptime = item.uptime;
  869. obj.address = item.address || '无';
  870. uni.navigateTo({
  871. url: '../environment/gsequipment?shebei=' + JSON.stringify(obj),
  872. });
  873. break;
  874. case 17:
  875. break;
  876. case 18:
  877. var obj = {};
  878. obj.device_id = item.id;
  879. obj.is_online = item.status;
  880. uni.navigateTo({
  881. url: '../cb/shuifeiL/shuifeiL?detail=' + JSON.stringify(obj),
  882. });
  883. break;
  884. case 43:
  885. uni.navigateTo({
  886. url: "/pages/fmSys/details?info=" + JSON.stringify(item)
  887. })
  888. break;
  889. // case 44:
  890. // uni.navigateTo({
  891. // url: "/pages/webviewdgp/webview?device_id=" + item.id + "&accessToken=" + this.accessToken || uni
  892. // .getStorageSync('session_key') +
  893. // '&type=dgp'
  894. // })
  895. // break;
  896. case 11:
  897. var obj = {};
  898. obj.d_id = item.d_id;
  899. obj.device_id = item.id;
  900. obj.is_online = item.status;
  901. obj.lat = item.lat;
  902. obj.lng = item.lng;
  903. obj.equip_name = item.name;
  904. obj.uptime = item.uptime;
  905. obj.location = item.address;
  906. obj.type = 11;
  907. uni.navigateTo({
  908. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  909. });
  910. break;
  911. case 19:
  912. var obj = {};
  913. obj.d_id = item.d_id;
  914. obj.device_id = item.id;
  915. obj.is_online = item.status;
  916. obj.lat = item.lat;
  917. obj.lng = item.lng;
  918. obj.equip_name = item.name;
  919. obj.uptime = item.uptime;
  920. obj.location = item.address;
  921. obj.type = 19;
  922. uni.navigateTo({
  923. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  924. });
  925. break;
  926. case 20:
  927. var obj = {};
  928. obj.d_id = item.d_id;
  929. obj.device_id = item.id;
  930. obj.is_online = item.status;
  931. obj.lat = item.lat;
  932. obj.lng = item.lng;
  933. obj.equip_name = item.name;
  934. obj.uptime = item.uptime;
  935. obj.location = item.address;
  936. obj.type = 20;
  937. uni.navigateTo({
  938. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  939. });
  940. break;
  941. case 21:
  942. var obj = {};
  943. obj.d_id = item.d_id;
  944. obj.device_id = item.id;
  945. obj.is_online = item.status;
  946. obj.lat = item.lat;
  947. obj.lng = item.lng;
  948. obj.equip_name = item.name;
  949. obj.uptime = item.uptime;
  950. obj.location = item.address;
  951. obj.type = 21;
  952. uni.navigateTo({
  953. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  954. });
  955. break;
  956. case 26:
  957. var obj = {};
  958. obj.d_id = item.d_id;
  959. obj.device_id = item.id;
  960. obj.is_online = item.status;
  961. obj.lat = item.lat;
  962. obj.lng = item.lng;
  963. obj.equip_name = item.name;
  964. obj.uptime = item.uptime;
  965. obj.location = item.address;
  966. obj.type = 26;
  967. uni.navigateTo({
  968. url: '../disease/cmb?shebei=' + JSON.stringify(obj),
  969. });
  970. break;
  971. case 27:
  972. var obj = {};
  973. obj.d_id = item.d_id;
  974. obj.device_id = item.id;
  975. obj.is_online = item.status;
  976. obj.lat = item.lat;
  977. obj.lng = item.lng;
  978. obj.equip_name = item.name;
  979. obj.uptime = item.uptime;
  980. obj.location = item.address;
  981. obj.type = 26;
  982. uni.navigateTo({
  983. url: '../disease/mls/mls?shebei=' + JSON.stringify(obj),
  984. });
  985. break;
  986. case 25:
  987. item.addtime = item.uptime;
  988. uni.navigateTo({
  989. url: '../cb/xylps/detail/detail?detail=' + JSON.stringify(item),
  990. });
  991. break;
  992. case 40:
  993. item.addtime = item.uptime;
  994. uni.navigateTo({
  995. url: `../cb/shuifeizs/shuifeizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  996. });
  997. break;
  998. case 42:
  999. item.addtime = item.uptime;
  1000. uni.navigateTo({
  1001. url: `../cb/wenshizs/wenshizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  1002. });
  1003. break;
  1004. case 45:
  1005. item.addtime = item.uptime;
  1006. uni.navigateTo({
  1007. url: `../cb/shuifeizsFirst/shuifeizs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  1008. });
  1009. break;
  1010. case 46:
  1011. uni.navigateTo({
  1012. 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`,
  1013. });
  1014. break;
  1015. case 47:
  1016. uni.navigateTo({
  1017. url: `../cb/zhamenFirst/zhamenzs?devBid=${item.d_id}&devName=${item.name}&devStatus=${item.status}`,
  1018. });
  1019. break;
  1020. default:
  1021. item.addtime = item.uptime;
  1022. item.type = this.type_id;
  1023. uni.navigateTo({
  1024. url: '../cb/xy2.0/particulars?info=' + JSON.stringify(item),
  1025. });
  1026. break;
  1027. }
  1028. },
  1029. searchinput() {
  1030. Debounce(() => {
  1031. this.eqlistdata = [];
  1032. this.page = 1;
  1033. this.eqlist();
  1034. }, 1000)();
  1035. },
  1036. scrollTop(e) {},
  1037. upper() {},
  1038. lower() {
  1039. if(this.eqlistdata.length >= this.total){
  1040. return;
  1041. }
  1042. Debounce(() => {
  1043. this.page++;
  1044. this.eqlist(true);
  1045. }, 500)();
  1046. },
  1047. scroll() {},
  1048. },
  1049. watch:{
  1050. pur_id(){
  1051. setTimeout(() => {
  1052. this.getUserlogin();
  1053. }, 100);
  1054. },
  1055. },
  1056. onLoad() {
  1057. this.getHours();
  1058. this.getMinutes();
  1059. const that = this;
  1060. uni.$on('purId', (item) => {
  1061. that.pur_id = item.purId;
  1062. that.menu = item.menu;
  1063. that.device_model = item.device_model;
  1064. });
  1065. uni.$on('refreshData', (refreshData) => {
  1066. this.eqlist();
  1067. });
  1068. this.getUserlogin();
  1069. },
  1070. onShow() {
  1071. // 监听刷新数据事件
  1072. const refreshData = uni.getStorageSync('refreshData');
  1073. if(!this.refreshData){
  1074. this.refreshData = refreshData;
  1075. // 如果发生改变,刷新数据
  1076. if(refreshData){
  1077. Debounce(() => {
  1078. this.getUserlogin();
  1079. }, 500)();
  1080. }
  1081. }else if(this.refreshData != refreshData){
  1082. this.refreshData = refreshData;
  1083. Debounce(() => {
  1084. this.getUserlogin();
  1085. }, 500)();
  1086. }
  1087. },
  1088. onTabItemTap(e) {
  1089. },
  1090. onReachBottom() {
  1091. if(this.eqlistdata.length >= this.total){
  1092. return;
  1093. }
  1094. Debounce(() => {
  1095. this.page++;
  1096. this.eqlist(true);
  1097. }, 500)();
  1098. },
  1099. onPageScroll(e) {
  1100. //nvue暂不支持滚动监听,可用bindingx代替
  1101. if (e.scrollTop > 200) {
  1102. //距离大于200时显示
  1103. this.isTop = true;
  1104. } else {
  1105. //距离小于200时隐藏
  1106. this.isTop = false;
  1107. }
  1108. },
  1109. };
  1110. </script>
  1111. <style lang="scss">
  1112. page {
  1113. background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  1114. }
  1115. ::v-deep .u-flex{
  1116. display: flex;
  1117. align-items: center;
  1118. justify-content: center;
  1119. }
  1120. .hour,.minute{
  1121. font-size: 28rpx;
  1122. color: #999999;
  1123. border-radius: 8rpx;
  1124. border: 2rpx solid #aaa;
  1125. padding: 4rpx 8rpx;
  1126. margin-right: 8rpx;
  1127. height: 40rpx;
  1128. display: flex;
  1129. align-items: center;
  1130. justify-content: center;
  1131. width: 160rpx;
  1132. }
  1133. /deep/.uni-icons {
  1134. font-size: 40rpx !important;
  1135. }
  1136. input{
  1137. background: transparent !important;
  1138. }
  1139. .textbox {
  1140. width: 100%;
  1141. height: calc(100vh - 82rpx);
  1142. padding-top: 82rpx;
  1143. box-sizing: border-box;
  1144. }
  1145. .inputs {
  1146. width: 65%;
  1147. margin-left: 12rpx;
  1148. /deep/.u-content {
  1149. background-color: #fff !important;
  1150. }
  1151. /deep/.uni-input-wrapper {
  1152. background-color: #fff !important;
  1153. }
  1154. }
  1155. .slider-container{
  1156. position: relative;
  1157. margin-top: 10rpx;
  1158. .slider-min-value{
  1159. position: absolute;
  1160. left: 0;
  1161. top: -60rpx;
  1162. }
  1163. .slider{
  1164. width: 600rpx;
  1165. }
  1166. .slider-max-value{
  1167. position: absolute;
  1168. right: 0;
  1169. top: -60rpx;
  1170. }
  1171. }
  1172. .custom-progress{
  1173. width: 500rpx;
  1174. padding: 0;
  1175. .progress-track{
  1176. position: relative;
  1177. height: 12rpx;
  1178. background-color: #ebedf0;
  1179. border-radius: 6rpx;
  1180. }
  1181. .progress-fill{
  1182. position: absolute;
  1183. left: 0;
  1184. top: 0;
  1185. height: 100%;
  1186. background-color: #0BBC58;
  1187. border-radius: 6rpx;
  1188. transition: width 0.2s;
  1189. }
  1190. .progress-thumb{
  1191. position: absolute;
  1192. top: 50%;
  1193. width: 28rpx;
  1194. height: 28rpx;
  1195. margin-left: -14rpx;
  1196. margin-top: -14rpx;
  1197. border-radius: 50%;
  1198. background-color: #fff;
  1199. box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  1200. transition: left 0.2s;
  1201. }
  1202. }
  1203. .utabs_box {
  1204. width: 100%;
  1205. position: fixed;
  1206. top: 88px;
  1207. background-color: #ffffff;
  1208. z-index: 100;
  1209. .utabs {
  1210. width: 95%;
  1211. margin: 0 auto;
  1212. }
  1213. }
  1214. .opening-container{
  1215. position: relative;
  1216. width: 100%;
  1217. .opening-min{
  1218. position: absolute;
  1219. top: 0;
  1220. left: 0;
  1221. font-size: 24rpx;
  1222. }
  1223. .opening-max{
  1224. position: absolute;
  1225. top: 0;
  1226. right: 0;
  1227. font-size: 24rpx;
  1228. }
  1229. }
  1230. .loading {
  1231. position: fixed;
  1232. top: 440px;
  1233. width: 95%;
  1234. left: 2.5%;
  1235. text-align: center;
  1236. .img {
  1237. width: 300rpx;
  1238. height: 40rpx;
  1239. }
  1240. }
  1241. .active-tab{
  1242. border-radius: 8rpx;
  1243. background: linear-gradient(0deg, #0bbc580f 0%, #0bbc580f 100%), #00000005;
  1244. }
  1245. .tab-box {
  1246. font-size: 30rpx;
  1247. box-sizing: border-box;
  1248. width: 100%;
  1249. height: 100%;
  1250. overflow-y: hidden;
  1251. overflow-x: auto;
  1252. white-space: nowrap;
  1253. // 去掉滚动条
  1254. -ms-overflow-style: none;
  1255. scrollbar-width: none;
  1256. .tab-item {
  1257. cursor: pointer;
  1258. position: relative;
  1259. text-align: center;
  1260. display: inline-block;
  1261. padding: 16rpx 24rpx;
  1262. box-sizing: border-box;
  1263. span {
  1264. display: inline-block;
  1265. }
  1266. }
  1267. }
  1268. .tab-box-top{
  1269. .tab-item {
  1270. width: 140rpx;
  1271. text-align: center;
  1272. }
  1273. }
  1274. .action-list{
  1275. display: flex;
  1276. margin: 8px 0;
  1277. .action-item{
  1278. display: flex;
  1279. align-items: center;
  1280. margin-right: 8px;
  1281. .item-icon{
  1282. width: 15px;
  1283. height: 15px;
  1284. margin-right: 4px;
  1285. }
  1286. }
  1287. }
  1288. .action-container{
  1289. display: flex;
  1290. align-items: center;
  1291. gap: 16rpx;
  1292. .action-container-item{
  1293. flex:1;
  1294. height: 90rpx;
  1295. border-radius: 8rpx;
  1296. background: #ffffff;
  1297. padding: 8rpx;
  1298. border: 2rpx solid #999999;
  1299. }
  1300. .action-container-container-item-active{
  1301. border: 2rpx solid #0BBC58;
  1302. }
  1303. .action-open{
  1304. width: 100%;
  1305. display: flex;
  1306. justify-content: center;
  1307. align-items: center;
  1308. }
  1309. .item-number{
  1310. width: 30rpx;
  1311. height: 30rpx;
  1312. line-height: 30rpx;
  1313. display: flex;
  1314. justify-content: center;
  1315. align-items: center;
  1316. border-radius: 50%;
  1317. border: 2rpx solid #999999;
  1318. color: #999999;
  1319. font-size: 22rpx;
  1320. margin-right: 8rpx;
  1321. //超出部分省略号
  1322. overflow: hidden;
  1323. white-space: nowrap;
  1324. text-overflow: ellipsis;
  1325. }
  1326. .item-number-active{
  1327. border: 2rpx solid #0BBC58;
  1328. color: #0BBC58;
  1329. }
  1330. .action-open-value{
  1331. margin-top: 8rpx;
  1332. display: flex;
  1333. align-items: center;
  1334. justify-content: center;
  1335. font-size: 24rpx;
  1336. }
  1337. .item-icon{
  1338. width: 15px;
  1339. height: 15px;
  1340. margin-right: 4px;
  1341. }
  1342. }
  1343. .progress-container{
  1344. display: flex;
  1345. justify-content: center;
  1346. align-items: center;
  1347. height:100%;
  1348. }
  1349. .tab {
  1350. // background-color: #0BBC58;
  1351. margin-top: 42rpx;
  1352. margin-bottom: 38rpx;
  1353. padding: 0 32rpx;
  1354. .img-icon {
  1355. width: 80rpx;
  1356. height: 80rpx;
  1357. margin-bottom: 12rpx;
  1358. }
  1359. .text {
  1360. color: #303133;
  1361. font-size: 24rpx;
  1362. }
  1363. .tab-content {
  1364. width: 100%;
  1365. height: 162rpx;
  1366. }
  1367. .tab-item.active {
  1368. border-radius: 24rpx;
  1369. background: linear-gradient(0deg, #0bbc580f 0%, #0bbc580f 100%), #00000005;
  1370. }
  1371. }
  1372. .second-tab {
  1373. height: 80rpx;
  1374. .tab-item{
  1375. font-size: 28rpx;
  1376. color: #999999;
  1377. }
  1378. .tab-item.active {
  1379. color: #303133;
  1380. font-weight: 700;
  1381. }
  1382. .tab-item.active::after {
  1383. content: '';
  1384. position: absolute;
  1385. bottom: 0;
  1386. left: 50%;
  1387. transform: translateX(-50%);
  1388. width: 18px; /* 比文字略宽 */
  1389. height: 18px;
  1390. border: 3px solid #0BBC58;
  1391. border-radius: 50%;
  1392. border-color: transparent; /* 隐藏其他部分 */
  1393. border-bottom-color: #0BBC58; /* 组合成45度角 */
  1394. // transform: rotate(0deg); /* 调整角度 */
  1395. }
  1396. }
  1397. .third-tab {
  1398. margin: 8rpx 0;
  1399. height: 64rpx;
  1400. line-height: 64rpx;
  1401. display: flex;
  1402. justify-content: space-between;
  1403. .third-tab-item {
  1404. flex: 1;
  1405. text-align: center;
  1406. }
  1407. }
  1408. .list {
  1409. width: 100%;
  1410. background-color: #F5F6FA;
  1411. // margin-bottom: 100rpx;
  1412. overflow-y: auto;
  1413. padding: 0 32rpx;
  1414. box-sizing: border-box;
  1415. .list_item {
  1416. width: 100%;
  1417. margin: 0 auto 24rpx;
  1418. padding: 32rpx;
  1419. box-sizing: border-box;
  1420. position: relative;
  1421. background-color: #ffffff;
  1422. border-radius: 16rpx;
  1423. .list_item_top {
  1424. .p1 {
  1425. width: 86%;
  1426. font-size: 28rpx;
  1427. overflow: hidden;
  1428. display: flex;
  1429. align-items: center;
  1430. .title{
  1431. max-width: 75%;
  1432. color: #333333;
  1433. font-size: 28rpx;
  1434. font-weight: 700;
  1435. margin-right: 8rpx;
  1436. overflow: hidden;
  1437. text-overflow: ellipsis;
  1438. white-space: nowrap;
  1439. }
  1440. .sub-title{
  1441. border-radius: 32rpx;
  1442. border:2rpx solid #0bbc58;
  1443. padding: 4rpx 12rpx;
  1444. font-size: 22rpx;
  1445. font-weight: 400;
  1446. overflow: hidden;
  1447. text-overflow: ellipsis;
  1448. white-space: nowrap;
  1449. color:#0bbc58;
  1450. margin-left: 20rpx;
  1451. }
  1452. }
  1453. }
  1454. .online-status{
  1455. font-size: 28rpx;
  1456. position: absolute;
  1457. text-align: center;
  1458. right: 2rpx;
  1459. top: 2rpx;
  1460. image{
  1461. width: 140rpx;
  1462. height: 56rpx;
  1463. }
  1464. .status-text-online{
  1465. color: #0BBC58;
  1466. position: absolute;
  1467. top: 0rpx;
  1468. right: 0rpx;
  1469. width: 120rpx;
  1470. height: 56rpx;
  1471. line-height: 56rpx;
  1472. font-size: 26rpx;
  1473. }
  1474. .status-text-offline{
  1475. color: #FB4E52;
  1476. position: absolute;
  1477. top: 0rpx;
  1478. right: 0rpx;
  1479. width: 120rpx;
  1480. height: 56rpx;
  1481. line-height: 56rpx;
  1482. font-size: 26rpx;
  1483. }
  1484. }
  1485. // .p2 {
  1486. // color: #0BBC58;
  1487. // background: #0bbc581a;
  1488. // }
  1489. // .p_out {
  1490. // color: #FB4E52;
  1491. // background: #fb4e521a;
  1492. // }
  1493. .list_item_text {
  1494. margin-top: 20rpx;
  1495. .p1 {
  1496. font-size: 24rpx;
  1497. color: #303133;
  1498. margin-top: 10rpx;
  1499. word-break: break-all;
  1500. }
  1501. .label{
  1502. color: #999999;
  1503. text-align: left;
  1504. margin-right: 32rpx;
  1505. font-size: 24rpx;
  1506. min-width: 90rpx;
  1507. display: inline-block;
  1508. }
  1509. .nav-label{
  1510. //超出隐藏
  1511. display: inline-block;
  1512. width: 70%;
  1513. overflow: hidden;
  1514. text-overflow: ellipsis;
  1515. white-space: nowrap;
  1516. }
  1517. }
  1518. .list_item_btn {
  1519. width: 126rpx;
  1520. color: #42b983;
  1521. height: 40rpx;
  1522. text-align: center;
  1523. border: 1rpx solid #42b983;
  1524. border-radius: 25rpx;
  1525. font-size: 24rpx;
  1526. line-height: 35rpx;
  1527. position: absolute;
  1528. bottom: 15rpx;
  1529. right: 20rpx;
  1530. }
  1531. }
  1532. }
  1533. .top {
  1534. position: fixed;
  1535. right: 30px;
  1536. bottom: 100px;
  1537. z-index: 100;
  1538. image {
  1539. width: 100rpx;
  1540. height: 100rpx;
  1541. }
  1542. }
  1543. </style>