infomation.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="uni-list" >
  3. <view @click="goDetail(item)" class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,index) in newList" :key="index">
  4. <view class="uni-media-list" >
  5. <!-- 左图右文 -->
  6. <image mode="aspectFill" class="uni-media-list-logo-left" :src="item.image"></image>
  7. <view class="uni-media-list-body" style="height: 180rpx;">
  8. <view class="uni-media-list-text-top text-cut-2">{{item.title}}</view>
  9. <view class="text-sm text-cut-2" style="color: #464646;">
  10. <text>{{item.article | formatHtml}}</text>
  11. <!-- <rich-text :nodes="item.article"></rich-text> -->
  12. </view>
  13. <view class="uni-media-list-text-bottom">
  14. <text class="cuIcon-time padding-right-10"></text>
  15. <text>{{item.createTime}}</text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. props:{
  25. newList:{
  26. type:Array,
  27. default:()=>{
  28. return []
  29. }
  30. }
  31. },
  32. filters: {
  33. formatHtml (str) {
  34. return str.replace(/<[^>]+>/g, "");
  35. }
  36. },
  37. data() {
  38. return {
  39. };
  40. },
  41. onLoad() {
  42. },
  43. methods:{
  44. goDetail(item){
  45. getApp().globalData.newsDetail=item
  46. uni.navigateTo({
  47. url:"/pages/news/detail?id="+item.id
  48. })
  49. },
  50. }
  51. };
  52. </script>
  53. <style lang="scss">
  54. .uni-list {
  55. background-color: #FFFFFF;
  56. position: relative;
  57. width: 100%;
  58. display: flex;
  59. flex-direction: column;
  60. }
  61. .uni-list:after {
  62. position: absolute;
  63. z-index: 10;
  64. right: 0;
  65. bottom: 0;
  66. left: 0;
  67. height: 1px;
  68. content: '';
  69. -webkit-transform: scaleY(.5);
  70. transform: scaleY(.5);
  71. // background-color: #c8c7cc;
  72. }
  73. .uni-list::before {
  74. position: absolute;
  75. z-index: 10;
  76. right: 0;
  77. top: 0;
  78. left: 0;
  79. height: 1px;
  80. content: '';
  81. -webkit-transform: scaleY(.5);
  82. transform: scaleY(.5);
  83. }
  84. .uni-list-cell {
  85. position: relative;
  86. display: flex;
  87. flex-direction: row;
  88. justify-content: space-between;
  89. align-items: center;
  90. }
  91. .uni-list-cell-hover {
  92. background-color: #eee;
  93. }
  94. .uni-list-cell::after {
  95. position: absolute;
  96. z-index: 3;
  97. right: 0;
  98. bottom: 0;
  99. left: 30upx;
  100. height: 1px;
  101. content: '';
  102. -webkit-transform: scaleY(.5);
  103. transform: scaleY(.5);
  104. background-color: #c8c7cc;
  105. }
  106. .uni-list .uni-list-cell:last-child::after {
  107. height: 0upx;
  108. }
  109. /* 图文列表 */
  110. .uni-media-list {
  111. padding: 22upx 20upx;
  112. box-sizing: border-box;
  113. display: flex;
  114. width: 100%;
  115. flex-direction: row;
  116. }
  117. .uni-navigate-right.uni-media-list {
  118. padding-right: 74upx;
  119. }
  120. .uni-media-list-text-bottom {
  121. line-height: 30upx;
  122. font-size: 26upx;
  123. color: #8f8f94;
  124. }
  125. .uni-media-list-logo-left {
  126. border-radius: 10rpx;
  127. width: 230upx;
  128. height: 180upx;
  129. margin-right: 20upx
  130. }
  131. .uni-media-list-logo-right {
  132. width: 180upx;
  133. height: 140upx;
  134. margin-left: 20upx
  135. }
  136. .uni-media-list-body {
  137. display: flex;
  138. flex: 1;
  139. flex-direction: column;
  140. justify-content: space-between;
  141. align-items: flex-start;
  142. overflow: hidden;
  143. height: auto;
  144. }
  145. .uni-media-list-text-top {
  146. width: 100%;
  147. line-height: 36upx;
  148. height: 50upx;
  149. font-size: 26upx;
  150. font-weight: 800;
  151. overflow: hidden;
  152. }
  153. .uni-media-list-text-bottom {
  154. display: flex;
  155. flex-direction: row;
  156. justify-content: space-between;
  157. }
  158. </style>