index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view id="infoBoardHome">
  3. <view class="title-box">{{title}}</view>
  4. <view class="type-button-max-box" v-if="showType">
  5. <view class="check-button" @click="goPage('1')">
  6. <img src="@/static/icon_sys_aqxxp@1x.png">
  7. <view style="color:#00DEDE;">安全信息牌</view>
  8. </view>
  9. <view class="null-border"></view>
  10. <view class="check-button" @click="goPage('2')">
  11. <img src="@/static/icon_sys_jckz@1x.png">
  12. <view>监测控制</view>
  13. </view>
  14. <view class="null-border"></view>
  15. <view class="check-button" @click="goPage('3')">
  16. <img src="@/static/icon_sys_jcjl@1x.png">
  17. <view>进出记录</view>
  18. </view>
  19. </view>
  20. <view class="flex-box-page">
  21. <infoBoard :dataInfo="infoData" v-if="showType"></infoBoard>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. systemConfigInfoGetConfigByType,
  28. laboratoryAppletGetSubDetailNoAuth,
  29. } from '@/api/index.js'
  30. import infoBoard from '@/pages/home/infoBoard.vue'
  31. export default {
  32. name:"infoBoardHome",
  33. components:{
  34. infoBoard
  35. },
  36. data() {
  37. return {
  38. title:'实验室信息牌',
  39. infoData:{},
  40. showType:false,
  41. }
  42. },
  43. onLoad() {
  44. },
  45. onShow(){
  46. let url = window.location.href;
  47. url = url.replace(new RegExp('/', 'g'), '');
  48. url = url.replace(new RegExp('#', 'g'), '');
  49. if(url.indexOf('code') != -1&&url.indexOf('?') != -1){
  50. let codeData = {};
  51. url = url.split("?")[1];
  52. if(url.indexOf('&') == -1){
  53. codeData[url.split("=")[0]] = url.split("=")[1];
  54. }else{
  55. let list = url.split("&");
  56. list.forEach((item) => {
  57. codeData[item.split("=")[0]] = item.split("=")[1];
  58. })
  59. }
  60. this.laboratoryAppletGetSubDetailNoAuth(codeData.code);
  61. }else{
  62. uni.showToast({
  63. title: '二维码无效,请扫描实验室二维码',
  64. icon:'none',
  65. duration: 2000
  66. });
  67. }
  68. },
  69. methods: {
  70. goPage(type){
  71. if(type != '1'){
  72. uni.showToast({
  73. title: '功能暂未开通',
  74. icon:'none',
  75. duration: 2000
  76. });
  77. }
  78. },
  79. //实验室详情
  80. async laboratoryAppletGetSubDetailNoAuth(code) {
  81. let obj = {infoId:code};
  82. const {
  83. data
  84. } = await laboratoryAppletGetSubDetailNoAuth(obj);
  85. if (data.code == 200) {
  86. for(let i=0;i<data.data.labInfoBrandModels.length;i++){
  87. data.data.labInfoBrandModels[i].showType = true;
  88. }
  89. this.$set(this,'infoData',data.data);
  90. this.$set(this,'showType',true);
  91. }
  92. },
  93. }
  94. }
  95. </script>
  96. <style lang="stylus" scoped>
  97. #infoBoardHome {
  98. height: 100%;
  99. display: flex;
  100. flex-direction: column;
  101. overflow: hidden;
  102. .title-box{
  103. height:100rpx;
  104. line-height:100rpx;
  105. text-align: center;
  106. background-color: #0183FA;
  107. color:#fff;
  108. font-size:32rpx;
  109. display block
  110. overflow hidden
  111. text-overflow ellipsis
  112. white-space nowrap
  113. }
  114. .type-button-max-box{
  115. height:180rpx;
  116. display: flex;
  117. .check-button{
  118. flex:1;
  119. img{
  120. display: block;
  121. height:80rpx;
  122. width:80rpx;
  123. margin:16rpx auto 11rpx;
  124. }
  125. view{
  126. font-size:30rpx;
  127. text-align: center;
  128. }
  129. }
  130. .null-border{
  131. height:40rpx;
  132. width:2rpx;
  133. margin-top:74rpx;
  134. background-color:#D8D8D8 ;
  135. }
  136. }
  137. .flex-box-page{
  138. flex:1;
  139. display: flex;
  140. flex-direction: column;
  141. overflow: hidden;
  142. }
  143. }
  144. </style>