index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <view :style="viewColor">
  3. <!-- 选择送货方式 -->
  4. <view class="mask-box">
  5. <view class="bg" v-if="isShowDiscount"></view>
  6. <view class="mask-content animated" :class="{slideInUp:isShowDiscount}">
  7. <view class="title-bar">
  8. 优惠明细
  9. <view class="close" @click="closeShowBox"><text class="iconfont icon-guanbi"></text></view>
  10. </view>
  11. <view class="box">
  12. <view class="check-item">
  13. <view>商品金额:</view>
  14. <view class="radio">
  15. ¥{{couponData.total_price}}
  16. </view>
  17. </view>
  18. <view v-if="couponData.order_total_integral_price>0" class="check-item">
  19. <view>积分抵扣:</view>
  20. <view class="radio">
  21. -¥{{couponData.order_total_integral_price}}
  22. </view>
  23. </view>
  24. <view v-if="couponData.total_platform_coupon_price>0" class="check-item">
  25. <view>平台优惠金额:</view>
  26. <view class="radio">
  27. -¥{{ couponData.total_platform_coupon_price }}
  28. </view>
  29. </view>
  30. <view v-if="couponData.order_coupon_price>0" class="check-item">
  31. <view>店铺优惠金额:</view>
  32. <view class="radio">
  33. -¥{{ couponData.order_coupon_price }}
  34. </view>
  35. </view>
  36. <view v-if="couponData.total_coupon>0" class="check-item total">
  37. <view>共优惠:</view>
  38. <view class="radio">
  39. -¥{{ couponData.total_coupon}}
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. // +----------------------------------------------------------------------
  49. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  50. // +----------------------------------------------------------------------
  51. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  52. // +----------------------------------------------------------------------
  53. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  54. // +----------------------------------------------------------------------
  55. // | Author: CRMEB Team <admin@crmeb.com>
  56. // +----------------------------------------------------------------------
  57. import { mapGetters } from "vuex";
  58. export default{
  59. name:'Discount',
  60. props:{
  61. isShowDiscount:{
  62. type:Boolean,
  63. default:false
  64. },
  65. couponData:{
  66. type:Object,
  67. default:function(){
  68. return {}
  69. }
  70. }
  71. },
  72. computed: mapGetters(['viewColor']),
  73. data(){
  74. return {
  75. }
  76. },
  77. created() {
  78. },
  79. methods:{
  80. // 关闭配送方式弹窗
  81. closeShowBox(){
  82. this.$emit('close')
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang="scss">
  88. .mask-box{
  89. .bg{
  90. z-index: 9;
  91. position: fixed;
  92. left: 0;
  93. bottom: 100rpx;
  94. width: 100%;
  95. height: 100%;
  96. background: rgba(0,0,0,0.5);
  97. }
  98. .mask-content{
  99. z-index: 10;
  100. position: fixed;
  101. left: 0;
  102. bottom: 100rpx;
  103. width: 100%;
  104. background-color: #f5f5f5;
  105. border-radius: 16rpx 16rpx 0 0;
  106. transform: translate3d(0, 200%, 0);
  107. transition: all .3s cubic-bezier(.25, .5, .5, .9);
  108. .title-bar{
  109. position: relative;
  110. text-align: center;
  111. padding: 30rpx 0;
  112. margin-bottom: 20rpx;
  113. font-size: 32rpx;
  114. color: #282828;
  115. .close{
  116. position: absolute;
  117. right: 30rpx;
  118. top: 50%;
  119. transform: translateY(-50%);
  120. .iconfont{
  121. color: #8A8A8A;
  122. }
  123. }
  124. }
  125. .box{
  126. padding: 0 30rpx 60rpx;
  127. .check-item{
  128. display: flex;
  129. align-items: center;
  130. justify-content: space-between;
  131. height: 40rpx;
  132. margin-bottom: 50rpx;
  133. font-size: 28rpx;
  134. &.total{
  135. font-weight: bold;
  136. font-size: 32rpx;
  137. .radio{
  138. color: var(--view-priceColor);
  139. }
  140. }
  141. }
  142. }
  143. }
  144. }
  145. .animated {
  146. animation-duration: .3s
  147. }
  148. </style>