From a5628ff71d5fcd4f12c441e6ca3194b66b4a4f0e Mon Sep 17 00:00:00 2001
From: "3321822538@qq.com" <3321822538@qq.com>
Date: Mon, 4 Nov 2024 18:03:49 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=96=B0=E5=A2=9E=E4=BB=A3?=
=?UTF-8?q?=E7=90=86=20=E5=BE=85=E6=8E=A5=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/http.interceptor.js | 4 +-
page_components/shebeixz.vue | 6 +-
page_fenbao/device/joinDevice.vue | 69 +-
page_fenbao/zhuce.vue | 119 +-
page_user/sbdetail.vue | 40 +-
page_user/wifijoint/index.vue | 36 +-
page_user/yetx.vue | 16 +-
pages.json | 31 +
pages/daili/dailibing.vue | 815 ++++++++++
pages/daili/devicexq.vue | 2132 ++++++++++++++++++++++++++
pages/daili/index.vue | 2345 +++++++++++++++++++++++++++++
pages/my.vue | 12 +-
12 files changed, 5501 insertions(+), 124 deletions(-)
create mode 100644 pages/daili/dailibing.vue
create mode 100644 pages/daili/devicexq.vue
create mode 100644 pages/daili/index.vue
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 @@
+
+
+
+
+
+
+
+ 设备主图
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 设备名称
+
+
+
+ {{listobj.deviceName}}
+
+
+
+
+
+
+ 备注(代理)
+
+
+
+ {{remake == null ? '' : remake}}
+
+
+
+
+
+
+ 所属商户
+
+
+
+ {{listobj.storeName == null ? '' : listobj.storeName}}
+
+
+
+
+
+
+
+ S/N
+
+
+
+ {{listobj.deviceNo == null ? '' : listobj.deviceNo}}
+
+
+
+
+
+ 类型
+
+
+
+ {{listobj.model == null ? '' : listobj.model}}
+
+
+
+
+
+ WiFi名称
+
+
+
+ {{listobj.wifi == null || listobj.wifi == '创特物联TP' ? '--' : listobj.wifi}}
+
+
+
+
+
+ 解除绑定
+
+
+
+
+
+
+
+
+
+
+
+ 设备分组
+
+
+ 管理
+
+
+
+
+
+ {{item.groupName}}
+
+
+ {{item.deviceCount}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 修改备注
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
+ 修改备注
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
+
+ 修改名称
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
+
+
+
+
+
+
+
+
+
+
+ {{ deviceInfo.deviceName == null ? '' : deviceInfo.deviceName }}
+
+
+
+ 网络: 在线
+
+
+ 网络: 离线
+
+
+ 状态: 空闲
+
+
+ 状态: 使用中
+
+
+
+ SN:{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}
+
+ 更新时间:{{deviceInfo.lastPullTime == null ? '--' : deviceInfo.lastPullTime}}
+
+ 归属商户:111
+
+
+
+
+
+
+ {{deviceInfo.model == undefined ? '' : deviceInfo.model}}
+
+
+
+
+
+
+
+
+
+
+ 实时参数
+
+ 点击刷新
+
+
+
+
+
+
+ {{deviceInfo.voltage == null ? 0 : deviceInfo.voltage}}
+
+
+ 电压(V)
+
+
+
+
+ {{deviceInfo.electricity == null ? 0 : deviceInfo.electricity}}
+
+
+ 电流(A)
+
+
+
+
+ {{deviceInfo.realTimePower == null ? 0 : deviceInfo.realTimePower}}
+
+
+ 功率(W)
+
+
+
+
+
+ 开关状态:{{tdtxt}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 设备剩余
+
+
+
+ {{deviceInfo.surplusEle == null || Number(deviceInfo.surplusEle) < 0 ? '--' : deviceInfo.surplusEle}}
+
+
+ 剩余度数
+
+
+
+
+ {{formattedTime}}
+
+
+ 剩余时长
+
+
+
+
+
+
+
+ 当前订单 查看
+
+ 用户 {{sklist.userName}}
+
+
+ 计价方式 计时收费
+ 按量收费
+ 分时段按量收费
+ 分时段按时收费
+
+
+ 下单时间 {{sklist.suitStartTime}}
+
+
+
+
+
+
+ 其他功能
+
+
+
+
+
+ 充值记录
+
+
+
+
+
+
+
+ 归零
+
+
+
+
+
+
+
+ 充值
+
+
+
+
+
+
+
+
+
+ 配网
+
+
+
+
+
+
+
+ 分享
+
+
+
+
+
+
+
+
+ 设置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 请输入您需要充值的时长或度数
+
+
+
+
+
+ 取消 确定
+
+
+
+
+
+
+ 正在连接该设备蓝牙
+
+
+ 请将手机与设备尽量靠近
+
+
+
+
+
+
+
+
+ 蓝牙连接失败
+
+
+ 请确保手机足够靠近设备
+
+
+ 并且设备处于上电状态
+
+
+
+ 取消
+
+
+ 重新连接
+
+
+
+
+
+
+
+
+
+
+ SN:{{deviceNo}}
+
+
+ 关闭二维码
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
+
+
+
+
+ 代理设备列表
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 管理
+
+
+
+
+
+
+ {{item.name}}
+
+
+ {{item.deviceCount}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item.deviceName}}
+
+
+ 网络:
+ 未配网
+
+ 离线
+ 在线
+
+
+ 状态:
+
+ 维修中
+
+
+ 使用中
+
+
+ 空闲
+
+
+
+ S/N码:{{item.deviceNo}}
+
+
+
+ 未绑定商户
+
+
+ 归属商户:{{item.storeName == null ? '--' : item.storeName}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 正在连接该设备蓝牙
+
+
+ 请将手机与设备尽量靠近
+
+
+
+
+
+
+
+
+ 蓝牙连接失败
+
+
+ 请确保手机足够靠近设备
+
+
+ 并且设备处于上电状态
+
+
+
+ 取消
+
+
+ 重新连接
+
+
+
+
+
+
+
+
+
+
+
\ 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 @@
-
设备录入
+
+
+ 代理入口
+
+