infoPage.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. <!-- 实验室详情 -->
  2. <template>
  3. <view class="infoPage">
  4. <view class="title">
  5. <view class="title-t">
  6. <view :style="'border:1rpx solid '+newData.levelColor+';color:'+newData.levelColor+';'">
  7. {{newData.levelName?newData.levelName:''}}
  8. </view>
  9. <view>{{newData.subName}}</view>
  10. </view>
  11. <view class="title-m">
  12. <view v-for="(item,index) in newData.labClassTypeList" :key="index">{{item.typeName}}</view>
  13. </view>
  14. <view class="title-m1">
  15. <img src="@/pages_manage/images/icon_xq_xy.png">
  16. <view>{{newData.deptName}}</view>
  17. </view>
  18. <view class="title-b">
  19. <img src="@/pages_manage/images/icon_14.png">
  20. <view>{{newData.buildName}}{{newData.floorName}}{{newData.subName}}{{ newData.roomNum?newData.roomNum:''}}</view>
  21. </view>
  22. </view>
  23. <view class="tab-btn">
  24. <view :class="currentIndex==0?'color-B':''" @click="tabFun(0)" v-if="!saoCodeType">物联控制</view>
  25. <view :class="currentIndex==1?'color-B':''" @click="tabFun(1)">安全信息牌</view>
  26. <view :class="currentIndex==2?'color-B':''" @click="tabFun(2)" v-if="!saoCodeType">进出记录</view>
  27. <!-- <view :class="currentIndex==index?'color-B':''" v-for="(item,index) in tabData" :key="index"
  28. @click="tabFun(index)">{{item}}</view> -->
  29. </view>
  30. <!-- 物联控制 -->
  31. <iotControl ref="iotControl" v-if="pageType == 2" :subjectData="subjectData"></iotControl>
  32. <!-- 安全信息牌 -->
  33. <safetyCard v-if="pageType == 3" :subjectData="subjectData"></safetyCard>
  34. <!-- 进出记录 -->
  35. <accessRecord v-if="pageType == 4" :subjectData="subjectData"></accessRecord>
  36. <!-- 语音广播弹窗 -->
  37. <voiceBroadcast v-if="broadcastPage" :subjectData="subjectData"></voiceBroadcast>
  38. <!-- 空调弹窗 -->
  39. <airConditioning v-if="conditioningPage" :airConditioningData="airConditioningData"></airConditioning>
  40. </view>
  41. </template>
  42. <script>
  43. import {
  44. iotControl
  45. } from '@/pages_manage/views/laboratory/iotControl.vue'
  46. import {
  47. safetyCard
  48. } from '@/pages_manage/views/laboratory/safetyCard.vue'
  49. import {
  50. accessRecord
  51. } from '@/pages_manage/views/laboratory/accessRecord.vue'
  52. import {
  53. voiceBroadcast
  54. } from '@/pages_manage/views/laboratory/voiceBroadcast.vue'
  55. import {
  56. airConditioning
  57. } from '@/pages_manage/views/laboratory/airConditioning.vue'
  58. export default {
  59. name: 'infoPage',
  60. components: {
  61. iotControl,
  62. safetyCard,
  63. accessRecord,
  64. voiceBroadcast,
  65. airConditioning,
  66. },
  67. data() {
  68. return {
  69. newData: {},
  70. tabData: ['物联控制', '安全信息牌', '进出记录'],
  71. currentIndex: 0,
  72. pageType: 0,
  73. //语音广播弹窗
  74. broadcastPage: false,
  75. //空调弹窗
  76. conditioningPage: false,
  77. // 查询参数
  78. queryParams: {
  79. page: 1,
  80. pageSize: 20,
  81. },
  82. subjectData: null,
  83. // 空调弹窗
  84. airConditioningData: null,
  85. saoCodeType:false,
  86. }
  87. },
  88. // 父页面
  89. onReachBottom() {
  90. uni.$emit('onReachBottom') // 设置监听事件
  91. },
  92. onPullDownRefresh() {
  93. uni.$emit('onPullDownRefresh') // 设置监听事件
  94. },
  95. onLoad(option) {
  96. this.$set(this, 'newData', JSON.parse(decodeURIComponent(option.infoData)));
  97. this.$set(this, 'subjectData', JSON.parse(decodeURIComponent(option.infoData)));
  98. if(option.saoCode){
  99. this.$set(this,'saoCodeType',true);
  100. this.$set(this,'currentIndex',1);
  101. this.$set(this,'pageType',3);
  102. }else{
  103. this.$set(this,'saoCodeType',false);
  104. this.$set(this,'currentIndex',0);
  105. this.$set(this,'pageType',2);
  106. }
  107. },
  108. created() {
  109. },
  110. mounted() {
  111. },
  112. methods: {
  113. goVideoPage(){
  114. console.log('视频')
  115. let obj = {
  116. type:4,
  117. subId:this.newData.subId
  118. }
  119. uni.navigateTo({
  120. url: '/pages_manage/views/laboratory/videoPlayer?item='+encodeURIComponent(JSON.stringify(obj))
  121. });
  122. },
  123. getIotControlData(){
  124. this.$refs['iotControl'].iotAppHardwareFindByType();
  125. },
  126. tabFun(index) {
  127. this.$set(this, 'currentIndex', index);
  128. if (index == 0) {
  129. //物联控制
  130. this.$set(this, 'pageType', 2);
  131. } else if (index == 1) {
  132. //安全信息牌
  133. this.$set(this, 'pageType', 3);
  134. } else if (index == 2) {
  135. //进出记录
  136. this.$set(this, 'pageType', 4);
  137. }
  138. },
  139. buttonClick(type, row) {
  140. let self = this;
  141. if (type == 'subDetail') {
  142. //实验室详情
  143. } else if (type == 'broadcastOpen') {
  144. //语音弹窗开启
  145. this.$set(this, 'broadcastPage', true);
  146. } else if (type == 'broadcastClose') {
  147. //语音弹窗关闭
  148. this.$set(this, 'broadcastPage', false);
  149. } else if (type == 'conditioningOpen') {
  150. //空调弹窗开启
  151. this.$set(this, 'airConditioningData', row);
  152. this.$set(this, 'conditioningPage', true);
  153. } else if (type == 'conditioningClose') {
  154. //空调弹窗关闭
  155. this.$set(this, 'conditioningPage', false);
  156. } else if (type == 'back') {
  157. this.$set(this, 'pageType', 2);
  158. }
  159. },
  160. },
  161. }
  162. </script>
  163. <style lang="stylus" scoped>
  164. .infoPage {
  165. height: 100%;
  166. display flex;
  167. flex-direction column;
  168. .title {
  169. height: auto;
  170. background: #FFFFFF;
  171. padding: 0 20rpx;
  172. box-sizing: border-box;
  173. .title-t {
  174. display: flex;
  175. justify-content: flex-start;
  176. align-items: center;
  177. padding: 28rpx 0 20rpx 0;
  178. box-sizing: border-box;
  179. >view:nth-of-type(1) {
  180. background: #fff;
  181. margin-right: 20rpx;
  182. border-radius: 8px;
  183. padding: 6rpx 16rpx;
  184. box-sizing: border-box;
  185. }
  186. >view:nth-of-type(2) {
  187. font-family: PingFang SC;
  188. font-weight: 500;
  189. font-size: 30rpx;
  190. color: #333333;
  191. line-height: 36rpx;
  192. }
  193. }
  194. .title-m {
  195. display: flex;
  196. justify-content: flex-start;
  197. flex-wrap: wrap;
  198. >view {
  199. display: inline-block;
  200. font-family: PingFang SC;
  201. font-weight: 500;
  202. font-size: 24rpx;
  203. color: #0183FA;
  204. background: rgba(1, 131, 250, 0.2);
  205. border-radius: 18rpx;
  206. padding: 6rpx 12rpx;
  207. box-sizing: border-box;
  208. margin-right: 12rpx;
  209. margin-bottom: 20rpx;
  210. }
  211. }
  212. .title-m1 {
  213. display: flex;
  214. justify-content: flex-start;
  215. margin: 0rpx 0 20rpx 0;
  216. >img {
  217. width: 30rpx;
  218. height: 27rpx;
  219. margin-right: 12rpx;
  220. }
  221. >view {
  222. font-family: PingFang SC;
  223. font-weight: 500;
  224. font-size: 26rpx;
  225. color: #666666;
  226. line-height: 30rpx;
  227. }
  228. }
  229. .title-b {
  230. display: flex;
  231. justify-content: flex-start;
  232. margin-bottom: 22rpx;
  233. >img {
  234. width: 30rpx;
  235. height: 27rpx;
  236. margin-right: 12rpx;
  237. }
  238. >view {
  239. font-family: PingFang SC;
  240. font-weight: 500;
  241. font-size: 26rpx;
  242. color: #666666;
  243. line-height: 30rpx;
  244. }
  245. }
  246. }
  247. .tab-btn {
  248. width: 750rpx;
  249. height: 80rpx;
  250. border: 1px solid #E0E0E0;
  251. background: #fff;
  252. display: flex;
  253. justify-content: flex-start;
  254. margin-top: 20rpx;
  255. >view {
  256. width: 250rpx;
  257. height: 80rpx;
  258. font-family: PingFang SC;
  259. font-weight: 500;
  260. font-size: 32rpx;
  261. color: #222222;
  262. line-height: 80rpx;
  263. text-align: center;
  264. border-right: 1px solid #E0E0E0;
  265. }
  266. .color-B {
  267. width: 250rpx;
  268. height: 80rpx;
  269. font-family: PingFang SC;
  270. font-weight: 500;
  271. font-size: 32rpx;
  272. color: #FFFFFF;
  273. line-height: 80rpx;
  274. text-align: center;
  275. background: #0183FA;
  276. }
  277. }
  278. }
  279. </style>