zhenggaijindu.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import http from '../../base/httputil'
  2. Page({
  3. onLoad(e) {
  4. this.getZhenggaijindu(e.busInspectionId)
  5. },
  6. getZhenggaijindu(busInspectionId) {
  7. let obj = new Object();
  8. obj.busInspectionId = busInspectionId
  9. http.post("/system/AppZhenggaijinduController/getZhenggaijindu", obj, this.getZhenggaijinduSuccess);
  10. },
  11. getZhenggaijinduSuccess(res) {
  12. console.log(res)
  13. this.data.pictureBasePath = res.pictureBasePath
  14. this.setData({
  15. pictureBasePath : res.pictureBasePath,
  16. zgjdList: res.zgjdList
  17. })
  18. },
  19. /**
  20. * 页面的初始数据
  21. */
  22. data: {
  23. pictureBasePath: null,
  24. zgjdList: null,
  25. processData: [{
  26. name: '提交工单',
  27. start: '#fff',
  28. end: '#EFF3F6',
  29. icon: '../../img/process_1.png'
  30. },
  31. {
  32. name: '已接单',
  33. start: '#EFF3F6',
  34. end: '#EFF3F6',
  35. icon: '../../img/process_1.png'
  36. },
  37. {
  38. name: '开始维修',
  39. start: '#EFF3F6',
  40. end: '#EFF3F6',
  41. icon: '../../img/process_1.png'
  42. },
  43. {
  44. name: '维修结束',
  45. start: '#EFF3F6',
  46. end: '#EFF3F6',
  47. icon: '../../img/process_1.png'
  48. },
  49. {
  50. name: '已确认',
  51. start: '#EFF3F6',
  52. end: '#fff',
  53. icon: '../../img/process_1.png'
  54. }
  55. ]
  56. },
  57. //进度条的状态
  58. setPeocessIcon: function () {
  59. var index = 0 //记录状态为1的最后的位置
  60. var processArr = this.data.processData
  61. // console.log("progress", this.data.detailData.progress)
  62. for (var i = 0; i < this.data.detailData.progress.length; i++) {
  63. var item = this.data.detailData.progress[i]
  64. processArr[i].name = item.word
  65. if (item.state == 1) {
  66. index = i
  67. processArr[i].icon = "../../img/process_3.png"
  68. processArr[i].start = "#45B2FE"
  69. processArr[i].end = "#45B2FE"
  70. } else {
  71. processArr[i].icon = "../../img/process_1.png"
  72. processArr[i].start = "#EFF3F6"
  73. processArr[i].end = "#EFF3F6"
  74. }
  75. }
  76. processArr[index].icon = "../../img/process_2.png"
  77. processArr[index].end = "#EFF3F6"
  78. processArr[0].start = "#fff"
  79. processArr[this.data.detailData.progress.length - 1].end = "#fff"
  80. this.setData({
  81. processData: processArr
  82. })
  83. },
  84. })