沙盘演示系统应用的微信小程序
zuoxiao
2024-10-18 35cd1fc2e97ee8c8ec93d632cfc6b8b90e7a6e2b
pages/openCard/openCard.js
@@ -14,7 +14,8 @@
    vcId: "",
    activeIndex: -1,
    datetimeVisible: false,
    datetime: new Date().getTime(),
    dateStartTime: new Date().getTime(),
    dateEndTime: new Date().getTime() + 24 * 60 * 60 * 1000,
    datetimeText: '',
    allCardPoints: [], // 所有虚拟卡
    irrigateProfile: [], //获取所选灌溉方式的详细数据
@@ -36,7 +37,8 @@
    radioValue: "0", //开阀方式选中的类型
    costiomTime: "", //自定义灌溉时间
    waterAmount: 0, //定量开阀的水量
    costiomWater:"",//输入的自定义水量
    costiomWater: "", //输入的自定义水量
    isWXRefreshing:false,
  },
  openValva(event) {
    const {
@@ -51,7 +53,7 @@
      // 选择虚拟卡后
      this.initDialogData();
      this.setData({
        vcId: item.vcId,
        vcId: item.id,
      })
    }
  },
@@ -103,7 +105,10 @@
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
    this.setData({
      isWXRefreshing: true
    });
    this.getCardList();
  },
  /**
@@ -163,7 +168,8 @@
    });
    // 更新列表数据
    this.setData({
      allCardPoints: updatedList
      allCardPoints: updatedList,
      isWXRefreshing:false
    });
  },
  handleClost() {
@@ -198,7 +204,7 @@
      this.data.waterAmount = parseInt(this.data.irrigateProfile[index].defaultValue)
      this.setData({
        activeIndex: parseInt(index),
        costiomWater:""
        costiomWater: ""
      });
    }
  },
@@ -431,11 +437,11 @@
    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 => {
      // 处理成功响应
@@ -472,7 +478,7 @@
      plannedOpenTime: this.data.openTime
    };
    post({
      url: "/wx/valve/planed_open_quantify_close",
      url: "wx/valve/planed_open_quantify_close",
      data: data
    }).then(response => {
      // 处理成功响应
@@ -583,7 +589,7 @@
    }
  },
  //输入自定义水量的监听
  onWaterInputChange(data){
  onWaterInputChange(data) {
    console.log(data.detail.value)
    if (data.detail.value !== "") {
      this.setData({
@@ -597,7 +603,7 @@
    }
  },
  // 定量开泵按钮
  btnOpenOnWater(){
  btnOpenOnWater() {
    if (this.data.waterAmount > 0) {
      if (this.data.isOpenTiming) {
        this.quantifyOpenTime();
@@ -610,7 +616,7 @@
        title: '请选择或输入灌溉时间!',
      })
    }
  }
  },
})