| | |
| | | isRefreshing_common: false, |
| | | showConfirm: false, |
| | | waterIntakeName: "", |
| | | choseItem: null |
| | | choseItem: null, |
| | | errorData: '', //错误内容 |
| | | showErrorDialog: false, |
| | | confirmBtn: { |
| | | content: '确认' |
| | | }, |
| | | }, |
| | | |
| | | // 切换 Tabs |
| | |
| | | }; |
| | | post({ |
| | | url: "wx/valve/open_wx", |
| | | data: data |
| | | data: data, |
| | | timeout: 180000 |
| | | }).then(response => { |
| | | |
| | | // 处理成功响应 |
| | |
| | | wx.hideLoading(); |
| | | // 处理错误响应 |
| | | console.error('请求失败:', error); |
| | | if (error.code === "1002") { |
| | | wx.showToast({ |
| | | title: '开阀失败', |
| | | icon: 'error', |
| | | duration: 3000 // 提示的持续时间,单位毫秒 |
| | | }) |
| | | } |
| | | |
| | | this.setData({ |
| | | showErrorDialog: true, |
| | | errorData: error.msg |
| | | }) |
| | | |
| | | }); |
| | | }, |
| | | |
| | |
| | | */ |
| | | getallWaterPoints: function (intakeNum) { |
| | | let params = { |
| | | url: 'project/intake/all_intakes' |
| | | url: 'wx/intake/all_intakes' |
| | | }; |
| | | if (intakeNum) { |
| | | params.data = { |
| | |
| | | this.setData({ |
| | | isRefreshing_all: false |
| | | }); |
| | | wx.showToast({ |
| | | title: error.msg, |
| | | icon: 'error', |
| | | duration: 3000 // 提示的持续时间,单位毫秒 |
| | | }) |
| | | console.error('Failed to add item:', error); |
| | | }); |
| | | }, |
| | | //获取常用取水口 |
| | | getcommonWaterPoints() { |
| | | get({ |
| | | url: 'project/intake/used_intakes', |
| | | url: 'wx/intake/used_intakes', |
| | | data: { |
| | | operator: getApp().globalData.sessionId |
| | | } |
| | |
| | | isRefreshing_common: false |
| | | }); |
| | | wx.showToast({ |
| | | title: error.code, |
| | | title: error.msg, |
| | | icon: 'error', |
| | | duration: 3000 // 提示的持续时间,单位毫秒 |
| | | }) |
| | |
| | | }, |
| | | confirmDialog() { |
| | | this.setData({ |
| | | showConfirm:false |
| | | showConfirm: false |
| | | }) |
| | | this.postOpenValva(this.data.choseItem.intakeId); |
| | | }, |
| | |
| | | this.setData({ |
| | | showConfirm: false |
| | | }) |
| | | }, |
| | | closeErrorDialog() { |
| | | this.setData({ |
| | | showErrorDialog: false |
| | | }) |
| | | } |
| | | |
| | | }) |