order-bottom-bar.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="bottom-bar">
  3. <!-- 加入购物车 -->
  4. <u-button v-if="orderInfo.showAddToCart" size="mini" shape="circle" plain :custom-style="btnStyle"
  5. @click="emitAction('addToCart')">加入购物车</u-button>
  6. <!-- 修改地址 -->
  7. <u-button v-if="orderInfo.showModifyAddress" size="mini" shape="circle" plain :custom-style="btnStyle"
  8. @click="emitAction('address')">修改地址</u-button>
  9. <!-- 取消订单 -->
  10. <u-button v-if="orderInfo.showCancel" size="mini" shape="circle" plain :custom-style="btnStyle"
  11. @click="emitAction('cancel')">取消订单</u-button>
  12. <!-- 投诉 -->
  13. <u-button v-if="orderInfo.showComplaint" size="mini" shape="circle" plain :custom-style="btnStyle"
  14. @click="emitAction('complaint')">投诉</u-button>
  15. <!-- 超时发货 -->
  16. <u-button v-if="orderInfo.showSendTimeout === 1" size="mini" shape="circle" type="warning" :custom-style="btnStyle"
  17. @click="emitAction('overtime')">超时发货</u-button>
  18. <u-button v-if="orderInfo.showSendTimeout === 2" size="mini" shape="circle" type="warning" plain :custom-style="autoBtnStyle"
  19. >超时发货已赔付</u-button>
  20. <!-- 降价补差 -->
  21. <u-button v-if="orderInfo.showCompensation" size="mini" shape="circle" type="primary"
  22. :custom-style="themeLightBtnStyle" @click="emitAction('priceMatch')">降价补差</u-button>
  23. <!-- 催发货 -->
  24. <u-button v-if="orderInfo.showUrge" size="mini" shape="circle" :custom-style="themeBtnStyle"
  25. @click="emitAction('remind')">催发货</u-button>
  26. <!-- 付款 -->
  27. <u-button v-if="orderInfo.showPay" size="mini" shape="circle" :custom-style="themeBtnStyle"
  28. @click="emitAction('pay')">继续付款</u-button>
  29. <!-- 确认收货 -->
  30. <u-button v-if="orderInfo.showConfirmShop" size="mini" shape="circle" :custom-style="themeBtnStyle"
  31. @click="emitAction('confirm')">确认收货</u-button>
  32. <!-- 钱款去向 -->
  33. <!-- <u-button v-if="orderInfo.showMoneyDestination" size="mini" shape="circle" :custom-style="themeBtnStyle"
  34. @click="emitAction('moneyWhere')">钱款去向</u-button> -->
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. props: {
  40. orderInfo: {
  41. type: Object,
  42. default: () => ({})
  43. }
  44. },
  45. data() {
  46. return {
  47. btnStyle: {
  48. marginLeft: '20rpx',
  49. width: '160rpx',
  50. height: '60rpx',
  51. lineHeight: '60rpx',
  52. padding: '0',
  53. fontSize: '26rpx'
  54. },
  55. autoBtnStyle: {
  56. marginLeft: '20rpx',
  57. height: '60rpx',
  58. lineHeight: '60rpx',
  59. padding: '0 20rpx',
  60. fontSize: '26rpx'
  61. },
  62. themeBtnStyle: {
  63. marginLeft: '20rpx',
  64. width: '160rpx',
  65. height: '60rpx',
  66. lineHeight: '60rpx',
  67. padding: '0',
  68. backgroundColor: '#38C148',
  69. color: '#fff',
  70. border: 'none',
  71. fontSize: '26rpx'
  72. },
  73. themeLightBtnStyle: {
  74. marginLeft: '20rpx',
  75. width: '160rpx',
  76. height: '60rpx',
  77. lineHeight: '60rpx',
  78. padding: '0',
  79. backgroundColor: '#5bc0de',
  80. color: '#fff',
  81. border: 'none',
  82. fontSize: '26rpx'
  83. }
  84. };
  85. },
  86. methods: {
  87. emitAction(type) {
  88. this.$emit('action', type);
  89. }
  90. }
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. .bottom-bar {
  95. position: fixed;
  96. bottom: 0;
  97. left: 0;
  98. right: 0;
  99. background-color: #fff;
  100. display: flex;
  101. align-items: center;
  102. justify-content: flex-end;
  103. padding: 20rpx 30rpx 0 30rpx;
  104. z-index: 99;
  105. padding-bottom: constant(safe-area-inset-bottom);
  106. padding-bottom: env(safe-area-inset-bottom);
  107. }
  108. </style>