This commit is contained in:
3321822538@qq.com 2024-06-05 18:07:50 +08:00
parent 800a961d1e
commit fea4d0be97
25 changed files with 460 additions and 243 deletions

View File

@ -364,7 +364,7 @@
}
.date {
font-size: 24rpx;
font-size: 26rpx;
color: #525252;
margin-top: 10rpx;
}

View File

@ -543,7 +543,7 @@
.text {
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
@ -551,7 +551,7 @@
.info_bot {
margin-top: 24rpx;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
@ -563,11 +563,11 @@
display: flex;
align-items: center;
justify-content: center;
border: 2rpx solid #ccc;
border: 2rpx solid #8883F0;
border-radius: 20rpx;
font-weight: 400;
font-size: 28rpx;
color: #ccc;
color: #8883F0;
}
@ -673,7 +673,7 @@
.mac {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #262B37;
line-height: 32rpx;
text-align: left;

View File

@ -92,10 +92,10 @@
}
},
onLoad(e) {
let orderinfo = JSON.parse(e.orderinfo);
this.orderinfo = orderinfo
console.log(this.orderinfo, 'aaa');
this.mac = orderinfo.deviceMac
// let orderinfo = JSON.parse(e.orderinfo);
// this.orderinfo = orderinfo
// console.log(this.orderinfo, 'aaa');
// this.mac = orderinfo.deviceMac
xBlufi.initXBlufi(1);
console.log("xBlufi", xBlufi.XMQTT_SYSTEM);
@ -103,7 +103,7 @@
xBlufi.notifyStartDiscoverBle({
'isStart': true
});
this.dl = ((this.orderinfo.deviceAmount / this.orderinfo.unitPrice)*1000).toFixed(2);
// this.dl = ((this.orderinfo.deviceAmount / this.orderinfo.unitPrice)*1000).toFixed(2);
//
setTimeout(() => {
@ -583,7 +583,7 @@
.text {
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
@ -591,7 +591,7 @@
.info_bot {
margin-top: 24rpx;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
@ -713,7 +713,7 @@
.mac {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #262B37;
line-height: 32rpx;
text-align: left;

View File

@ -457,7 +457,7 @@
.mac {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #262B37;
line-height: 32rpx;
text-align: left;

View File

@ -529,14 +529,14 @@
margin-top: 24rpx;
.text{
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
.info_bot{
margin-top: 24rpx;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
@ -655,7 +655,7 @@
.mac {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #262B37;
line-height: 32rpx;
text-align: left;

View File

@ -408,7 +408,7 @@
.mac {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #262B37;
line-height: 32rpx;
text-align: left;

View File

@ -524,14 +524,14 @@
margin-top: 24rpx;
.text{
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
.info_bot{
margin-top: 24rpx;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #95989D;
}
}
@ -650,7 +650,7 @@
.mac {
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #262B37;
line-height: 32rpx;
text-align: left;

View File

@ -138,6 +138,7 @@
}
page {
// background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
background: #F4F5F7;
}
.page {
@ -171,7 +172,7 @@
color: #3D3D3D;
}
.qian{
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
}
}

View File

@ -164,7 +164,7 @@
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
}
input{
font-size: 24rpx;
font-size: 26rpx;
}
.page {
width: 750rpx;

View File

@ -151,7 +151,7 @@
color: #3D3D3D;
}
.qian{
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
}
}

View File

@ -158,14 +158,14 @@
color: #3D3D3D;
}
.wz{
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
margin-top: 16rpx;
}
}
.rt{
.top{
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
}
.je{

View File

@ -441,7 +441,7 @@
}
.wz {
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
margin-top: 20rpx;
}

View File

@ -26,7 +26,7 @@
</view>
<view class="rishou">
<view class="rishouwz">
<text>日收</text><text>月收</text><text>上月收</text><text>在线</text><text>离线</text>
<text> 日收 </text><text> 月收 </text><text> 上月收</text><text> 在线 </text><text> 离线 </text>
</view>
<view class="rishouje">
<text>{{item.todayIncome}}</text><text>{{item.monthIncome}}</text><text>{{item.lastMonthIncome}}</text><text>{{item.onlineCount}}</text><text>{{item.offlineCount}}</text>
@ -206,14 +206,14 @@
.yunxing {
display: flex;
justify-content: space-between;
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
margin-top: 26rpx;
}
.phones {
margin-top: 16rpx;
font-size: 24rpx;
font-size: 26rpx;
color: #1DBE7B;
border-bottom: 1px solid #ccc;
padding-bottom: 26rpx;
@ -226,7 +226,7 @@
.phone {
margin-top: 16rpx;
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
text {
@ -240,7 +240,7 @@
padding-bottom: 26rpx;
.jfgz {
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
text {
@ -251,7 +251,7 @@
.rishou {
margin-top: 26rpx;
padding: 0 28rpx;
// padding: 0 28rpx;
box-sizing: border-box;
.rishouwz {
@ -259,8 +259,10 @@
justify-content: space-between;
text {
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
width: 230rpx;
text-align: center;
}
}
@ -273,6 +275,8 @@
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
width: 230rpx;
text-align: center;
}
}
}

View File

@ -186,7 +186,7 @@
.sta_txt {
margin-left: 15rpx;
color: #262B37;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
}
@ -194,7 +194,7 @@
.card_left_no {
margin-top: 15rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
color: #95989D;

View File

@ -447,14 +447,14 @@
justify-content: space-between;
.qian {
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
width: 40%;
// margin-right: 20rpx;
}
.shen {
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
}
}

View File

@ -404,7 +404,7 @@
}
.wz {
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
margin-top: 20rpx;
}

View File

@ -431,7 +431,7 @@
.cenb {
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
line-height: 32rpx;
margin-top: 14rpx;
@ -448,7 +448,7 @@
.cenc {
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
line-height: 32rpx;
margin-top: 14rpx;

View File

@ -142,14 +142,14 @@
color: #3D3D3D;
}
.wz{
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
margin-top: 16rpx;
}
}
.rt{
.top{
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
}
.je{

View File

@ -434,7 +434,7 @@
.cenb {
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
line-height: 32rpx;
margin-top: 14rpx;
@ -449,7 +449,7 @@
.cenc {
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
line-height: 32rpx;
margin-top: 14rpx;

View File

@ -21,9 +21,12 @@
<view class="mid_right">
<view class="mid_top">
{{ deviceInfo.deviceName == null ? '' : deviceInfo.deviceName }}
<view class="" style="font-size: 26rpx;">
更新时间{{deviceInfo.lastPullTime}}</view>
</view>
<view class="mid_bot">
<view class="txt" v-if="deviceInfo">S/N码{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}</view>
<view class="txt" v-if="deviceInfo">
S/N码{{ deviceInfo.deviceNo == null ? '' : deviceInfo.deviceNo }}</view>
<div class="tip" v-if="deviceInfo.onlineStatus==1">在线</div>
<div class="tip" v-if="deviceInfo.onlineStatus==0">离线</div>
<div class="tip" v-if="deviceInfo.powerStatus==0">断电</div>
@ -40,7 +43,7 @@
</uni-ec-canvas>
</view>
</view> -->
<view class="bot_right">
<!-- <view class="bot_right">
<view class="cont" style="text-align: center;">
<view class="tit">
{{deviceInfo.orderAmount == null ? 0 : deviceInfo.orderAmount}}
@ -59,32 +62,61 @@
</view>
<view class="cont" style="text-align: center;">
<view class="tit">
{{timeday == null ? 0 : timeday}}
{{timeday}}
sb:{{setMode}}
</view>
<view class="txt">
剩余分钟
</view>
</view>
</view>
</view> -->
</view>
</view>
<view class="card2">
<view class="tit">实时</view>
<view class="cont_box">
<!-- <view class="cont_box">
<view class="cont">
<view class="top">{{deviceInfo.realTimePower == null ? '' : deviceInfo.realTimePower}}KW</view>
<view class="bot">实时功率</view>
</view>
<view class="cont" style="width: 70rpx;">
<view class="top">{{deviceInfo.electricity == null ? '' : deviceInfo.electricity}}A</view>
<view class="cont" >
<view class="top" style="width: 100%">{{deviceInfo.electricity == null ? '' : deviceInfo.electricity}}A</view>
<view class="bot">电流</view>
</view>
<view class="cont" style="width: 110rpx;">
<view class="top">{{deviceInfo.voltage == null ? '' : deviceInfo.voltage}}V</view>
<view class="cont" >
<view class="top" style="width:100%">{{deviceInfo.voltage == null ? '' : deviceInfo.voltage}}V</view>
<view class="bot">电压</view>
</view>
</view> -->
<view class="bot_right">
<view class="cont" style="text-align: center;">
<view class="tit">
{{deviceInfo.orderAmount == null ? 0 : deviceInfo.orderAmount}}
</view>
<view class="txt">
订单金额
</view>
</view>
<view class="cont" style="text-align: center;">
<view class="tit">
{{deviceInfo.orderCount == null ? 0 : deviceInfo.orderCount}}
</view>
<view class="txt">
订单数
</view>
</view>
<view class="cont" style="text-align: center;">
<view class="tit">
{{timeday}}
sb:{{setMode}}
</view>
<view class="txt">
剩余分钟
</view>
</view>
</view>
</view>
<view class="card3">
<view class="tit">其他</view>
@ -122,7 +154,7 @@
<view class="" style="display: flex;margin-top: 20rpx;">
<view class="cont" style="width: 120rpx;" @click="topage(3)">
<view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uW2T5sbuiMPbPaJp9p2U" mode=""
<image src="https://api.ccttiot.com/smartmeter/img/static/uijv1lOhn2ds1ZS4gEMT" mode=""
style="width: 58rpx;height: 60rpx;"></image>
</view>
<view class="bot">收费方式</view>
@ -134,13 +166,20 @@
</view>
<view class="bot">设置</view>
</view>
<view class="cont" style="width: 60rpx;" @click="topage(5)">
<view class="cont" style="width: 60rpx;margin-right: 100rpx;" @click="topage(5)">
<view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/uWaQjL7vph474LWTyGfs" mode="">
</image>
</view>
<view class="bot">配网</view>
</view>
<view class="cont" style="width: 60rpx;" @click="topage(6)">
<view class="top">
<image src="https://api.ccttiot.com/smartmeter/img/static/udZvVKZIh6brG3cm3YpN" mode="">
</image>
</view>
<view class="bot">充值</view>
</view>
</view>
</view>
@ -149,7 +188,18 @@
</view>
</view>
</view>
<view class="tanc" v-if="vipflag">
<view class="tit">请输入您需要充值的时长(分钟)</view>
<input type="text" v-model="cztime" />
<view class="xian"></view>
<view class="anniu">
<text @click="btnqx">取消</text> <text style="border-left: 1px solid #D8D8D8;color: #8883F0;"
@click="trueje">确定</text>
</view>
</view>
<view class="mask" v-if="vipflag"></view>
</view>
</template>
@ -192,16 +242,39 @@
deviceId: '',
storeId: '',
qrResult: '',
devicesList:[]
devicesList: [],
setMode:0,
vipflag:false,
cztime:''
}
},
onLoad(option) {
// setTimeout(() => {
// this.$refs.canvas.init(this.initChart)
// }, 1000)
let id = option.id
this.id = id
this.getDevice(id)
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
//
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
xBlufi.notifyConnectBle({
isStart: true,
deviceId: this.deviceId,
name: this.name
})
xBlufi.notifyInitBleEsp32({
deviceId: this.deviceId
});
}, 2000)
},
onShow() {
setTimeout(() => {
@ -214,68 +287,29 @@
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
wx.closeBLEConnection({
deviceId: this.objlist.deviceId,
})
},
onHide() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
wx.closeBLEConnection({
deviceId: this.objlist.deviceId,
})
},
onBeforeUnmount() {
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
wx.closeBLEConnection({
deviceId: this.objlist.deviceId,
})
},
methods: {
async initChart() {
let value = 100;
let value2 = this.deviceInfo.orderAmount
const option = {
series: [{
type: 'pie', //
radius: ['98%', '70%'], //
silent: true,
clockwise: true,
startAngle: 90, //
z: 0,
zlevel: 0,
data: [{
value: value,
name: '占比', //
itemStyle: {
normal: {
color: '#8883F0', //
},
},
label: {
normal: {
position: 'center',
formatter: ` {a|${value2 == null ? 0 : value2}}\n\n{b|订单金额}`, //
rich: {
a: {
fontSize: 15,
fontWeight: '700',
color: '#333',
},
b: {
fontSize: 11,
color: '#888',
},
},
},
},
}, ],
}, ],
};
// console.log( this.$refs.chartRef,'1111');
const chart = await this.$refs.chart.init(echarts);
// console.log(option,11);
chart.setOption(option)
return chart
},
getQiniuToken() {
this.$u.get("/common/qiniu/uploadInfo").then((res) => {
if (res.code == 200) {
@ -355,12 +389,11 @@
let now = new Date();
let differenceInMs = expireDate - now;
if (differenceInMs <= 0) {
this.timeday = 0
this.timeday = null
} else {
this.timeday = Math.abs(Math.floor(differenceInMs / (1000 * 60)));
}
this.loadings = true
// this.initChart()
}
});
@ -424,18 +457,22 @@
title: res.data,
icon: 'none',
duration: 2000
});
})
this.getDevice(this.id)
} else if (res.msg == '设备剩余时间不足,无需归零') {
uni.showToast({
title: '设备剩余时间不足,无需归零',
icon: 'none',
duration: 2000
});
this.getDevice(this.id)
})
}else if(res.code == 500){
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (num == 2) { //
uni.navigateTo({
url: '/page_fenbao/statulist/fault/yichang/index'
@ -450,48 +487,165 @@
url: '/page_user/setting?id=' + this.id
})
} else if (num == 5) {
console.log(this.deviceInfo);
// uni.navigateTo({
// url: '/page_fenbao/device/lianjie?mac=' + this.deviceInfo.mac + '&storeId=' + this
// .deviceInfo.storeId
// })
uni.showLoading({
title: '加载中...'
});
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': true
});
//
setTimeout(() => {
if(this.deviceId == ''){
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
'isStart': true
})
//
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
});
xBlufi.notifyConnectBle({
isStart: true,
deviceId: this.deviceId,
name: this.name
})
// if(this.devicesList.length == 0){
// uni.hideLoading();
// uni.showToast({
// title: '线',
// icon: 'none',
// duration: 2000
// });
// }
}, 2000)
xBlufi.notifyInitBleEsp32({
deviceId: this.deviceId
})
let name = ''
let index = this.name.indexOf('-');
if (index !== -1) {
name = this.name.slice(index + 1);
}
let data = {
storeId: this.storeId,
mac: this.mac
}
this.$u.put('/app/device/bind', data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '绑定成功',
icon: 'none',
duration: 2000
})
uni.hideLoading();
uni.removeStorageSync('mac');
let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform == 'android') {
// Android
uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' +this.deviceId + '&name=' +this.name
})
} else if (systemInfo.platform == 'ios') {
// iOS
uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name
})
}
} else if (res.msg == '设备编号和mac不能同时为空') {
uni.showToast({
title: '设备不在线,未找到设备',
icon: 'none',
duration: 2000
});
} else {
uni.showToast({
title: '连接失败',
icon: 'none',
duration: 2000
});
// uni.navigateBack()
}
})
}, 1000)
}else{
let name = ''
let index = this.name.indexOf('-');
if (index !== -1) {
name = this.name.slice(index + 1);
}
let data = {
storeId: this.storeId,
mac: this.mac
}
this.$u.put('/app/device/bind', data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '绑定成功',
icon: 'none',
duration: 2000
})
uni.hideLoading();
uni.removeStorageSync('mac');
let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform == 'android') {
// Android
uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' +this.deviceId + '&name=' +this.name
})
} else if (systemInfo.platform == 'ios') {
// iOS
uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name
})
}
} else if (res.msg == '设备编号和mac不能同时为空') {
uni.showToast({
title: '设备不在线,未找到设备',
icon: 'none',
duration: 2000
})
} else {
uni.showToast({
title: '连接失败',
icon: 'none',
duration: 2000
});
// uni.navigateBack()
}
})
}
}else if(num == 6){
this.vipflag = true
}
},
trueje(){
let id = this.deviceInfo.deviceId
this.vipflag = false
this.$u.put('/app/device/addTime/' + id + '?amount=' + this.cztime).then(res => {
if(res.code == 200){
uni.showToast({
title: '充值成功',
icon: 'success',
duration: 2000
})
this.getDevice(this.id)
this.cztime = ''
}else if(res.code == 500){
uni.showToast({
title: res.msg,
icon: 'success',
duration: 2000
})
}
})
},
btnqx(){
this.vipflag = false
this.cztime = ''
},
funListenDeviceMsgEvent: function(options) {
switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
let loadPercent = options.data;
let loadText = '文件读取中'
// console.log("", options.data);
break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
let ver_data = this.parseCustomData(options.data)
this.setMode = Math.floor(ver_data.setMode / 60)
console.log("1收到设备发来的自定义数据结果", ver_data,this.setMode);
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) {
let devicesarr = options.data
@ -502,15 +656,15 @@
this.deviceId = device.deviceId
this.name = device.name
this.mac = device.name.slice(5, 17)
console.log(this.mac, 'macmacmac');
this.devicesList = uniqueDevicesList;
// console.log(this.mac, 'macmacmac');
// this.devicesList = uniqueDevicesList;
}
})
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
console.log("连接回调:" + JSON.stringify(options));
// console.log("" + JSON.stringify(options));
if (options.result) {
uni.hideLoading();
// uni.showToast({
@ -520,70 +674,8 @@
{
console.log("连接回调options.data.deviceId" + options.data.deviceId,
"连接回调options.data.name" + options.data.name);
let name = ''
let index = this.name.indexOf('-');
if (index !== -1) {
name = this.name.slice(index + 1);
}
let data = {
storeId: this.storeId,
mac: this.mac
}
this.$u.put('/app/device/bind', data).then((res) => {
if (res.code == 200) {
uni.showToast({
title: '绑定成功',
icon: 'none',
duration: 2000
});
uni.hideLoading();
uni.removeStorageSync('mac');
let vm = this
uni.showModal({
title: '提示',
content: '你已绑定该设备,需前去配网吗?',
success: function(res) {
if (res.confirm) {
let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'android') {
// Android
uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' +
options
.data.deviceId + '&name=' +
options.data.name
})
} else if (systemInfo.platform === 'ios') {
// iOS
uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +
options
.data.deviceId + '&name=' +
options.data.name
})
}
} else if (res.cancel) {
console.log('用户点击了取消');
}
}
})
} else if (res.msg == '设备编号和mac不能同时为空') {
uni.showToast({
title: '设备不在线,未找到设备',
icon: 'none',
duration: 2000
});
} else {
uni.showToast({
title: '连接失败',
icon: 'none',
duration: 2000
});
// uni.navigateBack()
}
})
}
}else{
} else {
uni.hideLoading()
uni.showToast({
title: '设备离线或不在范围内',
@ -646,33 +738,125 @@
// });
break;
}
},
parseCustomData(data) {
// "@"
const dataArray = data.split('@');
//
const voltage = parseFloat(dataArray[0].substring(1)); // "V"
const switchState = dataArray[1].substring(1); // "S"
const current = parseFloat(dataArray[2].substring(1)); // "A"
const power = parseFloat(dataArray[4].substring(1)); // "P"
const remainingPower = parseFloat(dataArray[5].substring(1)); // "M"
const setMode = dataArray[6].substring(1); // "T"
//
return {
voltage,
switchState,
current,
power,
remainingPower,
setMode
};
},
}
}
</script>
<style lang="scss">
/deep/ .u-title{
/deep/ .u-title {
padding-bottom: 22rpx;
}
/deep/ .u-icon__icon{
/deep/ .u-icon__icon {
padding-bottom: 22rpx;
}
page {
background-color: #F7FAFE;
}
.mask {
width: 750rpx;
height: 100vh;
background: #000000;
border-radius: 0rpx 0rpx 0rpx 0rpx;
opacity: 0.2;
z-index: 1;
position: fixed;
top: 0;
left: 0;
}
.tanc {
width: 610rpx;
height: 282rpx;
background: #FFFFFF;
border-radius: 30rpx 30rpx 30rpx 30rpx;
position: fixed;
top: 628rpx;
left: 50%;
transform: translateX(-50%);
z-index: 2;
.tit {
width: 100%;
text-align: center;
margin-top: 28rpx;
font-weight: 500;
font-size: 32rpx;
color: #3D3D3D;
}
input {
width: 504rpx;
height: 62rpx;
background: #EEEEEE;
border-radius: 6rpx 6rpx 6rpx 6rpx;
margin: auto;
margin-top: 22rpx;
padding-left: 20rpx;
}
.xian {
width: 610rpx;
height: 2rpx;
background: #D8D8D8;
border-radius: 0rpx 0rpx 0rpx 0rpx;
margin-top: 26rpx;
}
.anniu {
display: flex;
justify-content: space-between;
height: 98rpx;
text {
padding: 24rpx;
text-align: center;
box-sizing: border-box;
font-weight: 500;
font-size: 36rpx;
color: #3D3D3D;
display: inline-block;
width: 100%;
height: 100rpx;
}
}
}
.page {
.zhuhu {
margin-top: 20rpx;
margin-top: 60rpx;
padding: 0 40rpx;
.card1 {
padding: 34rpx 0 0 40rpx;
width: 670rpx;
height: 470rpx;
height: 320rpx;
background: #FFFFFF;
box-shadow: 0rpx 14rpx 35rpx 0rpx rgba(53, 140, 255, 0.1);
border-radius: 28rpx 28rpx 28rpx 28rpx;
@ -708,7 +892,7 @@
.mid_left {
image {
width: 170rpx;
width: 160rpx;
height: 160rpx;
border-radius: 20rpx;
}
@ -733,7 +917,7 @@
align-items: center;
.txt {
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #95989D;
@ -752,7 +936,7 @@
opacity: 1;
border: 2rpx solid #8883F0;
border-radius: 40rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #8883F0;
@ -805,7 +989,7 @@
}
.txt {
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #262B37;
@ -814,6 +998,34 @@
}
}
}
.bot_right {
// margin-top: 50rpx;
display: flex;
// flex-wrap: nowrap;
width: 100%;
justify-content: space-between;
padding-left: 80rpx;
padding-right: 120rpx;
box-sizing: border-box;
margin-top: 30rpx;
.cont {
.tit {
font-size: 28rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 600;
color: #262B37;
line-height: 49rpx;
margin-left: 0;
}
.txt {
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #262B37;
}
}
}
.card2 {
padding-top: 40rpx;
@ -858,7 +1070,7 @@
.bot {
margin-top: 20rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #262B37;

View File

@ -151,7 +151,7 @@
margin-left: 50rpx;
.top {
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #262B37;
@ -159,7 +159,7 @@
.bot {
margin-top: 12rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #808080;
@ -180,7 +180,7 @@
.bot {
margin-top: 12rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #808080;

View File

@ -112,7 +112,7 @@
margin-left: 50rpx;
.top {
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #262B37;
@ -120,7 +120,7 @@
.bot {
margin-top: 12rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #808080;
@ -141,7 +141,7 @@
.bot {
margin-top: 12rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #808080;

View File

@ -64,7 +64,7 @@
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.notifyInitBleEsp32({
deviceId: this.objlist.deviceId
});
})
},
onReady() {},

View File

@ -944,7 +944,7 @@
align-items: center;
.txt {
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #95989D;
@ -1002,7 +1002,7 @@
}
.txt {
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #262B37;
@ -1054,7 +1054,7 @@
.bot {
margin-top: 20rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
color: #262B37;
@ -1351,7 +1351,7 @@
.sta_txt {
margin-left: 15rpx;
color: #262B37;
font-size: 24rpx;
font-size: 26rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
}
@ -1359,7 +1359,7 @@
.card_left_no {
margin-top: 15rpx;
font-size: 24rpx;
font-size: 26rpx;
font-family: AlibabaPuHuiTi, AlibabaPuHuiTi;
font-weight: 400;
color: #95989D;

View File

@ -151,7 +151,7 @@
}
},
fail: (error) => {
console.error('获取地图缩放级别失败:', error);
// console.error('', error);
},
});
},
@ -351,7 +351,7 @@
10) {
return -45
} else {
return -item.name.length * 5
return -item.name.length * 6
}
})(),
fontWeight: 700,
@ -613,7 +613,7 @@
box-sizing: border-box;
background: #eee;
border-radius: 10rpx 10rpx 10rpx 10rpx;
font-size: 24rpx;
font-size: 26rpx;
color: #808080;
}
}
@ -663,13 +663,13 @@
justify-content: space-between;
text {
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
}
}
.tx {
font-size: 24rpx;
font-size: 26rpx;
color: #27D089;
}
}
@ -692,7 +692,7 @@
height: 42rpx;
background: linear-gradient(270deg, #54DAA1 0%, #19CD82 100%);
border-radius: 40rpx 40rpx 40rpx 40rpx;
font-size: 24rpx;
font-size: 26rpx;
color: #FFFFFF;
text-align: center;
line-height: 42rpx;
@ -702,7 +702,7 @@
.buc {
margin-top: 20rpx;
font-size: 24rpx;
font-size: 26rpx;
color: #979797;
}
}
@ -802,7 +802,7 @@
text-align: center;
width: 100%;
font-weight: 400;
font-size: 24rpx;
font-size: 26rpx;
color: #3D3D3D;
image {