newsList.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <view>
  3. <u-navbar title="消息"></u-navbar>
  4. <view class="newsList">
  5. <template v-for="(item,i) in result">
  6. <view class="newsList-time" :key="i">
  7. <span>{{item.createTime}}</span>
  8. </view>
  9. <view class="newsList-item" @click="item.isRead=true,gotoUrl('pages/hr/newsIndex/newsEntry/newsEntry?id='+item.id)">
  10. <view class="newsList-head">
  11. <h3 class="u-line-1">{{item.title}}</h3>
  12. <span :style="item.isRead?'color:#0ebd5f':''" >[{{item.isRead?'已读':'未读'}}]</span>
  13. </view>
  14. <view class="newsList-main" v-html="item.content">
  15. </view>
  16. <view class="newsList-foot">
  17. <span>查看详情</span>
  18. <u-icon name="arrow-right" color="#999" size="24"></u-icon>
  19. </view>
  20. </view>
  21. </template>
  22. <u-loadmore @loadmore="myLoadmore" :status="result.length<recordsTotal?'loadmore':'nomore'"></u-loadmore>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import api from './index.js'
  28. export default api;
  29. </script>
  30. <style>
  31. page {
  32. background-color: #F7F7F7;
  33. }
  34. </style>
  35. <style scoped lang="scss">
  36. .newsList-time {
  37. display: flex;
  38. justify-content: center;
  39. margin-top: 40rpx;
  40. span {
  41. background-color: #c8c8c8;
  42. padding: 6rpx 16rpx;
  43. color: #fff;
  44. border-radius: 10rpx;
  45. }
  46. }
  47. .newsList-item {
  48. padding: 20rpx;
  49. margin: 20rpx;
  50. background-color: #fff;
  51. border-radius: 20rpx;
  52. .newsList-head {
  53. display: flex;
  54. justify-content: space-between;
  55. padding-bottom: 20rpx;
  56. span {
  57. color: #FF6D58;
  58. min-width: 80rpx;
  59. text-align: right;
  60. }
  61. }
  62. .newsList-main {
  63. padding-bottom: 20rpx;
  64. color: #999;
  65. height: 70px;
  66. overflow: hidden;
  67. }
  68. .newsList-foot {
  69. padding-top: 20rpx;
  70. border-top: 1px solid #f7f7f7;
  71. display: flex;
  72. justify-content: space-between;
  73. }
  74. }
  75. </style>