columnList.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view @click="linkDetails(item)" v-for="(item,index) in newsList" :key="index" class="box" >
  5. <view class="box_img">
  6. <u--image radius='16rpx' width="180rpx" height="180rpx" :src="item.fileList[0].fileUrl" ></u--image>
  7. </view>
  8. <view class="box_right">
  9. <view class="box_title">
  10. {{item.title}}
  11. </view>
  12. <view class="box_c">
  13. <text>{{ item.subTitle }}</text>
  14. </view>
  15. <view class="box_num">
  16. <view class="bn_left">
  17. ¥{{item.price}}
  18. </view>
  19. <view class="bn_right">
  20. {{item.views}}人看过
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. props: {
  31. listdata: {
  32. type: Array,
  33. default: [],
  34. },
  35. },
  36. watch:{
  37. listdata: {
  38. immediate: true,
  39. handler(val) {
  40. console.log(val);
  41. this.newsList = val
  42. },
  43. }
  44. },
  45. data() {
  46. return {
  47. newsList:[]
  48. }
  49. },
  50. onLoad(e) {
  51. },
  52. methods: {
  53. linkDetails(e){
  54. let id = e.id
  55. if (e?.productId) {
  56. id = e?.productId
  57. }
  58. uni.navigateTo({
  59. url: '/pages/market/ProductDetails?id=' + e.id
  60. });
  61. }
  62. }
  63. }
  64. </script>
  65. <style>
  66. .content{
  67. width: 100vw;
  68. background-color: #FFFFFF;
  69. padding: 30rpx 0 30rpx 0;
  70. }
  71. .box{
  72. width: 702rpx;
  73. height: 244rpx;
  74. background: #FFFFFF;
  75. border-radius: 16rpx 16rpx 16rpx 16rpx;
  76. opacity: 1;
  77. display: flex;
  78. margin: 20rpx auto;
  79. justify-content: space-around;
  80. align-items: center;
  81. }
  82. .box_img{
  83. width: 180rpx;
  84. height: 180rpx;
  85. border-radius: 16rpx;
  86. background-color: #999999;
  87. }
  88. .box_right{
  89. width: 448rpx;
  90. height: 180rpx;
  91. margin-left: 10rpx;
  92. display: flex;
  93. flex-direction: column;
  94. justify-content: space-between;
  95. }
  96. .box_title{
  97. width: 440rpx;
  98. height: 40rpx;
  99. font-size: 28rpx;
  100. font-weight: bold;
  101. color: #333333;
  102. line-height: 40rpx;
  103. display: -webkit-box;
  104. word-break: break-all;
  105. text-overflow: ellipsis;
  106. overflow: hidden;
  107. -webkit-box-orient: vertical;
  108. -webkit-line-clamp:1;
  109. }
  110. .box_c{
  111. width: 400rpx;
  112. height: 33rpx;
  113. font-size: 24rpx;
  114. font-weight: 400;
  115. color: #999999;
  116. line-height: 36rpx;
  117. display: -webkit-box;
  118. word-break: break-all;
  119. text-overflow: ellipsis;
  120. overflow: hidden;
  121. -webkit-box-orient: vertical;
  122. -webkit-line-clamp:1;
  123. }
  124. .box_num{
  125. width: 410rpx;
  126. display: flex;
  127. justify-content: space-between;
  128. align-items: center;
  129. }
  130. .bn_left{
  131. width: 106rpx;
  132. height: 38rpx;
  133. font-size: 28rpx;
  134. font-weight: bold;
  135. color: #F6514F;
  136. line-height: 36rpx;
  137. }
  138. .bn_right{
  139. width: 120rpx;
  140. height: 33rpx;
  141. font-size: 24rpx;
  142. font-weight: 400;
  143. color: #999999;
  144. line-height: 40rpx;
  145. }
  146. </style>