ShopGoods.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <view
  3. class="item"
  4. @click="go(`/another-tf/another-serve/goodsDetails/index?shopId=${shopId}&productId=${cItem.productId}&skuId=${cItem.skuId}`)"
  5. >
  6. <image :src="common.seamingImgUrl(cItem.image)" mode="aspectFit" class="product-img"></image>
  7. <view class="product-bottom-box">
  8. <view class="product-name">{{ cItem.productName }}</view>
  9. <view v-if="cItem.number" class="product-num font-color-C5AA7B mar-top-10">
  10. 已售{{ cItem.number }}件
  11. </view>
  12. <view class="product-line-box">
  13. <view class="product-price-box">
  14. <ATFActivityImage :type="cItem.activityType"></ATFActivityImage>
  15. <view style="flex: 1;display: flex;align-items: center;flex-wrap: wrap;">
  16. <text class="price-box fs40 font-color-C83732 mar-right-20">
  17. <text class="fs32">¥</text>
  18. {{ cItem.price }}
  19. </text>
  20. <text v-if="cItem.price !== cItem.originalPrice" class="price-through">¥{{ cItem.originalPrice }}</text>
  21. </view>
  22. </view>
  23. <view
  24. style="padding: 10upx;background-color: #ffe500;border-radius: 50%;line-height: 1;"
  25. @click.stop="$emit('add-car', cItem)"
  26. >
  27. <tui-icon name="plus" color="#000000" :size="28" unit="upx" bold></tui-icon>
  28. </view>
  29. </view>
  30. <view
  31. v-if="cItem.voucherId && cItem.voucherPrice"
  32. style="width: fit-content;max-width: 100%;padding: 2upx 8upx;margin: 10upx 0;color: #E24747;font-size: 26upx;border: 1upx solid #e247478c;border-radius: 8upx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
  33. >
  34. 可使用{{ cItem.voucherPrice }}代金券抵扣
  35. </view>
  36. <view
  37. v-if="cItem.presenterVoucher"
  38. style="width: fit-content;max-width: 100%;padding: 2upx 8upx;margin: 10upx 0;color: #E24747;font-size: 26upx;border: 1upx solid #e247478c;border-radius: 8upx;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
  39. >
  40. 赠送 {{ cItem.presenterVoucher }} 代金券
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. name: 'ShopGoods',
  48. props: {
  49. shopId: {
  50. type: [Number, String],
  51. required: true
  52. },
  53. cItem: {
  54. type: Object,
  55. required: true
  56. }
  57. },
  58. methods: {
  59. }
  60. }
  61. </script>
  62. <style lang="less" scoped>
  63. .item {
  64. // width: 100%;
  65. width: 340upx;
  66. margin: 12rpx 0;
  67. background: #d6d6d6;
  68. border-radius: 10rpx;
  69. display: flex;
  70. flex-direction: column;
  71. box-sizing: border-box;
  72. .product-img {
  73. width: 340rpx;
  74. height: 340rpx;
  75. border-radius: 20upx;
  76. overflow: hidden;
  77. }
  78. .product-bottom-box {
  79. padding: 20rpx;
  80. box-sizing: border-box;
  81. background: #fff;
  82. .product-name {
  83. display: block;
  84. font-size: 28rpx;
  85. color: #333;
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. white-space: nowrap;
  89. }
  90. .product-num {
  91. font-size: 24rpx;
  92. margin-top: 15rpx;
  93. border: 2rpx solid #E4E5E6;
  94. padding: 10rpx;
  95. display: inline-block;
  96. }
  97. .product-line-box {
  98. margin-top: 18rpx;
  99. display: flex;
  100. justify-content: space-between;
  101. flex-direction: row;
  102. align-items: center;
  103. flex-wrap: wrap;
  104. .product-price-box {
  105. flex: 1;
  106. width: 100%;
  107. display: flex;
  108. flex-direction: row;
  109. align-items: center;
  110. flex-wrap: wrap;
  111. }
  112. .product-price-box .price-through {
  113. text-decoration: line-through;
  114. font-size: 24rpx;
  115. color: #CCC;
  116. }
  117. }
  118. }
  119. }
  120. // .item:nth-of-type(2n) {
  121. // margin-left: 2%;
  122. // margin-right: 0;
  123. // }
  124. </style>