index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div class="propertyNotice">
  3. <ul class="noticeUl">
  4. <li class="noticeLi" v-for="item in noticeList" @tap="toDetail(item)">
  5. <img :src="item.isRead?unReadImg:readImg" class="leftImg"/>
  6. <div class="rightBox">
  7. <span class="noticeTitle">{{item.title}}</span>
  8. <span class="noticeTimeBox">
  9. <span class="noticeTime">2024-06-18 19:34:06</span>
  10. <van-icon name="like" :class="item.isLike?'likeIcon':'unLikeIcon'" @tap.stop="clickLike(item)"/>
  11. </span>
  12. </div>
  13. </li>
  14. </ul>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: "index",
  20. data(){
  21. return {
  22. unReadImg:'https://www.idea-co-sf.com/gardenProduct/image/xiaoxi01.png',
  23. readImg:'https://www.idea-co-sf.com/gardenProduct/image/xiaoxi02.png',
  24. noticeList:[
  25. { title:'XXXXX南门出口道闸维修的通知', isRead:false, isLike:true },
  26. { title:'XXXXXXXX停电的紧急通知', isRead:true, isLike:false },
  27. { title:'XXXXX南门出口道闸维修的通知', isRead:false, isLike:true },
  28. { title:'关于强降雨天气防范措的通知', isRead:true, isLike:true },
  29. { title:'关于无端午节禁止施工的温馨提示', isRead:false, isLike:false },
  30. { title:'关于园区枇杷消杀禁止采摘的通知', isRead:false, isLike:true },
  31. { title:'关于开展爱邻活动的通知', isRead:true, isLike:false },
  32. ]
  33. }
  34. },
  35. methods:{
  36. toDetail(item){
  37. uni.navigateTo({
  38. url: "/pages/subPackages/propertyNotice/detail?type=" + JSON.stringify(item),
  39. });
  40. },
  41. clickLike(item){
  42. item.isLike = !item.isLike
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .propertyNotice{
  49. .noticeUl{
  50. display: flex;
  51. flex-direction: column;
  52. align-items: center;
  53. .noticeLi{
  54. margin-top: 24rpx;
  55. width: 686rpx;
  56. height: 162rpx;
  57. border-radius: 16rpx;
  58. display: flex;
  59. align-items: center;
  60. background: rgba(255, 255, 255, 1);
  61. padding: 0 32rpx;
  62. box-sizing: border-box;
  63. .leftImg{
  64. width: 80rpx;
  65. height: 80rpx;
  66. }
  67. .rightBox{
  68. display: flex;
  69. flex-direction: column;
  70. margin-left: 16rpx;
  71. .noticeTitle{
  72. color: rgba(34, 34, 34, 1);
  73. font-size: 32rpx;
  74. }
  75. .noticeTimeBox{
  76. font-size: 32rpx;
  77. margin-top: 12rpx;
  78. display: flex;
  79. justify-content: space-between;
  80. width: 526rpx;
  81. .noticeTime{
  82. color: rgba(136, 136, 136, 1);
  83. font-size: 28rpx;
  84. }
  85. .likeIcon{
  86. color: red;
  87. }
  88. .unLikeIcon{
  89. color: rgba(230, 235, 241, 1);
  90. }
  91. }
  92. }
  93. }
  94. }
  95. }
  96. </style>