|  |  |  | 
|---|
|  |  |  | showInfoDialog: false, | 
|---|
|  |  |  | showTipDialog: false, | 
|---|
|  |  |  | options: '', | 
|---|
|  |  |  | showUnBind: false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  |  | 
|---|
|  |  |  | openValve: function (e) { | 
|---|
|  |  |  | 
|---|
|  |  |  | onLoad(options) { | 
|---|
|  |  |  | //当开阀成功后调用刷新 | 
|---|
|  |  |  | console.log("onLoad:" + options.param); | 
|---|
|  |  |  | if (options.param) { | 
|---|
|  |  |  | if (options.param === "1" || options.param === "2") { | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | options: options, | 
|---|
|  |  |  | isLogin: true, | 
|---|
|  |  |  | 
|---|
|  |  |  | //本地没有缓存微信登录 | 
|---|
|  |  |  | 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(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | showForceConfirm: false, | 
|---|
|  |  |  | showConfirm: false, | 
|---|
|  |  |  | showTipDialog: false | 
|---|
|  |  |  | showTipDialog: false, | 
|---|
|  |  |  | showUnBind:false | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | showTipDialog: true, | 
|---|
|  |  |  | tipData: "关阀命令下发成功,约20-60秒后可刷新快速关阀列表查看执行结果。" | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.getOpenList(); | 
|---|
|  |  |  | setTimeout(() => { | 
|---|
|  |  |  | this.getOpenList(); | 
|---|
|  |  |  | }, 40000) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | wx.showToast({ | 
|---|
|  |  |  | title: '命令执行失败', | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //解绑 | 
|---|
|  |  |  | unbind() { | 
|---|
|  |  |  | //清空数据 | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | userPhone: "未登录", | 
|---|
|  |  |  | userName: "请登录", | 
|---|
|  |  |  | listData: [] | 
|---|
|  |  |  | showUnBind: true | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //确认解绑 | 
|---|
|  |  |  | unBindPost() { | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | showUnBind: false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | wx.showLoading({ | 
|---|
|  |  |  | title: '正在解绑请稍候...', // 加载提示文字 | 
|---|
|  |  |  | 
|---|
|  |  |  | wx.hideLoading(); | 
|---|
|  |  |  | // 处理错误响应 | 
|---|
|  |  |  | console.error('请求失败:', error); | 
|---|
|  |  |  | wx.showToast({ | 
|---|
|  |  |  | title: '解绑失败', | 
|---|
|  |  |  | icon: 'error', | 
|---|
|  |  |  | duration: 3000 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //点击提示按钮 | 
|---|
|  |  |  | 
|---|
|  |  |  | <text class="content-container"> | 
|---|
|  |  |  | 1.网络等不可抗力因素可能导致设备状态显示延迟或错误。 | 
|---|
|  |  |  | 2.当提示您操作失败后您可稍后尝试重新操作。 | 
|---|
|  |  |  | 3.在定时或定量开阀的预约式开阀过程中,系统仅显示取消状态。当用户点击取消时,程序会尝试执行取消操作,但可能因网络等不可抗力因素而失败。 | 
|---|
|  |  |  | 3.在定时或定量开阀的预约式开阀后,只有阀门到达约定的时间成功开阀后未关阀记录才会显示。 | 
|---|
|  |  |  | 4.我们诚挚地邀请您通过意见反馈渠道提出宝贵的建议或意见。 | 
|---|
|  |  |  | </text> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | </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> | 
|---|
|  |  |  | 
|---|
|  |  |  | // 开卡选择虚拟卡 | 
|---|
|  |  |  | // 开阀选择虚拟卡 | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | get, | 
|---|
|  |  |  | post | 
|---|
|  |  |  | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | isOpenTiming: true, | 
|---|
|  |  |  | radioValue: value, | 
|---|
|  |  |  | dateStartTime: new Date().getTime() | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | 
|---|
|  |  |  | dialog_time: false, | 
|---|
|  |  |  | dialog_water: false, | 
|---|
|  |  |  | dialog_mode: true, | 
|---|
|  |  |  | group_time: false | 
|---|
|  |  |  | group_time: false, | 
|---|
|  |  |  | activeIndex: -1 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //立即开泵 | 
|---|
|  |  |  | 
|---|
|  |  |  | wx.hideLoading(); | 
|---|
|  |  |  | //完成后回到首页 | 
|---|
|  |  |  | wx.reLaunch({ | 
|---|
|  |  |  | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | url: '/pages/home/home?param=1' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }).catch(error => { | 
|---|
|  |  |  | 
|---|
|  |  |  | wx.hideLoading(); | 
|---|
|  |  |  | //完成后回到首页 | 
|---|
|  |  |  | wx.reLaunch({ | 
|---|
|  |  |  | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | url: '/pages/home/home?param=1' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }).catch(error => { | 
|---|
|  |  |  | // 加载完成后隐藏加载动画 | 
|---|
|  |  |  | 
|---|
|  |  |  | plannedOpenTime: this.data.openTime | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | post({ | 
|---|
|  |  |  | url: "wx/valve/timed_close", | 
|---|
|  |  |  | url: "wx/valve/planed_open_timed_close", | 
|---|
|  |  |  | data: data | 
|---|
|  |  |  | }).then(response => { | 
|---|
|  |  |  | // 处理成功响应 | 
|---|
|  |  |  | 
|---|
|  |  |  | wx.hideLoading(); | 
|---|
|  |  |  | //完成后回到首页 | 
|---|
|  |  |  | wx.reLaunch({ | 
|---|
|  |  |  | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | url: '/pages/home/home?param=2' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }).catch(error => { | 
|---|
|  |  |  | // 加载完成后隐藏加载动画 | 
|---|
|  |  |  | 
|---|
|  |  |  | wx.hideLoading(); | 
|---|
|  |  |  | //完成后回到首页 | 
|---|
|  |  |  | wx.reLaunch({ | 
|---|
|  |  |  | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | url: '/pages/home/home?param=1' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }).catch(error => { | 
|---|
|  |  |  | // 加载完成后隐藏加载动画 | 
|---|
|  |  |  | 
|---|
|  |  |  | wx.hideLoading(); | 
|---|
|  |  |  | //完成后回到首页 | 
|---|
|  |  |  | wx.reLaunch({ | 
|---|
|  |  |  | url: '/pages/home/home?param=true' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | url: '/pages/home/home?param=2' // 首页的路径,根据实际情况填写 | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }).catch(error => { | 
|---|
|  |  |  | // 加载完成后隐藏加载动画 | 
|---|
|  |  |  | 
|---|
|  |  |  | <!--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}}"> | 
|---|
|  |  |  | 
|---|
|  |  |  | 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({ | 
|---|
|  |  |  | 
|---|
|  |  |  | this.getRechargList(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //处理充值记录的数据 | 
|---|
|  |  |  | updateDisplayText() { | 
|---|
|  |  |  | const updatedList = this.data.allRechargeList.map(item => { | 
|---|
|  |  |  | let morny = item.rechargeAmount / 100 + "元" | 
|---|
|  |  |  | let morny = item.rechargeAmount  + "元" | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | ...item, | 
|---|
|  |  |  | morny | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 => { | 
|---|
|  |  |  | // 错误回调 | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | this.setData({ | 
|---|
|  |  |  | isPhysicalRefreshing: true, | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.getPhysicalListData(); | 
|---|
|  |  |  | this.getPhysicalListData(true); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | //获取实体卡列表 | 
|---|
|  |  |  | getPhysicalListData(isRefresh) { | 
|---|
|  |  |  | 
|---|
|  |  |  | // pages/waterIntake/waterIntake.js | 
|---|
|  |  |  | //常用取水口列表页 | 
|---|
|  |  |  | const { | 
|---|
|  |  |  | get, | 
|---|
|  |  |  | post | 
|---|