shuifeizs.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. <template>
  2. <view class="facilitystate-page">
  3. <custom-card>
  4. <block slot="backText">
  5. <view class="facilitystate-top__title">
  6. <text :class="devStatus == '1' ? 'online' : 'offline'">{{
  7. devStatus == '1' ? '在线' : '离线'
  8. }}</text>
  9. {{ devName }}
  10. </view>
  11. </block>
  12. </custom-card>
  13. <view class="facilitystate-top">
  14. <view
  15. class="facilitystate-top__item"
  16. v-for="(item, index) in deviceList"
  17. :key="index"
  18. @click="nativeTo(item)"
  19. >
  20. <view class="item-icon-container" :class="item.className">
  21. <image class="item-icon" :src="item.icon" />
  22. </view>
  23. <view class="facilitystate-top__item-text">{{ item.title }}</view>
  24. </view>
  25. </view>
  26. <view class="irrMode">
  27. <view class="irrMode__header">
  28. <view @click="changeMode('1')" :class="workStatus == '1' ? 'active' : ''">施肥模式</view>
  29. <view @click="changeMode('0')" :class="workStatus == '0' ? 'active' : ''">灌溉模式</view>
  30. </view>
  31. <view class="irrMode__content">
  32. <view class="irrMode__content-header">
  33. <view class="irrMode__content-header-list">
  34. <view class="irrMode__content-header-title">
  35. <view class="irrMode__content-header-container">
  36. <image class="header-item-icon" :src="rain" />
  37. <text style="color:#333;font-size: 24rpx;margin-left: 10rpx">当前灌溉区域:</text>{{ runTitle }}
  38. </view>
  39. <view class="timer-text">{{ timer }}分</view>
  40. </view>
  41. </view>
  42. <view class="irrMode__content-item">
  43. <view class="irrMode__content-item-raduis" :class="runStatus == '1' ? 'active-radius' : ''" @click="changeActive('1')">
  44. <image class="item-icon" :src="runStatus=='1'?mediaPlayFill:mediaPlay" />
  45. <view class="item-text">启动</view>
  46. </view>
  47. <view class="irrMode__content-item-raduis" :class="runStatus == '2' ? 'active-radius' : ''" @click="changeActive('2')">
  48. <image class="item-icon" :src="runStatus=='2'?mediaPauseFill:mediaPause" />
  49. <view class="item-text">暂停</view>
  50. </view>
  51. <view class="irrMode__content-item-raduis" :class="runStatus == '0' ? 'active-radius' : ''" @click="changeActive('0')" style="margin-right:0">
  52. <image class="item-icon" :src="runStatus=='0'?stopFill:stop" />
  53. <view class="item-text">停止</view>
  54. </view>
  55. </view>
  56. <view class="irr-run-list">
  57. <text v-for="(item, index) in selectAreaList" :key="index">
  58. {{ item.group_name }}
  59. <text v-if="index != selectAreaList.length - 1">、</text>
  60. </text>
  61. </view>
  62. </view>
  63. </view>
  64. <Base :dataList="dataList" />
  65. <facilitystate
  66. :devBid="devBid"
  67. :ggbCurrent="ggbCurrent"
  68. :sfbCurrent="sfbCurrent"
  69. :irrigatedAreaList="irrigatedAreaList"
  70. :webSockedData="webSockedData"
  71. :alreadyfertilizerBucketList="alreadyfertilizerBucketList"
  72. />
  73. </view>
  74. </view>
  75. </template>
  76. <script>
  77. import manualControl from './assets/manualControl.png';
  78. import mediaPause from './assets/media-pause.png';
  79. import mediaPauseFill from './assets/media-pause-fill.png';
  80. import mediaPlay from './assets/media-play.png';
  81. import mediaPlayFill from './assets/media-play-fill.png';
  82. import rain from './assets/rain.png';
  83. import stop from './assets/stop.png';
  84. import stopFill from './assets/stop-fill.png';
  85. import wheelIrrigation from './assets/wheelIrrigation.png';
  86. import time from './assets/timing.png';
  87. import formulaSetting from './assets/formulaSetting.png';
  88. import operatingRecord from './assets/operatingRecord.png';
  89. import Base from './components/base.vue';
  90. import facilitystate from './components/facilitystate.vue';
  91. export default {
  92. data() {
  93. return {
  94. ws: null,
  95. currentMode: '1',
  96. title: '水肥一体机',
  97. manualControl,
  98. devBid: '',
  99. devName: '',
  100. devStatus: '1',
  101. dataList: [],
  102. irrigatedAreaList: [],
  103. alreadyfertilizerBucketList: [],
  104. mediaPause,
  105. mediaPauseFill,
  106. mediaPlay,
  107. mediaPlayFill,
  108. rain,
  109. stop,
  110. stopFill,
  111. deviceList: [
  112. {
  113. icon: manualControl,
  114. title: '手动控制',
  115. className: 'manualControl',
  116. url: '/pages/cb/shuifeizsFirst/control',
  117. },
  118. {
  119. icon: wheelIrrigation,
  120. title: '自动控制',
  121. className: 'wheelIrrigation',
  122. url: '/pages/cb/shuifeizsFirst/autoSetting?devBid=' + this.devBid,
  123. }, {
  124. icon: time,
  125. title: '定时设置',
  126. className: 'timedSetting',
  127. url: '/pages/cb/shuifeizsFirst/timingSetting?devBid=' + this.devBid,
  128. },{
  129. icon: formulaSetting,
  130. title: '配方设置',
  131. className: 'formulaSetting',
  132. url: '/pages/cb/shuifeizsFirst/formulaSetting?devBid=' + this.devBid,
  133. }, {
  134. icon: operatingRecord,
  135. title: '操作记录',
  136. className: 'operatingRecord',
  137. url: '/pages/cb/shuifeizsFirst/history?devBid=' + this.devBid,
  138. },
  139. ],
  140. ggbCurrent: {},
  141. sfbCurrent: {},
  142. sfToken: '',
  143. entityId: '',
  144. heartbeatTimer: null,
  145. info: {},
  146. dataArray:[],
  147. webSockedData: {},
  148. reconnectCount: 0,
  149. isActive: '0',
  150. runStatus: -1,
  151. workStatus: -1,
  152. clearIrr: {},
  153. selectAreaList: [],
  154. runTitle: '--',
  155. timer:'--'
  156. };
  157. },
  158. components: {
  159. Base,
  160. facilitystate,
  161. },
  162. onLoad(options) {
  163. /*
  164. 0 水源 泵类 负责水源进入管道的总泵或者阀
  165. 1 肥料 泵类 负责肥料进入管道的总阀或者泵
  166. 2 吸肥 泵类 控制肥料桶出肥的阀或者泵,每个肥料桶一个
  167. 3 搅拌 泵类 肥料桶的搅拌电机或者泵 每个肥料桶一个
  168. 4 肥料桶 泵类 肥料桶,每个施肥机有多个或者没有,不一定真实存在,只是逻辑上的概念
  169. 5 电磁阀 无 管道最末端每个田地里控制出水的阀门
  170. 6 传感器 无 水肥机上的 温度,压力,流速,PH EC等监测类要素
  171. 7 灌区 无 逻辑区域,电磁阀的分组
  172. */
  173. const { devBid, devName, devStatus } = options;
  174. this.devBid = devBid;
  175. this.devName = devName;
  176. this.devStatus = devStatus;
  177. this.deviceList[0].url = `/pages/cb/shuifeizsFirst/control?devBid=${options.devBid}`;
  178. this.deviceList[1].url = `/pages/cb/shuifeizsFirst/autoSetting?devBid=${options.devBid}`;
  179. this.deviceList[2].url = `/pages/cb/shuifeizsFirst/timingSetting?devBid=${options.devBid}`;
  180. this.deviceList[3].url = `/pages/cb/shuifeizsFirst/formulaSetting?devBid=${options.devBid}`;
  181. this.deviceList[
  182. this.deviceList.length - 1
  183. ].url = `/pages/cb/shuifeizsFirst/history?devBid=${options.devBid}`;
  184. if (devBid) {
  185. this.init();
  186. }
  187. },
  188. onUnload() {
  189. this.ws.close();
  190. },
  191. methods: {
  192. isHaveTime(childrenList) {
  193. let time = 0;
  194. let currentKey = '';
  195. let currentItem = {};
  196. for (let i = 0; i < this.selectAreaList.length; i++) {
  197. for (let key in this.selectAreaList[i]) {
  198. if (key.includes(':Status')) {
  199. currentKey = key;
  200. currentItem = this.selectAreaList[i];
  201. break;
  202. }
  203. }
  204. for (let i = 0; i < childrenList.length; i++) {
  205. const item = childrenList[i];
  206. if (item.sfCode === currentKey) {
  207. for (let key in currentItem) {
  208. if (key.includes(':PartTim')) {
  209. time = currentItem[key];
  210. }
  211. }
  212. break;
  213. }
  214. }
  215. }
  216. return time;
  217. },
  218. isAutoRun(childrenList) {
  219. for (let i = 0; i < childrenList.length; i++) {
  220. const item = childrenList[i];
  221. if (item.value == 1) {
  222. return true
  223. }
  224. }
  225. return false
  226. },
  227. async initsfyunshangAutoConfigInfo() {
  228. const selectAreaList = [];
  229. const res = await this.$myRequest({
  230. url:'/api/v2/iot/device/sf/yunshang/auto/config/info/',
  231. method:'post',
  232. data: {
  233. devBid: String(this.devBid),
  234. },
  235. })
  236. const list = res;
  237. const group_list = list.group_list || [];
  238. group_list.forEach((item) => {
  239. if (item.group_value == 1) {
  240. selectAreaList.push(item);
  241. }
  242. });
  243. this.selectAreaList = selectAreaList;
  244. },
  245. async devctlContorl(data){
  246. const params = {
  247. devBid: Number(this.devBid),
  248. data,
  249. };
  250. const res = await this.$myRequest({
  251. url: '/api/v2/iot/mobile/device/sf/devctl/',
  252. method: 'post',
  253. data:params,
  254. header: {
  255. 'Content-Type': 'application/json',
  256. },
  257. });
  258. uni.showToast({
  259. title: res.msg,
  260. icon: 'none',
  261. });
  262. },
  263. changeActive(active) {
  264. this.runStatus = active;
  265. const params = {
  266. IrrStatus:active
  267. }
  268. this.devctlContorl(params);
  269. },
  270. changeMode(mode) {
  271. if(this.runStatus == '1' || this.runStatus == '2'){
  272. uni.showToast({
  273. title: '请先停止运行',
  274. icon: 'none',
  275. });
  276. return
  277. }
  278. this.currentMode = mode;
  279. const params = {
  280. IrrMode:mode
  281. }
  282. this.devctlContorl(params);
  283. },
  284. initWebSocket() {
  285. const url = 'wss://things.ysiot.net:18080/api/ws';
  286. this.ws = uni.connectSocket({
  287. url: url,
  288. success: () => {
  289. console.log('WebSocket 连接初始化成功');
  290. }
  291. });
  292. uni.onSocketOpen(() => {
  293. console.log('WebSocket 已连接');
  294. // 发送测试参数
  295. const testParams = {
  296. cmds: [
  297. {
  298. type: 'TIMESERIES',
  299. entityType: 'DEVICE',
  300. entityId: this.entityId,
  301. scope: 'LATEST_TELEMETRY',
  302. cmdId: 1
  303. }
  304. ],
  305. authCmd: {
  306. cmdId: 0,
  307. token: this.sfToken,
  308. }
  309. };
  310. console.log('发送测试参数:', testParams);
  311. uni.sendSocketMessage({
  312. data: JSON.stringify(testParams)
  313. });
  314. // 心跳:每 30 秒 ping 一次
  315. this.heartbeatTimer = setInterval(() => {
  316. uni.sendSocketMessage({
  317. data: JSON.stringify({ type: 'ping' })
  318. });
  319. }, 30 * 1000);
  320. });
  321. uni.onSocketMessage((evt) => {
  322. try {
  323. const data = JSON.parse(evt.data);
  324. this.webSockedData = data;
  325. // 收到实时数据后刷新右侧组件
  326. if(this.dataArray.length){
  327. this.mergeTwoObject(this.dataArray,this.webSockedData?.data);
  328. this.initData(this.dataArray);
  329. }
  330. } catch (e) {
  331. console.error('WebSocket 消息解析失败', e);
  332. }
  333. });
  334. uni.onSocketError((e) => {
  335. console.error('WebSocket 错误', e);
  336. });
  337. uni.onSocketClose(() => {
  338. console.warn('WebSocket 已断开,3 秒后尝试重连');
  339. clearInterval(this.heartbeatTimer);
  340. this.reconnectCount = (this.reconnectCount || 0) + 1;
  341. if (this.reconnectCount <= 10) {
  342. setTimeout(() => this.initWebSocket(), 3000);
  343. } else {
  344. console.warn('WebSocket 重连次数已达上限,停止重连');
  345. }
  346. });
  347. },
  348. mergeTwoObject(firstObject, secondObject) {
  349. // 构建 sfCode 到对象的映射,实现 O(1) 查找
  350. const sfCodeMap = new Map();
  351. // 递归构建映射
  352. const buildMap = (items) => {
  353. for (const item of items) {
  354. if (item.sfCode) {
  355. sfCodeMap.set(item.sfCode, item);
  356. }
  357. if (item.childrenList && item.childrenList.length) {
  358. buildMap(item.childrenList);
  359. }
  360. }
  361. };
  362. buildMap(firstObject);
  363. // 遍历 secondObject 并更新值
  364. for (const key in secondObject) {
  365. let newKey = '';
  366. if(key.includes('GHChannelDev:ChannelParamSet')){
  367. newKey = key + ':Status';
  368. const item = sfCodeMap.get(newKey);
  369. if (item) {
  370. const params = JSON.parse(secondObject[key][0][1]);
  371. this.$set(item,'value',params.Status)
  372. }
  373. }else{
  374. const item = sfCodeMap.get(key);
  375. if (item) {
  376. this.$set(item,'value',secondObject[key][0][1])
  377. }
  378. }
  379. }
  380. },
  381. // 关闭 WebSocket
  382. closeWebSocket() {
  383. clearInterval(this.heartbeatTimer);
  384. if (this.ws) {
  385. uni.closeSocket();
  386. this.ws = null;
  387. }
  388. },
  389. async getsfrhinfo() {
  390. const res = await this.$myRequest({
  391. url: '/api/v2/iot/device/sf/info/',
  392. method: 'post',
  393. data: {
  394. devBid: String(this.devBid),
  395. },
  396. });
  397. this.info = res;
  398. this.sfToken = this.info?.sfToken;
  399. this.entityId = this.info?.sfUuid;
  400. this.closeWebSocket();
  401. this.initWebSocket();
  402. },
  403. async init() {
  404. this.getdeviceSfStatus();
  405. await this.getpeifangRefresh();
  406. this.getsfrhinfo();
  407. this.initsfyunshangAutoConfigInfo();
  408. await this.getRunStatus();
  409. },
  410. async getpeifangRefresh() {
  411. await this.$myRequest({
  412. url: '/api/v2/iot/mobile/device/sf/peifang/refresh/',
  413. method: 'post',
  414. data: {
  415. devBid: this.devBid,
  416. },
  417. });
  418. },
  419. async getRunStatus() {
  420. const res = await this.$myRequest({
  421. url: '/api/v2/iot/mobile/device/sf/zsrf/task/run/status/',
  422. method: 'post',
  423. data: {
  424. devBid: this.devBid,
  425. },
  426. });
  427. const data = JSON.stringify(res || {});
  428. if (data == '{}') {
  429. this.isRun = true;
  430. } else {
  431. this.isRun = false;
  432. }
  433. },
  434. initData(res){
  435. this.dataList = [];
  436. this.irrigatedAreaList = [];
  437. this.alreadyfertilizerBucketList = [];
  438. res?.forEach((item) => {
  439. if (item.sfType === '0') {
  440. this.ggbCurrent = item;
  441. } else if (item.sfType === '1') {
  442. this.sfbCurrent = item;
  443. } else if (item.sfType === '4') {
  444. this.alreadyfertilizerBucketList.push(item);
  445. } else if (item.sfType === '6') {
  446. this.dataList.push(item);
  447. } else if (item.sfType === '7') {
  448. this.irrigatedAreaList.push(item);
  449. } else if (item.sfType === '9') {
  450. if (item.sfCode === 'IrrStatus') {
  451. this.runStatus = item.value;
  452. } else if (item.sfCode === 'IrrMode') {
  453. this.workStatus = item.value;
  454. } else if (item.sfCode === 'WaterFlowSum:Value') {
  455. this.clearIrr = item;
  456. }
  457. }
  458. });
  459. this.runTitle = '--';
  460. this.timer = '--';
  461. if(this.runStatus == '1'){
  462. this.irrigatedAreaList.forEach((item) => {
  463. if (this.isAutoRun(item.childrenList)) {
  464. this.runTitle = item.sfDisplayname || item.sfName;
  465. this.timer = this.isHaveTime(item.childrenList);
  466. }
  467. });
  468. }else{
  469. this.runTitle = '--';
  470. this.timer = '--';
  471. }
  472. },
  473. async getdeviceSfStatus() {
  474. const res = await this.$myRequest({
  475. url: '/api/v2/iot/mobile/device/sf/status/',
  476. method: 'post',
  477. data: {
  478. devBid: this.devBid,
  479. },
  480. });
  481. this.dataArray = res || [];
  482. this.initData(this.dataArray);
  483. },
  484. nativeTo(item) {
  485. if(item.className == 'manualControl'){
  486. if(this.runStatus == '1' || this.runStatus == '2'){
  487. uni.showToast({
  488. title: '请先停止运行',
  489. icon: 'none',
  490. });
  491. return
  492. }
  493. }
  494. uni.navigateTo({
  495. url: item.url,
  496. });
  497. },
  498. },
  499. };
  500. </script>
  501. <style scoped lang="scss">
  502. uni-page-body {
  503. position: relative;
  504. height: 100%;
  505. }
  506. .irrMode{
  507. margin-top: 30rpx;
  508. border-radius: 32rpx 32rpx 0 0;
  509. margin-bottom: 30rpx;
  510. padding: 32rpx;
  511. border: 3rpx solid #FFF;
  512. background: linear-gradient(180deg, #D3F3F2 0%, #FFF 41.06%);
  513. .irrMode__header{
  514. display: flex;
  515. width:320rpx;
  516. padding:0 10rpx;
  517. align-items: center;
  518. background: #ffffff;
  519. border-radius: 12rpx;
  520. margin-bottom: 24rpx;
  521. font-family: "Source Han Sans CN VF";
  522. font-size: 28rpx;
  523. font-style: normal;
  524. font-weight: 400;
  525. line-height: normal;
  526. color:#999999;
  527. height: 68rpx;
  528. line-height: 68rpx;
  529. view{
  530. width: 160rpx;
  531. text-align: center;
  532. }
  533. }
  534. .active{
  535. display: flex;
  536. align-items: center;
  537. justify-content: center;
  538. border-radius: 8rpx;
  539. color: #ffffff;
  540. background: #0BBC58;
  541. height: 56rpx;
  542. }
  543. .irrMode__content{
  544. margin-top: 24rpx;
  545. border-radius: 16rpx;
  546. padding: 2rpx;
  547. background: linear-gradient(180deg, #FFF 0%, #F5F6FA 100%);
  548. .irrMode__content-header{
  549. width: calc(100% - 32rpx);
  550. padding: 16rpx 16rpx 16rpx 16rpx;
  551. border-radius: 12rpx;
  552. background: linear-gradient(180deg, #BBF1EA 0%, #E6F4F9 100%);
  553. .irrMode__content-header-list{
  554. display:flex;
  555. justify-content: space-between;
  556. align-items: center;
  557. margin-bottom: 12rpx;
  558. }
  559. .irrMode__content-header-title{
  560. color: #020305;
  561. text-align: right;
  562. font-family: "Source Han Sans CN VF";
  563. font-size: 30rpx;
  564. font-weight: 500;
  565. display: flex;
  566. align-items: center;
  567. justify-content: space-between;
  568. width: 100%;
  569. .irrMode__content-header-container{
  570. display: flex;
  571. align-items: center;
  572. }
  573. .header-item-icon{
  574. width: 48rpx;
  575. height: 48rpx;
  576. }
  577. .timer-text{
  578. color: #0bbc58;
  579. text-align: right;
  580. font-family: "Source Han Sans CN VF";
  581. font-size: 28rpx;
  582. font-weight: 400;
  583. }
  584. }
  585. .irrMode__content-header-desc{
  586. color: #999999;
  587. text-align: right;
  588. font-family: "Source Han Sans CN VF";
  589. font-size: 28rpx;
  590. font-weight: 400;
  591. }
  592. }
  593. .irrMode__content-item{
  594. display:flex;
  595. align-items: center;
  596. justify-content: center;
  597. padding: 16rpx 0;
  598. border-radius: 12rpx;
  599. .irrMode__content-item-raduis{
  600. display: flex;
  601. height: 88rpx;
  602. padding: 0rpx 32rpx;
  603. flex-direction: column;
  604. justify-content: center;
  605. align-items: center;
  606. flex: 1 0 0;
  607. border-radius: 16rpx;
  608. margin-right: 16rpx;
  609. border: 2rpx solid #0BBC58;
  610. color: #0bbc58;
  611. text-align: right;
  612. font-family: "Source Han Sans CN VF";
  613. font-size: 20rpx;
  614. image{
  615. width: 48rpx;
  616. height: 48rpx;
  617. }
  618. }
  619. .active-radius{
  620. background: #0BBC58;
  621. color:#ffffff;
  622. }
  623. }
  624. .irr-run-list{
  625. padding: 16rpx;
  626. font-family: "Source Han Sans CN VF";
  627. color: #999999;
  628. font-family: "Source Han Sans CN VF";
  629. font-size: 24rpx;
  630. font-weight: 400;
  631. }
  632. }
  633. }
  634. .online {
  635. height: 32rpx;
  636. line-height: 32rpx;
  637. padding: 0 8rpx;
  638. border-radius: 4rpx;
  639. background: #14a478;
  640. color: #ffffff;
  641. font-family: 'Source Han Sans CN';
  642. font-size: 20rpx;
  643. font-weight: 500;
  644. margin-right: 8rpx;
  645. top: -4rpx;
  646. display:inline-block;
  647. position: relative;
  648. }
  649. .manualControl{
  650. background: linear-gradient(326deg, #FFAB3D 6.86%, #FED55A 93.52%);
  651. }
  652. .wheelIrrigation{
  653. background: linear-gradient(152deg, #83D2FF 14.82%, #02A2FC 92.92%);
  654. }
  655. .timedSetting{
  656. background: linear-gradient(335deg, #0BBC58 6.91%, #60D799 89.95%);
  657. }
  658. .formulaSetting{
  659. background: linear-gradient(147deg, #FE9797 12.77%, #FF6060 92.63%);
  660. }
  661. .operatingRecord{
  662. background: linear-gradient(152deg, #B9B9F6 11.22%, #8080F8 94.92%);
  663. }
  664. .facilitystate-top__title{
  665. overflow: hidden;
  666. white-space: nowrap;
  667. text-overflow: ellipsis;
  668. }
  669. .offline {
  670. height: 32rpx;
  671. line-height: 32rpx;
  672. padding: 0 8rpx;
  673. border-radius: 4rpx;
  674. background: #ff4d4f;
  675. color: #ffffff;
  676. font-family: 'Source Han Sans CN';
  677. font-size: 20rpx;
  678. font-weight: 500;
  679. margin-right: 8rpx;
  680. top: -4rpx;
  681. display:inline-block;
  682. position: relative;
  683. }
  684. .facilitystate-page {
  685. background: linear-gradient(180deg, #f5f6fa00 0%, #F5F6FA 23.46%, #FFF 25.24%, #FFF 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  686. height: 100%;
  687. width: 100%;
  688. overflow-x: hidden;
  689. overflow-y: scroll;
  690. .facilitystate-top {
  691. display: grid;
  692. grid-template-columns: repeat(5, 1fr);
  693. text-align: center;
  694. margin-top: 18rpx;
  695. &__item {
  696. margin-bottom: 32rpx;
  697. .item-icon-container{
  698. width: 96rpx;
  699. height: 96rpx;
  700. border-radius: 26rpx;
  701. overflow: hidden;
  702. margin: 0 auto;
  703. display:flex;
  704. align-items: center;
  705. justify-content: center;
  706. }
  707. .item-icon {
  708. width: 64rpx;
  709. height: 64rpx;
  710. }
  711. }
  712. &__item-text {
  713. color: #042118;
  714. font-family: 'Source Han Sans CN VF';
  715. font-size: 28rpx;
  716. font-weight: 400;
  717. margin-top: 16rpx;
  718. }
  719. }
  720. }
  721. </style>