openingNotice.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view>
  3. <uni-popup ref="popup">
  4. <view class="box">
  5. <view class="content">
  6. <view class="title">
  7. <view class="icon">
  8. <image src="./icon/icon.png" mode="scaleToFill"></image>
  9. </view>
  10. <view class="text" v-if="data.title != ''">{{data.title || '通知'}}</view>
  11. <view class="close" @click.stop="maskClick()">
  12. <uni-icons type="closeempty" size="26" color="#ccc"></uni-icons>
  13. </view>
  14. </view>
  15. <scroll-view scroll-y>
  16. <view class="inner">
  17. <view v-html="data.content"></view>
  18. </view>
  19. </scroll-view>
  20. </view>
  21. </view>
  22. </uni-popup>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. name: "openingNotice",
  28. data() {
  29. return {
  30. data: {}
  31. };
  32. },
  33. mounted() {
  34. this.get_notify_getNotifyOne()
  35. },
  36. methods: {
  37. get_notify_getNotifyOne() {
  38. this.$api.notify_getNotifyOne({
  39. }).then((res)=>{
  40. // console.log(res)
  41. if(res.data.code == 0 && res.data.data != null){
  42. this.data = res.data.data
  43. this.$refs.popup.open('top')
  44. setTimeout(()=>{
  45. // this.$refs.popup.close()
  46. },4000)
  47. }else{
  48. // console.log("已读")
  49. }
  50. })
  51. },
  52. maskClick(){
  53. this.$refs.popup.close()
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .box {
  60. height: 100vh;
  61. display: flex;
  62. align-items: center;
  63. }
  64. .content {
  65. z-index: 99;
  66. margin: 0 auto;
  67. width: 700rpx;
  68. background-color: #FFFFFF;
  69. border-radius: 20rpx;
  70. box-sizing: border-box;
  71. padding: 25rpx;
  72. .title {
  73. position: relative;
  74. height: 90rpx;
  75. line-height: 90rpx;
  76. font-size: 38rpx;
  77. font-weight: 700;
  78. text-align: center;
  79. padding-top: 20rpx;
  80. .icon {
  81. position: absolute;
  82. top: -160rpx;
  83. left: 0;
  84. image {
  85. width: 218rpx;
  86. height: 193rpx;
  87. }
  88. }
  89. .text{
  90. border-bottom: 1rpx solid #E1E5E9;
  91. }
  92. .close{
  93. position: absolute;
  94. top: -10rpx;
  95. right: 0;
  96. }
  97. }
  98. .inner {
  99. height: 50vh;
  100. // text-indent: 2rem;
  101. box-sizing: border-box;
  102. padding: 20rpx 0;
  103. }
  104. }
  105. </style>