建材商城系统20241014
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
2.5 KiB

  1. <template>
  2. <view class="productItem" @click="$emit('click')">
  3. <view class="picture-shop">
  4. <image :src="item.image && item.image.split(',')[0]" mode="aspectFill"></image>
  5. </view>
  6. <view class="price-shop">
  7. <view class="title">{{item.name}}</view>
  8. <view class="tag-shop">
  9. <uv-tags :text="item.categoryName || '建材'" type="warning" plain size="mini"></uv-tags>
  10. <uv-tags text="快速下单" type="warning" plain size="mini"></uv-tags>
  11. </view>
  12. <view class="bottom-price">
  13. <text style="font-size: 30rpx; ">{{item.price}}</text>/{{item.unit}}
  14. </view>
  15. </view>
  16. <view class="buy-shop">
  17. <uv-button
  18. type="primary"
  19. shape="circle"
  20. v-if="btn"
  21. text="立即购买"></uv-button>
  22. <view class="tips">
  23. 已售{{ item.payNum }}
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. name:"productItem",
  31. props : {
  32. item : {
  33. default : {}
  34. },
  35. btn : {
  36. default : true
  37. }
  38. },
  39. data() {
  40. return {
  41. };
  42. }
  43. }
  44. </script>
  45. <style scoped lang="scss">
  46. .productItem {
  47. width: 95%;
  48. display: flex;
  49. margin: 30rpx auto;
  50. background-color: #ffffff;
  51. border-radius: 20rpx;
  52. box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.05);
  53. transition: transform 0.3s, box-shadow 0.3s;
  54. padding: 20rpx;
  55. &:active {
  56. transform: translateY(2rpx);
  57. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  58. }
  59. // /deep/
  60. .picture-shop {
  61. display: flex;
  62. margin-right: 20rpx;
  63. image {
  64. width: 200rpx;
  65. height: 150rpx;
  66. border-radius: 10rpx;
  67. }
  68. }
  69. .price-shop {
  70. flex: 1;
  71. .title{
  72. font-size: 28rpx;
  73. font-weight: 600;
  74. overflow: hidden;
  75. text-overflow: ellipsis;
  76. white-space: nowrap;
  77. }
  78. .tag-shop {
  79. display: flex;
  80. gap: 10rpx;
  81. margin-top: 10rpx;
  82. }
  83. .bottom-price {
  84. margin-top: 10rpx;
  85. font-size: 26rpx;
  86. color: #DC2828;
  87. text {
  88. font-weight: 700;
  89. }
  90. }
  91. }
  92. .buy-shop {
  93. display: flex;
  94. justify-content: center;
  95. align-items: center;
  96. flex-direction: column;
  97. :deep(.uv-button) {
  98. transition: transform 0.2s;
  99. &:active {
  100. transform: scale(0.95);
  101. }
  102. }
  103. .tips{
  104. font-size: 24rpx;
  105. color: #999;
  106. margin-top: 16rpx;
  107. }
  108. }
  109. @keyframes pulse {
  110. 0% {
  111. transform: scale(1);
  112. }
  113. 50% {
  114. transform: scale(1.05);
  115. }
  116. 100% {
  117. transform: scale(1);
  118. }
  119. }
  120. }
  121. </style>