index.vue 1.9 KB

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