管灌系统农户端微信小程序(嘉峪关应用)
zuoxiao
2024-06-13 5dc54a59184b305a85aaad31dd4cce01b31a8a2d
pages/openCard/openCard.js
@@ -20,7 +20,7 @@
    if (item.inUse === 0) {
      // 在页面加载时显示加载动画
      wx.showLoading({
        title: '正在开泵请稍后...', // 加载提示文字
        title: '正在开泵请稍候...', // 加载提示文字
        mask: true // 是否显示透明蒙层,防止触摸穿透,默认为 false
      });
      this.postOpenValva(item.vcId);
@@ -32,11 +32,10 @@
    const data = {
      intakeId: this.data.intakeId, //取水口ID
      vcId: vcId, //虚拟卡ID
      userType: 2, //用户类型1-平台,2-App
      operator: app.globalData.sessionId //操作员
    };
    post({
      url: "comRes/receive",
      url: "8087/wx/valve/open_wx",
      data: data
    }).then(response => {
    
@@ -54,6 +53,13 @@
      wx.hideLoading();
      // 处理错误响应
      console.error('请求失败:', error);
      if (error.code === "1002") {
        wx.showToast({
          title: '开泵失败',
          icon: 'error',
          duration: 3000 // 提示的持续时间,单位毫秒
        })
      }
    });
  },
  /**
@@ -120,9 +126,12 @@
  },
  //获取虚拟卡列表
  getCardList(){
    get({url:'https://d4x9787456.vicp.fun/sell/virtual_card/get', data: {
      operator: getApp().globalData.sessionId
    }})
    get({
        url: '8084/sell/virtual_card/get',
        data: {
          clientId: getApp().globalData.sessionId
        }
      })
    .then((data) => {
      if(data.success&&data.code==="0001"){
        this.setData({
@@ -136,6 +145,8 @@
      console.log('Failed to add item:');
    })
    .catch((error) => {
      console.error('Failed to add item:', error);
    });
  }