infoPage.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. uni.navigateTo({
  116. url: '/pages_manage/views/laboratory/videoPlayer?item='+encodeURIComponent(JSON.stringify(this.newData))
  117. });
  118. },
  119. getIotControlData(){
  120. this.$refs['iotControl'].iotAppHardwareFindByType();
  121. },
  122. tabFun(index) {
  123. this.$set(this, 'currentIndex', index);
  124. if (index == 0) {
  125. //物联控制
  126. this.$set(this, 'pageType', 2);
  127. } else if (index == 1) {
  128. //安全信息牌
  129. this.$set(this, 'pageType', 3);
  130. } else if (index == 2) {
  131. //进出记录
  132. this.$set(this, 'pageType', 4);
  133. }
  134. },
  135. buttonClick(type, row) {
  136. let self = this;
  137. if (type == 'subDetail') {
  138. //实验室详情
  139. } else if (type == 'broadcastOpen') {
  140. //语音弹窗开启
  141. this.$set(this, 'broadcastPage', true);
  142. } else if (type == 'broadcastClose') {
  143. //语音弹窗关闭
  144. this.$set(this, 'broadcastPage', false);
  145. } else if (type == 'conditioningOpen') {
  146. //空调弹窗开启
  147. this.$set(this, 'airConditioningData', row);
  148. this.$set(this, 'conditioningPage', true);
  149. } else if (type == 'conditioningClose') {
  150. //空调弹窗关闭
  151. this.$set(this, 'conditioningPage', false);
  152. } else if (type == 'back') {
  153. this.$set(this, 'pageType', 2);
  154. }
  155. },
  156. },
  157. }
  158. </script>
  159. <style lang="stylus" scoped>
  160. .infoPage {
  161. height: 100%;
  162. display flex;
  163. flex-direction column;
  164. .title {
  165. height: auto;
  166. background: #FFFFFF;
  167. padding: 0 20rpx;
  168. box-sizing: border-box;
  169. .title-t {
  170. display: flex;
  171. justify-content: flex-start;
  172. align-items: center;
  173. padding: 28rpx 0 20rpx 0;
  174. box-sizing: border-box;
  175. >view:nth-of-type(1) {
  176. background: #fff;
  177. margin-right: 20rpx;
  178. border-radius: 8px;
  179. padding: 6rpx 16rpx;
  180. box-sizing: border-box;
  181. }
  182. >view:nth-of-type(2) {
  183. font-family: PingFang SC;
  184. font-weight: 500;
  185. font-size: 30rpx;
  186. color: #333333;
  187. line-height: 36rpx;
  188. }
  189. }
  190. .title-m {
  191. display: flex;
  192. justify-content: flex-start;
  193. flex-wrap: wrap;
  194. >view {
  195. display: inline-block;
  196. font-family: PingFang SC;
  197. font-weight: 500;
  198. font-size: 24rpx;
  199. color: #0183FA;
  200. background: rgba(1, 131, 250, 0.2);
  201. border-radius: 18rpx;
  202. padding: 6rpx 12rpx;
  203. box-sizing: border-box;
  204. margin-right: 12rpx;
  205. margin-bottom: 20rpx;
  206. }
  207. }
  208. .title-m1 {
  209. display: flex;
  210. justify-content: flex-start;
  211. margin: 0rpx 0 20rpx 0;
  212. >img {
  213. width: 30rpx;
  214. height: 27rpx;
  215. margin-right: 12rpx;
  216. }
  217. >view {
  218. font-family: PingFang SC;
  219. font-weight: 500;
  220. font-size: 26rpx;
  221. color: #666666;
  222. line-height: 30rpx;
  223. }
  224. }
  225. .title-b {
  226. display: flex;
  227. justify-content: flex-start;
  228. margin-bottom: 22rpx;
  229. >img {
  230. width: 30rpx;
  231. height: 27rpx;
  232. margin-right: 12rpx;
  233. }
  234. >view {
  235. font-family: PingFang SC;
  236. font-weight: 500;
  237. font-size: 26rpx;
  238. color: #666666;
  239. line-height: 30rpx;
  240. }
  241. }
  242. }
  243. .tab-btn {
  244. width: 750rpx;
  245. height: 80rpx;
  246. border: 1px solid #E0E0E0;
  247. background: #fff;
  248. display: flex;
  249. justify-content: flex-start;
  250. margin-top: 20rpx;
  251. >view {
  252. width: 250rpx;
  253. height: 80rpx;
  254. font-family: PingFang SC;
  255. font-weight: 500;
  256. font-size: 32rpx;
  257. color: #222222;
  258. line-height: 80rpx;
  259. text-align: center;
  260. border-right: 1px solid #E0E0E0;
  261. }
  262. .color-B {
  263. width: 250rpx;
  264. height: 80rpx;
  265. font-family: PingFang SC;
  266. font-weight: 500;
  267. font-size: 32rpx;
  268. color: #FFFFFF;
  269. line-height: 80rpx;
  270. text-align: center;
  271. background: #0183FA;
  272. }
  273. }
  274. }
  275. </style>