order-actions.vue 4.9 KB

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