用工小程序前端代码
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.

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