KlonContent.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="introduce-section">
  3. <text class="title clamp">{{ goodsObjact.title }}</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-box">
  14. <text class="price-tip">¥</text>
  15. <view class="price">
  16. {{ goodsObjact.price }}
  17. <text class="text">/份</text>
  18. <text class="m-price" v-if="goodsObjact.ot_price > goodsObjact.price">¥{{ goodsObjact.ot_price }}</text>
  19. </view>
  20. </view>
  21. <!-- <view class="price-green">
  22. ¥{{ goodsObjact.ot_price }}
  23. <text>市场价</text>
  24. </view> -->
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. goodsObjact: {
  31. type: Object,
  32. default: function() {
  33. return {
  34. percent:1
  35. };
  36. }
  37. }
  38. },
  39. filters: {
  40. parseIntTo(percent) {
  41. percent = +percent * 100;
  42. if (percent % 1 === 0) {
  43. return percent;
  44. } else {
  45. percent = percent.toFixed(1);
  46. return percent;
  47. }
  48. }
  49. },
  50. data() {
  51. return {};
  52. }
  53. };
  54. </script>
  55. <style lang="scss">
  56. /* 标题简介 */
  57. .introduce-section {
  58. position: relative;
  59. background: #fff;
  60. padding: 35rpx 0rpx;
  61. padding-left: 35rpx;
  62. .title {
  63. font-size: 32rpx;
  64. color: $font-color-dark;
  65. height: 50rpx;
  66. width: 70%;
  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: 99;
  105. top: 3rpx;
  106. left: 15rpx;
  107. color: #ffffff;
  108. }
  109. }
  110. .price-box {
  111. display: flex;
  112. align-items: baseline;
  113. height: 64rpx;
  114. padding: 10rpx 0;
  115. font-size: 26rpx;
  116. color: $uni-color-primary;
  117. }
  118. .price {
  119. font-size: $font-lg + 6rpx;
  120. .text {
  121. padding-left: 5rpx;
  122. color: #b0b0b0;
  123. font-size: 22rpx !important;
  124. }
  125. }
  126. .price-green {
  127. color: #2dbd59;
  128. font-size: 28rpx !important;
  129. text {
  130. background: #2dbd59;
  131. color: #ffffff;
  132. padding: 0rpx 10rpx;
  133. border-radius: 5rpx;
  134. font-size: 22rpx !important;
  135. margin-left: 15rpx;
  136. }
  137. }
  138. .m-price {
  139. margin: 0 12rpx;
  140. color: $font-color-light;
  141. text-decoration: line-through;
  142. margin-left: 25rpx;
  143. font-size: 24rpx;
  144. }
  145. }
  146. </style>