list-goods-card.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!-- 页面;暂时没用到 -->
  2. <template>
  3. <view class="list-goods-card ss-flex-col" @tap="onClick">
  4. <view class="md-img-box">
  5. <image class="goods-img md-img-box" :src="sheep.$url.cdn(img)" mode="aspectFill"></image>
  6. </view>
  7. <view class="md-goods-content ss-flex-col ss-row-around">
  8. <view class="md-goods-title ss-line-2 ss-m-x-20 ss-m-t-6 ss-m-b-16">{{ title }}</view>
  9. <view class="md-goods-subtitle ss-line-1 ss-p-y-10 ss-p-20">{{ subTitle }}</view>
  10. <view class="ss-flex ss-col-center ss-row-between ss-m-b-16 ss-m-x-20">
  11. <view class="md-goods-price text-price">{{ price }}</view>
  12. <view class="goods-origin-price text-price">{{ originPrice }}</view>
  13. <view class="sales-text">已售{{ sales }}件</view>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script setup>
  19. import sheep from '@/sheep';
  20. import { onLoad } from '@dcloudio/uni-app';
  21. import { computed, reactive } from 'vue';
  22. const props = defineProps({
  23. img: {
  24. type: String,
  25. default: '',
  26. },
  27. subTitle: {
  28. type: String,
  29. default: '',
  30. },
  31. title: {
  32. type: String,
  33. default: '',
  34. },
  35. price: {
  36. type: [String, Number],
  37. default: '',
  38. },
  39. originPrice: {
  40. type: [String, Number],
  41. default: '',
  42. },
  43. sales: {
  44. type: [String, Number],
  45. default: '',
  46. },
  47. });
  48. const emits = defineEmits(['click']);
  49. const onClick = () => {
  50. emits('click');
  51. };
  52. </script>
  53. <style lang="scss" scoped>
  54. .goods-img {
  55. width: 100%;
  56. height: 100%;
  57. background-color: #f5f5f5;
  58. }
  59. .sales-text {
  60. font-size: 20rpx;
  61. color: #c4c4c4;
  62. }
  63. .goods-origin-price {
  64. font-size: 20rpx;
  65. color: #c4c4c4;
  66. text-decoration: line-through;
  67. }
  68. .list-goods-card {
  69. overflow: hidden;
  70. width: 344rpx;
  71. position: relative;
  72. z-index: 1;
  73. background-color: $white;
  74. box-shadow: 0 0 20rpx 4rpx rgba(199, 199, 199, 0.22);
  75. border-radius: 20rpx;
  76. .md-img-box {
  77. width: 344rpx;
  78. height: 344rpx;
  79. }
  80. .md-goods-title {
  81. font-size: 26rpx;
  82. color: #333;
  83. }
  84. .md-goods-subtitle {
  85. background-color: var(--ui-BG-Main-tag);
  86. color: var(--ui-BG-Main);
  87. font-size: 20rpx;
  88. }
  89. .md-goods-price {
  90. font-size: 30rpx;
  91. color: $red;
  92. }
  93. }
  94. </style>