yd-product-more.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view>
  3. <view class="prod-block list">
  4. <view class="bloc-header">
  5. <text class="bloc-title">更多宝贝</text>
  6. <text></text>
  7. </view>
  8. <view class="prod-list" v-for="(item, index) in productList" :key="item.id">
  9. <view class="prod-item" @click="handleProdItemClick(item.id)">
  10. <image class="prod-image" :src="item.image"></image>
  11. <view class="item-info">
  12. <view class="info-text">
  13. <u--text :lines="1" size="14px" color="#333333" :text="item.title"></u--text>
  14. <u-gap height="2px"></u-gap>
  15. <u--text class="info-desc" :lines="2" size="12px" color="#939393" :text="item.desc"></u--text>
  16. </view>
  17. <view class="price-and-cart">
  18. <yd-text-price color="red" size="12" intSize="18" :price="item.price"></yd-text-price>
  19. <u-icon name="shopping-cart" color="#2979ff" size="28"></u-icon>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <!--加载更多-->
  26. <u-loadmore fontSize="28rpx" :line="true" :status="moreStatus" :loading-text="loadingText" :loadmore-text="loadmoreText" :nomore-text="nomoreText" />
  27. </view>
  28. </template>
  29. <script>
  30. /**
  31. * 商品列表(加载更多)
  32. */
  33. export default {
  34. name: 'yd-product-more',
  35. components: {},
  36. props: {
  37. title: {
  38. type: String,
  39. default: '商品推荐'
  40. },
  41. productList: {
  42. type: Array,
  43. default: () => []
  44. },
  45. moreStatus: {
  46. type: String,
  47. default: 'nomore'
  48. }
  49. },
  50. data() {
  51. return {
  52. //status: 'nomore',
  53. loadingText: '加载中...',
  54. loadmoreText: '上拉加载更多',
  55. nomoreText: '已经到底了'
  56. }
  57. },
  58. methods: {
  59. handleProdItemClick(productId) {
  60. uni.$u.route('/pages/product/product', {
  61. id: productId
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. .prod-block {
  69. margin-top: 0;
  70. .bloc-header {
  71. margin-top: 50rpx;
  72. margin-bottom: 20rpx;
  73. .bloc-title {
  74. margin-left: 20rpx;
  75. color: #333333;
  76. }
  77. }
  78. .prod-list {
  79. .prod-item {
  80. background: #ffffff;
  81. @include flex-space-between;
  82. border-bottom: $custom-border-style;
  83. padding: 20rpx;
  84. .prod-image {
  85. width: 200rpx;
  86. height: 200rpx;
  87. border-radius: 10rpx;
  88. }
  89. .item-info {
  90. flex: 1;
  91. padding: 20rpx 20rpx 0;
  92. .info-text {
  93. height: 100rpx;
  94. padding-bottom: 10rpx;
  95. }
  96. .price-and-cart {
  97. @include flex-space-between;
  98. }
  99. }
  100. }
  101. }
  102. }
  103. </style>