rowList.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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="343rpx" height="343rpx" :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_num">
  13. <view class="bn_left">
  14. ¥{{item.price}}
  15. </view>
  16. <view class="bn_right">
  17. {{item.views}}人看过
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. props: {
  28. listdata: {
  29. type: Array,
  30. default: [],
  31. },
  32. },
  33. watch:{
  34. listdata: {
  35. immediate: true,
  36. handler(val) {
  37. console.log(val);
  38. this.newsList = val
  39. },
  40. }
  41. },
  42. data() {
  43. return {
  44. newsList:[]
  45. }
  46. },
  47. onLoad(e) {
  48. },
  49. methods: {
  50. linkDetails(e){
  51. let id = e.id
  52. if (e?.productId) {
  53. id = e?.productId
  54. }
  55. uni.navigateTo({
  56. url: '/pages/market/ProductDetails?id=' + id
  57. });
  58. }
  59. }
  60. }
  61. </script>
  62. <style>
  63. .content{
  64. width: 100vw;
  65. /* background-color: #FFFFFF; */
  66. padding: 30rpx 0 30rpx 0;
  67. display: flex;
  68. flex-wrap: wrap;
  69. }
  70. .box{
  71. width: 343rpx;
  72. height: 545rpx;
  73. background: #FFFFFF;
  74. border-radius: 8rpx 8rpx 8rpx 8rpx;
  75. opacity: 1;
  76. border: 6rpx solid white;
  77. margin: 10rpx;
  78. display: flex;
  79. flex-direction: column;
  80. align-items: center;
  81. }
  82. .box_img{
  83. width: 343rpx;
  84. height: 343rpx;
  85. border-radius: 16rpx;
  86. background-color: #999999;
  87. }
  88. .box_right{
  89. margin-left: 10rpx;
  90. display: flex;
  91. flex-direction: column;
  92. justify-content: space-evenly;
  93. }
  94. .box_title{
  95. width: 343rpx;
  96. height: 80rpx;
  97. font-size: 28rpx;
  98. font-weight: bold;
  99. color: #333333;
  100. margin: 24rpx 0;
  101. line-height: 40rpx;
  102. display: -webkit-box;
  103. word-break: break-all;
  104. text-overflow: ellipsis;
  105. overflow: hidden;
  106. -webkit-box-orient: vertical;
  107. -webkit-line-clamp:2;
  108. }
  109. .box_num{
  110. width: 343rpx;
  111. display: flex;
  112. justify-content: space-between;
  113. align-items: center;
  114. }
  115. .bn_left{
  116. width: 106rpx;
  117. height: 38rpx;
  118. font-size: 28rpx;
  119. font-weight: bold;
  120. color: #F6514F;
  121. }
  122. .bn_right{
  123. width: 120rpx;
  124. height: 33rpx;
  125. font-size: 24rpx;
  126. font-weight: 400;
  127. color: #999999;
  128. }
  129. </style>