productContent.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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-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. .tip-o {
  66. color: #ff3334;
  67. padding-left: 15rpx;
  68. }
  69. }
  70. .shareDate {
  71. position: absolute;
  72. top: 25rpx;
  73. right: 25rpx;
  74. font-size: 26rpx;
  75. color: #3d3f46;
  76. border-radius: 15rpx;
  77. background-color: #ffffff;
  78. height: 60rpx;
  79. line-height: 60rpx;
  80. }
  81. .share-img {
  82. width: 30rpx;
  83. height: 30rpx;
  84. position: relative;
  85. top: 5rpx;
  86. left: 0;
  87. margin-right: 10rpx;
  88. }
  89. .info {
  90. color: #999999;
  91. font-size: 26rpx;
  92. padding-bottom: 15rpx;
  93. }
  94. .progress-box {
  95. width: 260rpx;
  96. position: relative;
  97. margin-top: 15rpx;
  98. line-height: 10px;
  99. .number {
  100. font-size: 17rpx;
  101. position: absolute;
  102. z-index: 999;
  103. top: 3rpx;
  104. left: 15rpx;
  105. color: #ffffff;
  106. }
  107. }
  108. .price-box {
  109. display: flex;
  110. align-items: baseline;
  111. height: 64rpx;
  112. padding: 10rpx 0;
  113. font-size: 26rpx;
  114. color: $uni-color-primary;
  115. }
  116. .price {
  117. font-size: $font-lg + 6rpx;
  118. .text {
  119. padding-left: 5rpx;
  120. color: #b0b0b0;
  121. font-size: 22rpx !important;
  122. }
  123. }
  124. .price-green {
  125. color: #2dbd59;
  126. font-size: 28rpx !important;
  127. text {
  128. background: #2dbd59;
  129. color: #ffffff;
  130. padding: 0rpx 10rpx;
  131. border-radius: 5rpx;
  132. font-size: 22rpx !important;
  133. margin-left: 15rpx;
  134. }
  135. }
  136. .m-price {
  137. margin: 0 12rpx;
  138. color: $font-color-light;
  139. text-decoration: line-through;
  140. margin-left: 25rpx;
  141. font-size: 24rpx;
  142. }
  143. }
  144. </style>