From d589d357824c81d38344644becbe7a5c588e8efd Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Tue, 9 Jul 2024 18:03:16 +0800 Subject: [PATCH] aaa --- common/http.interceptor.js | 2 +- page_components/fuwu/index.vue | 214 +++++++++++++++--- page_fenbao/chongzhi.vue | 174 +++++++++++--- .../statulist/myorder/detailxq/index.vue | 202 +++++++++++++++-- page_fenbao/statulist/myorder/index.vue | 2 +- page_user/sbdetail.vue | 113 +++------ pages/my.vue | 2 +- pages/shouye/index.vue | 19 +- 8 files changed, 568 insertions(+), 160 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index dbce9cd..040d4ce 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -20,7 +20,7 @@ const install = (Vue, vm) => { // }, // }); Vue.prototype.$u.http.setConfig({ - baseUrl: 'http://192.168.2.17:3000/dev-api', + baseUrl: 'http://124.221.246.124:2290', // baseUrl: 'https://kg.chuantewulian.cn/prod-api', loadingText: '努力加载中~', loadingTime: 1000, diff --git a/page_components/fuwu/index.vue b/page_components/fuwu/index.vue index c2dd61a..3cc4a29 100644 --- a/page_components/fuwu/index.vue +++ b/page_components/fuwu/index.vue @@ -5,7 +5,7 @@ {{deviceobj.deviceName}} - 该设备还剩余时长:{{expireTimeStr}}分钟 + 联系客服:{{deviceobj.userMobile}} @@ -14,7 +14,35 @@ 联系客服:{{deviceobj.storeContactMobile}} - + + + + + 充值失败 + + + 充值失败请查看手机蓝牙是否打开 + + + + 第一:检查手机蓝牙是否打开 + + + + + + 第二:设置小程序蓝牙授权 + + + + + + + 我已知晓 + + + + 选择服务 @@ -34,6 +62,9 @@ ¥{{item.price}} + + 暂无更多套餐了... + - + 我已同意 《用户服务协议》 @@ -66,6 +97,11 @@ + + + + + @@ -78,6 +114,7 @@ return { indexactive: 0, checked: false, + lanyaflag:false, deviceobj: {}, timer: null, expireTimeStr: '', @@ -109,30 +146,53 @@ this.startTimer() this.gettaoc() this.getmac() + if(this.onlineStatus == 0){ + // 一开始搜索设备 + xBlufi.initXBlufi(1) + xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); + xBlufi.notifyStartDiscoverBle({ + 'isStart': true + }) + setTimeout(() => { + xBlufi.notifyStartDiscoverBle({ + 'isStart': false + }) + if (this.devicesList.length > 0) { + xBlufi.notifyConnectBle({ + isStart: true, + deviceId: this.deviceId, + name: this.name + }) + } + }, 2000) + } } else { this.id = option.id this.startTimer() this.gettaoc() this.getmac() - } - // 一开始搜索设备 - xBlufi.initXBlufi(1) - xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); - xBlufi.notifyStartDiscoverBle({ - 'isStart': true - }) - setTimeout(() => { - xBlufi.notifyStartDiscoverBle({ - 'isStart': false - }) - if (this.devicesList.length > 0) { - xBlufi.notifyConnectBle({ - isStart: true, - deviceId: this.deviceId, - name: this.name + if(this.onlineStatus == 0){ + // 一开始搜索设备 + xBlufi.initXBlufi(1) + xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); + xBlufi.notifyStartDiscoverBle({ + 'isStart': true }) + setTimeout(() => { + xBlufi.notifyStartDiscoverBle({ + 'isStart': false + }) + if (this.devicesList.length > 0) { + xBlufi.notifyConnectBle({ + isStart: true, + deviceId: this.deviceId, + name: this.name + }) + } + }, 2000) } - }, 2000) + } + }, computed: { @@ -166,6 +226,26 @@ }); }, methods: { + btnjxcz(){ + xBlufi.initXBlufi(1) + xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); + xBlufi.notifyStartDiscoverBle({ + 'isStart': true + }) + setTimeout(() => { + xBlufi.notifyStartDiscoverBle({ + 'isStart': false + }) + if (this.devicesList.length > 0) { + xBlufi.notifyConnectBle({ + isStart: true, + deviceId: this.deviceId, + name: this.name + }) + } + }, 2000) + }, + call() { let phoneNumber = '' if(this.deviceobj.storeContactMobile == null){ @@ -279,8 +359,7 @@ success: (res) => { console.log(res, '支付成功'); if (that.timer) { - clearInterval(this - .timer); + clearInterval(this.timer); that.timer = null; } // 支付成功逻辑 @@ -307,14 +386,18 @@ } }) } else { + this.czflag = true + uni.showLoading({ + title:'支付准备中' + }) if (this.ver_data == '') { let that = this uni.showModal({ title: '提示', - content: '支付的时候请靠近设备并打开蓝牙', + content: '支付失败,支付的时候请靠近设备,并打开蓝牙', success: function(res) { if (res.confirm) { - console.log(that.deviceId,that.name); + xBlufi.initXBlufi(1); xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent); xBlufi.notifyStartDiscoverBle({ @@ -359,9 +442,8 @@ paySign: res.data.paySign, success: (res) => { console.log(res, '支付成功'); - if (that.timer) { - clearInterval(this - .timer); + if (that.timer) { + clearInterval(this.timer); that.timer = null; } // 支付成功逻辑 @@ -371,6 +453,8 @@ uni.setStorageSync('time', that.expireTimeStr) }, fail(err) { + this.czflag = false + uni.hideLoading() // 支付失败逻辑 uni.showToast({ title: '支付失败', @@ -409,7 +493,7 @@ let devicesarr = options.data devicesarr.forEach(device => { const mac = device.name.substring(4); - console.log(device.name,this.mac,'111'); + // console.log(device.name,this.mac,'111'); if (device.name == this.mac) { this.deviceId = device.deviceId this.name = device.name @@ -439,14 +523,14 @@ case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA: this.ver_data = this.parseCustomData(options.data) + this.czflag = false uni.hideLoading() console.log("1收到设备发来的自定义数据结果:", this.ver_data); break; case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP: if (options.result) { let uniqueDevicesList = Array.from(new Set(this.devicesList)); - let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 4) === - "CTKG"); + let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 4) === "CTKG"); // 将过滤后的数组重新赋值给 this.devicesList this.devicesList = filteredDevices; filteredDevices.forEach(device => { @@ -461,6 +545,19 @@ } this.searching = false break; + case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START: + if (!options.result) { + this.lanyaflag = true + uni.showToast({ + title: '蓝牙未开启', + icon: 'none', + duration: 3000 + }); + return + }else{ + this.lanyaflag = false + } + break; } }, @@ -490,6 +587,55 @@