goods.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="goods ss-flex">
  3. <image class="image" :src="sheep.$url.cdn(goodsData.image)" mode="aspectFill"> </image>
  4. <view class="ss-flex-1">
  5. <view class="title ss-line-2">
  6. {{ goodsData.title }}
  7. </view>
  8. <view v-if="goodsData.subtitle" class="subtitle ss-line-1">
  9. {{ goodsData.subtitle }}
  10. </view>
  11. <view class="price ss-m-t-8">
  12. ¥{{ isArray(goodsData.price) ? goodsData.price[0] : goodsData.price }}
  13. </view>
  14. </view>
  15. </view>
  16. </template>
  17. <script setup>
  18. import sheep from '@/sheep';
  19. import { isArray } from 'lodash';
  20. const props = defineProps({
  21. goodsData: {
  22. type: Object,
  23. default: {},
  24. },
  25. });
  26. </script>
  27. <style lang="scss" scoped>
  28. .goods {
  29. background: #fff;
  30. padding: 20rpx;
  31. border-radius: 12rpx;
  32. .image {
  33. width: 116rpx;
  34. height: 116rpx;
  35. flex-shrink: 0;
  36. margin-right: 20rpx;
  37. }
  38. .title {
  39. height: 64rpx;
  40. line-height: 32rpx;
  41. font-size: 26rpx;
  42. font-weight: 500;
  43. color: #333;
  44. }
  45. .subtitle {
  46. font-size: 24rpx;
  47. font-weight: 400;
  48. color: #999;
  49. }
  50. .price {
  51. font-size: 26rpx;
  52. font-weight: 500;
  53. color: #ff3000;
  54. }
  55. }
  56. </style>