This commit is contained in:
3321822538@qq.com 2024-12-09 16:29:47 +08:00
parent dc56cff238
commit e5a84d1abf
4 changed files with 112 additions and 100 deletions

View File

@ -41,7 +41,6 @@
<view class="bot">临时开关{{tdtxt}}</view>
<view class="cont" @click="btnkq">
<view class="top" style="padding-top: 10rpx;">
<!-- <u-switch v-model="checked" active-color="#8883F0"></u-switch> -->
<view class="rt">
<image v-if="tdtxt == '开启'" style="width: 160rpx;height: 80rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uccaWar4FDp37op7haWM " mode="aspectFit">
@ -515,7 +514,7 @@
//
btnkq() {
if (this.onlineStatus == 0) {
if (this.onlineStatus == 1) {
if (this.tdtxt == '开启') {
this.$u.put(`/app/bill/switchDevice?billId=${this.billId}&open=false`).then((res) => {
if (res.code == 200) {
@ -558,96 +557,109 @@
})
}
} else {
if (this.ver_data == null) {
this.jieshufalg = true
uni.showLoading({
title: '切换中'
})
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
})
let name = ''
let index = this.name.indexOf('-')
if (index !== -1) {
name = this.name.slice(index + 1)
}
if (this.sbobj.powerStatus == 0) {
this.imgflag = false
} else {
this.imgflag = true
}
}, 1000)
} else {
// console.log(this.tdtxt,'020202');
if (this.tdtxt == '开启') {
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
// console.log('close');
that.tdtxt = '关闭'
that.imgflag = false
xBlufi.notifySendCustomData({
customData: 'close'
})
xBlufi.notifySendCustomData({
customData: '11close'
})
}, 1000)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
}
}
})
} else {
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
// console.log('open');
that.tdtxt = '开启'
that.imgflag = true
xBlufi.notifySendCustomData({
customData: 'open'
})
xBlufi.notifySendCustomData({
customData: '11open'
})
}, 1000)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
}
}
})
}
}
let currentTime = new Date();
let endTimeString = this.detaobj.suitEndTime
let endTimeParts = endTimeString.split(/[- :]/)
let endTime = new Date(endTimeParts[0], endTimeParts[1] - 1, endTimeParts[2], endTimeParts[3], endTimeParts[4], endTimeParts[5]);
//
if (currentTime > endTime) {
uni.showToast({
title: '该订单已结束,不能进行操作',
icon: 'none',
duration: 2000
})
} else {
if (this.ver_data == null) {
this.jieshufalg = true
uni.showLoading({
title: '切换中'
})
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
})
let name = ''
let index = this.name.indexOf('-')
if (index !== -1) {
name = this.name.slice(index + 1)
}
if (this.sbobj.powerStatus == 0) {
this.imgflag = false
} else {
this.imgflag = true
}
}, 1000)
} else {
// console.log(this.tdtxt,'020202');
if (this.tdtxt == '开启') {
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
// console.log('close');
that.tdtxt = '关闭'
that.imgflag = false
xBlufi.notifySendCustomData({
customData: 'close'
})
xBlufi.notifySendCustomData({
customData: '11close'
})
}, 1000)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
}
}
})
} else {
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
// console.log('open');
that.tdtxt = '开启'
that.imgflag = true
xBlufi.notifySendCustomData({
customData: 'open'
})
xBlufi.notifySendCustomData({
customData: '11open'
})
}, 1000)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
}
}
})
}
}
}
}
},

View File

@ -7,15 +7,15 @@
<u-search placeholder="搜索" input-align="center" v-model="keyword" @custom="searchs"></u-search>
</view>
</view>
<view class="list" v-for="(item,index) in wateringList" :key="index">
<view class="list" v-for="(item,index) in wateringList" :key="index" @click="btnxq(index)">
<view class="top">
<view class="lt" style="display: flex;align-items: center;">
<image style="margin-right: 10rpx;width: 32rpx;
height: 32rpx;" src="https://api.ccttiot.com/smartmeter/img/static/uspdprPKiYdcIdwhtdPM" mode=""></image>
<view v-if="item.userName" class="" style="font-weight: 500;font-size: 24rpx;color: #3D3D3D;">{{item.userName}}-合伙人</view>
<view v-else class="" style="font-weight: 500;font-size: 24rpx;color: red;" @click="qrFun(item.employId)">点击扫码绑定</view>
<view v-else class="" style="font-weight: 500;font-size: 24rpx;color: red;" @click.stop="qrFun(item.employId)">点击扫码绑定</view>
</view>
<view class="rt" @click="btnxq(index)">
<view class="rt" >
<text style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;display: inline-block;background-color: #575B66;"></text>
<text style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;display: inline-block;background-color: #575B66;"></text>
<text style="width: 9rpx;height: 9rpx;border-radius: 50%;margin-right: 5rpx;display: inline-block;background-color: #575B66;"></text>
@ -240,7 +240,7 @@
width: 750rpx;
height: 100vh;
background: #fff;
opacity: .8;
// opacity: .8;
border-radius: 0rpx 0rpx 0rpx 0rpx;
z-index: 1;
position: fixed;

View File

@ -36,9 +36,9 @@
暂无可用套餐
</view>
<view class="anniu">
<!-- <view class="xinz" @click="btnadd">
<view class="xinz" @click="btnadd" style="width: 240rpx;margin-right: 30rpx;">
新建套餐
</view> -->
</view>
<view class="xinz" @click="btnqd">
确定
</view>
@ -277,7 +277,7 @@
},
btnadd() {
uni.navigateTo({
url: '/page_fenbao/statulist/taocanlist/addtaocan/index?id=' + ''
url: '/page_fenbao/statulist/taocanlist/addtaocan/index'
})
}
}

View File

@ -189,7 +189,7 @@
<image style="width: 44rpx;height: 44rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uMdtTPOmGVJqcYIQvnUj" mode="aspectFit">
</image>
<view class="bot">分享</view>
<view class="bot">设备二维码</view>
</view>
<image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode="aspectFit"></image>
</view>