zhenggaijindu.js 2.3 KB

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