jf.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="hotgoods-item" @click="goItem(item)" :style="{'height': height}">
  3. <view class="image-wrapper">
  4. <image class="image" :src="item.image" mode="scaleToFill"></image>
  5. </view>
  6. <view class="price-wrap flex">
  7. <view class="title clamp">{{item.store_name}}</view>
  8. <view class="hot-price">
  9. <view class="price clamp" :style="{'color': pColor}">{{ item.price * 1 }}+200 积分
  10. </view>
  11. <image class="gobuy" src="./img/cart.png" mode="widthFix" :style="{'width': iconWith}"></image>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'good',
  19. data() {
  20. return {
  21. }
  22. },
  23. props: {
  24. height: {
  25. type: String,
  26. default: '490rpx'
  27. },
  28. item: {
  29. type: Object,
  30. default: () => {}
  31. },
  32. pColor: {
  33. type: String,
  34. default: '#FF4C4F'
  35. },
  36. iconWith: {
  37. type: String,
  38. default: '44rpx'
  39. }
  40. },
  41. methods: {
  42. goItem(item) {
  43. this.$emit('goItem', item)
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. .hotgoods-item {
  50. width: 335rpx;
  51. background-color: #ffffff;
  52. border-radius: 12rpx;
  53. box-shadow: 0 0 15rpx rgba(0, 0, 0, 0.2);
  54. margin-bottom: 15rpx;
  55. .price-wrap {
  56. flex-direction: column;
  57. justify-content: space-between;
  58. align-items: flex-start;
  59. height: 130rpx;
  60. }
  61. .image-wrapper {
  62. width: 100%;
  63. height: 345rpx;
  64. border-radius: 3px;
  65. overflow: hidden;
  66. position: relative;
  67. .image {
  68. width: 100%;
  69. height: 100%;
  70. opacity: 1;
  71. border-radius: 12rpx 12rpx 0 0;
  72. }
  73. }
  74. .title {
  75. width: 100%;
  76. margin-top: 24rpx;
  77. padding: 0 20rpx;
  78. font-size: 32rpx;
  79. font-weight: 500;
  80. }
  81. .hot-price {
  82. display: flex;
  83. justify-content: space-between;
  84. align-items: center;
  85. width: 100%;
  86. padding: 0 10rpx;
  87. .price {
  88. margin-left: 10rpx;
  89. font-size: 36rpx;
  90. justify-content: flex-start;
  91. align-items: center;
  92. &::before {
  93. content: '¥';
  94. font-size: 28rpx;
  95. }
  96. }
  97. }
  98. }
  99. </style>