cm-order-submit-nav.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <view class="cm-order-submit-nav" :class="{offset : isIphoneX}">
  3. <view class="submit">
  4. <view class="count">共{{ orderInfo.allCount }}件商品</view>
  5. <view class="total">
  6. <view class="price"> <text class="label">总计:</text> <text>¥{{orderInfo.payAllPrice | formatPrice}}</text> </view>
  7. <view class="reduce" v-if="orderInfo.discountedPrice"> <text class="label">共减:</text> <text>¥{{orderInfo.discountedPrice | formatPrice}}</text> </view>
  8. </view>
  9. <button class="btn" @click="$emit('commit')">提交订单</button>
  10. </view>
  11. <view class="reserved"></view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. props:{
  17. orderInfo:{
  18. type: Object,
  19. default:()=>{}
  20. }
  21. },
  22. computed:{
  23. isIphoneX(){
  24. return this.$store.getters.isIphoneX
  25. }
  26. }
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .cm-order-submit-nav{
  31. width: 100%;
  32. position: fixed;
  33. bottom: 0;
  34. left: 0;
  35. .reserved{
  36. background: #fff;
  37. }
  38. .submit {
  39. display: flex;
  40. justify-content: space-between;
  41. align-items: center;
  42. box-sizing: border-box;
  43. height: 100rpx;
  44. padding: 0 24rpx;
  45. background: #fff;
  46. &.offset{
  47. transform: translateY(-50rpx);
  48. }
  49. .count {
  50. font-size: 28rpx;
  51. color: #333333;
  52. }
  53. .total {
  54. display: flex;
  55. flex-direction: column;
  56. justify-content: center;
  57. align-items: flex-start;
  58. margin: 0 24rpx;
  59. .price {
  60. font-size: 26rpx;
  61. color: #ff457b;
  62. .label {
  63. color: #333333;
  64. }
  65. }
  66. .reduce {
  67. margin-top: 4rpx;
  68. font-size: 24rpx;
  69. color: #ff457b;
  70. }
  71. }
  72. .btn {
  73. width: 210rpx;
  74. height: 80rpx;
  75. background: linear-gradient(90deg, #fa55bf 0%, #f83c6c 100%);
  76. opacity: 1;
  77. color: #fff;
  78. line-height: 80rpx;
  79. text-align: center;
  80. border-radius: 40rpx;
  81. margin: 0;
  82. }
  83. }
  84. }
  85. </style>