建材商城系统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.

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