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

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