order-actions.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="order-container" style="width: 100%;" :class="{ 'large-size': size === 'large' }">
  3. <view class="order-actions">
  4. <!-- 未提交 -->
  5. <button v-if="status === 0" class="action-btn" @click.stop="handleAction('submit')">提交订单</button>
  6. <!-- 待初审 -->
  7. <template v-if="status === 2">
  8. <view class="flex-row w-full" style="display: flex;justify-content: space-between;">
  9. <button class="action-btn info-btn" @click.stop="handleAction('cancel')">取消订单</button>
  10. <view class="flex-row">
  11. <button class="action-btn plain" @click.stop="handleAction('editAddress')">修改地址</button>
  12. <button v-if="item.canReport == 1" class="action-btn"
  13. @click.stop="handleAction('report')">一键上报</button>
  14. </view>
  15. </view>
  16. </template>
  17. <!-- 待取件 -->
  18. <button v-if="status === 3 && item.canReport == 1" class="action-btn"
  19. @click.stop="handleAction('report')">一键上报</button>
  20. <!-- 待审核 -->
  21. <template v-if="status === 8">
  22. <button class="action-btn" @click.stop="handleAction('remindAudit')"
  23. v-if="item.canNotice == 1">提醒审核</button>
  24. <button class="action-btn plain" v-if="item.canComplaints == 1"
  25. @click.stop="handleAction('complaint')">订单投诉</button>
  26. </template>
  27. <!-- 待到款 -->
  28. <button v-if="status === 10" class="action-btn" @click.stop="handleAction('complaint')">订单投诉</button>
  29. <!-- 已完成 -->
  30. <template v-if="status === 11">
  31. <button class="action-btn plain" v-if="item.canComplaints == 1"
  32. @click.stop="handleAction('complaint')">订单投诉</button>
  33. <button v-if="showCompensation" class="action-btn"
  34. @click.stop="handleAction('compensation')">卖亏补差</button>
  35. </template>
  36. </view>
  37. <u-action-sheet v-model="showReportSheet" :list="actionList" @close="showReportSheet = false"
  38. @click="handleReportSelect" cancelText="取消" :mask-close-able="false" :safe-area-inset-bottom="true" />
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. name: 'OrderActions',
  44. props: {
  45. status: {
  46. type: Number,
  47. required: true
  48. },
  49. order: {
  50. type: Object,
  51. default: () => ({})
  52. },
  53. size: {
  54. type: String,
  55. default: 'normal'
  56. }
  57. },
  58. methods: {
  59. handleAction(type) {
  60. this.$emit('action', {
  61. type,
  62. order: this.order
  63. })
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .order-actions {
  70. display: flex;
  71. justify-content: flex-end;
  72. gap: 10px;
  73. padding: 16rpx 0;
  74. padding-bottom: 10rpx;
  75. width: 100%;
  76. .w-full {
  77. width: 100%;
  78. }
  79. .action-btn {
  80. display: flex;
  81. align-items: center;
  82. justify-content: center;
  83. min-width: 166rpx;
  84. height: 60rpx;
  85. line-height: 60rpx;
  86. border-radius: 10rpx;
  87. font-size: 28rpx;
  88. background-color: #38C148;
  89. color: #ffffff;
  90. cursor: pointer;
  91. margin: 0;
  92. border: 0;
  93. max-width: 200rpx;
  94. &::after {
  95. border: 0;
  96. }
  97. &+.action-btn {
  98. margin-left: 16rpx;
  99. }
  100. &.info-btn {
  101. background-color: #DBDBDB;
  102. color: #ffffff;
  103. }
  104. &.plain {
  105. border: 1px solid #38C148;
  106. color: #38C148;
  107. background-color: #fff;
  108. }
  109. }
  110. }
  111. .large-size {
  112. .order-actions {
  113. .action-btn {
  114. max-width: 200rpx;
  115. height: 72rpx;
  116. line-height: 72rpx;
  117. }
  118. }
  119. }
  120. </style>