From bfab58ddbb0ecbb35d3964ee14c132b25b387291 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Sun, 29 Sep 2024 19:32:37 +0800 Subject: [PATCH] 111 --- common/http.interceptor.js | 4 +- components/tab-bar/tab-bar.vue | 5 +- page_components/bindszthr.vue | 344 +++++++++++++---- page_components/eletj.vue | 355 ++++++++++++++++-- page_components/fuwu/index.vue | 42 ++- page_fenbao/HM-dragSorts/HM-dragSorts.vue | 23 +- .../statulist/myorder/detailxq/index.vue | 15 +- page_fenbao/statulist/myorder/index.vue | 14 +- .../statulist/taocanlist/addtaocan/index.vue | 14 +- page_user/mapditu/orderxq.vue | 33 +- page_user/sbdetail.vue | 79 ++-- page_user/switchs.vue | 2 +- pages.json | 11 + pages/index/index.vue | 12 +- 14 files changed, 766 insertions(+), 187 deletions(-) diff --git a/common/http.interceptor.js b/common/http.interceptor.js index dec621d..9c734f5 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -19,8 +19,8 @@ const install = (Vue, vm) => { // }, // }); Vue.prototype.$u.http.setConfig({ - baseUrl: 'http://192.168.2.81:10002', - // baseUrl: 'https://kg.chuangtewl.com/prod-api', + // baseUrl: 'http://192.168.2.81:10002', + baseUrl: 'https://kg.chuangtewl.com/prod-api', // loadingText: '努力加载中~', // loadingTime: 1000, // 设置自定义头部content-type diff --git a/components/tab-bar/tab-bar.vue b/components/tab-bar/tab-bar.vue index 32c89d8..6c40651 100644 --- a/components/tab-bar/tab-bar.vue +++ b/components/tab-bar/tab-bar.vue @@ -15,7 +15,10 @@
商户
- + diff --git a/page_components/bindszthr.vue b/page_components/bindszthr.vue index 86a2e14..276e6c4 100644 --- a/page_components/bindszthr.vue +++ b/page_components/bindszthr.vue @@ -19,27 +19,43 @@ 套餐模版配置 - + 能更方便,快速的配置设备套餐 - + 选择套餐列表 - 套餐名称 {{item.name}} + {{item.name}} + + 计时收费 + 按量收费 + 分时段按量收费 + 分时段按时收费 + (单次收费 + 智能收费) + + 押金{{item.price}} + {{item.value}}时 {{item.price}}元 + {{item.value}}分 {{item.price}}元 + {{item.value}}秒 {{item.price}}元 + + + 备注:{{item.description == null ? '--' : item.description}} + @@ -48,13 +64,43 @@ - - 完成设置(3/3) + + + + + 新建套餐 + + + + 完成设置(3/3) + + + + + + + 商户反洗钱协议 + + + 欢迎来到创想物联 + + + + + + 同意 + + + 已阅 {{countdown}}秒 + + + + @@ -63,6 +109,7 @@ export default { data() { return { + xintsflag:false, btnmsk:false, qrResult:'', bluetoothflag: false, @@ -103,7 +150,10 @@ url: '', tclist:[], list:[], - isActive: [] + isActive: [], + countdown: 10, // 初始倒计时时间 + intervalId: null, + contwz:'' } }, onLoad(option) { @@ -118,12 +168,14 @@ // this.getgroup() // this.gettanc() this.getlistobj(this.id) - // this.getuserinfo() this.getao() this.getlist() + this.getxieyi() }, onUnload: function() { - console.log("unload "); + if (this.intervalId) { + clearInterval(this.intervalId); + } xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent); wx.closeBLEConnection({ deviceId: this.deviceId, @@ -146,6 +198,54 @@ } }, methods: { + // 滚动到底部 + onScrollToLower() { + this.startCountdown() + }, + startCountdown() { + if(this.intervalId){ + + }else{ + this.intervalId = setInterval(() => { + if (this.countdown > 0) { + this.countdown--; + } else { + clearInterval(this.intervalId); // 清除定时器 + } + }, 1000); // 每秒执行一次 + } + }, + getxieyi(){ + this.$u.get(`/app/article/licence/mch`).then(res => { + if(res.code == 200){ + this.contwz = res.data.content + } + }) + }, + getuser(){ + this.$u.get("/app/user/userInfo").then((res) => { + if (res.code == 200) { + if(res.data.readMchLicence == false){ + this.xintsflag = true + }else{ + this.xintsflag = false + } + } + }) + }, + btnzx(){ + this.$u.put(`/app/user/readMchLicence`).then((res) => { + if (res.code == 200) { + uni.reLaunch({ + url:'/pages/index/index' + }) + // this.getuser() + // this.xintsflag = false + } + }) + }, + + toindex(suitId){ const index = this.isActive.indexOf(suitId); if (index !== -1) { @@ -210,48 +310,63 @@ // 点击进行下一步 btnxia(){ if(this.isActive.length == 0){ - uni.showModal({ - title: '提示', - content: '还未绑定套餐,设备将无法扫码使用,是否继续完成设置?', - success: function(res) { - if (res.confirm) { - this.btnmsk = false - uni.switchTab({ - url:'/pages/index/index' - }) - } - } + // uni.showModal({ + // title: '提示', + // content: '还未绑定套餐,请先绑定或创建套餐', + // success: function(res) { + // if (res.confirm) { + // this.btnmsk = false + // // uni.switchTab({ + // // url:'/pages/index/index' + // // }) + // } + // } + // }) + uni.showToast({ + title: '还未绑定套餐,请先绑定或新建套餐', + icon: 'none', + duration: 3000, }) }else{ - this.$u.delete(`/app/suit/delByDevice/${this.deviceId}`).then(res => {}) - let numArr = this.isActive.map(item => parseInt(item, 10)) - let data = { - deviceId: this.id, - suitIds: numArr - } - this.$u.put(`/app/device`, data).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: res.msg, - icon: 'success', - duration: 1000, - }) - this.getao() - setTimeout(() => { - this.btnmsk = false - uni.reLaunch({ - url:'/pages/index/index' - }) - }, 1000) - }else{ - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 1000, - }) - this.btnmsk = false - } - }) + this.$u.get("/app/user/userInfo").then((res) => { + if (res.code == 200) { + if(res.data.readMchLicence == false){ + this.xintsflag = true + // this.startCountdown() + }else{ + this.xintsflag = false + this.$u.delete(`/app/suit/delByDevice/${this.deviceId}`).then(res => {}) + let numArr = this.isActive.map(item => parseInt(item, 10)) + let data = { + deviceId: this.id, + suitIds: numArr + } + this.$u.put(`/app/device`, data).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: res.msg, + icon: 'success', + duration: 1000, + }) + this.getao() + setTimeout(() => { + this.btnmsk = false + uni.reLaunch({ + url:'/pages/index/index' + }) + }, 1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 1000, + }) + this.btnmsk = false + } + }) + } + } + }) } }, // 点击wifi进行配网 @@ -528,6 +643,91 @@