import http from '../../base/httputil' const app = getApp() Page({ onLoad(e) { this.getZhenggaijindu(e.busInspectionId) }, getZhenggaijindu(busInspectionId) { let obj = new Object(); obj.busInspectionId = busInspectionId http.post("/system/AppZhenggaijinduController/getZhenggaijindu", obj, this.getZhenggaijinduSuccess); }, getZhenggaijinduSuccess(res) { console.log(res) this.data.pictureBasePath = res.pictureBasePath this.setData({ pictureBasePath : res.pictureBasePath, zgjdList: res.zgjdList }) }, /** * 页面的初始数据 */ data: { host: app.globalData.host, pictureBasePath: null, zgjdList: null, isRefreshUP:true, processData: [{ name: '提交工单', start: '#fff', end: '#EFF3F6', icon: '../../img/process_1.png' }, { name: '已接单', start: '#EFF3F6', end: '#EFF3F6', icon: '../../img/process_1.png' }, { name: '开始维修', start: '#EFF3F6', end: '#EFF3F6', icon: '../../img/process_1.png' }, { name: '维修结束', start: '#EFF3F6', end: '#EFF3F6', icon: '../../img/process_1.png' }, { name: '已确认', start: '#EFF3F6', end: '#fff', icon: '../../img/process_1.png' } ], // 期限按钮 buttons: [{ id: 1, name: "一天" }, { id: 2, name: "两天" }, { id: 3, name:"三天" }] }, //进度条的状态 setPeocessIcon: function () { var index = 0 //记录状态为1的最后的位置 var processArr = this.data.processData // console.log("progress", this.data.detailData.progress) for (var i = 0; i < this.data.detailData.progress.length; i++) { var item = this.data.detailData.progress[i] processArr[i].name = item.word if (item.state == 1) { index = i processArr[i].icon = "../../img/process_3.png" processArr[i].start = "#45B2FE" processArr[i].end = "#45B2FE" } else { processArr[i].icon = "../../img/process_1.png" processArr[i].start = "#EFF3F6" processArr[i].end = "#EFF3F6" } } processArr[index].icon = "../../img/process_2.png" processArr[index].end = "#EFF3F6" processArr[0].start = "#fff" processArr[this.data.detailData.progress.length - 1].end = "#fff" this.setData({ processData: processArr }) }, <<<<<<< HEAD onUnload(){ let page = getCurrentPages(); let prevPage = page[page.length - 2]; prevPage.setData({ isRefresh :this.data.isRefreshUP, }); } ======= // 期限按钮 onLoad: function (options) { this.data.buttons[0].checked = true; this.setData({ buttons: this.data.buttons, }) }, radioButtonTap: function (e) { console.log(e) let id = e.currentTarget.dataset.id console.log(id) for (let i = 0; i < this.data.buttons.length; i++) { if (this.data.buttons[i].id == id) { //当前点击的位置为true即选中 this.data.buttons[i].checked = true; } else { //其他的位置为false this.data.buttons[i].checked = false; } } this.setData({ buttons: this.data.buttons, msg: "id:"+id }) }, checkButtonTap:function(e){ console.log(e) let id = e.currentTarget.dataset.id console.log(id) for (let i = 0; i < this.data.buttons.length; i++) { if (this.data.buttons[i].id == id) { if (this.data.buttons[i].checked == true) { this.data.buttons[i].checked = false; } else { this.data.buttons[i].checked = true; } } } }, >>>>>>> 57f7980a209c37c9f7735fbe7e3a57926d779ed2 })