|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="volumn-box" :class="airData.isOpen ? 'active' : ''">
|
|
|
+ <div class="volumn-box" :class="airData.isOpen ? 'activeShow' : ''">
|
|
|
<div>
|
|
|
<div class="top">
|
|
|
<img :src="parseImgUrl('taiguv1/envmonitor', airData.isOpen ? 'active/air-con.svg' : 'air-con.svg')" alt="" />
|
|
@@ -23,8 +23,7 @@
|
|
|
<div class="status">{{ airData.isOpen ? '已开启' : '已关闭' }}</div>
|
|
|
</div>
|
|
|
<div class="temp" v-if="airData.isOpen">
|
|
|
- {{ airData.tempSet }}
|
|
|
- <sup>℃</sup>
|
|
|
+ {{ airData.tempSet || 16}}<sup>℃</sup>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--温度⏭️-->
|
|
@@ -48,14 +47,14 @@
|
|
|
<div class="text">风量调节</div>
|
|
|
</div>
|
|
|
<div class="volume-right">
|
|
|
- <div class="control-item" :ref="setRef" @click.prevent.stop="handle('minus')">
|
|
|
- <img class="icon" :src="parseImgUrl('taiguv1/envmonitor', 'minus.svg')" />
|
|
|
+ <div class="control-item" :ref="setRef" data-type="minus" @click.prevent.stop="handle('minus')">
|
|
|
+ <img class="icon" :src="buttonStates.minus ? MinusIconActive : MinusIcon" />
|
|
|
</div>
|
|
|
- <div class="control-item" :ref="setRef" @click.prevent.stop="handle('plus')">
|
|
|
- <img class="icon" :src="parseImgUrl('taiguv1/envmonitor', 'plus.svg')" />
|
|
|
+ <div class="control-item" :ref="setRef" data-type="plus" @click.prevent.stop="handle('plus')">
|
|
|
+ <img class="icon" :src="buttonStates.plus ? AddIconActive : AddIcon" />
|
|
|
</div>
|
|
|
- <div class="control-item" :class="airData.isAutoGear ? 'active' : ''" @click.prevent.stop="handle('auto')">
|
|
|
- A
|
|
|
+ <div class="control-item" @click.prevent.stop="handle('auto')">
|
|
|
+ <img class="icon" :src="airData.isAutoGear ? AutoIconActive : AutoIcon" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -64,6 +63,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
+import AddIcon from '@/assets/taiguv1/svg/add_icon.svg'
|
|
|
+import AddIconActive from '@/assets/taiguv1/svg/add_icon_active.svg'
|
|
|
+import AutoIcon from '@/assets/taiguv1/svg/auto_icon.svg'
|
|
|
+import AutoIconActive from '@/assets/taiguv1/svg/auto_icon_active.svg'
|
|
|
+import MinusIcon from '@/assets/taiguv1/svg/minus_icon.svg'
|
|
|
+import MinusIconActive from '@/assets/taiguv1/svg/minus_icon_active.svg'
|
|
|
+
|
|
|
import FilterIcon from '@/assets/taiguv1/svg/filter_icon.svg'
|
|
|
import Slider from '@/components/slider/Slider.vue'
|
|
|
import SwitchButton from '@/components/switch-button/SwitchButton.vue'
|
|
@@ -164,6 +170,11 @@ const allAirStatus = computed(() => store.state.taiguv1.airSwtichStatus)
|
|
|
|
|
|
const emit = defineEmits(['getStatus'])
|
|
|
|
|
|
+const buttonStates = ref({
|
|
|
+ minus: false,
|
|
|
+ plus: false
|
|
|
+})
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
nextTick(() => {
|
|
|
nextTick(() => {
|
|
@@ -174,15 +185,18 @@ onMounted(() => {
|
|
|
})
|
|
|
})
|
|
|
|
|
|
-// 添加 touchstart 处理函数
|
|
|
const handleTouchStart = event => {
|
|
|
const button = event.currentTarget
|
|
|
+ const type = button.dataset.type
|
|
|
button.classList.add('active')
|
|
|
+ buttonStates.value[type] = true
|
|
|
+
|
|
|
setTimeout(() => {
|
|
|
button.classList.remove('active')
|
|
|
+ buttonStates.value[type] = false
|
|
|
}, 200)
|
|
|
}
|
|
|
-// 添加 onUnmounted 钩子
|
|
|
+
|
|
|
onUnmounted(() => {
|
|
|
controlBtn.value.forEach(button => {
|
|
|
button.removeEventListener('touchstart', handleTouchStart)
|
|
@@ -203,16 +217,13 @@ const handle = type => {
|
|
|
}
|
|
|
airData.value.isAutoGear = false
|
|
|
} else if (type === 'auto') {
|
|
|
+ airData.value.gear = 4
|
|
|
airData.value.isAutoGear = true
|
|
|
}
|
|
|
setAirStatus('gear')
|
|
|
}
|
|
|
|
|
|
const setAirStatus = type => {
|
|
|
- // if (type == 'isOpen') {
|
|
|
- // airData.value.lastSwitchStatus = airData.value.isOpen
|
|
|
- // }
|
|
|
- // console.log(airData.isOpen, 'airData.isOpen')
|
|
|
if (type == 'isOpen') {
|
|
|
store.dispatch('taiguv1/setAirStatus', {
|
|
|
id: 'all',
|
|
@@ -273,23 +284,17 @@ const searchMore = () => {
|
|
|
}
|
|
|
.bottom {
|
|
|
width: 100%;
|
|
|
- // margin-top: 18vh;
|
|
|
- // margin-top: 109px;
|
|
|
.air-info {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: end;
|
|
|
.temp {
|
|
|
- //styleName: En/H2;
|
|
|
- width: 60px;
|
|
|
- // text-align: right;
|
|
|
font-family: Jost;
|
|
|
font-size: 20px;
|
|
|
font-weight: 300;
|
|
|
line-height: 28px;
|
|
|
color: rgba(0, 20, 40, 1);
|
|
|
sup {
|
|
|
- //styleName: En/Body XS;
|
|
|
font-family: Jost;
|
|
|
font-size: 11px;
|
|
|
font-weight: 400;
|
|
@@ -299,7 +304,6 @@ const searchMore = () => {
|
|
|
}
|
|
|
}
|
|
|
.text {
|
|
|
- //styleName: Chi/Body Large;
|
|
|
font-family: PingFang SC;
|
|
|
font-size: 16px;
|
|
|
font-weight: 300;
|
|
@@ -312,7 +316,6 @@ const searchMore = () => {
|
|
|
padding-bottom: 2px;
|
|
|
}
|
|
|
.status {
|
|
|
- //styleName: Chi/Body XS;
|
|
|
font-family: PingFang SC;
|
|
|
font-size: 11px;
|
|
|
font-weight: 400;
|
|
@@ -335,7 +338,7 @@ const searchMore = () => {
|
|
|
border: none;
|
|
|
}
|
|
|
}
|
|
|
-.active {
|
|
|
+.activeShow {
|
|
|
background: rgba(255, 255, 255, 0.8);
|
|
|
backdrop-filter: blur(40px);
|
|
|
box-shadow: 0px 10px 20px 0px rgba(0, 20, 40, 0.1);
|
|
@@ -359,7 +362,6 @@ const searchMore = () => {
|
|
|
height: 3.33vh;
|
|
|
line-height: 1;
|
|
|
span {
|
|
|
- //styleName: En/Body Small;
|
|
|
display: inline-block;
|
|
|
margin-right: 5px;
|
|
|
font-family: Jost;
|
|
@@ -375,7 +377,6 @@ const searchMore = () => {
|
|
|
}
|
|
|
}
|
|
|
.text {
|
|
|
- //styleName: Chi/Body XS;
|
|
|
font-family: PingFang SC;
|
|
|
font-size: 11px;
|
|
|
font-weight: 400;
|
|
@@ -391,52 +392,11 @@ const searchMore = () => {
|
|
|
.control-item {
|
|
|
width: 36px;
|
|
|
height: 36px;
|
|
|
- background: rgba(255, 255, 255, 0.4);
|
|
|
- // backdrop-filter: blur(15px);
|
|
|
- border-radius: 50%;
|
|
|
text-align: center;
|
|
|
.icon {
|
|
|
- width: 20px;
|
|
|
- height: 20px;
|
|
|
margin-top: 8px;
|
|
|
}
|
|
|
- &:nth-child(3) {
|
|
|
- font-family: Jost;
|
|
|
- font-size: 16px;
|
|
|
- font-weight: 300;
|
|
|
- line-height: 36px;
|
|
|
- text-align: center;
|
|
|
- color: rgba(0, 20, 40, 1);
|
|
|
- }
|
|
|
- &.active {
|
|
|
- background: #fff;
|
|
|
- box-shadow: 0px 10px 20px 0px rgba(0, 20, 40, 0.1);
|
|
|
- }
|
|
|
- // &:active,
|
|
|
- // &:focus {
|
|
|
- // background: #fff;
|
|
|
- // box-shadow: 0px 10px 20px 0px rgba(0, 20, 40, 0.1);
|
|
|
- // }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
-<style lang="scss">
|
|
|
-// .volumn-box {
|
|
|
-// .van-loading__spinner {
|
|
|
-// color: $elActiveColor !important;
|
|
|
-// }
|
|
|
-
|
|
|
-// .van-switch__loading {
|
|
|
-// top: 0;
|
|
|
-// left: 0;
|
|
|
-// width: 100%;
|
|
|
-// height: 100%;
|
|
|
-// line-height: 1;
|
|
|
-// }
|
|
|
-
|
|
|
-// .van-switch--disabled {
|
|
|
-// opacity: 0.5;
|
|
|
-// }
|
|
|
-// }
|
|
|
-</style>
|