safetyCardScan.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <!-- 安全检查扫一扫 实验室详情 -->
  2. <template>
  3. <view class="safetyCardScan">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="header">
  6. <view class="tabTitle">
  7. <view class="tabTitle_li" @tap="tabClick(index)" :key="index" v-for="(item,index) in tabText">
  8. <view class="tabTitle_text">
  9. <img :src="item.img">
  10. <view
  11. :id="curTab==index && curTab==0?'fontColor-A':(curTab==index && curTab==1?'fontColor-B':'')">
  12. {{item.name}}
  13. </view>
  14. </view>
  15. <view :class="{on:curTab==index}" class="tabTitle_across">
  16. <img src="@/pages_safetyCheck/images/img_xyzc_bg@1x.png">
  17. </view>
  18. <view class="line"></view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="safetyCard" v-if="pageType==1">
  23. <view class="lab-info">
  24. <view class="lab-info-t">
  25. <view>一级</view>
  26. <view>化学类</view>
  27. <view>实验室名称名称名称(房间号)</view>
  28. </view>
  29. <view class="lab-info-b">
  30. <img src="@/pages_safetyCheck/images/icon_sys_xz@1x.png">
  31. 楼栋楼层
  32. </view>
  33. </view>
  34. <view class="liability-unit">
  35. <view>学院单位</view>
  36. <view>学院单位名称</view>
  37. </view>
  38. <view class="small-title">
  39. <view>实验室负责人</view>
  40. <img src="@/pages_safetyCheck/images/icon_06_1.png">
  41. </view>
  42. <view class="sub-head">
  43. <view>{{newData.adminName}}</view>
  44. <view @click="callPhone(newData.adminPhone)">
  45. <img src="@/pages_manage/images/icon_aqxxp_dh.png">
  46. <view>{{newData.adminPhone}}</view>
  47. </view>
  48. </view>
  49. <view class="small-title">安全员</view>
  50. <view class="sub-head" v-for="(item,index) in newData.safeUserList" :key="index">
  51. <view>{{item.safeUserName}}</view>
  52. <view @click="callPhone(item.safeUserPhone)">
  53. <img src="@/pages_manage/images/icon_aqxxp_dh.png">
  54. <view>{{item.safeUserPhone}}</view>
  55. </view>
  56. </view>
  57. <view class="classify" v-for="(item,index) in newData.labInfoBrandModels" :key="index">
  58. <view v-if="item.privateList.length>0 && item.brandType==1" class="small-title">{{item.brandName}}
  59. </view>
  60. <view v-if="item.privateList.length>0 && item.brandType==1 && !item.isSpecial" class="small-items"
  61. v-for="(item2,index2) in item.privateList" :key="index2">
  62. <view>● </view>
  63. <view>{{item2.infoName}}</view>
  64. </view>
  65. <view v-if="item.privateList.length>0 && item.brandType==1 && item.isSpecial" class="small-items"
  66. v-for="(item2,index2) in item.privateList" :key="index2">
  67. <view></view>
  68. <view>{{item2.infoName}}</view>
  69. </view>
  70. <view v-if="item.privateList.length>0 && item.brandType==2" class="logotype">{{item.brandName}}
  71. </view>
  72. <view v-if="item.privateList.length>0 && item.brandType==2" class="logotype-img">
  73. <img v-for="(item3,index3) in item.privateList" :key="index3" :src="baseUrl+item3.infoContent">
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 物联控制 -->
  78. <iotControl ref="iotControl" v-if="pageType == 2" :subjectData="subjectData"></iotControl>
  79. <!-- 进出记录 -->
  80. <accessRecord v-if="pageType == 4" :subjectData="subjectData"></accessRecord>
  81. <!-- 语音广播弹窗 -->
  82. <voiceBroadcast v-if="broadcastPage" :subjectData="subjectData"></voiceBroadcast>
  83. <!-- 空调弹窗 -->
  84. <airConditioning v-if="conditioningPage" :airConditioningData="airConditioningData"></airConditioning>
  85. </scroll-view>
  86. </view>
  87. </template>
  88. <script>
  89. import {
  90. iotControl
  91. } from '@/pages_manage/views/laboratory/iotControl.vue'
  92. import {
  93. accessRecord
  94. } from '@/pages_manage/views/laboratory/accessRecord.vue'
  95. import {
  96. voiceBroadcast
  97. } from '@/pages_manage/views/laboratory/voiceBroadcast.vue'
  98. import {
  99. airConditioning
  100. } from '@/pages_manage/views/laboratory/airConditioning.vue'
  101. import {
  102. config
  103. } from '@/api/request/config.js'
  104. import {
  105. } from '@/pages/api/index.js'
  106. export default {
  107. name: "safetyCardScan",
  108. components: {
  109. iotControl,
  110. accessRecord,
  111. voiceBroadcast,
  112. airConditioning,
  113. },
  114. data() {
  115. return {
  116. baseUrl: config.base_url,
  117. pageType: 1,
  118. tabText: [{
  119. name: '安全信息牌',
  120. img: require('@/pages_safetyCheck/images/icon_sys_aqxxp@1x.png'),
  121. },
  122. {
  123. name: '监测控制',
  124. img: require('@/pages_safetyCheck/images/icon_sys_jckz@1x.png'),
  125. },
  126. {
  127. name: '进出记录',
  128. img: require('@/pages_safetyCheck/images/icon_sys_jcjl@1x.png'),
  129. },
  130. ],
  131. curTab: 0,
  132. newData: {
  133. adminName: '李飘飘',
  134. adminPhone: '13655668899',
  135. safeUserList: [{
  136. safeUserName: '周游',
  137. safeUserPhone: '13655668899',
  138. },
  139. {
  140. safeUserName: '周游',
  141. safeUserPhone: '13655668899',
  142. },
  143. ],
  144. },
  145. //语音广播弹窗
  146. broadcastPage: false,
  147. //空调弹窗
  148. conditioningPage: false,
  149. // 查询参数
  150. queryParams: {
  151. page: 1,
  152. pageSize: 20,
  153. },
  154. subjectData: null,
  155. // 空调弹窗
  156. airConditioningData: null,
  157. saoCodeType: false,
  158. }
  159. },
  160. // 父页面
  161. onReachBottom() {
  162. uni.$emit('onReachBottom') // 设置监听事件
  163. },
  164. onPullDownRefresh() {
  165. uni.$emit('onPullDownRefresh') // 设置监听事件
  166. },
  167. onLoad(option) {
  168. //this.$set(this, 'newData', JSON.parse(decodeURIComponent(option.infoData)));
  169. //this.$set(this, 'subjectData', JSON.parse(decodeURIComponent(option.infoData)));
  170. if (option.saoCode) {
  171. this.$set(this, 'saoCodeType', true);
  172. this.$set(this, 'currentIndex', 1);
  173. this.$set(this, 'pageType', 3);
  174. } else {
  175. this.$set(this, 'saoCodeType', false);
  176. this.$set(this, 'currentIndex', 0);
  177. this.$set(this, 'pageType', 2);
  178. }
  179. },
  180. onShow() {
  181. },
  182. mounted() {
  183. },
  184. methods: {
  185. //滚动事件
  186. scrollGet() {},
  187. //顶部tab点击
  188. tabClick(index) {
  189. this.curTab = index;
  190. if (index == 0) {
  191. //安全信息牌
  192. this.$set(this, 'pageType', 1);
  193. } else if (index == 1) {
  194. //监测控制
  195. this.$set(this, 'pageType', 2);
  196. } else if (index == 2) {
  197. //进出记录
  198. this.$set(this, 'pageType', 4);
  199. }
  200. },
  201. goVideoPage() {
  202. console.log('视频')
  203. let obj = {
  204. type: 4,
  205. subId: this.newData.subId
  206. }
  207. uni.navigateTo({
  208. url: '/pages_manage/views/laboratory/videoPlayer?item=' + encodeURIComponent(JSON.stringify(
  209. obj))
  210. });
  211. },
  212. getIotControlData() {
  213. this.$refs['iotControl'].iotAppHardwareFindByType();
  214. },
  215. buttonClick(type, row) {
  216. let self = this;
  217. if (type == 'subDetail') {
  218. //实验室详情
  219. } else if (type == 'broadcastOpen') {
  220. //语音弹窗开启
  221. this.$set(this, 'broadcastPage', true);
  222. } else if (type == 'broadcastClose') {
  223. //语音弹窗关闭
  224. this.$set(this, 'broadcastPage', false);
  225. } else if (type == 'conditioningOpen') {
  226. //空调弹窗开启
  227. this.$set(this, 'airConditioningData', row);
  228. this.$set(this, 'conditioningPage', true);
  229. } else if (type == 'conditioningClose') {
  230. //空调弹窗关闭
  231. this.$set(this, 'conditioningPage', false);
  232. } else if (type == 'back') {
  233. this.$set(this, 'pageType', 2);
  234. }
  235. },
  236. }
  237. }
  238. </script>
  239. <style lang="stylus" scoped>
  240. .safetyCardScan {
  241. height: 100%;
  242. #fontColor-A {
  243. color: #00DEDE;
  244. }
  245. #fontColor-B {
  246. color: #FF8C00;
  247. }
  248. .header {
  249. width: 100%;
  250. position: fixed;
  251. top: 0rpx;
  252. z-index: 100;
  253. background: #fff;
  254. .tabTitle {
  255. width: 750rpx;
  256. height: 188rpx;
  257. display flex;
  258. justify-content: flex-start;
  259. align-items: center;
  260. border-bottom: 4rpx solid #F5F5F5;
  261. .tabTitle_li {
  262. height: 188rpx;
  263. flex: 1;
  264. position: relative;
  265. text-align center;
  266. .tabTitle_text {
  267. display: flex;
  268. justify-content: center;
  269. flex-direction: column;
  270. align-items: center;
  271. >img {
  272. width: 80rpx;
  273. height: 80rpx;
  274. margin-top: 20rpx;
  275. }
  276. >view:nth-of-type(1) {
  277. font-size: 30rpx;
  278. color: #333333;
  279. line-height: 42rpx;
  280. text-align: left;
  281. margin-top: 10rpx;
  282. }
  283. >view:nth-of-type(2) {
  284. font-size: 24rpx;
  285. color: #666666;
  286. line-height: 34rpx;
  287. text-align: left;
  288. }
  289. position: relative;
  290. &.on {}
  291. }
  292. .line {
  293. width: 2rpx;
  294. height: 40rpx;
  295. background: #D8D8D8;
  296. position: absolute;
  297. top: 40%;
  298. }
  299. .tabTitle_across {
  300. /* width: 50rpx;
  301. height: 4rpx;
  302. background: #0183FA;
  303. border-radius: 2rpx; */
  304. margin-left: 38%;
  305. margin-top: 12rpx;
  306. display none;
  307. >img {
  308. width: 40rpx;
  309. height: 26rpx;
  310. }
  311. &.on {
  312. display block;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. /* 安全信息牌 */
  319. .safetyCard {
  320. margin-top: 190rpx;
  321. .lab-info {
  322. background: #FFFFFF;
  323. .lab-info-t {
  324. width: 750rpx;
  325. height: 80rpx;
  326. border: 2rpx dashed #E0E0E0;
  327. display: flex;
  328. justify-content: flex-start;
  329. align-items: center;
  330. padding: 0 30rpx;
  331. box-sizing: border-box;
  332. >view:nth-of-type(1) {
  333. width: 100rpx;
  334. height: 60rpx;
  335. background: #FF0000;
  336. border-radius: 50rpx 50rpx 50rpx 50rpx;
  337. font-size: 30rpx;
  338. color: #FFFFFF;
  339. line-height: 60rpx;
  340. text-align: center;
  341. }
  342. >view:nth-of-type(2) {
  343. width: 130rpx;
  344. height: 60rpx;
  345. border-radius: 50rpx 50rpx 50rpx 50rpx;
  346. border: 2rpx solid #FF8C00;
  347. font-size: 30rpx;
  348. color: #FF8C00;
  349. line-height: 60rpx;
  350. text-align: center;
  351. margin: 0 30rpx 0 10rpx;
  352. }
  353. >view:nth-of-type(3) {
  354. font-size: 30rpx;
  355. color: #333333;
  356. line-height: 42rpx;
  357. text-align: left;
  358. overflow: hidden;
  359. text-overflow: ellipsis;
  360. white-space: nowrap;
  361. }
  362. }
  363. .lab-info-b {
  364. height: 80rpx;
  365. padding: 0 30rpx;
  366. box-sizing: border-box;
  367. display: flex;
  368. justify-content: flex-start;
  369. align-items: center;
  370. >img {
  371. width: 34rpx;
  372. height: 34rpx;
  373. margin-right: 12rpx;
  374. }
  375. font-size: 30rpx;
  376. color: #333333;
  377. line-height: 42rpx;
  378. text-align: left;
  379. }
  380. }
  381. .liability-unit {
  382. width: 750rpx;
  383. height: 80rpx;
  384. background: #FFFFFF;
  385. border-bottom: 1rpx solid #E0E0E0;
  386. padding: 0 30rpx;
  387. box-sizing: border-box;
  388. display: flex;
  389. justify-content: space-between;
  390. margin-top: 14rpx;
  391. >view:nth-of-type(1) {
  392. font-size: 30rpx;
  393. color: #333333;
  394. line-height: 80rpx;
  395. text-align: left;
  396. }
  397. >view:nth-of-type(2) {
  398. font-size: 30rpx;
  399. color: #666666;
  400. line-height: 80rpx;
  401. text-align: left;
  402. }
  403. }
  404. .small-title {
  405. width: 750rpx;
  406. height: 80rpx;
  407. background: #FFFFFF;
  408. border-bottom: 1rpx solid #E0E0E0;
  409. padding: 0 30rpx;
  410. box-sizing: border-box;
  411. display: flex;
  412. justify-content: space-between;
  413. align-items: center;
  414. >view {
  415. font-size: 30rpx;
  416. color: #333333;
  417. line-height: 80rpx;
  418. text-align: left;
  419. }
  420. >img {
  421. width: 24rpx;
  422. height: 12rpx;
  423. }
  424. }
  425. .sub-head {
  426. width: 750rpx;
  427. height: 80rpx;
  428. background: #fff;
  429. padding: 0 30rpx;
  430. box-sizing: border-box;
  431. display: flex;
  432. justify-content: space-between;
  433. align-items: center;
  434. border-bottom: 1rpx solid #E0E0E0;
  435. >view:nth-of-type(1) {
  436. font-family: PingFang SC;
  437. font-weight: 500;
  438. font-size: 30rpx;
  439. color: #666666;
  440. line-height: 30rpx;
  441. }
  442. >view:nth-of-type(2) {
  443. display: flex;
  444. justify-content: flex-end;
  445. align-items: center;
  446. >img {
  447. width: 34rpx;
  448. height: 34rpx;
  449. margin-right: 14rpx;
  450. }
  451. >view {
  452. font-family: PingFang SC;
  453. font-weight: 500;
  454. font-size: 30rpx;
  455. color: #0183FA;
  456. line-height: 30rpx;
  457. }
  458. }
  459. }
  460. .sub-head:last-child {
  461. border-bottom: none;
  462. }
  463. .classify {
  464. .small-items {
  465. padding-left: 20rpx;
  466. box-sizing: border-box;
  467. background: #fff;
  468. display: flex;
  469. justify-content: flex-start;
  470. padding: 20rpx;
  471. box-sizing: border-box;
  472. >view:nth-of-type(1) {
  473. color: #999999;
  474. margin-right: 12rpx;
  475. }
  476. >view:nth-of-type(2) {
  477. display: block;
  478. font-family: PingFang SC;
  479. font-weight: 500;
  480. font-size: 28rpx;
  481. line-height: 34rpx;
  482. color: #999999;
  483. }
  484. }
  485. .logotype {
  486. width: 750rpx;
  487. height: 100rpx;
  488. font-family: PingFang SC;
  489. font-weight: 500;
  490. font-size: 32rpx;
  491. color: #333333;
  492. line-height: 100rpx;
  493. padding-left: 20rpx;
  494. box-sizing: border-box;
  495. background: #0183FA;
  496. }
  497. .logotype-img {
  498. padding: 26rpx 0 34rpx 0;
  499. box-sizing: border-box;
  500. background: #fff;
  501. >img {
  502. display: inline-block;
  503. width: 86rpx;
  504. height: 114rpx;
  505. margin-left: 30rpx;
  506. margin-bottom: 20rpx;
  507. }
  508. }
  509. }
  510. }
  511. }
  512. </style>