info-card.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <view class="info-card">
  3. <view class="title-row">
  4. <text class="book-title">{{ product.bookName }}</text>
  5. </view>
  6. <view class="price-row">
  7. <text class="currency">¥</text>
  8. <text class="price">{{ product.sellPrice || product.price }}</text>
  9. <view class="balance-tag" v-if="product.balanceMoney">
  10. <text>余额价 {{ product.balanceMoney }}</text>
  11. </view>
  12. </view>
  13. <view class="meta-row">
  14. <text class="label">原价:</text>
  15. <text class="original-price">¥{{ product.price }}</text>
  16. </view>
  17. <view class="author-row">
  18. <text class="author">作者:{{ product.author }}</text>
  19. <view class="works-link" @click="goToAuthorWorks">
  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. methods: {
  36. goToAuthorWorks() {
  37. if (!this.product.author) return;
  38. uni.navigateTo({
  39. url: `/pages-sell/pages/search-result?keyword=${encodeURIComponent(this.product.author)}`
  40. });
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss" scoped>
  46. .info-card {
  47. background: #fff;
  48. border-radius: 24rpx 24rpx 0 0;
  49. padding: 30rpx;
  50. .title-row {
  51. margin-bottom: 20rpx;
  52. .book-title {
  53. font-size: 40rpx;
  54. font-weight: bold;
  55. color: #333;
  56. }
  57. }
  58. .price-row {
  59. display: flex;
  60. align-items: center;
  61. margin-bottom: 10rpx;
  62. .currency {
  63. font-size: 32rpx;
  64. color: #D81A00;
  65. font-weight: bold;
  66. }
  67. .price {
  68. font-size: 48rpx;
  69. color: #D81A00;
  70. font-weight: bold;
  71. margin-right: 20rpx;
  72. }
  73. .balance-tag {
  74. background: #EFA941;
  75. border-radius: 20rpx;
  76. padding: 2rpx 16rpx;
  77. text {
  78. font-size: 22rpx;
  79. color: #fff;
  80. }
  81. }
  82. }
  83. .meta-row {
  84. margin-bottom: 20rpx;
  85. font-size: 26rpx;
  86. color: #999;
  87. .original-price {
  88. text-decoration: line-through;
  89. margin-left: 10rpx;
  90. }
  91. }
  92. .author-row {
  93. display: flex;
  94. justify-content: space-between;
  95. align-items: center;
  96. font-size: 28rpx;
  97. color: #F2950A;
  98. .author {
  99. flex: 1;
  100. }
  101. .works-link {
  102. display: flex;
  103. align-items: center;
  104. }
  105. }
  106. }
  107. </style>