order-bottom-bar.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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" size="mini" shape="circle" type="warning" :custom-style="btnStyle"
  17. @click="emitAction('overtime')">超时发货</u-button>
  18. <!-- 降价补差 -->
  19. <u-button v-if="orderInfo.showCompensation" size="mini" shape="circle" type="primary"
  20. :custom-style="themeLightBtnStyle" @click="emitAction('priceMatch')">降价补差</u-button>
  21. <!-- 催发货 -->
  22. <u-button v-if="orderInfo.showUrge" size="mini" shape="circle" :custom-style="themeBtnStyle"
  23. @click="emitAction('remind')">催发货</u-button>
  24. <!-- 付款 -->
  25. <u-button v-if="orderInfo.showPay" size="mini" shape="circle" :custom-style="themeBtnStyle"
  26. @click="emitAction('pay')">继续付款</u-button>
  27. <!-- 确认收货 -->
  28. <u-button v-if="orderInfo.showConfirmShop" size="mini" shape="circle" :custom-style="themeBtnStyle"
  29. @click="emitAction('confirm')">确认收货</u-button>
  30. <!-- 钱款去向 -->
  31. <u-button v-if="orderInfo.showMoneyDestination" size="mini" shape="circle" :custom-style="themeBtnStyle"
  32. @click="emitAction('moneyWhere')">钱款去向</u-button>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. props: {
  38. orderInfo: {
  39. type: Object,
  40. default: () => ({})
  41. }
  42. },
  43. data() {
  44. return {
  45. btnStyle: {
  46. marginLeft: '20rpx',
  47. width: '160rpx',
  48. height: '60rpx',
  49. lineHeight: '60rpx',
  50. padding: '0',
  51. fontSize: '26rpx'
  52. },
  53. themeBtnStyle: {
  54. marginLeft: '20rpx',
  55. width: '160rpx',
  56. height: '60rpx',
  57. lineHeight: '60rpx',
  58. padding: '0',
  59. backgroundColor: '#38C148',
  60. color: '#fff',
  61. border: 'none',
  62. fontSize: '26rpx'
  63. },
  64. themeLightBtnStyle: {
  65. marginLeft: '20rpx',
  66. width: '160rpx',
  67. height: '60rpx',
  68. lineHeight: '60rpx',
  69. padding: '0',
  70. backgroundColor: '#5bc0de',
  71. color: '#fff',
  72. border: 'none',
  73. fontSize: '26rpx'
  74. }
  75. };
  76. },
  77. methods: {
  78. emitAction(type) {
  79. this.$emit('action', type);
  80. }
  81. }
  82. };
  83. </script>
  84. <style lang="scss" scoped>
  85. .bottom-bar {
  86. position: fixed;
  87. bottom: 0;
  88. left: 0;
  89. right: 0;
  90. background-color: #fff;
  91. display: flex;
  92. align-items: center;
  93. justify-content: flex-end;
  94. padding: 20rpx 30rpx 0 30rpx;
  95. z-index: 99;
  96. padding-bottom: constant(safe-area-inset-bottom);
  97. padding-bottom: env(safe-area-inset-bottom);
  98. }
  99. </style>