| | |
| | | showInfoDialog: false, |
| | | showTipDialog: false, |
| | | options: '', |
| | | showUnBind: false |
| | | }, |
| | | |
| | | openValve: function (e) { |
| | |
| | | onLoad(options) { |
| | | //当开阀成功后调用刷新 |
| | | console.log("onLoad:" + options.param); |
| | | if (options.param) { |
| | | if (options.param === "1" || options.param === "2") { |
| | | this.setData({ |
| | | options: options, |
| | | isLogin: true, |
| | |
| | | //本地没有缓存微信登录 |
| | | this.wxLogin(); |
| | | } |
| | | if (this.data.options.param) { |
| | | if (this.data.options.param === "1") { |
| | | this.setData({ |
| | | |
| | | showTipDialog: true, |
| | | tipData: "开阀命令下发成功,约20-60秒后可刷新快速关阀列表查看执行结果。" |
| | | }) |
| | | setTimeout(() => { |
| | | this.getOpenList(); |
| | | }, 20000) |
| | | |
| | | } else if (this.data.options.param === "2") { |
| | | this.setData({ |
| | | showTipDialog: true, |
| | | tipData: "预约开阀命令下发成功,当到达预约时间并且成功开阀后快速关阀列表会显示未关阀记录" |
| | | }) |
| | | this.getOpenList(); |
| | | } |
| | |
| | | this.setData({ |
| | | showForceConfirm: false, |
| | | showConfirm: false, |
| | | showTipDialog: false |
| | | showTipDialog: false, |
| | | showUnBind:false |
| | | }); |
| | | }, |
| | | /** |
| | |
| | | showTipDialog: true, |
| | | tipData: "关阀命令下发成功,约20-60秒后可刷新快速关阀列表查看执行结果。" |
| | | }) |
| | | this.getOpenList(); |
| | | setTimeout(() => { |
| | | this.getOpenList(); |
| | | }, 40000) |
| | | } else { |
| | | wx.showToast({ |
| | | title: '命令执行失败', |
| | |
| | | }, |
| | | //解绑 |
| | | unbind() { |
| | | //清空数据 |
| | | this.setData({ |
| | | userPhone: "未登录", |
| | | userName: "请登录", |
| | | listData: [] |
| | | showUnBind: true |
| | | }) |
| | | }, |
| | | //确认解绑 |
| | | unBindPost() { |
| | | this.setData({ |
| | | showUnBind: false |
| | | }) |
| | | wx.showLoading({ |
| | | title: '正在解绑请稍候...', // 加载提示文字 |
| | |
| | | wx.hideLoading(); |
| | | // 处理错误响应 |
| | | console.error('请求失败:', error); |
| | | wx.showToast({ |
| | | title: '解绑失败', |
| | | icon: 'error', |
| | | duration: 3000 |
| | | }) |
| | | }); |
| | | }, |
| | | //点击提示按钮 |