沙盘演示系统应用的微信小程序
zuoxiao
2024-11-01 ddbd8c7ea87b66d5a9c4362ce284d12a4ae970d1
pages/openCard/openCard.js
@@ -38,7 +38,8 @@
    costiomTime: "", //自定义灌溉时间
    waterAmount: 0, //定量开阀的水量
    costiomWater: "", //输入的自定义水量
    isWXRefreshing:false,
    isWXRefreshing: false,
    intakeName: "" //扫码开阀从首页传来的取水口名称
  },
  openValva(event) {
    const {
@@ -47,14 +48,20 @@
    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.id,
      })
      if (this.data.intakeName) {
        //扫码开阀逻辑
        this.postOpenValva(false);
      } else {
        // 选择虚拟卡后
        this.initDialogData();
      }
    }
  },
  handleAutoIrrigation() {},
@@ -64,10 +71,12 @@
   */
  onLoad(options) {
    const {
      intakeId
      intakeId,
      intakeName
    } = options;
    this.setData({
      intakeId: intakeId
      intakeId: intakeId,
      intakeName: intakeName
    })
    console.log('intakeId:' + this.data.intakeId);
    this.getCardList();
@@ -169,7 +178,7 @@
    // 更新列表数据
    this.setData({
      allCardPoints: updatedList,
      isWXRefreshing:false
      isWXRefreshing: false
    });
  },
  handleClost() {
@@ -319,6 +328,7 @@
    const data = {
      intakeId: this.data.intakeId, //取水口ID
      vcId: this.data.vcId, //虚拟卡ID
      intakeName: this.data.intakeName, //取水口名称
      operator: app.globalData.sessionId, //操作员
      forceOpen: !!isforce // 使用逻辑非操作符 !! 来确保 isForce 是布尔值  
    };