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