info-card.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="info-card">
  3. <view class="title-row">
  4. <text class="book-title">{{ product.title }}</text>
  5. </view>
  6. <view class="price-row">
  7. <text class="currency">¥</text>
  8. <text class="price">{{ product.price }}</text>
  9. <view class="balance-tag">
  10. <text>余额价 {{ product.balancePrice }}</text>
  11. </view>
  12. </view>
  13. <view class="meta-row">
  14. <text class="label">原价:</text>
  15. <text class="original-price">¥{{ product.originalPrice }}</text>
  16. </view>
  17. <view class="author-row">
  18. <text class="author">作者:{{ product.author }}</text>
  19. <view class="works-link">
  20. <text>作品</text>
  21. <u-icon name="arrow-right" size="24" color="#F2950A"></u-icon>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. name: 'InfoCard',
  29. props: {
  30. product: {
  31. type: Object,
  32. default: () => ({})
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .info-card {
  39. background: #fff;
  40. border-radius: 24rpx 24rpx 0 0;
  41. padding: 30rpx;
  42. .title-row {
  43. margin-bottom: 20rpx;
  44. .book-title {
  45. font-size: 40rpx;
  46. font-weight: bold;
  47. color: #333;
  48. }
  49. }
  50. .price-row {
  51. display: flex;
  52. align-items: center;
  53. margin-bottom: 10rpx;
  54. .currency {
  55. font-size: 32rpx;
  56. color: #D81A00;
  57. font-weight: bold;
  58. }
  59. .price {
  60. font-size: 48rpx;
  61. color: #D81A00;
  62. font-weight: bold;
  63. margin-right: 20rpx;
  64. }
  65. .balance-tag {
  66. background: #EFA941;
  67. border-radius: 20rpx;
  68. padding: 2rpx 16rpx;
  69. text {
  70. font-size: 22rpx;
  71. color: #fff;
  72. }
  73. }
  74. }
  75. .meta-row {
  76. margin-bottom: 20rpx;
  77. font-size: 26rpx;
  78. color: #999;
  79. .original-price {
  80. text-decoration: line-through;
  81. margin-left: 10rpx;
  82. }
  83. }
  84. .author-row {
  85. display: flex;
  86. justify-content: space-between;
  87. align-items: center;
  88. font-size: 28rpx;
  89. color: #F2950A;
  90. .author {
  91. flex: 1;
  92. }
  93. .works-link {
  94. display: flex;
  95. align-items: center;
  96. }
  97. }
  98. }
  99. </style>