order-submit.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <view class="order-submit">
  3. <simple-safe-view>
  4. <template v-if="showAgreement">
  5. <order-return-instructions
  6. :content="agreementContent"
  7. @change="handleAgreementChange"
  8. ></order-return-instructions>
  9. </template>
  10. <view class="control">
  11. <view class="count">共{{ orderInfo.allCount }}件商品</view>
  12. <view class="price">
  13. <view class="total">
  14. 总计:
  15. <text class="paymount">¥{{ orderInfo.payAllPrice | priceFormat }}</text>
  16. </view>
  17. <view class="reduce" v-if="orderInfo.discountedPrice">
  18. 共减:¥{{ orderInfo.discountedPrice | priceFormat }}
  19. </view>
  20. </view>
  21. <tui-button type="base" width="210rpx" height="80rpx" shape="circle" @click="handleSubmit">
  22. 提交订单
  23. </tui-button>
  24. </view>
  25. </simple-safe-view>
  26. <!-- 订单提交拦截 -->
  27. <tui-modal
  28. :show="showModel"
  29. content="请先阅读《特殊商品退货须知》并勾选后再提交订单~"
  30. @click="showModel = false"
  31. ></tui-modal>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. name: 'order-submit',
  37. props: {
  38. showAgreement: {
  39. type: Boolean,
  40. default: false
  41. },
  42. agreementContent: {
  43. type: String,
  44. default: ''
  45. },
  46. orderInfo: {
  47. type: Object,
  48. default: () => {}
  49. }
  50. },
  51. data() {
  52. return {
  53. agreementActive: false,
  54. showModel: false
  55. }
  56. },
  57. methods: {
  58. handleAgreementChange(val) {
  59. this.agreementActive = val
  60. },
  61. handleSubmit() {
  62. if (this.showAgreement && !this.agreementActive) {
  63. this.showModel = true
  64. return
  65. }
  66. this.$emit('submit')
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .order-submit {
  73. @extend .fixed-bottom;
  74. border-top: 1px solid #eee;
  75. background-color: #fff;
  76. .control {
  77. @extend .cm-flex-between;
  78. height: 100rpx;
  79. box-sizing: border-box;
  80. padding: 0 24rpx;
  81. .count {
  82. font-size: 28rpx;
  83. }
  84. .price {
  85. font-size: 26rpx;
  86. .paymount {
  87. color: #f83c6c;
  88. }
  89. .reduce {
  90. color: #f83c6c;
  91. font-size: 24rpx;
  92. }
  93. }
  94. }
  95. }
  96. </style>