index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. const instance = getCurrentInstance().proxy
  32. const eventChannel = instance.getOpenerEventChannel();
  33. eventChannel.on('notification', function(data) {
  34. console.log('notification', data)
  35. if (data && data.data) {
  36. message.value = data.data.content;
  37. }
  38. })
  39. })
  40. </script>
  41. <style lang="scss">
  42. page {
  43. width: 100%;
  44. height: 100%;
  45. background: rgba(0, 0, 0, 0.4);
  46. }
  47. .informantion_mask {
  48. width: 100%;
  49. height: 100%;
  50. display: flex;
  51. flex-direction: row;
  52. justify-content: center;
  53. align-items: center;
  54. }
  55. .informantion_content {
  56. width: 600rpx;
  57. height: 820rpx;
  58. overflow: hidden;
  59. border-radius: 10rpx;
  60. background-color: white;
  61. display: flex;
  62. flex-direction: column;
  63. justify-content: space-between;
  64. padding-bottom: 20rpx;
  65. }
  66. .mask-header {
  67. height: 400rpx;
  68. position: relative;
  69. background-image: url('../../static/images/bj.png');
  70. background-repeat: no-repeat;
  71. background-size: cover;
  72. image {
  73. width: 40rpx;
  74. height: 40rpx;
  75. position: absolute;
  76. top: 20rpx;
  77. right: 20rpx;
  78. }
  79. }
  80. .informantion-title {
  81. text-align: center;
  82. padding: 0 40rpx;
  83. p {
  84. font-size: 35rpx;
  85. font-weight: bold;
  86. line-height: 80rpx;
  87. }
  88. span {
  89. color: #6C6C6C;
  90. }
  91. }
  92. .informantion-btn {
  93. height: 93rpx;
  94. width: 80%;
  95. margin: 0 auto;
  96. }
  97. </style>