productContent.vue 3.1 KB

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