Report.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="content">
  3. <view class="navStatus">
  4. <view class="flex margin-l-20 margin-r-20">
  5. <view class="itemNum" :class="{action:type>0}">
  6. 1
  7. </view>
  8. <view class="content flex" :class="{action:type>1}">
  9. </view>
  10. <view class="itemNum" :class="{action:type>1}">
  11. 2
  12. </view>
  13. <view class="content flex" :class="{action:type>2}">
  14. </view>
  15. <view class="itemNum" :class="{action:type>2}">
  16. 3
  17. </view>
  18. </view>
  19. <view class="titleBox flex">
  20. <view class="title">
  21. 报修申请
  22. </view>
  23. <view class="title">
  24. 等待维修
  25. </view>
  26. <view class="title">
  27. 维修完成
  28. </view>
  29. </view>
  30. </view>
  31. <status1 :cartInfo='cartInfo' v-if="type==1" @request='changeType(2)'></status1>
  32. <status2 :reportDeatil='reportDeatil' :cartInfo='cartInfo' v-if="type==2" @request='changeType(3)'></status2>
  33. <status3 :reportDeatil='reportDeatil' v-if="type==3"></status3>
  34. </view>
  35. </template>
  36. <script>
  37. import status1 from "./status1.vue"
  38. import status2 from "./status2.vue"
  39. import status3 from "./status3.vue"
  40. import {
  41. getCarInfo,
  42. question_info
  43. } from "../../../api/user.js"
  44. export default {
  45. components: {
  46. status1,
  47. status2,
  48. status3
  49. },
  50. data() {
  51. return {
  52. cartInfo: {},//车辆信息
  53. type: 1, //显示当前进度
  54. id: '', //车辆id
  55. loading: false, //是否提交中
  56. reportDeatil:{}//报修信息
  57. };
  58. },
  59. onLoad(options) {
  60. this.id = options.id;
  61. this.getCarInfo();
  62. // 初始化加载报修信息
  63. this.question_info();
  64. },
  65. methods: {
  66. // 报修信息
  67. getCarInfo() {
  68. getCarInfo({
  69. car_number: this.id,
  70. }).then((e) => {
  71. this.cartInfo = e.data;
  72. // console.log(e);
  73. }).catch((e) => {
  74. console.log(e);
  75. })
  76. },
  77. changeType(type) {
  78. this.type = type
  79. if(type==2){
  80. this.question_info()
  81. }
  82. },
  83. // 获取报修详情
  84. question_info() {
  85. question_info({
  86. car_number: this.id
  87. }).then((e) => {
  88. if (e.data) {
  89. this.reportDeatil = e.data;
  90. if(e.data.status==2){
  91. this.type=3
  92. }else if(e.data.status==0||e.data.status==1){
  93. this.type=2
  94. }
  95. }
  96. // console.log(e);
  97. }).catch((e) => {
  98. uni.hideToast();
  99. })
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss">
  105. page {
  106. height: 100%;
  107. }
  108. .navStatus {
  109. padding: 60rpx 80rpx;
  110. .item {
  111. .itemGree {}
  112. }
  113. .itemNum {
  114. width: 60rpx;
  115. height: 60rpx;
  116. line-height: 60rpx;
  117. font-size: 28rpx;
  118. text-align: center;
  119. color: #FFFFFF;
  120. background-color: $font-color-light;
  121. border-radius: 99rpx;
  122. &.action {
  123. background-color: $color-green;
  124. }
  125. }
  126. .title {
  127. margin-top: 30rpx;
  128. font-size: 24rpx;
  129. color: $font-color-light;
  130. }
  131. .content {
  132. flex-grow: 1;
  133. border-bottom: 8rpx dotted $font-color-light;
  134. margin: 0 10rpx;
  135. &.action {
  136. margin: 0;
  137. border-bottom: 8rpx solid $color-green;
  138. }
  139. }
  140. }
  141. </style>