diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 4f59292..3173f5d 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.12:10002', - baseUrl: 'https://kg.chuangtewl.com/prod-api', + baseUrl: 'http://192.168.2.12:10002', + // baseUrl: 'https://kg.chuangtewl.com/prod-api', // loadingText: '加载中...', // loadingTime: 1000, // 设置自定义头部content-type diff --git a/page_components/shebeixz.vue b/page_components/shebeixz.vue index a47e613..5885880 100644 --- a/page_components/shebeixz.vue +++ b/page_components/shebeixz.vue @@ -66,11 +66,12 @@ titflag:'', arrlists:[], deviceList:[], + shu:'' }; }, onLoad(option) { uni.removeStorageSync('tcidlist') - + this.shu = option.shu this.deviceId = option.id if(option.title == '确定'){ this.titflag = '确定' @@ -213,7 +214,8 @@ getlist() { let data = { pageNum: 1, - pageSize: 99 + pageSize: 99, + modelTag:this.shu } this.$u.get(`/app/device/list`, data).then((res) => { if (res.code == 200) { diff --git a/page_fenbao/device/joinDevice.vue b/page_fenbao/device/joinDevice.vue index befe9ed..b4f6d50 100644 --- a/page_fenbao/device/joinDevice.vue +++ b/page_fenbao/device/joinDevice.vue @@ -268,7 +268,8 @@ // delta: 1 // delta值为1时表示返回的页面层数 // }); // }, - bind() { + // 新增and替换设备 + gettihuan(){ let data = { sn: this.storeId, mac: this.mac, @@ -277,7 +278,7 @@ this.$u.post('/app/device', data).then((res) => { if (res.code == 200) { uni.showToast({ - title: '录入成功', + title: res.msg, icon: 'success', duration: 2000 }) @@ -297,38 +298,38 @@ }); } }) - - - // this.$u.post(`/appVerify/band?sn=` + this.sn + '&mac=' + this.mac + '&hardwareVersionId=' + this - // .hardwareVersionId).then((res) => { - - // if (res.code == 200) { - - // uni.showToast({ - // title: '绑定成功', - // icon: 'none', - // duration: 2000 - // }); - // setTimeout(() => { - // uni.navigateBack({ - // delta: 1 // delta值为1时表示返回的页面层数 - // }); - // }, 2000) - - // } else { - // if (res.msg == '该MAC号已经存在') { - // this.showbind = true - // } else { - // uni.showToast({ - // title: res.msg, - // icon: 'none', - // duration: 2000 - // }); - - // } - - // } - // }) + }, + bind() { + this.$u.get(`/app/device/admin/byMac?mac=${this.mac}`).then(res =>{ + if(res.code == 200){ + if(res.data == '' || res.data == null){ + this.gettihuan() + }else{ + let that = this + uni.showModal({ + title: '温馨提示', + content: '该设备已绑定SN,您确定修改该设备的SN吗?', + success: (resModal) => { + if (resModal.confirm) { + that.gettihuan() + } else if (resModal.cancel) { // 用户点击了取消按钮 + uni.showToast({ + title: '已取消', + icon: 'none', + duration: 1000 + }) + } + } + }) + } + }else{ + uni.showToast({ + title: res.msg, + icon: 'success', + duration: 2000 + }) + } + }) }, qrcode() { uni.scanCode({ diff --git a/page_fenbao/zhuce.vue b/page_fenbao/zhuce.vue index ca90406..f50f151 100644 --- a/page_fenbao/zhuce.vue +++ b/page_fenbao/zhuce.vue @@ -37,7 +37,7 @@ - + @@ -103,7 +103,8 @@ snname: '', qrResult:'', name:'', - ver_data:null + ver_data:null, + seachflag:true } }, onLoad(option) { @@ -442,18 +443,18 @@ // if (res.code == 200) { // this.lurulist = res.data // if(this.lurulist){ - xBlufi.initXBlufi(1); - xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); - xBlufi.notifyStartDiscoverBle({ - 'isStart': true - }) - // 两秒后停止蓝牙搜索 - setTimeout(() => { - xBlufi.notifyStartDiscoverBle({ - 'isStart': false - }); - this.status = true - }, 1000) + // xBlufi.initXBlufi(1); + // xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); + // xBlufi.notifyStartDiscoverBle({ + // 'isStart': true + // }) + // // 两秒后停止蓝牙搜索 + // setTimeout(() => { + // xBlufi.notifyStartDiscoverBle({ + // 'isStart': false + // }); + // this.status = true + // }, 1000) // } // } // }) @@ -485,47 +486,48 @@ return parsedData; }, //4、建立连接 - createBLEConnection(e) { - // this.deviceId = e.name - this.mengcflag = true - uni.showLoading({ - title: '录入中...' - }) - this.mac = e.name.substring(5) - // 录入设备 - let data = { - sn: this.storeId, - mac: this.mac, - modelId: this.valuexh - } - this.$u.post('/app/device', data).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: '设备:' + this.mac + '已录入成功', - icon: 'success', - duration: 2000 - }) - this.mengcflag = false - uni.hideLoading() - this.Search() - // setTimeout(() => { - // uni.navigateBack() - // }, 1000) - uni.removeStorageSync('mac') - } else { - this.mengcflag = false - uni.hideLoading() - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000 - }) - } - }) - }, + // createBLEConnection(e) { + // // this.deviceId = e.name + // this.mengcflag = true + // uni.showLoading({ + // title: '录入中...' + // }) + // this.mac = e.name.substring(5) + // // 录入设备 + // let data = { + // sn: this.storeId, + // mac: this.mac, + // modelId: this.valuexh + // } + // this.$u.post('/app/device', data).then((res) => { + // if (res.code == 200) { + // uni.showToast({ + // title: '设备:' + this.mac + '已录入成功', + // icon: 'success', + // duration: 2000 + // }) + // this.mengcflag = false + // uni.hideLoading() + // this.Search() + // // setTimeout(() => { + // // uni.navigateBack() + // // }, 1000) + // uni.removeStorageSync('mac') + // } else { + // this.mengcflag = false + // uni.hideLoading() + // uni.showToast({ + // title: res.msg, + // icon: 'none', + // duration: 2000 + // }) + // } + // }) + // }, // 点击重新搜索 Search() { // if (this.status) { + this.seachflag = false this.mengcflag = true uni.showLoading({ title: '请稍后...' @@ -551,13 +553,14 @@ xBlufi.notifyStartDiscoverBle({ 'isStart': false }); + this.seachflag = true // 判断是否存在设备 - if (this.devicesList.length == 0) { - this.tishiflag = true - this.texts = '扫描完毕,暂无发现设备' - } else { - this.texts = '扫描到以下设备,请点击录入!' - } + // if (this.devicesList.length == 0) { + // this.tishiflag = true + // this.texts = '扫描完毕,暂无发现设备' + // } else { + // this.texts = '扫描到以下设备,请点击录入!' + // } // } else { // xBlufi.notifyStartDiscoverBle({ // 'isStart': true diff --git a/page_user/sbdetail.vue b/page_user/sbdetail.vue index ba90d79..1f4ff79 100644 --- a/page_user/sbdetail.vue +++ b/page_user/sbdetail.vue @@ -57,7 +57,13 @@ - 实时参数 + + 实时参数 + + 点击刷新 + + + @@ -92,10 +98,23 @@ --> - - 点击刷新实时信息 - - + + 开关状态:{{tdtxt}} + + + + + + + + + + + + @@ -137,15 +156,15 @@ - + - + 其他功能 @@ -1971,7 +1990,8 @@ padding-top: 40rpx; margin-top: 20rpx; width: 670rpx; - max-height: 314rpx; + max-height: 614rpx; + padding-bottom: 30rpx; background: #FFFFFF; box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(53, 140, 255, 0.1); border-radius: 28rpx; diff --git a/page_user/wifijoint/index.vue b/page_user/wifijoint/index.vue index 02d9ec3..b54e5f0 100644 --- a/page_user/wifijoint/index.vue +++ b/page_user/wifijoint/index.vue @@ -140,6 +140,7 @@ icon: 'success', duration: 2000, }) + uni.hideLoading() }else{ uni.showToast({ title: res.msg, @@ -157,19 +158,23 @@ // 开启 btnkq(){ + uni.showLoading({ + title: '设备开启中...' + }) this.$u.put(`/app/device/admin/${this.id}/switch?open=true`).then((res) => { if (res.code == 200) { - setTimeout(()=>{ - this.btnsx() - },1000) + // setTimeout(()=>{ + // this.btnsx() + // },1000) uni.showToast({ - title: res.msg, + title: '开启成功', icon: 'success', duration: 2000 }) + this.powerStatus = '开启' } else { uni.showToast({ - title: res.msg, + title: '开启失败', icon: 'none', duration: 2000 }) @@ -178,19 +183,23 @@ }, // 关闭 btngb(){ + uni.showLoading({ + title: '设备关闭中...' + }) this.$u.put(`/app/device/admin/${this.id}/switch?open=false`).then((res) => { if (res.code == 200) { - setTimeout(()=>{ - this.btnsx() - },1000) + // setTimeout(()=>{ + // this.btnsx() + // },1000) uni.showToast({ - title: res.msg, + title: '关闭成功', icon: 'success', duration: 2000 }) + this.powerStatus = '关闭' } else { uni.showToast({ - title: res.msg, + title: '关闭失败', icon: 'none', duration: 2000 }) @@ -199,17 +208,18 @@ }, // 刷新 btnsx(){ - this.$u.get(`/app/device/${this.id}/refreshIot`).then((res) => { + + this.$u.get(`/app/device/v2/refreshIot?deviceNo=${this.storeId}`).then((res) => { if(res.code == 200){ this.getsn() uni.showToast({ - title: res.msg, + title: '刷新成功', icon: 'success', duration: 2000 }) }else{ uni.showToast({ - title: res.msg, + title: '刷新失败', icon: 'none', duration: 2000 }) diff --git a/page_user/yetx.vue b/page_user/yetx.vue index 208333c..d150290 100644 --- a/page_user/yetx.vue +++ b/page_user/yetx.vue @@ -6,7 +6,7 @@ 账户余额(元) - ¥{{userinfo.balance == undefined ? '' : Number(userinfo.balance) + Number(userinfo.waitBonusAmount)}} {{'待结算(' + userinfo.waitBonusAmount + ')'}} + ¥{{userinfo.balance == undefined ? '' : Number(userinfo.balance) + Number(userinfo.waitBonusAmount)}} {{'待结算(¥' + waitBonusAmount + ')'}} 累计提现:¥{{userinfo.withDrawlAmount == undefined ? '' : userinfo.withDrawlAmount}} @@ -101,7 +101,8 @@ sjmeoey: '', txlist: '', channelId: '', - listflag: true + listflag: true, + waitBonusAmount:0 } }, onShow() { @@ -229,7 +230,7 @@ title: '提现金额不能大于余额', icon: 'none', duration: 2000 - }); + }) } else if (this.currentindex == -1) { uni.showToast({ title: '请选择提现方式', @@ -293,6 +294,7 @@ this.$u.get("/app/user/userInfo").then((res) => { if (res.code == 200) { this.userinfo = res.data + this.waitBonusAmount = this.userinfo.waitBonusAmount this.money = '' } }) @@ -496,4 +498,10 @@ } } - \ No newline at end of file + + + + + + + diff --git a/pages.json b/pages.json index abaf3b9..3342f9a 100644 --- a/pages.json +++ b/pages.json @@ -22,6 +22,37 @@ "navigationBarTextStyle": "#FFFFFF", "navigationStyle": "custom" + } + }, + { + "path": "pages/daili/index", + "style": { + "navigationBarTitleText": "我的", + // "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#3996FD", + "navigationBarTextStyle": "#FFFFFF", + "navigationStyle": "custom" + + } + },{ + "path": "pages/daili/devicexq", + "style": { + "navigationBarTitleText": "我的", + // "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#3996FD", + "navigationBarTextStyle": "#FFFFFF", + "navigationStyle": "custom" + + } + },{ + "path": "pages/daili/dailibing", + "style": { + "navigationBarTitleText": "我的", + // "enablePullDownRefresh": true, + "navigationBarBackgroundColor": "#3996FD", + "navigationBarTextStyle": "#FFFFFF", + "navigationStyle": "custom" + } },{ "path": "pages/tongji", diff --git a/pages/daili/dailibing.vue b/pages/daili/dailibing.vue new file mode 100644 index 0000000..5476c72 --- /dev/null +++ b/pages/daili/dailibing.vue @@ -0,0 +1,815 @@ + + + + + \ No newline at end of file diff --git a/pages/daili/devicexq.vue b/pages/daili/devicexq.vue new file mode 100644 index 0000000..2bcc90b --- /dev/null +++ b/pages/daili/devicexq.vue @@ -0,0 +1,2132 @@ + + + + + \ No newline at end of file diff --git a/pages/daili/index.vue b/pages/daili/index.vue new file mode 100644 index 0000000..1b1d7e8 --- /dev/null +++ b/pages/daili/index.vue @@ -0,0 +1,2345 @@ + + + + + \ No newline at end of file diff --git a/pages/my.vue b/pages/my.vue index 6526f14..1a74b60 100644 --- a/pages/my.vue +++ b/pages/my.vue @@ -17,10 +17,14 @@ - 设备录入 + + + 代理入口 + +