noticeList.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view class="notice-list">
  3. <image src="/static/icon/pagebj.png" mode="" class="listbj"></image>
  4. <view class="align-items" style="padding: 42rpx 0 0 0;">
  5. <back></back>
  6. <view class="title-text">
  7. 公告列表
  8. </view>
  9. </view>
  10. <view class="notice" v-for="(item,index) in list" :key="index" >
  11. <view>
  12. <view class="justify-content">
  13. <view class="font-forty">
  14. {{item.title}}
  15. </view>
  16. <view class="font-twenty-eight gray">
  17. {{item.time}}
  18. </view>
  19. </view>
  20. <view class="font-thirty-two black" style="margin: 30rpx 0;">
  21. <rich-text :nodes="item.text"></rich-text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import service from '@/api/index.js'
  29. export default {
  30. data() {
  31. return {
  32. list: []
  33. }
  34. },
  35. onLoad() {
  36. this.lists()
  37. },
  38. methods: {
  39. toDetail(url){
  40. console.log(url)
  41. uni.navigateTo({
  42. url
  43. })
  44. },
  45. lists(){
  46. service.getNoticeList().then(res=>{
  47. // console.log('getNoticeList',res)
  48. this.list = res
  49. })
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .notice-list{
  56. position: relative;
  57. }
  58. .notice {
  59. margin: 30rpx 20rpx;
  60. padding: 20rpx;
  61. background: #FFFFFF;
  62. box-shadow: 0rpx 0rpx 14rpx #ccc;
  63. border-radius: 10rpx;
  64. }
  65. .listbj{
  66. position: absolute;
  67. width: 100%;
  68. height: 400rpx;
  69. z-index: -1;
  70. }
  71. .text {
  72. border-left: 15rpx solid #3857F3;
  73. padding-left: 20rpx;
  74. }
  75. .title-text{
  76. font-size: 38rpx;
  77. color: #fff;
  78. margin: 0 0 0 186rpx;
  79. }
  80. .back-icon.data-v-026711bc {
  81. background-color:transparent;
  82. }
  83. .font-forty{
  84. font-size: 36rpx;
  85. }
  86. .font-twenty-eight{
  87. font-size: 32rpx;
  88. }
  89. </style>