Commit 8859cf30 by zhuoym

修复完成报修bug

parent 0ef52a1d
Showing with 47 additions and 45 deletions
...@@ -195,54 +195,56 @@ Page({ ...@@ -195,54 +195,56 @@ Page({
// 点击完成维修 // 点击完成维修
bindBtn(e){ bindBtn(e){
var that = this; var that = this;
// debugger
//
wx.navigateTo({ wx.navigateTo({
url: `/pages/endRepair/repair?gongid=${e.currentTarget.dataset.id}`, url: `/pages/endRepair/repair?id=${e.currentTarget.dataset.id}`,
}) })
console.log(that.data.gongid); // console.log(that.data.gongid);
console.log(e.currentTarget.dataset.id) // console.log(e.currentTarget.dataset.id)
return return
this.setData({ // this.setData({
// wantan:true, // // wantan:true,
gongid: e.currentTarget.dataset.id, // gongid: e.currentTarget.dataset.id,
}) // })
wx.showModal({ // wx.showModal({
title: '提示', // title: '提示',
content: '确认完成维修吗?', // content: '确认完成维修吗?',
success: function (res) { // success: function (res) {
if (res.confirm) { // if (res.confirm) {
wx.showLoading({ // wx.showLoading({
title: '提交中...', // title: '提交中...',
icon: 'loading' // icon: 'loading'
}) // })
//
wx.request({ // wx.request({
url: baseUrl + '/api/emaint/repairProblem/complete', // url: baseUrl + '/api/emaint/repairProblem/complete',
data: { // data: {
id: that.data.gongid, // id: that.data.gongid,
}, // },
method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT // method: 'POST', // OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT
//
header: { // header: {
"Content-Type": "application/x-www-form-urlencoded", // "Content-Type": "application/x-www-form-urlencoded",
"accessToken": wx.getStorageSync('accessToken'), // "accessToken": wx.getStorageSync('accessToken'),
}, // 设置请求的 header // }, // 设置请求的 header
//
success: function (res) { // success: function (res) {
console.log(res) // console.log(res)
wx.hideLoading(); // wx.hideLoading();
that.setData({ // that.setData({
// buttonClickeds: false, // // buttonClickeds: false,
// wantan: false, // // wantan: false,
page: '1' // page: '1'
}) // })
that.login(); // that.login();
} // }
}) // })
} else if (res.cancel) { // } else if (res.cancel) {
console.log('用户点击取消') // console.log('用户点击取消')
} // }
} // }
}) // })
}, },
// bindBtnok(){ // bindBtnok(){
// var that = this; // var that = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment