index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <view class="informantion_mask">
  3. <view class="informantion_content" @tap.stop.prevent>
  4. <view class="informantion-title">
  5. <p class="informantion-title-p">公告</p>
  6. <span class="informantion-title-span">{{message}}</span>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script setup>
  12. import {
  13. normalizeProps,
  14. reactive,
  15. onMounted,
  16. ref,
  17. getCurrentInstance
  18. } from 'vue'
  19. import {
  20. onLoad,
  21. onReady,
  22. onUnload,
  23. onShow,
  24. onReachBottom
  25. } from '@dcloudio/uni-app'
  26. import {
  27. store
  28. } from '@/store/index.js'
  29. const message = ref('')
  30. onMounted(() => {
  31. uni.hideLoading();
  32. const instance = getCurrentInstance().proxy
  33. const eventChannel = instance.getOpenerEventChannel();
  34. eventChannel.on('notification', function(data) {
  35. console.log('notification', data)
  36. if (data && data.data) {
  37. message.value = data.data.content;
  38. }
  39. })
  40. })
  41. </script>
  42. <style lang="scss">
  43. page {
  44. width: 100%;
  45. height: 100%;
  46. background: rgba(0, 0, 0, 0.4);
  47. }
  48. .informantion_mask {
  49. width: 100%;
  50. height: 100%;
  51. display: flex;
  52. flex-direction: row;
  53. justify-content: center;
  54. align-items: center;
  55. }
  56. .informantion_content {
  57. width: 600rpx;
  58. height: 820rpx;
  59. overflow: hidden;
  60. border-radius: 10rpx;
  61. background-color: white;
  62. display: flex;
  63. flex-direction: column;
  64. justify-content: space-between;
  65. padding-bottom: 20rpx;
  66. }
  67. .mask-header {
  68. height: 400rpx;
  69. position: relative;
  70. background-image: url('../../static/images/bj.png');
  71. background-repeat: no-repeat;
  72. background-size: cover;
  73. image {
  74. width: 40rpx;
  75. height: 40rpx;
  76. position: absolute;
  77. top: 20rpx;
  78. right: 20rpx;
  79. }
  80. }
  81. .informantion-title {
  82. text-align: center;
  83. padding: 0 40rpx;
  84. p {
  85. font-size: 35rpx;
  86. font-weight: bold;
  87. line-height: 80rpx;
  88. }
  89. span {
  90. color: #6C6C6C;
  91. }
  92. }
  93. .informantion-btn {
  94. height: 93rpx;
  95. width: 80%;
  96. margin: 0 auto;
  97. }
  98. </style>