order-actions.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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="status-pending-row">
  23. <button class="action-btn info-btn" @click.stop="handleAction('cancel')">取消订单</button>
  24. <view class="status-pending-row__right">
  25. <button class="action-btn plain" @click.stop="handleAction('editAddress')">修改地址</button>
  26. <button v-if="order.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. .status-pending-row {
  105. display: flex;
  106. justify-content: space-between;
  107. align-items: center;
  108. width: 100%;
  109. gap: 40rpx;
  110. &__right {
  111. display: flex;
  112. align-items: center;
  113. flex-shrink: 0;
  114. gap: 16rpx;
  115. }
  116. }
  117. .action-btn {
  118. display: flex;
  119. align-items: center;
  120. justify-content: center;
  121. min-width: 166rpx;
  122. height: 60rpx;
  123. line-height: 60rpx;
  124. border-radius: 10rpx;
  125. font-size: 28rpx;
  126. background-color: #38C148;
  127. color: #ffffff;
  128. cursor: pointer;
  129. margin: 0;
  130. border: 0;
  131. max-width: 200rpx;
  132. &::after {
  133. border: 0;
  134. }
  135. &+.action-btn {
  136. margin-left: 16rpx;
  137. }
  138. &.info-btn {
  139. background-color: #DBDBDB;
  140. color: #ffffff;
  141. }
  142. &.plain {
  143. border: 1px solid #38C148;
  144. color: #38C148;
  145. background-color: #fff;
  146. }
  147. }
  148. }
  149. .large-size {
  150. .order-actions {
  151. .action-btn {
  152. max-width: 200rpx;
  153. height: 72rpx;
  154. line-height: 72rpx;
  155. }
  156. }
  157. }
  158. </style>