From 20ddd6de972ec3d54b32be6ff653bff16625c714 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Thu, 11 Jul 2024 18:02:47 +0800 Subject: [PATCH] aaa --- components/share.js | 28 + main.js | 3 + page_components/fuwu/index.vue | 66 ++- .../statulist/taocanlist/addtaocan/index.vue | 2 +- page_fenbao/statulist/taocanlist/index.vue | 7 +- page_fenbao/zhuce.vue | 542 ++++++++++++++++++ pages/index/index.vue | 9 +- pages/shouye/index.vue | 4 +- 8 files changed, 647 insertions(+), 14 deletions(-) create mode 100644 components/share.js create mode 100644 page_fenbao/zhuce.vue diff --git a/components/share.js b/components/share.js new file mode 100644 index 0000000..fc31c0b --- /dev/null +++ b/components/share.js @@ -0,0 +1,28 @@ +export default { + data() { + return { + // 默认的全局分享内容 + share: { + title: '共享智能开关', + path: '/pages/shouye/index', // 全局分享的路径,比如 首页 + // imageUrl: '/static/image/1.png', // 分享时显示的图片 + } + } + }, + // 1.发送给朋友 + onShareAppMessage(res) { + return { + title: this.share.title, + path: this.share.path, + // imageUrl: this.share.imageUrl, + } + }, + //2.分享到朋友圈 + onShareTimeline(res) { + return { + title: this.share.title, + path: this.share.path, + // imageUrl: this.share.imageUrl, + } + }, +} \ No newline at end of file diff --git a/main.js b/main.js index 28f7b2c..ea28c7d 100644 --- a/main.js +++ b/main.js @@ -17,6 +17,9 @@ import'./common/css/iconfont.css' import tabbar from '@/components/tab-bar/tab-bar.vue'; + + + // import customizeAnswer from'@/components/customizeAnswer/customizeAnswer.vue' // Vue.use('customizeAnswer',customizeAnswer) Vue.use('tab-bar',tabbar) diff --git a/page_components/fuwu/index.vue b/page_components/fuwu/index.vue index 2861455..ff5c1b4 100644 --- a/page_components/fuwu/index.vue +++ b/page_components/fuwu/index.vue @@ -109,7 +109,7 @@ export default { data() { return { - indexactive: 0, + indexactive: -1, checked: false, lanyaflag:false, deviceobj: {}, @@ -126,7 +126,9 @@ name: '', ver_data: '', devicesList: [], - onlineStatus: '' + onlineStatus: '', + jine:'', + dingobj:{} } }, onLoad(option) { @@ -304,7 +306,7 @@ this.$u.get(`/app/device/${this.id}/withSuitList`).then((res) => { if (res.code == 200) { this.deviceobj = res.data; - this.indexactive = res.data.suitList[0].suitId; + // this.indexactive = res.data.suitList[0].suitId; this.zfobj = res.data.suitList[0] // let targetDateStr = this.deviceobj.expireTime // let targetParts = targetDateStr.split(/[- :]/); @@ -333,6 +335,12 @@ icon: 'none', duration: 1000 }) + }else if(this.indexactive == -1){ + uni.showToast({ + title: '请选择套餐 !', + icon: 'none', + duration: 1000 + }) } else if (this.onlineStatus == 1) { let that = this let data = { @@ -443,10 +451,49 @@ clearInterval(this.timer); that.timer = null; } + + // 111111111111111111111111 + that.$u.get('/app/bill/recharge/device/fail/list').then(res => { + if (res.code == 200) { + console.log('获取订单状态',res); + let dingobj = res.data[0].billNo + console.log(dingobj); + uni.getNetworkType({ + success(res) { + if (res.networkType !== 'none') { + uni.getConnectedBluetoothDevices({ + success(res) { + xBlufi.notifySendCustomData({ + customData: "time@" + that.jine * 60 + }); + }, + fail(err) { + console.error('获取已连接蓝牙设备信息失败:', err); + } + }) + that.$u.get(`/app/bill/recharge/${dingobj}/bluetoothSuccess`).then(res => { + if(res.code == 200){ + console.log('蓝牙离线充值成功'); + setTimeout(()=>{ + uni.reLaunch({ + url: '/pages/shouye/index' + }) + },1000) + } + }) + } else { + console.log('手机未连接网络'); + // this.baiflag = false + } + } + }) + } + }) + + + // 11111111111111111111111 + // 支付成功逻辑 - uni.reLaunch({ - url: '/pages/shouye/index' - }) uni.setStorageSync('time', that.expireTimeStr) },fail(err) { setTimeout(()=>{ @@ -477,6 +524,7 @@ }, btnactive(item) { + this.jine = item.value this.sytime = item.value this.zfobj = item this.indexactive = item.suitId; @@ -502,6 +550,12 @@ let uniqueDevicesList = Array.from(new Set(this.devicesList)); // 将去重后的数组重新赋值给 this.devicesList this.devicesList = uniqueDevicesList; + }else{ + // uni.showToast({ + // title: '未找到该设备,请确认该设备在附近', + // icon: 'none', + // duration: 3000 + // }) } }); } diff --git a/page_fenbao/statulist/taocanlist/addtaocan/index.vue b/page_fenbao/statulist/taocanlist/addtaocan/index.vue index 4c40e23..7250275 100644 --- a/page_fenbao/statulist/taocanlist/addtaocan/index.vue +++ b/page_fenbao/statulist/taocanlist/addtaocan/index.vue @@ -13,7 +13,7 @@ - 通电时长 + 通电时长(分钟) diff --git a/page_fenbao/statulist/taocanlist/index.vue b/page_fenbao/statulist/taocanlist/index.vue index 6c809dd..e4b1732 100644 --- a/page_fenbao/statulist/taocanlist/index.vue +++ b/page_fenbao/statulist/taocanlist/index.vue @@ -2,13 +2,14 @@ - + + {{item.name}}({{item.value}}分钟) ¥{{item.price}} - + {{item.description.length > 20 ? item.description.substring(0, 20) + '...' : item.description}} @@ -29,6 +30,7 @@ data() { return { list: [], + loading:false, disabled: false, btnWidth: 180, show: false, @@ -57,6 +59,7 @@ this.$u.get(`/app/suit/listByDeviceId/${this.deviceId}`).then((res) => { if (res.code == 200) { this.list = res.data + this.loading = true } }); }, diff --git a/page_fenbao/zhuce.vue b/page_fenbao/zhuce.vue new file mode 100644 index 0000000..0b2cc3d --- /dev/null +++ b/page_fenbao/zhuce.vue @@ -0,0 +1,542 @@ + + + + + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 89c3a39..6bf9559 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -419,11 +419,14 @@ this.pagenum = 1 this.wateringList = [] this.titlist = item.name - this.$u.get( - `/app/device/list?storeId=${item.storeId}&pageNum=${this.pagenum}&pageSize=${this.pagesize}` - ).then((res) => { + this.$u.get(`/app/device/list?storeId=${item.storeId}&pageNum=${this.pagenum}&pageSize=${this.pagesize}`).then((res) => { if (res.code == 200) { this.total = res.total + // if(this.pagenum > 1){ + // this.wateringList = this.wateringList.concat(res.rows) + // }else{ + // this.wateringList = res.rows + // } if (res.rows.length > 0) { // 有数据,追加到列表 this.wateringList = this.wateringList.concat(res.rows) diff --git a/pages/shouye/index.vue b/pages/shouye/index.vue index f98d222..d9740ce 100644 --- a/pages/shouye/index.vue +++ b/pages/shouye/index.vue @@ -11,7 +11,7 @@ -