From 3bd17e7245173463c6be276f006d3507785836ca Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Fri, 13 Sep 2024 18:02:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=8A=E5=9E=AB=E5=9F=BA=E6=9C=AC=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 3 +- common/http.interceptor.js | 4 +- components/blufi/xBlufi-wx-impl.js | 4 +- page_user/caiwudetail.vue | 2 +- page_user/changsuo.vue | 2 - page_user/daili.vue | 6 +- page_user/deviceedit.vue | 2 +- page_user/devicelist.vue | 2 - page_user/dianpu.vue | 2 +- page_user/dianpuedit.vue | 2 +- page_user/fuwu.vue | 4 +- page_user/guzhang.vue | 25 -- page_user/homepage.vue | 13 + page_user/mydetail.vue | 121 ++++--- page_user/mydingdan.vue | 35 +- page_user/orderdetail.vue | 2 +- page_user/orderlist.vue | 13 +- page_user/sjhezuo.vue | 2 +- page_user/touzi.vue | 3 - pages/index/index.vue | 6 +- pages/zhuce.vue | 499 +++++++++++++++++------------ 21 files changed, 442 insertions(+), 310 deletions(-) diff --git a/App.vue b/App.vue index 3143ca6..f4d2f1e 100644 --- a/App.vue +++ b/App.vue @@ -176,5 +176,6 @@ } page{ background-color: #f8f8f8; - } + } + diff --git a/common/http.interceptor.js b/common/http.interceptor.js index c3a0345..134b800 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -20,8 +20,8 @@ const install = (Vue, vm) => { // }, // }); Vue.prototype.$u.http.setConfig({ - // baseUrl: 'http://192.168.2.81:3302', - baseUrl: 'https://kang.chuangtewl.com/prod-api', + baseUrl: 'http://192.168.2.81:3302', + // baseUrl: 'https://kang.chuangtewl.com/prod-api', loadingText: '努力加载中~', loadingTime: 800, // 设置自定义头部content-type diff --git a/components/blufi/xBlufi-wx-impl.js b/components/blufi/xBlufi-wx-impl.js index ef1a3f3..8c251fc 100644 --- a/components/blufi/xBlufi-wx-impl.js +++ b/components/blufi/xBlufi-wx-impl.js @@ -1145,8 +1145,8 @@ function init() { // && devices.devices[0].name != 'SMART_R2XS' // && devices.devices[0].name != 'SMART_R2XS' // ) - if (devices.devices[0].name.indexOf("CCYK") != -1 || devices.devices[0].name.indexOf("BBLE") != -1){ - // console.log("跳过",devices.devices[0].name) + if (devices.devices[0].name.indexOf("CCYK") != -1){ + // console.log("跳过",devices.devices[0].name) || devices.devices[0].name.indexOf("BBLE") != -1 // isnotexist = false; isnotexist = true; } diff --git a/page_user/caiwudetail.vue b/page_user/caiwudetail.vue index 1bc445d..5ea60ce 100644 --- a/page_user/caiwudetail.vue +++ b/page_user/caiwudetail.vue @@ -123,7 +123,7 @@ width: 100%; .rxdetail{ width: 672rpx; - height: 718rpx; + max-height: 718rpx; background: #FFFFFF; box-shadow: 0rpx 4rpx 22rpx 0rpx rgba(0,0,0,0.07); border-radius: 20rpx 20rpx 20rpx 20rpx; diff --git a/page_user/changsuo.vue b/page_user/changsuo.vue index 560e123..9bec7c1 100644 --- a/page_user/changsuo.vue +++ b/page_user/changsuo.vue @@ -266,8 +266,6 @@ url:'/page_user/dianpu' }) } - - } } diff --git a/page_user/daili.vue b/page_user/daili.vue index f1f54f1..81cdf1b 100644 --- a/page_user/daili.vue +++ b/page_user/daili.vue @@ -88,7 +88,7 @@ } }, - // 分享到朋友圈 + // 分享到朋友圈 onShareTimeline: function() { return { title: '创亿康', @@ -114,9 +114,7 @@ onScrollToLower() { if (this.total > this.wateringList.length) { this.getlist() // 上拉加载更多 - } else { - - } + } }, btnscreh(){ this.wateringList = [] diff --git a/page_user/deviceedit.vue b/page_user/deviceedit.vue index 6edee2f..308bf07 100644 --- a/page_user/deviceedit.vue +++ b/page_user/deviceedit.vue @@ -206,7 +206,7 @@ .list_item { margin-top: 32rpx; - height: 348rpx; + max-height: 348rpx; padding: 24rpx 28rpx; box-sizing: border-box; background-color: #fff; diff --git a/page_user/devicelist.vue b/page_user/devicelist.vue index 55e5ff8..5cef13e 100644 --- a/page_user/devicelist.vue +++ b/page_user/devicelist.vue @@ -445,8 +445,6 @@ .list { padding: 0 38rpx; box-sizing: border-box; - // height: 1130rpx; - // overflow: scroll; padding-bottom: 200rpx; box-sizing: border-box; diff --git a/page_user/dianpu.vue b/page_user/dianpu.vue index ee252f3..e15d46b 100644 --- a/page_user/dianpu.vue +++ b/page_user/dianpu.vue @@ -446,7 +446,7 @@ .list { width: 680rpx; - height: 1080rpx; + height: 980rpx; background: #FFFFFF; border-radius: 24rpx 24rpx 24rpx 24rpx; margin: auto; diff --git a/page_user/dianpuedit.vue b/page_user/dianpuedit.vue index 363a541..16183fd 100644 --- a/page_user/dianpuedit.vue +++ b/page_user/dianpuedit.vue @@ -454,7 +454,7 @@ .list { width: 680rpx; - height: 1080rpx; + height: 980rpx; background: #FFFFFF; border-radius: 24rpx 24rpx 24rpx 24rpx; margin: auto; diff --git a/page_user/fuwu.vue b/page_user/fuwu.vue index b3f2da3..dde6cf8 100644 --- a/page_user/fuwu.vue +++ b/page_user/fuwu.vue @@ -43,8 +43,8 @@ 功能介绍 - - {{obj.funcInfo == undefined ? '暂无介绍...' : obj.funcInfo}} + + diff --git a/page_user/guzhang.vue b/page_user/guzhang.vue index 6ce982f..fc74d8f 100644 --- a/page_user/guzhang.vue +++ b/page_user/guzhang.vue @@ -292,31 +292,6 @@ width: 64rpx; height: 64rpx; } - // view { - // border-radius: 15rpx; - // border: 2rpx solid #C4C4C4; - // padding: 14rpx 34rpx 14rpx 34rpx; - // box-sizing: border-box; - // margin-right: 28rpx; - // margin-top: 40rpx; - // position: relative; - // overflow: hidden; - - // text { - // position: absolute; - // bottom: 0; - // right: 0; - // display: inline-block; - // width: 31rpx; - // height: 19rpx; - // background: #8883F0; - // color: #fff; - // border-radius: 5rpx; - // font-size: 18rpx; - // text-align: center; - // line-height: 19rpx; - // } - // } } } diff --git a/page_user/homepage.vue b/page_user/homepage.vue index c25452c..df80824 100644 --- a/page_user/homepage.vue +++ b/page_user/homepage.vue @@ -130,6 +130,14 @@ + + + 设备录入 + + + + + @@ -242,6 +250,10 @@ uni.navigateTo({ url:'/page_fenbao/listtaocan' }) + }else if(num == 6){ + uni.navigateTo({ + url:'/pages/zhuce' + }) } }, // 跳转到实名 @@ -353,6 +365,7 @@ .gn_list{ width: 658rpx; max-height: 430rpx; + overflow: scroll; background: #FFFFFF; border-radius: 24rpx 24rpx 24rpx 24rpx; margin-top: 20rpx; diff --git a/page_user/mydetail.vue b/page_user/mydetail.vue index d4a4354..a2c3b2e 100644 --- a/page_user/mydetail.vue +++ b/page_user/mydetail.vue @@ -194,19 +194,37 @@ name: '', setMode: null, qrResult: '', - isUsing:false + isUsing: false, + timer: null, + timers: null, } }, + onShow() { + // 页面显示时启动定时器 + this.startTimers(); + }, + onHide() { + // 页面隐藏时清除定时器 + if (this.timers) { + clearInterval(this.timers); + this.timers = null; + console.log('消除'); + } + }, + onUnload() { + if (this.timers) { + clearInterval(this.timers); + this.timers = null; + console.log('消除'); + } + }, onLoad(option) { if (option.billId) { this.billId = option.billId - this.getlist() - // this.getad() } else { this.billId = option.id - this.getlist() - // this.getad() } + this.getlist() }, // 分享到好友(会话) onShareAppMessage: function() { @@ -235,9 +253,9 @@ } else if (this.timeday.minutes > 0) { // 展示分钟和秒 return `${this.timeday.minutes}分钟${this.timeday.seconds}秒` - } else if(this.timeday.seconds == 0){ + } else if (this.timeday.seconds == 0) { this.getlist() - }else{ + } else { // 展示秒或0(如果秒也为0) this.isUsing = false return this.timeday.seconds > 0 ? `${this.timeday.seconds}秒` : '0' @@ -245,6 +263,14 @@ } }, methods: { + startTimers() { + if (this.timers) { + clearInterval(this.timers); // 防止重复设置定时器 + } + this.timers = setInterval(() => { + this.getlist() + }, 60000); // 60秒 + }, // 蓝牙连接取消 btnlyqx() { this.shibaiflag = false @@ -334,11 +360,11 @@ success(res) { if (res.networkType !== 'none') { uni.getConnectedBluetoothDevices({ - success(res) { + success(res) { setTimeout(() => { - xBlufi.notifySendCustomData({ + xBlufi.notifySendCustomData({ customData: 'time0@' - }) + }) uni.showToast({ title: '操作成功', icon: 'success', @@ -348,21 +374,22 @@ billId: that.billId, totalEle: 0 } - that.$u.put(`/app/bill/endUse`, data).then(res => { - if (res.code == 200) { - that.getlist() - that.msakflag = false - that.btnmsk = false - that.shibaiflag = false - that.bluetoothflag = false - } else { - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 1000 - }) - } - }) + that.$u.put(`/app/bill/endUse`, data).then( + res => { + if (res.code == 200) { + that.getlist() + that.msakflag = false + that.btnmsk = false + that.shibaiflag = false + that.bluetoothflag = false + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 1000 + }) + } + }) }, 1000) }, fail(err) { @@ -390,7 +417,7 @@ }) } }) - }else{ + } else { if (this.setMode == null) { this.btnmsk = false this.shibaiflag = false @@ -420,11 +447,11 @@ success(res) { if (res.networkType !== 'none') { uni.getConnectedBluetoothDevices({ - success(res) { + success(res) { setTimeout(() => { xBlufi.notifySendCustomData({ customData: 'close' - }) + }) uni.showToast({ title: '操作成功', icon: 'success', @@ -434,7 +461,7 @@ that.getlist() that.msakflag = false that.btnmsk = false - that.shibaiflag = false + that.shibaiflag = false that.bluetoothflag = false }, 1000) }, @@ -449,7 +476,7 @@ } }, btnimgs() { - if(this.detailobj.deviceOnlineStatus == 1){ + if (this.detailobj.deviceOnlineStatus == 1) { this.$u.put(`/app/bill/switchDevice?billId=${this.billId}&open=true`).then(res => { if (res.code == 200) { this.imgflag = true @@ -461,7 +488,7 @@ }) } }) - }else{ + } else { if (this.setMode == null) { this.btnmsk = false this.shibaiflag = false @@ -491,11 +518,11 @@ success(res) { if (res.networkType !== 'none') { uni.getConnectedBluetoothDevices({ - success(res) { + success(res) { setTimeout(() => { xBlufi.notifySendCustomData({ customData: 'open' - }) + }) uni.showToast({ title: '操作成功', icon: 'success', @@ -505,7 +532,7 @@ that.getlist() that.msakflag = false that.btnmsk = false - that.shibaiflag = false + that.shibaiflag = false that.bluetoothflag = false }, 1000) }, @@ -557,7 +584,7 @@ }) }, - // 请求详情 + // 请求订单详情 getlist() { this.$u.get(`/app/bill/${this.billId}`).then((res) => { if (res.code == 200) { @@ -576,8 +603,8 @@ let expireTimeParts = expireTimeStr.split(" ") let expireDateParts = expireTimeParts[0].split("-") let expireTimePartsTime = expireTimeParts[1].split(":") - let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[ - 2], + let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, + expireDateParts[2], expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2]) let now = new Date() let differenceInMs = expireDate - now @@ -593,6 +620,7 @@ } }) }, + // 订单倒计时定时器 startTimer() { this.timer = setInterval(() => { @@ -652,7 +680,6 @@ case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS: if (options.result) { let devicesarr = options.data - // console.log(devicesarr,'000'); devicesarr.forEach(device => { const mac = device.name.substring(5) if (device.name.slice(5, 17) == this.qrResult) { @@ -666,9 +693,9 @@ case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED: // console.log("连接回调:" + JSON.stringify(options)) if (options.result) { - setTimeout(()=>{ + setTimeout(() => { this.bluetoothflag = false - },3000) + }, 3000) uni.hideLoading(); { console.log("连接回调options.data.deviceId:" + options.data.deviceId, "连接回调options.data.name:" + options.data.name) @@ -848,7 +875,8 @@ left: 50%; transform: translateX(-50%); z-index: 2; - .jieshus{ + + .jieshus { width: 500rpx; max-height: 430rpx; border-radius: 20rpx 20rpx 0 0; @@ -856,6 +884,7 @@ box-sizing: border-box; background-color: #fff; } + .tishi { font-size: 32rpx; width: 100%; @@ -864,9 +893,10 @@ .img { width: 100%; - margin-top: 20rpx; - text-align: center; - margin-bottom: 20rpx; + margin-top: 20rpx; + text-align: center; + margin-bottom: 20rpx; + image { width: 160rpx; height: 140rpx; @@ -884,8 +914,9 @@ display: flex; justify-content: space-between; align-items: center; - background-color: #fff; + background-color: #fff; border-radius: 0 0 20rpx 20rpx; + .qux { text-align: center; width: 100%; diff --git a/page_user/mydingdan.vue b/page_user/mydingdan.vue index ed57650..65b3b49 100644 --- a/page_user/mydingdan.vue +++ b/page_user/mydingdan.vue @@ -3,12 +3,13 @@ - + 设备编号:{{item.deviceNo}} - + + 进行中 + 已完成 + + 未支付 + 支付成功 + 已退款 + 用户取消 + 系统超时取消 + 支付中 + 退款中 + 押金未支付 + 押金已支付 - + 订单号 @@ -101,7 +126,7 @@ } }, onLoad(option) { - + }, onShow() { this.wateringList = [] @@ -130,7 +155,7 @@ if (this.total > this.wateringList.length) { this.getlist() // 上拉加载更多 } else { - + } }, // 跳转详情 billId参数 diff --git a/page_user/orderdetail.vue b/page_user/orderdetail.vue index be3083b..8e9d24d 100644 --- a/page_user/orderdetail.vue +++ b/page_user/orderdetail.vue @@ -187,7 +187,7 @@ icon: 'success', duration: 3000 }) - setInterval(()=>{ + setTimeout(()=>{ uni.navigateBack() },1000) }else{ diff --git a/page_user/orderlist.vue b/page_user/orderlist.vue index 030af7a..909084a 100644 --- a/page_user/orderlist.vue +++ b/page_user/orderlist.vue @@ -9,7 +9,7 @@ 时间范围 - {{firsTime}} - {{lasTime}} + {{firsTime}} - {{lasTime}} @@ -26,17 +26,17 @@ 订单编号:{{item.billNo}} - 进行中 - 已完成 + 进行中 + 已完成 - 未支付 + 未支付 支付成功 已退款 用户取消 系统超时取消 支付中 退款中 - 押金未支付 + 押金未支付 押金已支付 @@ -353,6 +353,9 @@ .date{ font-size: 32rpx; color: #979797; + text{ + display: inline-block; + } } } .serch{ diff --git a/page_user/sjhezuo.vue b/page_user/sjhezuo.vue index 8cd1766..4f77429 100644 --- a/page_user/sjhezuo.vue +++ b/page_user/sjhezuo.vue @@ -111,7 +111,7 @@ this.$u.get("/app/user/userInfo").then((res) => { if (res.code == 200) { - } else { + } else if(res.code == 401){ uni.reLaunch({ url:'/pages/login/login' }) diff --git a/page_user/touzi.vue b/page_user/touzi.vue index 6f98dc3..a333478 100644 --- a/page_user/touzi.vue +++ b/page_user/touzi.vue @@ -170,8 +170,6 @@ .order_list { padding-bottom: 100rpx; box-sizing: border-box; - // height: 1260rpx; - // overflow: scroll; .order_item { width: 672rpx; max-height: 370rpx; @@ -264,7 +262,6 @@ width: 100%; border-radius: 20rpx; justify-content: space-between; - // padding-right: 24rpx; box-sizing: border-box; .sousuo { diff --git a/pages/index/index.vue b/pages/index/index.vue index 8f0e6d4..b5bc61d 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -552,7 +552,6 @@ url: '/page_user/shiming' }) } - } else if (num == 6) { uni.navigateTo({ url: '/page_user/sjhezuo' @@ -621,6 +620,7 @@ // this.iconflag = false } }, + // 地图回正 async setMapScale(e, val) { let mapContext = uni.createMapContext('map', this); @@ -795,8 +795,6 @@ }) }, - - gethuidaio() { this.$u.get('/app/bill/recharge/device/fail/list').then(res => { if (res.code == 200) { @@ -833,7 +831,7 @@ width: 100%; height: 100%; } - + .bjimg { position: fixed; top: 0; diff --git a/pages/zhuce.vue b/pages/zhuce.vue index 2ab9a26..12f877d 100644 --- a/pages/zhuce.vue +++ b/pages/zhuce.vue @@ -4,18 +4,20 @@ back-icon-color="#fff" height='50'> 设备录入列表 - - - - - - + - 设备录入 + + 状态:已录入 未录入 + + + SN码: + MAC:{{item.name.substring(5)}} @@ -23,12 +25,14 @@ 蓝牙强度:{{item.RSSI}} - + 型号选择:{{item.xuanz == undefined ? '--' : item.xuanz}} - + 开关 + 扫码 录入 @@ -47,27 +51,22 @@ 3.确保设备未被添加过。 - - - + + + -