index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. // this.systemConfigInfoGetConfigByType();
  47. let url = window.location.href;
  48. if(url.indexOf('infoId') != -1){
  49. let codeData = {};
  50. if(url.indexOf('&') == -1){
  51. let list = url.split("?");
  52. list.forEach((item) => {
  53. codeData[item.split("=")[0]] = item.split("=")[1];
  54. })
  55. }else{
  56. let list = url.split("?")[1].split("&");
  57. list.forEach((item) => {
  58. codeData[item.split("=")[0]] = item.split("=")[1];
  59. })
  60. }
  61. this.laboratoryAppletGetSubDetailNoAuth(codeData.infoId);
  62. }else{
  63. uni.showToast({
  64. title: '二维码无效,请扫描实验室二维码',
  65. icon:'none',
  66. duration: 2000
  67. });
  68. }
  69. },
  70. methods: {
  71. goPage(type){
  72. if(type != '1'){
  73. uni.showToast({
  74. title: '功能暂未开通',
  75. icon:'none',
  76. duration: 2000
  77. });
  78. }
  79. },
  80. //查询公共配置
  81. async systemConfigInfoGetConfigByType(infoId) {
  82. const {
  83. data
  84. } = await systemConfigInfoGetConfigByType({ category: 2, configType: 5 });
  85. if (data.code == 200) {
  86. }
  87. },
  88. //实验室详情
  89. async laboratoryAppletGetSubDetailNoAuth(infoId) {
  90. let obj = {infoId:infoId};
  91. const {
  92. data
  93. } = await laboratoryAppletGetSubDetailNoAuth(obj);
  94. if (data.code == 200) {
  95. for(let i=0;i<data.data.labInfoBrandModels.length;i++){
  96. data.data.labInfoBrandModels[i].showType = true;
  97. }
  98. this.$set(this,'infoData',data.data);
  99. this.$set(this,'showType',true);
  100. }
  101. },
  102. }
  103. }
  104. </script>
  105. <style lang="stylus" scoped>
  106. #infoBoardHome {
  107. height: 100%;
  108. display: flex;
  109. flex-direction: column;
  110. overflow: hidden;
  111. .title-box{
  112. height:100rpx;
  113. line-height:100rpx;
  114. text-align: center;
  115. background-color: #0183FA;
  116. color:#fff;
  117. font-size:32rpx;
  118. display block
  119. overflow hidden
  120. text-overflow ellipsis
  121. white-space nowrap
  122. }
  123. .type-button-max-box{
  124. height:180rpx;
  125. display: flex;
  126. .check-button{
  127. flex:1;
  128. img{
  129. display: block;
  130. height:80rpx;
  131. width:80rpx;
  132. margin:16rpx auto 11rpx;
  133. }
  134. view{
  135. font-size:30rpx;
  136. text-align: center;
  137. }
  138. }
  139. .null-border{
  140. height:40rpx;
  141. width:2rpx;
  142. margin-top:74rpx;
  143. background-color:#D8D8D8 ;
  144. }
  145. }
  146. .flex-box-page{
  147. flex:1;
  148. display: flex;
  149. flex-direction: column;
  150. overflow: hidden;
  151. }
  152. }
  153. </style>