| | |
| | | vcId: "", |
| | | activeIndex: -1, |
| | | datetimeVisible: false, |
| | | datetime: new Date().getTime(), |
| | | dateStartTime: new Date().getTime(), |
| | | dateEndTime: new Date().getTime() + 24 * 60 * 60 * 1000, |
| | | datetimeText: '', |
| | | allCardPoints: [], // 所有虚拟卡 |
| | | irrigateProfile: [], //获取所选灌溉方式的详细数据 |
| | |
| | | radioValue: "0", //开阀方式选中的类型 |
| | | costiomTime: "", //自定义灌溉时间 |
| | | waterAmount: 0, //定量开阀的水量 |
| | | costiomWater:"",//输入的自定义水量 |
| | | costiomWater: "", //输入的自定义水量 |
| | | isWXRefreshing: false, |
| | | intakeName: "" //扫码开阀从首页传来的取水口名称 |
| | | }, |
| | | openValva(event) { |
| | | const { |
| | |
| | | if (item.isAlarmValue === true) { |
| | | //金额报警 |
| | | wx.navigateTo({ |
| | | url: '/pages/rechargeMoney/rechargMoney?vcId=' + item.vcId, |
| | | url: '/pages/rechargeMoney/rechargMoney?vcId=' + item.id, |
| | | }) |
| | | } else if (item.inUse === false) { |
| | | // 选择虚拟卡后 |
| | | this.initDialogData(); |
| | | this.setData({ |
| | | vcId: item.vcId, |
| | | vcId: item.id, |
| | | }) |
| | | if (this.data.intakeName === "") { |
| | | // 选择虚拟卡后 |
| | | this.initDialogData(); |
| | | } else { |
| | | //扫码开阀逻辑 |
| | | this.postOpenValva(false); |
| | | } |
| | | |
| | | } |
| | | }, |
| | | handleAutoIrrigation() {}, |
| | |
| | | */ |
| | | onLoad(options) { |
| | | const { |
| | | intakeId |
| | | intakeId, |
| | | intakeName |
| | | } = options; |
| | | this.setData({ |
| | | intakeId: intakeId |
| | | intakeId: intakeId, |
| | | intakeName: intakeName |
| | | }) |
| | | console.log('intakeId:' + this.data.intakeId); |
| | | this.getCardList(); |
| | |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | this.setData({ |
| | | isWXRefreshing: true |
| | | }); |
| | | this.getCardList(); |
| | | }, |
| | | |
| | | /** |
| | |
| | | }); |
| | | // 更新列表数据 |
| | | this.setData({ |
| | | allCardPoints: updatedList |
| | | allCardPoints: updatedList, |
| | | isWXRefreshing: false |
| | | }); |
| | | }, |
| | | handleClost() { |
| | |
| | | this.data.waterAmount = parseInt(this.data.irrigateProfile[index].defaultValue) |
| | | this.setData({ |
| | | activeIndex: parseInt(index), |
| | | costiomWater:"" |
| | | costiomWater: "" |
| | | }); |
| | | } |
| | | }, |
| | |
| | | const data = { |
| | | intakeId: this.data.intakeId, //取水口ID |
| | | vcId: this.data.vcId, //虚拟卡ID |
| | | intakeName: this.data.intakeName, //取水口名称 |
| | | operator: app.globalData.sessionId, //操作员 |
| | | forceOpen: !!isforce // 使用逻辑非操作符 !! 来确保 isForce 是布尔值 |
| | | }; |
| | |
| | | const data = { |
| | | intakeId: this.data.intakeId, //取水口ID |
| | | vcId: this.data.vcId, //虚拟卡ID |
| | | minutes: this.data.waterAmount, //水量 |
| | | waterAmount: this.data.waterAmount, //水量 |
| | | operator: app.globalData.sessionId //操作员 |
| | | }; |
| | | post({ |
| | | url: "/wx/valve/quantify_close", |
| | | url: "wx/valve/quantify_close", |
| | | data: data |
| | | }).then(response => { |
| | | // 处理成功响应 |
| | |
| | | plannedOpenTime: this.data.openTime |
| | | }; |
| | | post({ |
| | | url: "/wx/valve/planed_open_quantify_close", |
| | | url: "wx/valve/planed_open_quantify_close", |
| | | data: data |
| | | }).then(response => { |
| | | // 处理成功响应 |
| | |
| | | } |
| | | }, |
| | | //输入自定义水量的监听 |
| | | onWaterInputChange(data){ |
| | | onWaterInputChange(data) { |
| | | console.log(data.detail.value) |
| | | if (data.detail.value !== "") { |
| | | this.setData({ |
| | |
| | | } |
| | | }, |
| | | // 定量开泵按钮 |
| | | btnOpenOnWater(){ |
| | | btnOpenOnWater() { |
| | | if (this.data.waterAmount > 0) { |
| | | if (this.data.isOpenTiming) { |
| | | this.quantifyOpenTime(); |
| | |
| | | title: '请选择或输入灌溉时间!', |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | }) |