order-actions.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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" @click.stop="handleReview">已申请复审</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. handleReview() {
  85. uni.showToast({
  86. title: '正在复审中,请耐心等待',
  87. icon: 'none'
  88. })
  89. },
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .order-actions {
  95. display: flex;
  96. justify-content: flex-end;
  97. gap: 10px;
  98. padding: 16rpx 0;
  99. padding-bottom: 10rpx;
  100. width: 100%;
  101. .w-full {
  102. width: 100%;
  103. }
  104. .action-btn {
  105. display: flex;
  106. align-items: center;
  107. justify-content: center;
  108. min-width: 166rpx;
  109. height: 60rpx;
  110. line-height: 60rpx;
  111. border-radius: 10rpx;
  112. font-size: 28rpx;
  113. background-color: #38C148;
  114. color: #ffffff;
  115. cursor: pointer;
  116. margin: 0;
  117. border: 0;
  118. max-width: 200rpx;
  119. &::after {
  120. border: 0;
  121. }
  122. &+.action-btn {
  123. margin-left: 16rpx;
  124. }
  125. &.info-btn {
  126. background-color: #DBDBDB;
  127. color: #ffffff;
  128. }
  129. &.plain {
  130. border: 1px solid #38C148;
  131. color: #38C148;
  132. background-color: #fff;
  133. }
  134. }
  135. }
  136. .large-size {
  137. .order-actions {
  138. .action-btn {
  139. max-width: 200rpx;
  140. height: 72rpx;
  141. line-height: 72rpx;
  142. }
  143. }
  144. }
  145. </style>