Browse Source

定时添加

dev_230517
刘洪超 2 years ago
parent
commit
eea94ccd12
  1. 2
      src/view/device-detail/whole-setting.vue
  2. 27
      src/view/tabs/fixed-time.vue
  3. 15
      src/view/tabs/home-screen.vue
  4. 25
      src/view/timing/timing-add.vue
  5. 6
      src/view/ui/env-select.vue

2
src/view/device-detail/whole-setting.vue

@ -137,7 +137,7 @@ const setData = () => { @@ -137,7 +137,7 @@ const setData = () => {
* 全屋设定Event通知值变化
*/
const wholeSetting = () => {
proxy.$eventBusService.emit("selectNumEvent", tem);
proxy.$eventBusService.emit("queryData", tem.value, hum.value);
router.back();
};
const temSetting = (type: String) => {

27
src/view/tabs/fixed-time.vue

@ -70,6 +70,19 @@ const router = useRouter(); @@ -70,6 +70,19 @@ const router = useRouter();
const runFun = (index: any) => {
navList.value.splice(index, 1);
};
/**
* 添加定时
* @param index
*/
const addTiming = (data: any) => {
navList.value.unshift({
id: 0,
time: data.time,
name: data.name,
state: false,
selectState: false
});
};
/**
* 切换选中状态
*/
@ -100,12 +113,14 @@ const onItemDelete = (index: number) => { @@ -100,12 +113,14 @@ const onItemDelete = (index: number) => {
pageType: "timingSureDelete",
index: index,
hintText: "确定要删除该定时吗?",
hintImg: "/assets/imgs/show/icon_delete.png",
},
hintImg: "/assets/imgs/show/icon_delete.png"
}
});
};
onBeforeMount(() => {
proxy.$eventBusService.on("timingDelete", runFun);
proxy.$eventBusService.on("timingAdd", addTiming);
});
const navList = ref([
@ -114,22 +129,22 @@ const navList = ref([ @@ -114,22 +129,22 @@ const navList = ref([
time: "2.5",
name: "主卧空调",
state: false,
selectState: false,
selectState: false
},
{
id: 1,
time: "3.0",
name: "次卧空调",
state: true,
selectState: false,
selectState: false
},
{
id: 2,
time: "4.0",
name: "餐厅空调",
state: false,
selectState: false,
},
selectState: false
}
]);
</script>

15
src/view/tabs/home-screen.vue

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
<template>
<<<<<<< HEAD
<div id="home-screen-wrapper">
<div class="bg-video" @click="changeAnimation()">
<!-- 关机动画循环 -->
@ -35,6 +36,20 @@ @@ -35,6 +36,20 @@
v-show="currentAnimation === 3"
ref="animationExit"
></video>
=======
<div id="home-screen-wrapper">
<div class="nav-top">
<div class="wifi-icon">
<img src="@/assets/imgs/home-screen/WIFI@2x.png" alt="">
</div>
<div class="weather">雪天</div>
<div class="temp">-26</div>
</div>
<div class="content">
<div class="content-left">
<div class="time" @c="envSelect">
{{ hour }}<span>:</span>{{ minutes }}
>>>>>>> 267250d (定时添加)
</div>
<div class="nav-top">

25
src/view/timing/timing-add.vue

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<img
class="leftImg"
src="@/assets/imgs/show/back.png"
@click="onClickLeft()"
@click="router.back()"
/>
<div class="zhp-title-text">定时</div>
</div>
@ -67,6 +67,7 @@ @@ -67,6 +67,7 @@
import { getCurrentInstance, onBeforeMount, ref } from "vue";
import { useRouter } from "vue-router";
import { $commonService } from "@/services/framework/dependency-injection-service";
const getImgSrc = $commonService.$imgService.getImgSrc;
let selectNum = 0;
let time = 0;
@ -88,9 +89,6 @@ const selectNumEvent = (index: any) => { @@ -88,9 +89,6 @@ const selectNumEvent = (index: any) => {
const selectTimeEvent = (index: any) => {
time = index;
};
const onClickLeft = () => {
onSaveClick();
};
const onOpenClick = (b: boolean) => {
isOpen.value = b;
};
@ -113,10 +111,12 @@ onBeforeMount(() => { @@ -113,10 +111,12 @@ onBeforeMount(() => {
});
const onSaveClick = () => {
router.push({
path: "/tabs",
query: { pageType: "tabs", time: time, device: "主卧空调" }
});
proxy.$eventBusService.emit("timingAdd", { time: time, name: "主卧空调" });
router.back();
// router.push({
// path: "/tabs",
// query: { pageType: "tabs", time: time, device: "" },
// });
};
</script>
@ -128,8 +128,8 @@ const onSaveClick = () => { @@ -128,8 +128,8 @@ const onSaveClick = () => {
padding-right: 24px;
margin-bottom: 12px;
flex-wrap: wrap;
}
.time-center-item {
display: flex;
align-items: center;
@ -139,13 +139,14 @@ const onSaveClick = () => { @@ -139,13 +139,14 @@ const onSaveClick = () => {
background-position: center;
background-repeat: no-repeat;
background-image: url("@/assets/imgs/show/bg_add_timing_unselect.png");
}
.layout-horizontal {
display: flex;
align-items: stretch;
box-sizing: border-box;
}
.time-center-item-unselect {
color: #ffffff;
opacity: 0.4;
@ -153,17 +154,20 @@ const onSaveClick = () => { @@ -153,17 +154,20 @@ const onSaveClick = () => {
font-size: 32px;
font-weight: 400;
}
.time-center-item-select {
color: #ffffff;
text-align: center;
font-size: 32px;
font-weight: 700;
}
.selectImg {
width: 60px;
height: 60px;
margin-left: 26px;
}
.item-content {
margin-bottom: 12px;
position: relative;
@ -195,6 +199,7 @@ const onSaveClick = () => { @@ -195,6 +199,7 @@ const onSaveClick = () => {
font-size: 28px;
font-weight: 400;
}
.bottom-btn {
bottom: 30px;
position: absolute;

6
src/view/ui/env-select.vue

@ -31,12 +31,14 @@ @@ -31,12 +31,14 @@
</template>
<script lang="ts" setup>
import { ref } from "vue";
import { getCurrentInstance, ref } from "vue";
import router from "@/router";
import { Toast } from "vant";
const { proxy } = getCurrentInstance() as any;
const itemOnClick = (item: any) => {
Toast("获取的id" + item.id);
proxy.$eventBusService.emit("queryType", item.id);
router.back();
};
const seasonList = ref([
{

Loading…
Cancel
Save