用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

165 lines
6.1 KiB

  1. <template>
  2. <view>
  3. <!-- 状态显示区域 -->
  4. <view class="se-flex se-flex-h-sb se-flex-v-c se-py-20">
  5. <!-- <view class="se-flex se-flex-v-c">
  6. <image src="@/static/images/order/46525.png"
  7. style="width: 80rpx;height: 80rpx;"
  8. mode="aspectFit"></image>
  9. </view> -->
  10. <view class="se-flex se-flex-v-c"
  11. style="flex-direction: row;">
  12. <view class="line-orange"></view>
  13. <text class="se-ml-10 se-fs-28 se-fw-6 se-c-black">{{ statusText() }}</text>
  14. </view>
  15. </view>
  16. <!-- 进度条 -->
  17. <view class="se-py-20"
  18. v-if="orderData.status != 6">
  19. <u-steps
  20. activeColor="#FF7A31"
  21. :current="getStepsIndex()" dot>
  22. <u-steps-item class="se-fs-22" v-for="(items,indexs) in stepsList()"
  23. :key="indexs" :title="items.title">
  24. </u-steps-item>
  25. </u-steps>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'OrderStatus',
  32. props: {
  33. // 订单对象
  34. orderData: {
  35. type: Object,
  36. default: () => ({})
  37. },
  38. // 页面类型,用于区分不同页面的状态显示
  39. pageType: {
  40. type: String,
  41. default: 'job-order' // 'job-order' 或 'order'
  42. },
  43. },
  44. computed: {
  45. },
  46. methods: {
  47. getStepsIndex() {
  48. return this.orderData.status || 0;
  49. },
  50. statusText() {
  51. const statusTextMap = {
  52. '0' : {//先付后用
  53. 'job-order': {
  54. 0: '待待师傅确认',//师傅操作
  55. 1: '企业待支付',//企业操作
  56. 2: '订单进行中',//师傅操作
  57. 3: '试工完成',//企业操作
  58. 4: '',//暂无
  59. 5: '订单已完成',
  60. 6: '订单已取消'
  61. },
  62. default: {
  63. 0: '等待企业确认',//企业操作
  64. 1: '企业待支付',//暂无
  65. 2: '订单进行中',//师傅操作
  66. 3: '试工完成',//企业操作
  67. 4: '',//暂无
  68. 5: '订单已完成',
  69. 6: '订单已取消'
  70. }
  71. },
  72. '1' : {//试用以后支付
  73. 'job-order': {
  74. 0: '等待企业确认',
  75. 1: '订单进行中',
  76. 2: '试工完成',
  77. 3: '企业待支付',
  78. 4: '订单待完成',
  79. 5: '订单已完成',
  80. 6: '订单已取消'
  81. },
  82. default: {
  83. 0: '等待企业确认',
  84. 1: '订单进行中',
  85. 2: '试工完成',
  86. 3: '企业待支付',
  87. 4: '订单待完成',
  88. 5: '订单已完成',
  89. 6: '订单已取消'
  90. }
  91. }
  92. };
  93. let i = this.orderData ? this.orderData.payType : '1';
  94. let statusTextMapItem = statusTextMap[i] || statusTextMap[1];
  95. const pageTypeMap = statusTextMapItem[this.pageType] || statusTextMapItem.default;
  96. return pageTypeMap[this.getStepsIndex()] || '未知状态';
  97. },
  98. statusImage() {
  99. const statusImageMap = {
  100. 0: '/static/images/order/46524.png',
  101. 1: '/static/images/order/46524.png',
  102. 2: '/static/images/order/46525.png',
  103. 3: '/static/images/order/46525.png',
  104. 4: '/static/images/order/46525.png',
  105. 5: '/static/images/order/46525.png',
  106. 6: '/static/images/order/46525.png'
  107. };
  108. return statusImageMap[this.getStepsIndex()] || '/static/images/order/46524.png';
  109. },
  110. stepsList() {
  111. const stepsListMap = {
  112. 0 : {//先付后用
  113. 'job-order': [
  114. { title: "师傅确认", date: "" },
  115. { title: "企业支付", date: "" },
  116. { title: "进行", date: "" },
  117. { title: "试工完成", date: "" },
  118. // { title: "企业确认", date: "" },
  119. { title: "订单完成", date: "" }
  120. ],
  121. default: [
  122. { title: "接单", date: "" },
  123. { title: "企业支付", date: "" },
  124. { title: "进行", date: "" },
  125. { title: "试工完成", date: "" },
  126. // { title: "企业确认", date: "" },
  127. { title: "订单完成", date: "" }
  128. ]
  129. },
  130. 1 : {//试用以后支付
  131. 'job-order': [
  132. { title: "师傅确认", date: "" },
  133. { title: "进行", date: "" },
  134. { title: "试工完成", date: "" },
  135. { title: "企业确认", date: "" },
  136. { title: "企业支付", date: "" },
  137. { title: "订单完成", date: "" }
  138. ],
  139. default: [
  140. { title: "接单", date: "" },
  141. { title: "进行", date: "" },
  142. { title: "试工完成", date: "" },
  143. { title: "企业确认", date: "" },
  144. { title: "企业支付", date: "" },
  145. { title: "订单完成", date: "" }
  146. ]
  147. },
  148. };
  149. let i = this.orderData ? this.orderData.payType : '1';
  150. let stepsListMapItem = stepsListMap[i] || stepsListMap[1];
  151. return stepsListMapItem[this.pageType] || stepsListMapItem.default;
  152. },
  153. }
  154. }
  155. </script>
  156. <style lang="scss" scoped>
  157. .line-orange {
  158. width: 8rpx;
  159. height: 32rpx;
  160. background: #ff7a31;
  161. border-radius: 4rpx;
  162. }
  163. </style>