goods-info.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="goods_info">
  3. <view class="title">
  4. <u-tag text="HOT" type="error" size="mini" mode="dark" v-if="data.tags_type=='hot'" />
  5. <u-tag text="推荐" type="success" size="mini" mode="dark" v-if="data.tags_type=='recommend'" />
  6. <text>{{ data.title }}</text>
  7. </view>
  8. <view class="count">
  9. <view class="price">
  10. <text>¥</text>
  11. <text>{{ selectedSku.price_selling||data.price_selling }}</text>
  12. <!-- <text>¥{{ data.oldPrice }}</text> -->
  13. </view>
  14. <view class="sale">
  15. <text>月销</text>
  16. <!-- <text>{{ $replaceSale(data.stock_sales) }}</text> -->
  17. <text>{{ data.stock_sales}}</text>
  18. </view>
  19. </view>
  20. <!-- <view class="notice">
  21. <text>恭喜小主,您有优惠券可用哦</text>
  22. <text>查看</text>
  23. <u-icon name="arrow-right" :color="appThemeBuyBtnBgColor" size="24"></u-icon>
  24. </view> -->
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. name: 'goods-info',
  30. props: {
  31. // 数据源
  32. data: {
  33. type: Object,
  34. default: () => {
  35. return {};
  36. }
  37. },
  38. // 选中的sku
  39. selectedSku: {
  40. type: Object,
  41. default: () => {
  42. return {};
  43. }
  44. },
  45. // 商品类型
  46. goodsType: {
  47. type: String,
  48. default: ''
  49. }
  50. },
  51. data() {
  52. return {
  53. appThemeColor: this.$appTheme.appThemeColor
  54. };
  55. }
  56. };
  57. </script>
  58. <style lang="scss" scoped>
  59. .goods_info {
  60. margin-bottom: 16rpx;
  61. background-color: $app-theme-bg-color;
  62. }
  63. .count {
  64. display: flex;
  65. justify-content: space-between;
  66. align-items: flex-end;
  67. padding: 0 30rpx 26rpx;
  68. .price {
  69. font-weight: bold;
  70. text:nth-child(1) {
  71. font-size: 28rpx;
  72. color: $app-theme-text-money-color;
  73. }
  74. text:nth-child(2) {
  75. font-size: 40rpx;
  76. color: $app-theme-text-money-color;
  77. margin-right: 24rpx;
  78. }
  79. text:nth-child(3) {
  80. font-size: 28rpx;
  81. color: $app-theme-card-gray-light-color;
  82. text-decoration-line: line-through;
  83. }
  84. }
  85. .sale {
  86. text:nth-child(1) {
  87. font-size: 28rpx;
  88. color: $app-theme-card-gray-deep-color;
  89. margin-right: 8rpx;
  90. }
  91. text:nth-child(2) {
  92. font-size: 28rpx;
  93. color: $app-theme-card-gray-deep-color;
  94. }
  95. }
  96. }
  97. .title {
  98. padding: 26rpx 30rpx 16rpx;
  99. text {
  100. vertical-align: middle;
  101. padding-left: 8rpx;
  102. font-size: 32rpx;
  103. font-weight: 500;
  104. color: $app-theme-text-black-deep-color;
  105. }
  106. }
  107. .notice {
  108. padding: 0 30rpx 30rpx 30rpx;
  109. font-size: 28rpx;
  110. text:nth-child(1) {
  111. color: $app-theme-text-gray-color;
  112. margin-right: 20rpx;
  113. }
  114. text:nth-child(2) {
  115. color: $app-theme-buybtn-bg-color;
  116. }
  117. }
  118. </style>