Sprinkler-app/pages/index/index.vue

1658 lines
42 KiB
Vue
Raw Normal View History

2023-11-27 09:57:03 +08:00
<template>
2024-01-27 16:37:52 +08:00
<view class="page">
2024-10-09 16:52:44 +08:00
<u-navbar :is-back="false" :border-bottom="false" :background="bgc" title-color='#2E4975' title-size='36'
height='8'></u-navbar>
<view class="title">
<image src="https://api.ccttiot.com/smartmeter/img/static/uhRjXxrVaNwOCld2fYUl" mode=""></image>
</view>
<!-- 背景图 -->
<!-- 没设备时展示 -->
2024-11-02 17:59:26 +08:00
<image class="bjimg" v-if="bjflag" src="https://api.ccttiot.com/smartmeter/img/static/uz8MR6BuZW2qRANnYgLu"
2024-10-09 16:52:44 +08:00
mode=""></image>
<!-- 有设备时展示 -->
<image class="bjimg" v-else src="https://api.ccttiot.com/smartmeter/img/static/uXBpJuaUs0XUNb8HTahh" mode="">
</image>
2024-11-02 17:59:26 +08:00
<view class="wusb" v-if="bjflag">
2024-10-09 16:52:44 +08:00
<text>暂无设备请先绑定设备</text>
2024-11-02 17:59:26 +08:00
<view class="bang" @click="btnaddsb">
2024-10-09 16:52:44 +08:00
绑定
</view>
2024-11-07 17:44:29 +08:00
<view class="selectnames" @click="btnluru" v-if="userobj.userType == 00">
录入设备
</view>
2024-10-09 16:52:44 +08:00
</view>
<view class="" v-else>
<!-- 选择设备 -->
<view class="selectbox">
<view class="selectname" @click="btnksxz">
2024-10-31 17:57:18 +08:00
切换设备 <image src="https://api.ccttiot.com/smartmeter/img/static/uwHOBxvbJjkhx1uDiQHI" mode="">
2024-10-09 16:52:44 +08:00
</image>
</view>
2024-11-06 16:55:34 +08:00
<view class="selectshezhi" style="display: flex;">
<view class="selectnames" @click="btnluru" v-if="userobj.userType == 00">
录入设备
</view>
<image @click="btnsz" src="https://api.ccttiot.com/smartmeter/img/static/uvCJ8ro0MpfGZd53vypJ" mode=""></image>
2024-10-09 16:52:44 +08:00
</view>
</view>
<view class="selectbox">
2024-10-23 18:04:30 +08:00
<view class="shebeiname" @click="btnlj">
2024-10-31 17:57:18 +08:00
{{user.deviceName == undefined ? '--' : user.deviceName}} <text style="background-color: red;box-shadow: 0rpx 0rpx 10rpx 0rpx red, 0rpx 0rpx 30rpx 0rpx red" v-if="datalist == ''"></text> <text v-else></text>
2024-01-27 16:37:52 +08:00
</view>
2024-10-16 18:03:08 +08:00
<view class="shebeiadd" @click="btnaddsb">
2024-10-09 16:52:44 +08:00
<image src="https://api.ccttiot.com/smartmeter/img/static/udlX67UXzuRUZCuEtWDH" mode=""></image>
</view>
</view>
<!-- 设备信息 -->
<view class="devicebox">
<view class="devicetop">
<view class="devicelt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uVKucPVDjxjaCDCpFKvw" mode=""></image>
<view class="xinghao">
2024-10-31 17:57:18 +08:00
<view class="one">型号{{user.model == undefined ? '--' : user.model}}</view>
<view class="">MAC{{user.mac == undefined ? '--' : user.mac}}</view>
2024-10-09 16:52:44 +08:00
</view>
2024-01-27 16:37:52 +08:00
</view>
2024-10-09 16:52:44 +08:00
<view class="devicert">
<view class="shoudong">
<image @click="btnkq" v-if="kgflag"
src="https://api.ccttiot.com/smartmeter/img/static/uIiHf1LAHhLyVZODV9Pc" mode="">
</image>
<image @click="btngb" v-else
src="https://api.ccttiot.com/smartmeter/img/static/upKZD5SgfKHZDCxcPSCl" mode="">
</image> 手动浇水
2024-01-27 16:37:52 +08:00
</view>
2024-10-09 16:52:44 +08:00
<view class="shengyu">
2024-10-24 18:00:12 +08:00
剩余{{ sdminutes ? sdminutes + ':' : '' }}{{ sdseconds ? sdseconds : '--' }}
2024-01-27 16:37:52 +08:00
</view>
</view>
</view>
2024-10-09 16:52:44 +08:00
<view class="deviceweek">
2024-10-23 18:04:30 +08:00
<view class="weeklist">
2024-10-24 18:00:12 +08:00
<view class="kg" v-if="ver_data.p_set0[3] == 0">
2024-10-09 16:52:44 +08:00
OFF
2024-01-27 16:37:52 +08:00
</view>
2024-10-23 18:04:30 +08:00
<view class="kg" style="color: #48893B;" v-else>
NO
</view>
<view class="weekday">
P1
</view>
<view class="img">
2024-10-31 17:57:18 +08:00
<image
v-if="formattedTime(ver_data.p_set0[0],ver_data.p_set0[1])== xctimesj || formattedTime(ver_data.p_set0[0],Number(ver_data.p_set0[1]) + 1) == xctimesj"
src="https://api.ccttiot.com/smartmeter/img/static/u9iZpd6bW6bUsUay4uvH" mode="">
2024-10-23 18:04:30 +08:00
</image>
</view>
</view>
<view class="weeklist">
2024-10-24 18:00:12 +08:00
<view class="kg" v-if="ver_data.p_set1[3] == 0">
2024-10-23 18:04:30 +08:00
OFF
</view>
<view class="kg" style="color: #48893B;" v-else>
NO
</view>
<view class="weekday">
P2
</view>
<view class="img">
2024-10-31 17:57:18 +08:00
<image
v-if="formattedTime(ver_data.p_set1[0],ver_data.p_set1[1]) == xctimesj || formattedTime(ver_data.p_set1[0],Number(ver_data.p_set1[1]) + 1) == xctimesj"
src="https://api.ccttiot.com/smartmeter/img/static/u9iZpd6bW6bUsUay4uvH" mode="">
2024-10-23 18:04:30 +08:00
</image>
</view>
</view>
<view class="weeklist">
2024-10-24 18:00:12 +08:00
<view class="kg" v-if="ver_data.p_set2[3] == 0">
2024-10-23 18:04:30 +08:00
OFF
</view>
<view class="kg" style="color: #48893B;" v-else>
NO
</view>
<view class="weekday">
P3
</view>
<view class="img">
2024-10-31 17:57:18 +08:00
<image
v-if="formattedTime(ver_data.p_set2[0],ver_data.p_set2[1]) == xctimesj || formattedTime(ver_data.p_set2[0],Number(ver_data.p_set2[1]) + 1) == xctimesj"
src="https://api.ccttiot.com/smartmeter/img/static/u9iZpd6bW6bUsUay4uvH" mode="">
2024-10-23 18:04:30 +08:00
</image>
</view>
</view>
<view class="weeklist">
2024-10-24 18:00:12 +08:00
<view class="kg" v-if="ver_data.p_set3[3] == 0">
2024-10-23 18:04:30 +08:00
OFF
</view>
<view class="kg" style="color: #48893B;" v-else>
NO
</view>
<view class="weekday">
P4
</view>
<view class="img">
2024-10-31 17:57:18 +08:00
<image
v-if="formattedTime(ver_data.p_set3[0],ver_data.p_set3[1]) == xctimesj || formattedTime(ver_data.p_set3[0],Number(ver_data.p_set3[1]) + 1) == xctimesj"
src="https://api.ccttiot.com/smartmeter/img/static/u9iZpd6bW6bUsUay4uvH" mode="">
2024-10-23 18:04:30 +08:00
</image>
</view>
</view>
<view class="weeklist">
2024-10-24 18:00:12 +08:00
<view class="kg" v-if="ver_data.p_set4[3] == 0">
2024-10-23 18:04:30 +08:00
OFF
</view>
<view class="kg" style="color: #48893B;" v-else>
NO
</view>
<view class="weekday">
P5
</view>
<view class="img">
2024-10-31 17:57:18 +08:00
<image
v-if="formattedTime(ver_data.p_set4[0],ver_data.p_set4[1]) == xctimesj || formattedTime(ver_data.p_set4[0],Number(ver_data.p_set4[1]) + 1) == xctimesj"
src="https://api.ccttiot.com/smartmeter/img/static/u9iZpd6bW6bUsUay4uvH" mode="">
2024-10-23 18:04:30 +08:00
</image>
</view>
</view>
<view class="weeklist">
2024-10-24 18:00:12 +08:00
<view class="kg" v-if="ver_data.p_set5[3] == 0">
2024-10-23 18:04:30 +08:00
OFF
</view>
<view class="kg" style="color: #48893B;" v-else>
NO
</view>
2024-10-09 16:52:44 +08:00
<view class="weekday">
2024-10-23 18:04:30 +08:00
P6
2024-01-27 16:37:52 +08:00
</view>
2024-10-09 16:52:44 +08:00
<view class="img">
2024-10-31 17:57:18 +08:00
<image
v-if="formattedTime(ver_data.p_set5[0],ver_data.p_set5[1]) == xctimesj || formattedTime(ver_data.p_set5[0],Number(ver_data.p_set5[1]) + 1) == xctimesj"
src="https://api.ccttiot.com/smartmeter/img/static/u9iZpd6bW6bUsUay4uvH" mode="">
2024-10-09 16:52:44 +08:00
</image>
2024-01-27 16:37:52 +08:00
</view>
</view>
</view>
</view>
2024-10-23 18:04:30 +08:00
<!-- <button @click="kq">开启</button><button @click="gb">关闭</button><button @click="hq">获取</button> -->
2024-10-09 16:52:44 +08:00
<!-- 开关选择 -->
<view class="switchbox">
<view class="switch_he">
<image src="https://api.ccttiot.com/smartmeter/img/static/u7NwkNOoQYYsvHVMkDlu" mode=""></image>
<view class="yushui">
2024-10-31 17:57:18 +08:00
雨水感应
<u-switch v-if="yschecked" v-model="one" @change="btnyushui" inactive-color="#eee"
active-color="#eee" size="40"></u-switch>
<u-switch v-else v-model="ones" @change="btnyushuis" active-color="#7FAD76"
inactive-color="#7FAD76" size="40"></u-switch>
2024-01-27 16:37:52 +08:00
</view>
2024-10-09 16:52:44 +08:00
</view>
<view class="switch_he">
<image src="https://api.ccttiot.com/smartmeter/img/static/u7kd92ocUgDN052nhp4R" mode=""></image>
<view class="yushui">
2024-10-31 17:57:18 +08:00
儿童锁 <u-switch v-if="etchecked" v-model="two" @change="btnertong" inactive-color="#eee"
active-color="#eee" size="40"></u-switch>
<u-switch v-else v-model="twos" @change="btnertongs" active-color="#7FAD76"
inactive-color="#7FAD76" size="40"></u-switch>
2024-01-27 16:37:52 +08:00
</view>
</view>
</view>
2024-10-09 16:52:44 +08:00
<!-- 定时 -->
<view class="dingshi_he" @click="btntime">
<view class="naoz">
<image src="https://api.ccttiot.com/smartmeter/img/static/uJPgzMejk9gaogWnCO9M" mode=""></image> 6
</view>
<view class="dstime">
定时管理 <image src="https://api.ccttiot.com/smartmeter/img/static/uagx3wGa7RYvqKqoSymy" mode="">
</image>
</view>
</view>
<!-- 浇水日志 -->
<view class="wateringlogbox" @click="btnjs">
<view class="wateringlogtop">
<image src="https://api.ccttiot.com/smartmeter/img/static/uGh3pRM7mMRSHdmvtzv3" mode=""></image>
浇水日志
</view>
<view class="wateringlogbd">
<view class="lt">
2024-10-23 18:04:30 +08:00
<view class="">距离下次{{xctime}}</view>
<view class="">下次浇水时长{{xctimesc}}</view>
<view class="">上次浇水{{sctimejs}}</view>
2024-01-27 16:37:52 +08:00
</view>
2024-10-09 16:52:44 +08:00
<view class="rt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uagx3wGa7RYvqKqoSymy" mode=""></image>
2024-03-25 19:46:07 +08:00
</view>
2024-01-27 16:37:52 +08:00
</view>
</view>
</view>
2024-10-31 17:57:18 +08:00
2024-10-09 16:52:44 +08:00
<!-- 切换设备 -->
<view class="tabsb" v-if="xuanzeflag">
<view class="sblist">
2024-10-31 17:57:18 +08:00
<view class="sbist_val" v-for="(item,index) in devicelist" :key="index"
:id="activeshu == index ? 'activebor' : ''" @click="btnactive(item.deviceId,index)">
2024-10-09 16:52:44 +08:00
<view class="lt">
2024-10-31 17:57:18 +08:00
<view class="">{{item.deviceName}}</view>
<view class="" style="margin-top: 14rpx;">型号:{{item.model}}</view>
2024-10-09 16:52:44 +08:00
</view>
<view class="rt">
<image src="https://api.ccttiot.com/smartmeter/img/static/uVKucPVDjxjaCDCpFKvw" mode=""></image>
</view>
2024-03-13 10:54:22 +08:00
</view>
</view>
2024-10-09 16:52:44 +08:00
<view class="qdan" @click="btnxuanze">
确定
2024-03-13 10:54:22 +08:00
</view>
2024-01-27 16:37:52 +08:00
</view>
2024-10-09 16:52:44 +08:00
<!-- 手动浇水 -->
<view class="manualjs" v-if="sdjsflag">
<view class="toptit">
2024-10-31 17:57:18 +08:00
选择浇水时长
2024-03-13 10:54:22 +08:00
</view>
2024-10-24 18:00:12 +08:00
<view class="container" @click="btnshowjs">
2024-10-31 17:57:18 +08:00
<view class="">{{minute}}</view>
2024-10-16 18:03:08 +08:00
<text>:</text>
2024-10-31 17:57:18 +08:00
<view class="">{{second}}</view>
2024-03-13 10:54:22 +08:00
</view>
2024-10-09 16:52:44 +08:00
<view class="anniu">
<view class="qx" @click="btnqx">
取消
</view>
<view class="qd" @click="btnqd">
确定
</view>
2024-03-13 10:54:22 +08:00
</view>
</view>
2024-10-09 16:52:44 +08:00
<view class="manualmask" v-if="sdjsflag"></view>
2024-10-31 17:57:18 +08:00
<!-- 选择浇水时间-->
2024-10-23 18:04:30 +08:00
<u-picker v-model="showjs" mode="time" :params="params" @confirm="confirm"></u-picker>
2024-03-25 19:46:07 +08:00
2024-01-23 19:15:52 +08:00
<tab-bar :indexs='0'></tab-bar>
2024-03-25 19:46:07 +08:00
2023-11-27 09:57:03 +08:00
</view>
</template>
<script>
2024-10-31 17:57:18 +08:00
var xBlufi = require("@/components/blufi/xBlufi.js")
export default {
2023-11-27 09:57:03 +08:00
data() {
return {
2024-10-31 17:57:18 +08:00
one: false,
ones: true,
two: false,
twos: true,
2024-10-24 18:00:12 +08:00
yschecked: true,
2024-10-31 17:57:18 +08:00
etchecked: true,
2024-10-09 16:52:44 +08:00
kgflag: false,
activeshu: 0,
xuanzeflag: false,
selectedMinute: '1',
selectedSecond: '1',
2024-10-31 17:57:18 +08:00
sdjsflag: false,
2024-10-23 18:04:30 +08:00
showjs: false,
2024-10-16 18:03:08 +08:00
params: {
year: false,
month: false,
day: false,
hour: false,
minute: true,
second: true
},
2024-10-31 17:57:18 +08:00
minute: '--',
second: '--',
devicesList: [],
deviceId: '',
name: '',
mac: '',
jstime: '',
ver_data: {},
showobj: {},
xctime: '--',
sctimejs: '--',
xctimesc: '--',
xctimesj: '',
sdminutes: '',
sdseconds: '',
datalist: '',
devicelist:[],
shebid:'',
user:{},
2024-11-02 17:59:26 +08:00
lastChar:'',
timer:'',
2024-11-06 16:55:34 +08:00
bjflag:false,
userobj:{}
2024-03-13 10:54:22 +08:00
}
},
2024-10-18 17:59:38 +08:00
// 分享到好友(会话)
onShareAppMessage: function() {
return {
title: '绿小能',
path: '/pages/index/index'
}
},
2024-10-31 17:57:18 +08:00
2024-10-18 17:59:38 +08:00
// 分享到朋友圈
onShareTimeline: function() {
return {
title: '绿小能',
query: '',
path: '/pages/index/index'
}
},
2024-03-13 10:54:22 +08:00
onLoad() {
2024-10-31 17:57:18 +08:00
2024-10-18 17:59:38 +08:00
},
onShow() {
2024-11-02 17:59:26 +08:00
// 请求个人信息
2024-10-23 18:04:30 +08:00
this.getinfo()
2024-11-02 17:59:26 +08:00
// 一进来每分钟发一次上传信息命令
2024-10-24 18:00:12 +08:00
this.getshuju()
2024-10-16 18:03:08 +08:00
2023-11-27 09:57:03 +08:00
},
methods: {
2024-11-06 16:55:34 +08:00
// 点击进行设备录入
btnluru(){
this.datalist = ''
this.mac = ''
this.ver_data = {}
uni.navigateTo({
url:'/pages/myorder/index'
})
},
2024-10-24 18:00:12 +08:00
// 点击选择时间
2024-10-31 17:57:18 +08:00
btnshowjs() {
2024-10-24 18:00:12 +08:00
this.showjs = true
},
2024-11-02 17:59:26 +08:00
// 补零函数
2024-10-23 18:04:30 +08:00
formattedTime(minutes, seconds) {
2024-10-31 17:57:18 +08:00
// 将数字转换为字符串并补零
const formattedMinutes = String(minutes).padStart(2, '0');
const formattedSeconds = String(seconds).padStart(2, '0');
// 返回格式化后的时间字符串
return `${formattedMinutes}:${formattedSeconds}`;
2024-10-23 18:04:30 +08:00
},
// 点击连接
2024-10-31 17:57:18 +08:00
btnlj() {
2024-10-23 18:04:30 +08:00
let that = this
xBlufi.initXBlufi(1)
xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
2024-10-31 17:57:18 +08:00
this.getchao()
2024-10-23 18:04:30 +08:00
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
if (that.devicesList.length > 0) {
xBlufi.notifyConnectBle({
isStart: true,
deviceId: that.deviceId,
name: that.name
})
}
2024-11-08 18:02:11 +08:00
}, 10000)
2024-10-23 18:04:30 +08:00
},
2024-10-31 17:57:18 +08:00
// 连接超时提示
getchao(){
uni.showLoading({
title: '浇花器连接中...'
})
this.getshebxq()
setTimeout(()=>{
uni.hideLoading()
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '未连接成功是否重新连接重新连接请确保设备在附近5米范围内',
success: function (res) {
if (res.confirm) {
2024-11-02 17:59:26 +08:00
uni.hideLoading()
2024-10-31 17:57:18 +08:00
that.getinfo()
2024-11-02 17:59:26 +08:00
} else if (res.cancel) {
uni.hideLoading()
2024-10-31 17:57:18 +08:00
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}else{
uni.showToast({
title: '设备连接成功',
icon: 'success',
duration:2000
})
}
},15000)
},
// 静默登录
jmlogin() {
let taht = this
wx.login({
success(res) {
if (res.code) {
let data = {
jsCode: res.code,
}
taht.$u.post(`/loginByopenid?jsCode=${res.code}`, data).then(res => {
if (res.code == 200) {
taht.getinfo()
uni.setStorageSync('token', res.token)
}else{
uni.showModal({
title: '提示',
content: '您还未登录,是否前去登录?',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url:'/pages/login/login'
})
} else if (res.cancel) {
}
}
})
}
})
}
},
})
},
2024-10-23 18:04:30 +08:00
// 获取用户信息
getinfo() {
this.$u.get(`/appVerify/profile`).then((res) => {
if (res.code == 200) {
this.userobj = res.data
// 根据用户id获取当前用户
2024-10-31 17:57:18 +08:00
this.getlist()
}else if(res.code == 401){
this.jmlogin()
2024-10-23 18:04:30 +08:00
}
})
},
2024-10-24 18:00:12 +08:00
// 雨水感应开启
2024-10-31 17:57:18 +08:00
btnyushui() {
2024-11-07 17:44:29 +08:00
this.one = false
this.ones = true
2024-11-02 17:59:26 +08:00
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}else{
uni.showLoading({
title: '开启中...'
})
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
that.yschecked = false
xBlufi.notifySendCustomData({
customData: '11yudi'
})
uni.hideLoading()
}, 1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
} else {
console.log('手机未连接网络')
}
2024-10-18 17:59:38 +08:00
}
2024-11-02 17:59:26 +08:00
})
}
2024-10-22 18:01:20 +08:00
},
2024-10-24 18:00:12 +08:00
// 雨水感应关闭
2024-10-31 17:57:18 +08:00
btnyushuis() {
2024-11-07 17:44:29 +08:00
this.one = false
this.ones = true
2024-11-02 17:59:26 +08:00
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}else{
uni.showLoading({
2024-11-07 17:44:29 +08:00
title: '关闭中...'
2024-11-02 17:59:26 +08:00
})
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
that.yschecked = true
xBlufi.notifySendCustomData({
customData: '11unyudi'
})
uni.hideLoading()
}, 1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
} else {
console.log('手机未连接网络')
}
2024-10-22 18:01:20 +08:00
}
2024-11-02 17:59:26 +08:00
})
}
2024-10-22 18:01:20 +08:00
},
2024-10-24 18:00:12 +08:00
// 点击儿童锁开启
2024-10-31 17:57:18 +08:00
btnertong() {
2024-11-07 17:44:29 +08:00
this.two = false
this.twos = true
2024-11-02 17:59:26 +08:00
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}else{
uni.showLoading({
title: '开启中...'
})
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
that.etchecked = false
xBlufi.notifySendCustomData({
customData: '11lock'
})
uni.hideLoading()
}, 1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
} else {
console.log('手机未连接网络')
}
2024-10-18 17:59:38 +08:00
}
2024-11-02 17:59:26 +08:00
})
}
2024-10-31 17:57:18 +08:00
},
2024-10-24 18:00:12 +08:00
// 点击儿童锁关闭
2024-10-31 17:57:18 +08:00
btnertongs() {
2024-11-07 17:44:29 +08:00
this.two = false
this.twos = true
2024-11-02 17:59:26 +08:00
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}else{
uni.showLoading({
2024-11-07 17:44:29 +08:00
title: '关闭中...'
2024-11-02 17:59:26 +08:00
})
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
that.etchecked = true
xBlufi.notifySendCustomData({
customData: '11unlock'
})
uni.hideLoading()
}, 1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
} else {
console.log('手机未连接网络')
}
2024-10-22 18:01:20 +08:00
}
2024-11-02 17:59:26 +08:00
})
}
2024-10-31 17:57:18 +08:00
},
// 点击添加设备
btnaddsb() {
//跳转后清空数据 重新进行连接
this.datalist = ''
this.mac = ''
this.ver_data = {}
2024-10-16 18:03:08 +08:00
uni.navigateTo({
2024-10-31 17:57:18 +08:00
url: '/page_user/lanya'
2024-10-16 18:03:08 +08:00
})
},
2024-10-31 17:57:18 +08:00
2024-10-16 18:03:08 +08:00
// 点击选择浇水时间
2024-10-31 17:57:18 +08:00
confirm(e) {
2024-10-16 18:03:08 +08:00
this.minute = e.minute
2024-10-31 17:57:18 +08:00
this.second = e.second
2024-10-17 18:00:05 +08:00
this.jstime = Number(e.second) + Number(e.minute * 60)
2024-10-16 18:03:08 +08:00
},
2024-10-31 17:57:18 +08:00
2024-10-09 16:52:44 +08:00
// 点击跳转到定时页面
2024-10-31 17:57:18 +08:00
btntime() {
2024-03-25 19:46:07 +08:00
uni.navigateTo({
2024-10-31 17:57:18 +08:00
url: '/page_user/dingshi?list=' + JSON.stringify(this.ver_data)
2024-03-25 19:46:07 +08:00
})
},
2024-11-02 17:59:26 +08:00
2024-10-31 17:57:18 +08:00
2024-10-09 16:52:44 +08:00
// 点击取消手动浇水
2024-10-31 17:57:18 +08:00
btnqx() {
2024-10-09 16:52:44 +08:00
this.sdjsflag = false
2024-01-27 16:37:52 +08:00
},
2024-10-24 18:00:12 +08:00
// 确定选择时间
2024-10-31 17:57:18 +08:00
btnqd() {
if (this.minute == '--' || this.second == '--') {
2024-10-17 18:00:05 +08:00
uni.showToast({
title: '请选择浇水时长',
icon: 'none',
duration: 3000
})
2024-10-31 17:57:18 +08:00
} else {
2024-11-02 17:59:26 +08:00
uni.showLoading({
title: '开启中...'
})
2024-10-17 18:00:05 +08:00
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
2024-10-31 17:57:18 +08:00
success(res) {
setTimeout(() => {
2024-10-17 18:00:05 +08:00
xBlufi.notifySendCustomData({
2024-10-23 18:04:30 +08:00
customData: "11time@" + that.jstime + '@'
2024-10-17 18:00:05 +08:00
})
2024-11-02 17:59:26 +08:00
uni.hideLoading()
2024-10-24 18:00:12 +08:00
that.startTimer(that.jstime)
2024-10-18 17:59:38 +08:00
that.sdjsflag = false
that.kgflag = true
2024-10-31 17:57:18 +08:00
}, 1500)
2024-10-17 18:00:05 +08:00
},
fail(err) {
2024-10-31 17:57:18 +08:00
console.error('获取已连接蓝牙设备信息失败:', err)
2024-10-17 18:00:05 +08:00
}
2024-10-31 17:57:18 +08:00
})
2024-10-17 18:00:05 +08:00
} else {
console.log('手机未连接网络')
}
}
})
}
2024-03-13 10:54:22 +08:00
},
2024-10-31 17:57:18 +08:00
2024-10-24 18:00:12 +08:00
// 手动浇水定时器
2024-11-02 17:59:26 +08:00
startTimer(totalSeconds) {
let remainingSeconds = totalSeconds; // 正确初始化 remainingSeconds
const sdminutes = ''; // 如果您打算在组件中使用这些变量,最好在这里声明它们
const sdseconds = '';
this.timer = setInterval(() => {
// 计算分钟和秒
const minutes = Math.floor(remainingSeconds / 60).toString();
const secs = (remainingSeconds % 60).toString();
// 格式化秒和分钟,确保是两位数
this.sdseconds = secs.padStart(2, '0');
this.sdminutes = (minutes > 0 ? minutes : '').padStart(2, '0'); // 如果分钟为0则不显示分钟
// 更新剩余秒数
remainingSeconds--;
// 如果剩余秒数为0则停止定时器
if (remainingSeconds <= 0) {
clearInterval(this.timer);
this.btnkq(); // 确保这个函数是存在的,并且您想要在这里调用它
this.sdminutes = ''; // 清除分钟显示(可选,根据您的需求)
this.sdseconds = ''; // 清除秒显示(可选,根据您的需求)
}
}, 1000);
2024-10-31 17:57:18 +08:00
},
2024-11-02 17:59:26 +08:00
2024-10-24 18:00:12 +08:00
// 关闭手动浇水
2024-10-09 16:52:44 +08:00
btnkq() {
2024-11-02 17:59:26 +08:00
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}else{
uni.showLoading({
title: '关闭中...'
})
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
xBlufi.notifySendCustomData({
customData: "11close"
})
// that.startTimer(0)
clearInterval(that.timer)
that.sdminutes = ''
that.sdseconds = ''
that.kgflag = false
uni.hideLoading()
}, 1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
}
2024-10-18 17:59:38 +08:00
}
2024-11-02 17:59:26 +08:00
})
}
2024-03-13 10:54:22 +08:00
},
2024-10-31 17:57:18 +08:00
// 开启手动浇水
2024-10-09 16:52:44 +08:00
btngb() {
2024-11-02 17:59:26 +08:00
if(this.datalist == ''){
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
}else{
this.sdjsflag = true
}
2024-03-25 19:46:07 +08:00
},
2024-10-09 16:52:44 +08:00
// 跳转到设置
btnsz() {
2024-03-25 19:46:07 +08:00
uni.navigateTo({
2024-10-31 17:57:18 +08:00
url: '/page_user/upload?deviceid=' + this.shebid
2024-03-25 19:46:07 +08:00
})
},
2024-10-09 16:52:44 +08:00
// 选择设备
2024-10-31 17:57:18 +08:00
btnactive(deviceId,index) {
this.shebid = deviceId
2024-10-09 16:52:44 +08:00
this.activeshu = index
2024-03-13 10:54:22 +08:00
},
2024-10-31 17:57:18 +08:00
// 选择确定设备 shebid
2024-10-09 16:52:44 +08:00
btnxuanze() {
2024-10-31 17:57:18 +08:00
this.$u.put(`/app/toggleDevice?userId=${this.userobj.userId}&deviceId=${this.shebid}`).then(res => {
if(res.code == 200){
wx.closeBLEConnection({
deviceId: this.mac,
})
uni.showToast({
title: res.msg,
icon: 'success',
duration: 2000
})
this.datalist = ''
this.mac = ''
this.ver_data = {}
2024-11-02 17:59:26 +08:00
this.name = ''
this.deviceId = ''
2024-10-31 17:57:18 +08:00
this.xuanzeflag = false
let that = this
xBlufi.initXBlufi(1)
xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent)
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
if (that.devicesList.length > 0) {
xBlufi.notifyConnectBle({
isStart: true,
deviceId: that.deviceId,
name: that.name
})
}
2024-11-08 18:02:11 +08:00
}, 10000)
2024-10-31 17:57:18 +08:00
that.getchao()
}else{
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
},
// 获取设备信息
getshebxq(){
this.$u.get(`/app/getDeviceInfo/${this.shebid}`).then(res => {
if(res.code == 200){
this.mac = res.data.mac
this.user = res.data
uni.showLoading({
title: '浇花器连接中...'
})
}
})
},
// 获取设备列表
getlist(){
this.$u.get(`/app/getDeviceInfoByUser?userId=${this.userobj.userId}`).then((res) => {
if (res.code == 200) {
2024-11-02 17:59:26 +08:00
if(res.data.length > 0 || res.data != ''){
this.bjflag = false
this.devicelist = res.data
this.mac = res.data[0].mac
this.user = res.data[0]
this.shebid = res.data[0].deviceId
if(this.datalist == ''){
let that = this
uni.showModal({
title: '提示',
content: '设备未连接,是否进行设备连接?',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
2024-10-31 17:57:18 +08:00
})
2024-11-02 17:59:26 +08:00
}
}else{
this.bjflag = true
2024-10-31 17:57:18 +08:00
}
}
})
2024-03-13 10:54:22 +08:00
},
2024-11-02 17:59:26 +08:00
// 点击切换设备
2024-10-09 16:52:44 +08:00
btnksxz() {
if (this.xuanzeflag == true) {
this.xuanzeflag = false
} else {
this.xuanzeflag = true
}
2024-03-13 10:54:22 +08:00
},
2024-10-09 16:52:44 +08:00
//跳转到浇水日志页
btnjs() {
2024-03-13 10:54:22 +08:00
uni.navigateTo({
2024-10-09 16:52:44 +08:00
url: '/page_user/jiaoshui'
2024-03-13 10:54:22 +08:00
})
2024-10-17 18:00:05 +08:00
},
2024-10-31 17:57:18 +08:00
2024-10-17 18:00:05 +08:00
// 获取附近蓝牙设备列表
funListenDeviceMsgEvent: function(options) {
switch (options.type) {
case xBlufi.XBLUFI_TYPE.TYPE_STATUS_CONNECTED:
if (!options.result) {
2024-11-07 17:44:29 +08:00
this.datalist = ''
this.ver_data = ''
// uni.showModal({
// title: '很抱歉提醒你!',
// content: '小程序与设备异常断开',
// showCancel: false,
// //是否显示取消按钮
// success: function(res) {
// uni.hideLoading()
// this.datalist = ''
// this.ver_data = ''
// }
// })
2024-10-17 18:00:05 +08:00
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS:
if (options.result) {
let devicesarr = options.data
2024-10-24 18:00:12 +08:00
// console.log(devicesarr,'111')
2024-10-17 18:00:05 +08:00
devicesarr.forEach(device => {
2024-10-22 18:01:20 +08:00
const mac = device.name.substring(4)
2024-10-17 18:00:05 +08:00
if (device.name.slice(5, 17) == this.mac) {
this.deviceId = device.deviceId
this.name = device.name
2024-10-18 17:59:38 +08:00
// console.log(device.name,this.mac,'222');
2024-10-22 18:01:20 +08:00
this.devicesList.push(device)
let uniqueDevicesList = Array.from(new Set(this.devicesList))
2024-10-17 18:00:05 +08:00
this.devicesList = uniqueDevicesList;
2024-10-31 17:57:18 +08:00
}
2024-10-17 18:00:05 +08:00
})
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
2024-10-22 18:01:20 +08:00
console.log("连接回调:" + JSON.stringify(options))
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
2024-10-31 17:57:18 +08:00
success(res) {
setTimeout(() => {
2024-10-22 18:01:20 +08:00
xBlufi.notifySendCustomData({
2024-10-23 18:04:30 +08:00
customData: "11get"
2024-10-22 18:01:20 +08:00
})
2024-10-31 17:57:18 +08:00
}, 3000)
2024-10-22 18:01:20 +08:00
},
fail(err) {
2024-10-31 17:57:18 +08:00
console.error('获取已连接蓝牙设备信息失败:', err)
2024-10-22 18:01:20 +08:00
}
2024-10-31 17:57:18 +08:00
})
2024-10-22 18:01:20 +08:00
}
}
})
2024-10-18 17:59:38 +08:00
uni.setStorageSync('device_key', 'true')
2024-10-17 18:00:05 +08:00
if (options.result) {
{
xBlufi.notifyInitBleEsp32({
deviceId: this.deviceId
})
this.name = this.name
}
2024-10-31 17:57:18 +08:00
} else {
2024-10-17 18:00:05 +08:00
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA:
2024-10-31 17:57:18 +08:00
console.log("1收到设备发来的自定义数据结果", options.data,options.data.length)
this.datalist = options.data.slice(0, -1) + ";"
this.getchuli()
2024-10-23 18:04:30 +08:00
break
2024-10-17 18:00:05 +08:00
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP:
if (options.result) {
2024-10-22 18:01:20 +08:00
let uniqueDevicesList = Array.from(new Set(this.devicesList))
2024-10-31 17:57:18 +08:00
let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 5) ===
"WATER")
2024-10-17 18:00:05 +08:00
// 将过滤后的数组重新赋值给 this.devicesList
2024-10-22 18:01:20 +08:00
this.devicesList = filteredDevices
2024-10-17 18:00:05 +08:00
}
break;
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) {
2024-11-02 17:59:26 +08:00
uni.hideLoading()
// uni.showToast({
// title: '蓝牙未开启',
// icon: 'none',
// duration: 3000
2024-10-31 17:57:18 +08:00
// })
2024-11-02 17:59:26 +08:00
uni.showModal({
title: '提示',
content: '请打开蓝牙和位置信息',
success: function (res) {
if (res.confirm) {
uni.hideLoading()
that.btnlj()
} else if (res.cancel) {
uni.hideLoading()
uni.showToast({
title: '已取消连接',
icon: 'none',
duration:2000
})
}
}
})
2024-10-17 18:00:05 +08:00
return
}
2024-10-21 18:03:03 +08:00
break
2024-10-24 18:00:12 +08:00
}
2024-10-31 17:57:18 +08:00
},
// 每隔一分钟发送一次获取数据
getshuju() {
let that = this
const intervalId = setInterval(() => {
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(() => {
xBlufi.notifySendCustomData({
customData: "11get"
})
console.log(that.ver_data,'000');
if(that.ver_data != ''){
that.getchuli()
}
}, 1000)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:', err)
}
})
}
}
})
console.log("定时器每分钟执行一次")
}, 60000)
},
2024-11-02 17:59:26 +08:00
// 处理从设备接收数据
2024-10-31 17:57:18 +08:00
getchuli() {
const inputString = this.datalist
const pairs = inputString.split(';')
const showObject = {}
const pSetObjects = {}
pairs.forEach(pair => {
const [key, value] = pair.split(':')
if (key === 'show') {
showObject.showArray = value.split(',').map(Number)
} else if (key.startsWith('p_set')) {
const numbers = value.split(',').map(Number)
pSetObjects[key] = numbers
}
})
this.ver_data = pSetObjects //六个浇水时间段
console.log(inputString,this.ver_data, '002002002')
this.showobj = showObject //雨滴,锁,等是否开启
if (this.showobj.showArray[1] == 1) {
this.yschecked = false
} else {
this.yschecked = true
}
if (this.showobj.showArray[0] == 1) {
this.etchecked = false
} else {
this.etchecked = true
}
// 计算浇水时间
const ver_Data = this.ver_data
function secondsToMinutesAndSeconds(seconds) {
const minutes = Math.floor(seconds / 60)
const remainingSeconds = seconds % 60
return `${minutes}${remainingSeconds}`
}
function timeArrayToDate(timeArray) {
const [hour, minute,minutes, second, /* other fields */ ] = timeArray
const date = new Date()
date.setHours(hour, minute,minute, second, 0) // 毫秒设为0
2024-11-02 17:59:26 +08:00
console.log(date,'11111')
2024-10-31 17:57:18 +08:00
return date
}
function timeDifference(date1, date2) {
const diffMs = Math.abs(date1 - date2)
const diffSeconds = Math.floor(diffMs / 1000)
const diffMinutes = Math.floor(diffSeconds / 60)
const diffHours = Math.floor(diffMinutes / 60)
const remainingMinutes = diffMinutes % 60
return {
hours: diffHours,
minutes: remainingMinutes
}
}
let nextTimeDiff = null
let nextTime = null
let prevTimeDiff = null
let prevTime = null
let nextWaterDuration = null
for (const key in ver_Data) {
if (ver_Data.hasOwnProperty(key) && ver_Data[key][3] === 1) {
const timeArray = ver_Data[key]
2024-11-02 17:59:26 +08:00
console.log(timeArray,'00000')
2024-10-31 17:57:18 +08:00
const timeDate = timeArrayToDate(timeArray)
const diff = timeDifference(timeDate, new Date())
if (timeDate > new Date()) {
if (!nextTime || (diff.hours * 60 + diff.minutes < (nextTimeDiff.hours || 0) * 60 + (
nextTimeDiff.minutes || 0))) {
nextTimeDiff = diff
nextTime = timeDate
nextWaterDuration = secondsToMinutesAndSeconds(timeArray[2])
}
} else {
if (!prevTime || (new Date() - timeDate < new Date() - (prevTime || new Date(0)))) {
prevTimeDiff = timeDifference(new Date(), timeDate)
prevTime = timeDate
}
}
}
}
// 输出结果,确保在访问 null 值之前进行检查
2024-11-02 17:59:26 +08:00
this.xctime = nextTime ? `${nextTimeDiff.hours}${nextTimeDiff.minutes}` : '无距离下次浇水时间'
this.xctimesc = nextWaterDuration || '未知'
this.sctimejs = prevTime ? prevTime.toTimeString().split(' ')[0].slice(0, -3) : '无上次浇水时间'
this.xctimesj = nextTime ? nextTime.toTimeString().split(' ')[0].slice(0, -3) : '无下次浇水时间'
2024-10-31 17:57:18 +08:00
console.log('下次浇水时间',this.xctimesj,'距离下次浇水时间',this.xctime,'上次浇水时间',this.sctimejs)
}
2023-11-27 09:57:03 +08:00
}
}
</script>
2024-01-27 16:37:52 +08:00
<style lang="scss">
2024-10-09 16:52:44 +08:00
.container {
display: flex;
align-items: center;
justify-content: center;
margin-top: 22rpx;
2024-10-31 17:57:18 +08:00
view {
2024-10-16 18:03:08 +08:00
width: 242rpx;
height: 208rpx;
background: #F0F0F0;
border-radius: 24rpx 24rpx 24rpx 24rpx;
text-align: center;
line-height: 208rpx;
font-weight: 600;
font-size: 44rpx;
color: #3D3D3D;
}
2024-10-31 17:57:18 +08:00
text {
2024-10-16 18:03:08 +08:00
font-size: 80rpx;
margin-left: 46rpx;
margin-right: 46rpx;
}
2024-10-09 16:52:44 +08:00
}
2024-10-31 17:57:18 +08:00
.anniu {
2024-10-09 16:52:44 +08:00
display: flex;
justify-content: space-between;
2024-10-16 18:03:08 +08:00
margin-top: 58rpx;
2024-10-31 17:57:18 +08:00
.qx {
2024-10-09 16:52:44 +08:00
width: 278rpx;
2024-10-16 18:03:08 +08:00
height: 80rpx;
2024-10-09 16:52:44 +08:00
border-radius: 10rpx 10rpx 10rpx 10rpx;
border: 2rpx solid #7FAD76;
font-size: 36rpx;
color: #7FAD76;
font-weight: 600;
2024-10-16 18:03:08 +08:00
line-height: 80rpx;
2024-10-09 16:52:44 +08:00
text-align: center;
}
2024-10-31 17:57:18 +08:00
.qd {
2024-10-09 16:52:44 +08:00
width: 278rpx;
2024-10-16 18:03:08 +08:00
height: 80rpx;
2024-10-09 16:52:44 +08:00
background: #7FAD76;
border-radius: 10rpx 10rpx 10rpx 10rpx;
font-size: 36rpx;
color: #fff;
font-weight: 600;
2024-10-16 18:03:08 +08:00
line-height: 80rpx;
2024-10-09 16:52:44 +08:00
text-align: center;
}
}
.selected-time {
margin-top: 20px;
font-size: 20px;
2024-03-13 10:54:22 +08:00
}
2024-10-09 16:52:44 +08:00
#activebor {
border: 1px solid #48893B;
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
/* 初始位置稍微在上方 */
}
to {
opacity: 1;
transform: translateY(0);
/* 最终位置 */
}
}
.manualmask {
width: 100%;
height: 100vh;
background: #3D3D3D;
opacity: 0.2;
position: fixed;
top: 0;
left: 0;
z-index: 99;
}
.manualjs {
width: 678rpx;
2024-10-16 18:03:08 +08:00
max-height: 610rpx;
background: #fff;
2024-10-09 16:52:44 +08:00
border-radius: 24rpx 24rpx 24rpx 24rpx;
position: fixed;
top: 538rpx;
left: 50%;
transform: translateX(-50%);
z-index: 100;
padding: 42rpx 44rpx;
box-sizing: border-box;
.toptit {
font-size: 36rpx;
color: #3D3D3D;
font-weight: 600;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.page {
padding: 0 40rpx;
box-sizing: border-box;
2024-11-07 17:44:29 +08:00
// background-color: #FFFFFF;
2024-10-09 16:52:44 +08:00
.tabsb {
width: 750rpx;
height: 90vh;
background: #FFFFFF;
position: fixed;
top: 270rpx;
left: 0;
padding: 0 40rpx;
padding-bottom: 60rpx !important;
box-sizing: border-box;
border-radius: 0rpx 0rpx 50rpx 50rpx;
z-index: 1;
padding-top: 48rpx;
box-sizing: border-box;
animation: fadeInDown .5s ease-out forwards;
.qdan {
2024-03-13 10:54:22 +08:00
width: 100%;
2024-10-09 16:52:44 +08:00
height: 102rpx;
font-size: 48rpx;
color: #FFFFFF;
font-weight: 600;
line-height: 102rpx;
2024-03-13 10:54:22 +08:00
text-align: center;
2024-10-09 16:52:44 +08:00
background-color: #48893B;
border-radius: 20rpx;
margin-top: 40rpx;
2024-03-13 10:54:22 +08:00
}
2024-10-09 16:52:44 +08:00
.sblist {
width: 100%;
height: 68vh;
overflow: scroll;
.sbist_val {
2024-01-27 16:37:52 +08:00
display: flex;
2024-03-13 10:54:22 +08:00
justify-content: space-between;
align-items: center;
2024-10-09 16:52:44 +08:00
padding: 40rpx 34rpx;
margin-bottom: 28rpx;
box-sizing: border-box;
background: #F7F7F7;
border-radius: 20rpx 20rpx 20rpx 20rpx;
border: 1px solid transparent;
.lt {
font-size: 36rpx;
color: #3D3D3D;
font-weight: 600;
2024-01-27 16:37:52 +08:00
}
2024-10-09 16:52:44 +08:00
.rt {
image {
width: 124rpx;
height: 124rpx;
2024-03-13 10:54:22 +08:00
}
}
}
2024-10-09 16:52:44 +08:00
}
}
.sbmask {
width: 100%;
height: 100vh;
background-color: rgb(238, 238, 238);
position: fixed;
top: 400rpx;
left: 0;
opacity: .5;
}
.wusb {
margin-top: 514rpx;
text-align: center;
text {
font-size: 28rpx;
color: #737B80;
}
view {
width: 212rpx;
height: 76rpx;
background: #48893B;
border-radius: 38rpx 38rpx 38rpx 38rpx;
border-radius: 50rpx;
font-size: 28rpx;
color: #FFFFFF;
text-align: center;
line-height: 76rpx;
margin: auto;
margin-top: 50rpx;
}
}
.wateringlogbox {
width: 100%;
height: 244rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 38rpx 0rpx rgba(128, 128, 128, 0.3);
filter: blur(0px);
border-radius: 20rpx;
margin-top: 20rpx;
padding: 30rpx;
box-sizing: border-box;
.wateringlogbd {
display: flex;
justify-content: space-between;
.lt {
view {
font-size: 28rpx;
color: #50565A;
margin-top: 10rpx;
2024-01-27 16:37:52 +08:00
}
2024-10-09 16:52:44 +08:00
}
.rt {
image {
width: 114rpx;
height: 114rpx;
2024-03-13 10:54:22 +08:00
}
}
}
2024-10-09 16:52:44 +08:00
.wateringlogtop {
display: flex;
align-items: center;
font-size: 32rpx;
color: #3D3D3D;
font-weight: 600;
image {
width: 40rpx;
height: 40rpx;
margin-right: 14rpx;
2024-01-27 16:37:52 +08:00
}
2024-10-09 16:52:44 +08:00
}
}
.dingshi_he {
margin-top: 24rpx;
width: 304rpx;
height: 194rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 38rpx 0rpx rgba(128, 128, 128, 0.3);
filter: blur(0px);
border-radius: 20rpx;
padding: 26rpx;
box-sizing: border-box;
.naoz {
font-size: 40rpx;
color: #3D3D3D;
font-weight: 600;
display: flex;
justify-content: space-between;
image {
width: 78rpx;
height: 78rpx;
2024-01-27 16:37:52 +08:00
}
}
2024-10-09 16:52:44 +08:00
.dstime {
margin-top: 14rpx;
display: flex;
align-items: center;
width: 100%;
justify-content: space-between;
image {
width: 52rpx;
height: 52rpx;
}
}
}
.switchbox {
margin-top: 24rpx;
display: flex;
justify-content: space-between;
.switch_he {
width: 304rpx;
height: 194rpx;
2024-03-13 10:54:22 +08:00
background: #FFFFFF;
2024-10-09 16:52:44 +08:00
box-shadow: 0rpx 0rpx 38rpx 0rpx rgba(128, 128, 128, 0.3);
filter: blur(0px);
border-radius: 20rpx;
padding: 26rpx;
box-sizing: border-box;
.yushui {
width: 100%;
font-size: 28rpx;
color: #3D3D3D;
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 20rpx;
}
image {
width: 78rpx;
height: 78rpx;
2024-03-13 10:54:22 +08:00
}
2024-10-09 16:52:44 +08:00
}
}
.devicebox {
width: 100%;
height: 290rpx;
background: #FFFFFF;
box-shadow: 0rpx 0rpx 38rpx 0rpx rgba(128, 128, 128, 0.3);
filter: blur(0px);
2024-10-16 18:03:08 +08:00
margin-top: 22rpx;
2024-10-09 16:52:44 +08:00
border-radius: 20rpx;
padding: 30rpx;
box-sizing: border-box;
.deviceweek {
display: flex;
justify-content: space-between;
margin-top: 34rpx;
2024-10-23 18:04:30 +08:00
// align-items: center;
2024-10-09 16:52:44 +08:00
.weeklist {
.kg {
font-size: 24rpx;
color: #999999;
2024-10-23 18:04:30 +08:00
font-weight: 600;
2024-10-09 16:52:44 +08:00
}
.weekday {
font-size: 36rpx;
color: #3D3D3D;
font-weight: 600;
margin-top: 4rpx;
}
.img {
text-align: center;
image {
width: 12rpx;
height: 12rpx;
2024-03-13 10:54:22 +08:00
}
2024-01-27 16:37:52 +08:00
}
}
}
2024-10-09 16:52:44 +08:00
.devicetop {
2024-03-13 10:54:22 +08:00
display: flex;
2024-10-09 16:52:44 +08:00
justify-content: space-between;
2024-03-13 10:54:22 +08:00
align-items: center;
2024-10-09 16:52:44 +08:00
.devicert {
text-align: right;
.shoudong {
display: flex;
image {
width: 64rpx;
height: 32rpx;
margin-right: 8rpx;
}
font-size: 24rpx;
color: #3D3D3D;
}
.shengyu {
font-size: 24rpx;
color: #3D3D3D;
margin-top: 6rpx;
}
2024-03-13 10:54:22 +08:00
}
2024-10-09 16:52:44 +08:00
.devicelt {
display: flex;
.xinghao {
font-size: 24rpx;
color: #3D3D3D;
.one {
font-size: 28rpx !important;
color: #3D3D3D;
font-weight: 600 !important;
margin-top: 6rpx;
}
}
image {
width: 74rpx;
height: 80rpx;
margin-right: 32rpx;
}
2024-03-13 10:54:22 +08:00
}
}
2024-10-09 16:52:44 +08:00
}
.selectbox {
width: 100%;
margin-top: 22rpx;
display: flex;
justify-content: space-between;
align-items: center;
.shebeiname {
font-size: 36rpx;
color: #73787B;
font-weight: 600;
display: flex;
align-items: center;
text {
display: inline-block;
width: 14rpx;
height: 14rpx;
background: #15C55D;
border-radius: 50%;
box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(0, 255, 102, 0.9), 0rpx 0rpx 30rpx 0rpx rgba(69, 255, 143, 0.9);
margin-left: 22rpx;
2024-01-27 16:37:52 +08:00
}
}
2024-10-09 16:52:44 +08:00
.shebeiadd {
image {
width: 214rpx;
height: 64rpx;
}
}
.selectname {
font-size: 48rpx;
color: #3D3D3D;
font-weight: 600;
image {
width: 32rpx;
height: 26rpx;
margin-left: 14rpx;
}
}
2024-11-06 16:55:34 +08:00
.selectnames {
font-size: 28rpx;
color: #3D3D3D;
border: 1px solid;
padding:0 20rpx;
box-sizing: border-box;
2024-11-07 17:44:29 +08:00
border-radius: 10rpx;
background-color: #7FAD76;
2024-11-06 16:55:34 +08:00
color: #fff;
height: 60rpx;
line-height: 60rpx;
image {
width: 32rpx;
height: 26rpx;
margin-left: 14rpx;
}
}
2024-10-09 16:52:44 +08:00
.selectshezhi {
image {
width: 60rpx;
height: 66rpx;
}
}
2024-03-25 19:46:07 +08:00
}
2024-10-09 16:52:44 +08:00
.bjimg {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: -1;
2024-03-25 19:46:07 +08:00
}
2024-10-09 16:52:44 +08:00
.title {
2024-03-25 19:46:07 +08:00
box-sizing: border-box;
2024-10-09 16:52:44 +08:00
image {
width: 260rpx;
height: 60rpx;
}
2024-01-27 16:37:52 +08:00
}
}
2024-03-13 10:54:22 +08:00
</style>