news.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view>
  3. <view class="uni-list" >
  4. <view @click="goDetail(item.id)" class="uni-list-cell" hover-class="uni-list-cell-hover" v-for="(item,index) in newList" :key="index">
  5. <view class="uni-media-list" >
  6. <!-- 左图右文 -->
  7. <image mode="aspectFill" class="uni-media-list-logo-left" :src="item.image"></image>
  8. <view class="uni-media-list-body" style="height: 180rpx;">
  9. <view class="uni-media-list-text-top text-cut-2">{{item.title}}</view>
  10. <view class="text-cut-2 text-sm" style="color: #666666;">
  11. <text>{{item.subTitle}}</text>
  12. </view>
  13. <view class="uni-media-list-text-bottom">
  14. <text>{{item.time}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. newList:[]
  27. }
  28. },
  29. onLoad() {
  30. this.fetchStaticData()
  31. },
  32. methods: {
  33. goDetail(id){
  34. uni.navigateTo({
  35. url:"/pages/news/detail?id=125487446112543"
  36. })
  37. },
  38. fetchStaticData(){
  39. this.newList=[
  40. {
  41. title:'银川综保区举行重大项目签约首发仪式',
  42. subTitle:'原标题:推进新通道建设扩大对外开放——银川综保区举行重大项目签约暨“一带一路”国际卡车班列首发仪式',
  43. time:'2020-11-15 18:51:56',
  44. image:'http://139.9.103.171:1888/miniofile/xlyq/news.jpg'
  45. },
  46. {
  47. title:'为新产业新业态发展提供一片沃土',
  48. subTitle:'原标题:为新产业新业态发展提供一片沃土,为避免产业发展不好人才少,人才不够制约产业发展的恶性循环发生,我们更应该营造良好的创新环境,为新产业新业态发展提供一片沃土,为新职业创造更多的就业空间。',
  49. time:'2020-11-15 18:51:56',
  50. image:'http://139.9.103.171:1888/miniofile/xlyq/news1.jpg'
  51. },
  52. {
  53. title:'银川育新机开新局推动工业高质量发展',
  54. subTitle:'原标题:银川育新机开新局推动工业高质量发展坚持不懈推动高质量发展,加快转变经济发展方式,加快产业转型升级,加快新旧动能转换,推动经济发展实现量的合理增长和',
  55. time:'2020-11-15 18:51:56',
  56. image:'http://139.9.103.171:1888/miniofile/xlyq/news2.jpg'
  57. },
  58. {
  59. title:'宁夏银川入选全国营商环境标杆城市',
  60. subTitle:'原标题:银川入选全国营商环境标杆城市11月15日,记者从银川市审批服务管理局获悉,近日国家发改委组织召开了《中国营商环境报告2020》发布暨全国优化营商环境工作推',
  61. time:'2020-11-22 11:38:22',
  62. image:'http://139.9.103.171:1888/miniofile/xlyq/news3.jpg'
  63. }
  64. ]
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. .uni-list {
  71. background-color: #FFFFFF;
  72. position: relative;
  73. width: 100%;
  74. display: flex;
  75. flex-direction: column;
  76. }
  77. .uni-list:after {
  78. position: absolute;
  79. z-index: 10;
  80. right: 0;
  81. bottom: 0;
  82. left: 0;
  83. height: 1px;
  84. content: '';
  85. -webkit-transform: scaleY(.5);
  86. transform: scaleY(.5);
  87. // background-color: #c8c7cc;
  88. }
  89. .uni-list::before {
  90. position: absolute;
  91. z-index: 10;
  92. right: 0;
  93. top: 0;
  94. left: 0;
  95. height: 1px;
  96. content: '';
  97. -webkit-transform: scaleY(.5);
  98. transform: scaleY(.5);
  99. }
  100. .uni-list-cell {
  101. position: relative;
  102. display: flex;
  103. flex-direction: row;
  104. justify-content: space-between;
  105. align-items: center;
  106. }
  107. .uni-list-cell-hover {
  108. background-color: #eee;
  109. }
  110. .uni-list-cell::after {
  111. position: absolute;
  112. z-index: 3;
  113. right: 0;
  114. bottom: 0;
  115. left: 30upx;
  116. height: 1px;
  117. content: '';
  118. -webkit-transform: scaleY(.5);
  119. transform: scaleY(.5);
  120. background-color: #c8c7cc;
  121. }
  122. .uni-list .uni-list-cell:last-child::after {
  123. height: 0upx;
  124. }
  125. /* 图文列表 */
  126. .uni-media-list {
  127. padding: 22upx 20upx;
  128. box-sizing: border-box;
  129. display: flex;
  130. width: 100%;
  131. flex-direction: row;
  132. }
  133. .uni-navigate-right.uni-media-list {
  134. padding-right: 74upx;
  135. }
  136. .uni-media-list-text-bottom {
  137. line-height: 30upx;
  138. font-size: 26upx;
  139. color: #8f8f94;
  140. }
  141. .uni-media-list-logo-left {
  142. border-radius: 10rpx;
  143. width: 230upx;
  144. height: 180upx;
  145. margin-right: 20upx
  146. }
  147. .uni-media-list-logo-right {
  148. width: 180upx;
  149. height: 140upx;
  150. margin-left: 20upx
  151. }
  152. .uni-media-list-body {
  153. display: flex;
  154. flex: 1;
  155. flex-direction: column;
  156. justify-content: space-between;
  157. align-items: flex-start;
  158. overflow: hidden;
  159. height: auto;
  160. }
  161. .uni-media-list-text-top {
  162. width: 100%;
  163. line-height: 36upx;
  164. height: 50upx;
  165. font-size: 26upx;
  166. font-weight: 800;
  167. overflow: hidden;
  168. }
  169. .uni-media-list-text-bottom {
  170. display: flex;
  171. flex-direction: row;
  172. justify-content: space-between;
  173. }
  174. </style>