cm-order-share-reduce.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="share-reduce">
  3. <template v-if="!reductionData.status">
  4. <view class="left-title high">
  5. <text>金额满{{ reduction.touchPrice }}元,分享可立减{{ reduction.reducedAmount }}元</text>
  6. </view>
  7. <view class="right-content">
  8. <view class="share-btn">
  9. <!-- 分享按钮 -->
  10. <button open-type="share">点击分享</button>
  11. </view>
  12. </view>
  13. </template>
  14. <template v-else>
  15. <view class="left-title">分享减免</view>
  16. <view class="right-content">
  17. <view class="reduce-amount">-¥{{ reduction.reducedAmount | formatPrice }}</view>
  18. <view class="iconfont icon-chakangengduo"></view>
  19. </view>
  20. </template>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. props: {
  26. reductionData: {
  27. type: Object,
  28. default: () => {}
  29. }
  30. },
  31. computed: {
  32. reduction() {
  33. return this.reductionData.reduction || {}
  34. }
  35. },
  36. created() {
  37. console.log(this.reductionData)
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .share-reduce {
  43. display: flex;
  44. justify-content: space-between;
  45. align-items: center;
  46. padding: 0 24rpx;
  47. height: 90rpx;
  48. background: #fff;
  49. .left-title {
  50. font-weight: bold;
  51. color: #333333;
  52. font-size: 28rpx;
  53. &.high {
  54. color: #ff457b;
  55. }
  56. }
  57. .right-content {
  58. display: flex;
  59. justify-content: flex-start;
  60. align-items: center;
  61. .coupon-amount,
  62. .reduce-amount,
  63. .share-btn {
  64. font-size: 28rpx;
  65. color: #ff457b;
  66. margin-right: 12rpx;
  67. button {
  68. display: inline;
  69. color: #ff457b;
  70. }
  71. }
  72. .iconfont {
  73. font-size: 28rpx;
  74. color: #b2b2b2;
  75. }
  76. }
  77. }
  78. </style>