style2.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template id="goods-info-style2">
  2. <div class="goods-info-style2">
  3. <div class="goods-card">
  4. <div class="goods-price">
  5. ¥
  6. <span class="amount" v-if="goodsData.price == 1">88-100</span>
  7. <span class="amount" v-else>88</span>
  8. </div>
  9. <div class="goods-cont" flex="main:justify">
  10. <div class="goods-cont-left">
  11. <div class="goods-title">商品标题</div>
  12. <div class="goods-subtitle">商品副标题</div>
  13. </div>
  14. <div class="goods-cont-right" flex="main:center cross:center" v-if="goodsData.share == 1">
  15. <i class="iconfont icon-fenxiang"></i>
  16. </div>
  17. </div>
  18. <div class="goods-express" flex="main:justify">
  19. <div>
  20. 快递:¥
  21. <span v-if="goodsData.delivery == 1">10-22</span>
  22. <span v-else>10</span>
  23. </div>
  24. <div>销量:22</div>
  25. <div>库存:22</div>
  26. </div>
  27. <div class="goods-commison" v-if="goodsData.commission">
  28. <span>预计佣金</span>
  29. <span class="commison-money">¥12.4</span>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. /**
  36. * @descriptions
  37. * 1. 组件名字必须对应模板形式 - 递归组件name
  38. * 2. 样式内容方法尽量内部维护 - 前端方便通用
  39. * 3. 父级组件会传预览数据 - activeItem
  40. */
  41. Vue.component('goods-info-style2', {
  42. name: "goods-info-style2",
  43. props: {
  44. activeItem: {
  45. type: Object,
  46. default () {
  47. return {}
  48. }
  49. },
  50. goodsData: {
  51. type: Object,
  52. default () {
  53. return {}
  54. }
  55. }
  56. },
  57. template: '#goods-info-style2',
  58. data() {
  59. return {
  60. }
  61. }
  62. });
  63. </script>
  64. <style>
  65. .goods-info-style2 .goods-card {
  66. position: relative;
  67. width: 355px;
  68. background-color: #fff;
  69. margin: auto;
  70. margin-top: -20px;
  71. border-radius: 5px;
  72. padding: 0 12px 5px;
  73. }
  74. .goods-info-style2 .goods-commison {
  75. position: absolute;
  76. top: 20px;
  77. right: 0;
  78. padding: 0 20px;
  79. height: 20px;
  80. font-size: 12px;
  81. background: #FFE7E7;
  82. border-radius: 20px 0 0 20px;
  83. line-height: 20px;
  84. }
  85. .goods-info-style2 .goods-commison .commison-money {
  86. color: #DB0505;
  87. }
  88. .goods-info-style2 .goods-card .goods-price {
  89. font-weight: 700;
  90. font-size: 17px;
  91. padding: 18px 0;
  92. color: #DB0505;
  93. }
  94. .goods-info-style2 .goods-price .amount {
  95. font-size: 28px;
  96. }
  97. .goods-info-style2 .goods-cont-left .goods-title {
  98. font-size: 16px;
  99. font-weight: 700;
  100. }
  101. .goods-info-style2 .goods-cont-left .goods-subtitle {
  102. font-size: 14px;
  103. color: #b0b3bf;
  104. padding: 10px 0 20px 0;
  105. }
  106. .goods-info-style2 .goods-cont-right {
  107. width: 32px;
  108. height: 32px;
  109. background: #F0F0F0;
  110. border-radius: 50%;
  111. font-size: 12px;
  112. color: #999;
  113. }
  114. .goods-info-style2 .goods-express {
  115. position: relative;
  116. line-height: 36px;
  117. color: #b0b3bf;
  118. font-size: 12px;
  119. }
  120. .goods-info-style2 .goods-express:before {
  121. position: absolute;
  122. content: "";
  123. left: -12px;
  124. right: -12px;
  125. top: 0;
  126. border-top: 1px dashed #ededed;
  127. }
  128. </style>