notice.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view>
  3. <view class="notice-item" v-for="(item, index) in noticeData" :key="index">
  4. <text class="time">{{item.createTime}}</text>
  5. <view class="content">
  6. <text class="title">{{ item.noticeTitle }}</text>
  7. <view class="img-wrapper">
  8. <image class="pic" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556465765776&di=57bb5ff70dc4f67dcdb856e5d123c9e7&imgtype=0&src=http%3A%2F%2Fimg.zcool.cn%2Fcommunity%2F01fd015aa4d95fa801206d96069229.jpg%401280w_1l_2o_100sh.jpg"></image>
  9. <view class="cover">
  10. 重要通知
  11. </view>
  12. </view>
  13. <text class="introduce">{{ item.noticeContent }}</text>
  14. <view class="bot b-t">
  15. <text>查看详情</text>
  16. <text class="more-icon yticon icon-you"></text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. noticeData: []
  27. }
  28. },
  29. onLoad() {
  30. this.noticeList()
  31. },
  32. methods: {
  33. noticeList(){
  34. const that = this
  35. that.$api.request('get', 'notice/app/list', null, failres => {
  36. that.$api.msg(failres.msg)
  37. }).then(res => {
  38. this.noticeData = res.data;
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang='scss'>
  45. page {
  46. background-color: #f7f7f7;
  47. padding-bottom: 30upx;
  48. }
  49. .notice-item {
  50. display: flex;
  51. flex-direction: column;
  52. align-items: center;
  53. }
  54. .time {
  55. display: flex;
  56. align-items: center;
  57. justify-content: center;
  58. height: 80upx;
  59. padding-top: 10upx;
  60. font-size: 26upx;
  61. color: #7d7d7d;
  62. }
  63. .content {
  64. width: 710upx;
  65. padding: 0 24upx;
  66. background-color: #fff;
  67. border-radius: 4upx;
  68. }
  69. .title {
  70. display: flex;
  71. align-items: center;
  72. height: 90upx;
  73. font-size: 32upx;
  74. color: #303133;
  75. }
  76. .img-wrapper {
  77. width: 100%;
  78. height: 260upx;
  79. position: relative;
  80. }
  81. .pic {
  82. display: block;
  83. width: 100%;
  84. height: 100%;
  85. border-radius: 6upx;
  86. }
  87. .cover {
  88. display: flex;
  89. justify-content: center;
  90. align-items: center;
  91. position: absolute;
  92. left: 0;
  93. top: 0;
  94. width: 100%;
  95. height: 100%;
  96. background-color: rgba(0, 0, 0, .5);
  97. font-size: 36upx;
  98. color: #fff;
  99. }
  100. .introduce {
  101. display: inline-block;
  102. padding: 16upx 0;
  103. font-size: 28upx;
  104. color: #606266;
  105. line-height: 38upx;
  106. }
  107. .bot {
  108. display: flex;
  109. align-items: center;
  110. justify-content: space-between;
  111. height: 80upx;
  112. font-size: 24upx;
  113. color: #707070;
  114. position: relative;
  115. }
  116. .more-icon {
  117. font-size: 32upx;
  118. }
  119. </style>