BrandGoods.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view v-if="goodsData" class="brand-goods-container">
  3. <view style="max-height: 440upx;min-height: 120upx;overflow: hidden;">
  4. <tui-lazyload-img
  5. class="goods-img" mode="widthFix"
  6. width="340rpx" height="auto" :src="common.seamingImgUrl(goodsData.picUrl)" @click="$emit('click-content', { ...goodsData, ruleId })"
  7. ></tui-lazyload-img>
  8. </view>
  9. <view class=" brand-goods-name">
  10. {{ goodsData.name }}
  11. </view>
  12. <view class="time">
  13. <view class="wrapper" @click="$emit('click-content', { ...goodsData, ruleId })">
  14. <view class="price-wrapper">
  15. <text class="price-text">
  16. <text v-if="ruleId">{{ goodsData.counterPrice - grouponPrice }}</text>
  17. <text v-else-if="seckillGoodId">{{ seckillPrice }}</text>
  18. <text v-else>{{ goodsData.counterPrice }}</text>
  19. {{ ruleId ? goodsData.counterPrice + grouponPrice : goodsData.counterPrice }}
  20. </text>
  21. <text v-if="goodsData.isHot" class="price-tag">热卖</text>
  22. </view>
  23. </view>
  24. <view v-if="ruleId">
  25. <tui-button
  26. type="danger" width="168rpx" height="60rpx" margin="0 10rpx 0 0"
  27. style="border-radius: 50rpx;" @click="$emit('add', { ...goodsData, ruleId })"
  28. >
  29. 发起团购
  30. </tui-button>
  31. </view>
  32. <view v-else-if="seckillGoodId">
  33. <tui-button
  34. type="danger" width="168rpx" height="60rpx" margin="0 10rpx 0 0"
  35. style="border-radius: 50rpx;" @click="$emit('add', { ...goodsData, seckillGoodId })"
  36. >
  37. 秒杀
  38. </tui-button>
  39. </view>
  40. <view v-else>
  41. <BeeIcon
  42. :size="22" :src="require('../../static/images/icon/add-icon.png')"
  43. @click="$emit('add', { ...goodsData, ruleId })"
  44. ></BeeIcon>
  45. </view>
  46. </view>
  47. <view style="display: flex;justify-content: space-between;padding: 0 10upx;;font-size: 26upx;color: #777777;">
  48. <text>{{ goodsData.browse }}浏览量</text>
  49. <text>销量 {{ goodsData.sales }}</text>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. // import { getRandom } from '../../utils'
  55. export default {
  56. props: {
  57. goodsData: {
  58. type: Object,
  59. required: true
  60. },
  61. ruleId: {
  62. type: [Number, String],
  63. default: ''
  64. },
  65. grouponPrice: {
  66. type: Number,
  67. default: 0
  68. },
  69. grouponMember: {
  70. type: Number,
  71. default: 0
  72. },
  73. seckillGoodId: {
  74. type: Number,
  75. default: ''
  76. },
  77. seckillPrice: {
  78. type: Number,
  79. default: 0
  80. }
  81. },
  82. methods: {
  83. // getRandom
  84. }
  85. }
  86. </script>
  87. <style lang="less" scoped>
  88. .brand-goods-container {
  89. width: 340upx;
  90. margin-bottom: 40upx;
  91. .brand-goods-name {
  92. color: #3d3d3d;
  93. font-weight: 500;
  94. width: 340upx;
  95. overflow: hidden;
  96. text-overflow: ellipsis;
  97. white-space: nowrap;
  98. }
  99. .time {
  100. display: flex;
  101. align-items: center;
  102. justify-content: space-between;
  103. margin: 10upx 0;
  104. .wrapper {
  105. .price-text {
  106. color: #fa5151;
  107. font-weight: bold;
  108. font-size: 28upx;
  109. }
  110. .price-tag {
  111. padding: 0 10upx;
  112. border: 1upx solid #fa5151;
  113. font-size: 20upx;
  114. color: #fa5151;
  115. border-radius: 8upx;
  116. margin-left: 9upx;
  117. }
  118. }
  119. .bee-btn {
  120. width: 102upx;
  121. height: 44upx;
  122. background-color: #fa5151;
  123. border-radius: 10upx;
  124. color: #fff;
  125. }
  126. }
  127. }
  128. </style>