productList.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="product">
  3. <view @click="itemClick(item)" v-for="(item,index) in list" :key="index" class="product-item">
  4. <view class="product-item-img">
  5. <image style="width: 100%;height: 100%;" :src="item.img" mode=""></image>
  6. <view class="product-item-img-icon">
  7. <uni-icons v-if="item.Collect == 0" color="#fff" type="star" size="24"></uni-icons>
  8. <uni-icons v-else color="#05CCA1" type="star-filled" size="24"></uni-icons>
  9. </view>
  10. </view>
  11. <view class="product-item-text">
  12. <view class="product-item-text-title">
  13. {{item.title}}
  14. </view>
  15. <view class="product-item-text-usr">
  16. {{item.user}}
  17. </view>
  18. <view class="product-item-text-usr">
  19. {{item.date}}
  20. </view>
  21. <view class="product-item-text-Price">
  22. ¥ <text style="font-size: 36rpx;font-weight: 700;">{{item.Price}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name: "productList",
  31. props: {
  32. list: {
  33. type: Array,
  34. default: () => []
  35. }
  36. },
  37. data() {
  38. return {
  39. };
  40. },
  41. mounted() {
  42. console.log(this.list)
  43. },
  44. methods:{
  45. itemClick(item){
  46. this.$emit('item',item)
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .product {
  53. width: 100%;
  54. box-sizing: border-box;
  55. display: flex;
  56. flex-wrap: wrap;
  57. justify-content: space-between;
  58. padding: 32rpx 0;
  59. .product-item {
  60. height: 424rpx;
  61. width: 332rpx;
  62. border-radius: 5.33px;
  63. box-shadow: 0px 0px 6.67px 0px rgba(147, 147, 147, 0.10);
  64. background-color: #fff;
  65. margin-bottom: 24rpx;
  66. overflow: hidden;
  67. position: relative;
  68. .product-item-img {
  69. width: 100%;
  70. height: 260rpx;
  71. position: relative;
  72. .product-item-img-icon {
  73. position: absolute;
  74. right: 24rpx;
  75. top: 24rpx;
  76. }
  77. }
  78. .product-item-text {
  79. padding: 14rpx 24rpx 24rpx 24rpx;
  80. box-sizing: border-box;
  81. .product-item-text-title {
  82. font-size: 24rpx;
  83. font-weight: 700;
  84. }
  85. .product-item-text-usr {
  86. font-size: 24rpx;
  87. color: #999;
  88. }
  89. .product-item-text-Price {
  90. position: absolute;
  91. right: 24rpx;
  92. bottom: 24rpx;
  93. color: #05CCA1;
  94. }
  95. }
  96. }
  97. }
  98. </style>