noticeList.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. uni.setNavigationBarTitle({
  38. title: '公告列表',
  39. });
  40. uni.setNavigationBarColor({
  41. frontColor: '#ffffff',
  42. backgroundColor: '#2d95f4',
  43. })
  44. },
  45. methods: {
  46. toDetail(url){
  47. console.log(url)
  48. uni.navigateTo({
  49. url
  50. })
  51. },
  52. lists(){
  53. service.getNoticeList().then(res=>{
  54. // console.log('getNoticeList',res)
  55. this.list = res
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .notice-list{
  63. position: relative;
  64. }
  65. .notice {
  66. margin: 30rpx 20rpx;
  67. padding: 20rpx;
  68. background: #FFFFFF;
  69. box-shadow: 0rpx 0rpx 14rpx #ccc;
  70. border-radius: 10rpx;
  71. }
  72. .listbj{
  73. position: absolute;
  74. width: 100%;
  75. height: 400rpx;
  76. z-index: -1;
  77. }
  78. .text {
  79. border-left: 15rpx solid #3857F3;
  80. padding-left: 20rpx;
  81. }
  82. .title-text{
  83. font-size: 38rpx;
  84. color: #fff;
  85. margin: 0 0 0 186rpx;
  86. }
  87. .back-icon.data-v-026711bc {
  88. background-color:transparent;
  89. }
  90. .font-forty{
  91. font-size: 36rpx;
  92. }
  93. .font-twenty-eight{
  94. font-size: 32rpx;
  95. }
  96. </style>