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

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