productContent.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="introduce-section">
  3. <!-- 分享 -->
  4. <button open-type="share" class="shareDate" style="border: none;">
  5. <image class="share-img" src="../../../static/icon/share.png"></image>
  6. </button>
  7. <!-- 价格信息 -->
  8. <view class="price-box">
  9. <text class="price-tip">¥</text>
  10. <view class="price">
  11. {{ goodsObjact.price }}
  12. <text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text>
  13. </view>
  14. </view>
  15. <!-- 商品名称 -->
  16. <text class="title clamp2">{{ goodsObjact.store_name }}</text>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. props: {
  22. goodsObjact: {
  23. type: Object,
  24. default: function() {
  25. return {
  26. percent:1
  27. };
  28. }
  29. }
  30. },
  31. filters: {
  32. parseIntTo(percent) {
  33. percent = +percent * 100;
  34. if (percent % 1 === 0) {
  35. return percent;
  36. } else {
  37. percent = percent.toFixed(1);
  38. return percent;
  39. }
  40. }
  41. },
  42. data() {
  43. return {};
  44. }
  45. };
  46. </script>
  47. <style lang="scss">
  48. /* 标题简介 */
  49. .introduce-section {
  50. position: relative;
  51. background: #fff;
  52. padding: 35rpx 0rpx;
  53. padding-left: 35rpx;
  54. .title {
  55. font-size: 32rpx;
  56. color: $font-color-dark;
  57. .tip-o {
  58. color: #ff3334;
  59. padding-left: 15rpx;
  60. }
  61. }
  62. .shareDate {
  63. position: absolute;
  64. top: 25rpx;
  65. right: 10rpx;
  66. font-size: 26rpx;
  67. color: #3d3f46;
  68. border-radius: 15rpx;
  69. background-color: #ffffff;
  70. height: 60rpx;
  71. line-height: 60rpx;
  72. &::after {
  73. border: none;
  74. }
  75. }
  76. .share-img {
  77. width: 30rpx;
  78. height: 30rpx;
  79. position: relative;
  80. top: 5rpx;
  81. left: 0;
  82. margin-right: 10rpx;
  83. }
  84. .info {
  85. color: #999999;
  86. font-size: 26rpx;
  87. padding-bottom: 15rpx;
  88. }
  89. .progress-box {
  90. width: 260rpx;
  91. position: relative;
  92. margin-top: 15rpx;
  93. line-height: 10px;
  94. .number {
  95. font-size: 17rpx;
  96. position: absolute;
  97. z-index: 999;
  98. top: 3rpx;
  99. left: 15rpx;
  100. color: #ffffff;
  101. }
  102. }
  103. .price-box {
  104. display: flex;
  105. align-items: baseline;
  106. height: 64rpx;
  107. padding: 10rpx 0;
  108. font-size: 26rpx;
  109. color: $uni-color-primary;
  110. }
  111. .price {
  112. font-size: $font-lg + 6rpx;
  113. .text {
  114. padding-left: 5rpx;
  115. color: #b0b0b0;
  116. font-size: 22rpx !important;
  117. }
  118. }
  119. .price-green {
  120. color: #2dbd59;
  121. font-size: 28rpx !important;
  122. text {
  123. background: #2dbd59;
  124. color: #ffffff;
  125. padding: 0rpx 10rpx;
  126. border-radius: 5rpx;
  127. font-size: 22rpx !important;
  128. margin-left: 15rpx;
  129. }
  130. }
  131. .m-price {
  132. margin: 0 12rpx;
  133. color: $font-color-light;
  134. text-decoration: line-through;
  135. margin-left: 25rpx;
  136. font-size: 24rpx;
  137. }
  138. }
  139. .share-wrapper {
  140. width: 36rpx;
  141. height: 36rpx;
  142. position: absolute;
  143. top: 27rpx;
  144. right: 43rpx;
  145. background-color: #fff;
  146. image {
  147. width: 100%;
  148. height: 100%;
  149. }
  150. }
  151. </style>