goodsItem.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="goods-item">
  3. <image :src="item.imgUrl" mode="aspectFill"></image>
  4. <view class="goods-info">
  5. <view class="goods-name">{{item.packageName}}</view>
  6. <view class="price-box">
  7. <text class="price-box-unit">¥</text>
  8. <text class="price-box-integer">{{item.price.toFixed(0)}}</text>
  9. <text class="price-box-decimal">.00</text>
  10. <text class="price-box-text">/日</text>
  11. <text class="buynum">{{item.sales}} 人已购</text>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: "goodsItem",
  19. props: {
  20. item:{
  21. type:Object,
  22. default:function(){
  23. return {};
  24. }
  25. },
  26. },
  27. data() {
  28. return {
  29. };
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped>
  34. .goods-item {
  35. width: 342rpx;
  36. background: #FFFFFF;
  37. border-radius: 16rpx 16rpx 16rpx 16rpx;
  38. overflow: hidden;
  39. font-family: PingFang SC, PingFang SC;
  40. font-weight: 400;
  41. font-size: 28rpx;
  42. color: #000000;
  43. image {
  44. width: 342rpx;
  45. height: 342rpx;
  46. }
  47. .goods-info {
  48. padding: 12rpx 20rpx 32rpx 20rpx;
  49. }
  50. .goods-name {
  51. overflow: hidden;
  52. text-overflow: ellipsis;
  53. display: -webkit-box;
  54. -webkit-line-clamp: 2;
  55. -webkit-box-orient: vertical;
  56. }
  57. .price-box {
  58. font-family: Roboto, Roboto;
  59. font-weight: bold;
  60. font-size: 36rpx;
  61. color: #FF5C03;
  62. margin: 22rpx 0;
  63. &-unit {
  64. font-weight: 600;
  65. font-size: 20rpx;
  66. }
  67. &-integer {
  68. font-size: 26rpx;
  69. }
  70. &-decimal {
  71. font-weight: 600;
  72. font-size: 20rpx;
  73. }
  74. &-text {
  75. font-family: PingFang SC, PingFang SC;
  76. font-weight: 500;
  77. font-size: 22rpx;
  78. }
  79. .buynum {
  80. font-weight: 400;
  81. font-size: 22rpx;
  82. color: #757575;
  83. line-height: 22rpx;
  84. margin-left: 16rpx;
  85. }
  86. }
  87. }
  88. </style>