diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 9c734f5..3b195a8 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -19,7 +19,7 @@ const install = (Vue, vm) => { // }, // }); Vue.prototype.$u.http.setConfig({ - // baseUrl: 'http://192.168.2.81:10002', + // baseUrl: 'http://192.168.2.106:10002', baseUrl: 'https://kg.chuangtewl.com/prod-api', // loadingText: '努力加载中~', // loadingTime: 1000, @@ -101,7 +101,7 @@ const install = (Vue, vm) => { // } // }); } - }); + }) wx.login({ success(res) { if (res.code) { diff --git a/page_components/HM-dragSorts/HM-dragSorts.vue b/page_components/HM-dragSorts/HM-dragSorts.vue index 00d4ac8..7fd12e4 100644 --- a/page_components/HM-dragSorts/HM-dragSorts.vue +++ b/page_components/HM-dragSorts/HM-dragSorts.vue @@ -53,15 +53,6 @@ {{row.name}} - 计时收费 按量收费 @@ -70,10 +61,12 @@ (单次收费 智能收费) - {{row.value}}时 {{row.price}}元 - {{row.value}}分 {{row.price}}元 - {{row.value}}秒 {{row.price}}元 押金{{row.deposit}}元 + + {{row.value}}时 {{row.price}}元 + {{row.value}}分 {{row.price}}元 + {{row.value}}秒 {{row.price}}元 + diff --git a/page_components/eletj.vue b/page_components/eletj.vue index 564e201..b2a48b4 100644 --- a/page_components/eletj.vue +++ b/page_components/eletj.vue @@ -29,7 +29,7 @@ - + 点击刷新实时信息 @@ -94,11 +94,14 @@ - {{detaobj.suitTime == null ? '--' : detaobj.suitTime}} 分钟 - - {{detaobj.suitTime}}度 押金 + + {{detaobj.suitTime == null ? '--' : detaobj.suitTime}} 分钟 + + {{detaobj.suitTime}}度 + + {{detaobj.suitDeposit == null ? '--' : detaobj.suitDeposit}}元 @@ -226,6 +229,24 @@ + + + + + + 系统检测该设备未联网或者为蓝牙版本,金额充值失败,请靠近设备进行蓝牙充值 + + + + + 取消 + + + 蓝牙充值 + + + + @@ -262,6 +283,7 @@ "水表", ], + czflag:false, curtitidx: 0, id: '', timeday: '', @@ -296,7 +318,9 @@ suitStartEle: '', sbobj: {}, jieshufalg:false, - channelId:'' + channelId:'', + dingobj: '', + timerone:null } }, onLoad(option) { @@ -309,8 +333,11 @@ this.opflag = option.flag } setTimeout(()=>{ - this.shuaxin() + // this.shuaxin() + // this.gethuidaio() + this.startTimerone() },1500) + }, computed: { // 计算剩余时间 @@ -335,6 +362,8 @@ }, onUnload: function() { console.log("unload "); + clearInterval(this.timerone); + this.timerone= null xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent); wx.closeBLEConnection({ deviceId: this.deviceId, @@ -359,6 +388,7 @@ onShow() { setTimeout(() => { this.startTimers() + this.gethuidaio() if (this.id) { //判断有没有id 没有的话则直接返回首页 } else { @@ -366,7 +396,7 @@ url: '/pages/shouye/index' }) } - }, 100) + }, 1000) }, onHide() { this.stopTimer(); @@ -383,6 +413,37 @@ this.stopTimer(); }, methods: { + startTimerone() { + // 清除之前可能存在的定时器,防止重复设置 + clearInterval(this.timerone); + this.timerone = setInterval(() => { + this.shuaxin() + this.gethuidaio() + }, 2000); + }, + // 判断是否充值失败 充值失败启用蓝牙离线充值 + gethuidaio() { + this.$u.get('/app/bill/recharge/device/fail/list').then(res => { + if (res.code == 200) { + if (res.data.length > 0) { + this.czflag = true + this.dingobj = res.data + clearInterval(this.timerone); + this.timerone= null + } else { + uni.removeStorageSync('time') + } + } + }) + }, + // 点击进行蓝牙离线充值 + tocz() { + this.czflag = false + uni.navigateTo({ + url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj) + }) + }, + // 点击拨打客服电话 btncall(){ let phoneNumber = '' @@ -543,16 +604,18 @@ // 点击进行强刷数据 - shuaxin(){ + shuaxin(txt){ this.$u.get(`/app/device/${this.sbid}/refreshIot`).then((res) => { if(res.code == 200){ this.getDevice() this.getsb() - uni.showToast({ - title: res.msg, - icon: 'success', - duration: 1500 - }) + if(txt == 1){ + uni.showToast({ + title: res.msg, + icon: 'success', + duration: 1500 + }) + } }else{ uni.showToast({ title: res.msg, @@ -1102,7 +1165,7 @@ }) }, - // 获取设备详情 + // 获取订单详情 getDevice() { this.$u.get(`/app/bill/byNo/${this.id}`).then(res => { if (res.code == 200) { @@ -1112,6 +1175,10 @@ this.detaobj = res.data this.billId = res.data.billId this.orderno = res.data.billNo + if(res.data.deviceRechargeStatus == 1){ + clearInterval(this.timerone); + this.timerone = null + } this.getprice() let dateTimeString = res.data.suitStartTime // 示例时间字符串 this.timeDifferenceString = this.calculateTimeDifference(dateTimeString); // 调用函数 @@ -1805,7 +1872,72 @@ } } } + .masks { + width: 100%; + height: 100vh; + position: fixed; + top: 0; + left: 50%; + transform: translateX(-50%); + background-color: #000; + opacity: .6; + z-index: 998; + } + .tip_box { + position: fixed; + left: 72rpx; + top: 700rpx; + width: 610rpx; + background: #F7FAFE; + border-radius: 30rpx 30rpx 30rpx 30rpx; + z-index: 10000000; + + .top { + padding: 52rpx 38rpx 42rpx 36rpx; + + .txt { + width: 100%; + text-align: center; + font-weight: 500; + font-size: 32rpx; + color: #3D3D3D; + } + } + + .bot { + border-top: 2rpx solid #D8D8D8; + display: flex; + flex-wrap: nowrap; + height: 100%; + + .bot_left { + width: 50%; + height: 98rpx; + display: flex; + align-items: center; + justify-content: center; + font-weight: 500; + font-size: 36rpx; + color: #3D3D3D; + } + + .bot_right { + width: 50%; + height: 98rpx; + display: flex; + align-items: center; + justify-content: center; + + border-left: 2rpx solid #D8D8D8; + font-weight: 500; + font-size: 36rpx; + color: #8883F0; + + } + + } + } .page { .zhuhu { margin-top: 60rpx; diff --git a/page_components/fuwu/index.vue b/page_components/fuwu/index.vue index 42d71fa..8e2171d 100644 --- a/page_components/fuwu/index.vue +++ b/page_components/fuwu/index.vue @@ -116,10 +116,14 @@ 我已同意 《用户服务协议》 《隐私政策》 - + + + + 立即支付 @@ -148,11 +152,12 @@ +