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

View File

@ -36,9 +36,9 @@
暂无可用套餐 暂无可用套餐
</view> </view>
<view class="anniu"> <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 class="xinz" @click="btnqd">
确定 确定
</view> </view>
@ -277,7 +277,7 @@
}, },
btnadd() { btnadd() {
uni.navigateTo({ 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;" <image style="width: 44rpx;height: 44rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uMdtTPOmGVJqcYIQvnUj" mode="aspectFit"> src="https://api.ccttiot.com/smartmeter/img/static/uMdtTPOmGVJqcYIQvnUj" mode="aspectFit">
</image> </image>
<view class="bot">分享</view> <view class="bot">设备二维码</view>
</view> </view>
<image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode="aspectFit"></image> <image class="jt" src="https://api.ccttiot.com/smartmeter/img/static/ukdy921M8MNe9XDid0WI" mode="aspectFit"></image>
</view> </view>