沙盘演示系统应用的微信小程序
zuoxiao
2024-11-08 f3058f900e3143c0245c9b1686397b6e6e561422
1.解绑添加二次确认。2.接口返回的金额都是元
8个文件已修改
89 ■■■■■ 已修改文件
pages/home/home.js 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.wxml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/openCard/openCard.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/openCard/openCard.wxml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.js 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/rechargeMoney/rechargMoney.wxml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/valveList/valveList.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/waterIntake/waterIntake.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/home/home.js
@@ -34,6 +34,7 @@
    showInfoDialog: false,
    showTipDialog: false,
    options: '',
    showUnBind: false
  },
  openValve: function (e) {
@@ -91,7 +92,7 @@
  onLoad(options) {
    //当开阀成功后调用刷新
    console.log("onLoad:" + options.param);
    if (options.param) {
    if (options.param === "1" || options.param === "2") {
      this.setData({
        options: options,
        isLogin: true,
@@ -124,11 +125,19 @@
      //本地没有缓存微信登录
      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();
    }
@@ -268,7 +277,8 @@
    this.setData({
      showForceConfirm: false,
      showConfirm: false,
      showTipDialog: false
      showTipDialog: false,
      showUnBind:false
    });
  },
  /**
@@ -308,7 +318,9 @@
          showTipDialog: true,
          tipData: "关阀命令下发成功,约20-60秒后可刷新快速关阀列表查看执行结果。"
        })
        setTimeout(() => {
        this.getOpenList();
        }, 40000)
      } else {
        wx.showToast({
          title: '命令执行失败',
@@ -598,11 +610,14 @@
  },
  //解绑
  unbind() {
    //清空数据
    this.setData({
      userPhone: "未登录",
      userName: "请登录",
      listData: []
      showUnBind: true
    })
  },
  //确认解绑
  unBindPost() {
    this.setData({
      showUnBind: false
    })
    wx.showLoading({
      title: '正在解绑请稍候...', // 加载提示文字
@@ -641,6 +656,11 @@
      wx.hideLoading();
      // 处理错误响应
      console.error('请求失败:', error);
      wx.showToast({
        title: '解绑失败',
        icon: 'error',
        duration: 3000
      })
    });
  },
  //点击提示按钮
pages/home/home.wxml
@@ -93,7 +93,7 @@
        <text class="content-container">
          1.网络等不可抗力因素可能导致设备状态显示延迟或错误。
          2.当提示您操作失败后您可稍后尝试重新操作。
          3.在定时或定量开阀的预约式开阀过程中,系统仅显示取消状态。当用户点击取消时,程序会尝试执行取消操作,但可能因网络等不可抗力因素而失败。
          3.在定时或定量开阀的预约式开阀后,只有阀门到达约定的时间成功开阀后未关阀记录才会显示。
          4.我们诚挚地邀请您通过意见反馈渠道提出宝贵的建议或意见。
        </text>
@@ -101,5 +101,5 @@
    </scroll-view>
  </t-dialog>
  <t-dialog class="dialog" title="通知结果" visible="{{showTipDialog}}" content="{{tipData}}" confirm-btn="{{ confirmBtn }}" bind:confirm="cancelDialog" />
  <t-dialog class="dialog" visible="{{showUnBind}}" content="确认解除绑定吗?" confirm-btn="{{ { content: '确认', variant: 'base', theme: 'danger' } }}" close-on-overlay-click="false" cancel-btn="取消" bind:confirm="unBindPost" bind:cancel="cancelDialog" />
</view>
pages/openCard/openCard.js
@@ -1,4 +1,4 @@
// 开卡选择虚拟卡
// 开阀选择虚拟卡
const {
  get,
  post
@@ -264,6 +264,7 @@
      this.setData({
        isOpenTiming: true,
        radioValue: value,
        dateStartTime: new Date().getTime()
      })
    } else {
      this.setData({
@@ -315,7 +316,8 @@
      dialog_time: false,
      dialog_water: false,
      dialog_mode: true,
      group_time: false
      group_time: false,
      activeIndex: -1
    })
  },
  //立即开泵
@@ -343,7 +345,7 @@
      wx.hideLoading();
      //完成后回到首页
      wx.reLaunch({
        url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写
        url: '/pages/home/home?param=1' // 首页的路径,根据实际情况填写
      });
    }).catch(error => {
@@ -387,7 +389,7 @@
      wx.hideLoading();
      //完成后回到首页
      wx.reLaunch({
        url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写
        url: '/pages/home/home?param=1' // 首页的路径,根据实际情况填写
      });
    }).catch(error => {
      // 加载完成后隐藏加载动画
@@ -415,7 +417,7 @@
      plannedOpenTime: this.data.openTime
    };
    post({
      url: "wx/valve/timed_close",
      url: "wx/valve/planed_open_timed_close",
      data: data
    }).then(response => {
      // 处理成功响应
@@ -424,7 +426,7 @@
      wx.hideLoading();
      //完成后回到首页
      wx.reLaunch({
        url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写
        url: '/pages/home/home?param=2' // 首页的路径,根据实际情况填写
      });
    }).catch(error => {
      // 加载完成后隐藏加载动画
@@ -460,7 +462,7 @@
      wx.hideLoading();
      //完成后回到首页
      wx.reLaunch({
        url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写
        url: '/pages/home/home?param=1' // 首页的路径,根据实际情况填写
      });
    }).catch(error => {
      // 加载完成后隐藏加载动画
@@ -497,7 +499,7 @@
      wx.hideLoading();
      //完成后回到首页
      wx.reLaunch({
        url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写
        url: '/pages/home/home?param=2' // 首页的路径,根据实际情况填写
      });
    }).catch(error => {
      // 加载完成后隐藏加载动画
pages/openCard/openCard.wxml
@@ -1,4 +1,4 @@
<!--pages/openCard/openCard.wxml 开卡时的虚拟卡-->
<!--pages/openCard/openCard.wxml 开阀时的虚拟卡-->
<view class="container">
  <scroll-view class="list-container" scroll-y="true" scroll-x="false" refresher-enabled="true" bindrefresherrefresh="onPullDownRefresh" refresher-triggered="{{isWXRefreshing}}">
pages/rechargeMoney/rechargMoney.js
@@ -105,7 +105,7 @@
    const data = {
      sessionId: getApp().globalData.sessionId,
      vcId: this.data.vcId, //虚拟卡ID
      rechargeAmount: this.data.moneyList[this.data.activeIndex].rechargeAmount//(单位是分)
      rechargeAmount: this.data.moneyList[this.data.activeIndex].rechargeAmount//(单位是元)
    };
    console.log("postCloseValaue" + data);
    post({
@@ -200,9 +200,10 @@
      this.getRechargList();
    }
  },
  //处理充值记录的数据
  updateDisplayText() {
    const updatedList = this.data.allRechargeList.map(item => {
      let morny = item.rechargeAmount / 100 + "元"
      let morny = item.rechargeAmount  + "元"
      return {
        ...item,
        morny
@@ -219,15 +220,8 @@
      url: 'wx/virtual_card/gerRechargeProfiles'
    };
    get(params).then(data => {
      const updatedList=   data.content.map(item=>{
        let money=item.rechargeAmount/100;
        return {
          ...item,
          money
        };
      })
      this.setData({
        moneyList: updatedList ,
        moneyList: data.content ,
      })
    }).catch(err => {
      // 错误回调
pages/rechargeMoney/rechargMoney.wxml
@@ -17,19 +17,19 @@
    <view class="row">
      <view class="item{{activeIndex === 0 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="0">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[0].money}}</text>
          <text class="money-number">{{moneyList[0].rechargeAmount}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 1 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="1">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[1].money}}</text>
          <text class="money-number">{{moneyList[1].rechargeAmount}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 2 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="2">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[2].money}}</text>
          <text class="money-number">{{moneyList[2].rechargeAmount}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
@@ -37,19 +37,19 @@
    <view class="row">
      <view class="item{{activeIndex === 3 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="3">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[3].money}}</text>
          <text class="money-number">{{moneyList[3].rechargeAmount}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 4 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="4">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[4].money}}</text>
          <text class="money-number">{{moneyList[4].rechargeAmount}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
      <view class="item{{activeIndex === 5 ? 'active' : ''}}" bindtap="handleMoneyWrapperTap" data-index="5">
        <view class="money-wrapper">
          <text class="money-number">{{moneyList[5].money}}</text>
          <text class="money-number">{{moneyList[5].rechargeAmount}}</text>
          <text class="money-label">元</text>
        </view>
      </view>
pages/valveList/valveList.js
@@ -99,7 +99,7 @@
    this.setData({
      isPhysicalRefreshing: true,
    })
    this.getPhysicalListData();
    this.getPhysicalListData(true);
  },
  //获取实体卡列表
  getPhysicalListData(isRefresh) {
pages/waterIntake/waterIntake.js
@@ -1,4 +1,5 @@
// pages/waterIntake/waterIntake.js
//常用取水口列表页
const {
  get,
  post