123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- <template>
- <view class="aircondition-box">
- <view class="aircondition-control">
- <view class="aircondition-toogle">
- <view class="toogle-icon-text">
- <view class="toogle-icon">
- <uni-icons type="icon-fentikongtiaokongtiaojieneng" custom-prefix="iconfont" color="#fff"
- size="26">
- </uni-icons>
- </view>
- <text class="text">{{title}}</text>
- </view>
- <uni-icons type="icon-caozuo-kaiguan" custom-prefix="iconfont" size="40"
- :color="!isOpen?'#c3c3c3':'#08979c'" @click="isOpen = !isOpen">
- </uni-icons>
- </view>
- <view class="aircondition-show">
- <view class="aircondition-reduce aircondition-icon">
- <uni-icons type="icon-jian" custom-prefix="iconfont" color="#8c8c8c"></uni-icons>
- </view>
- <view class="aircondition-label">
- <view class="value">{{temp}}</view>
- <view class="unit">°C</view>
- </view>
- <view class="aircondition-add aircondition-icon">
- <uni-icons type="plusempty" color="#8c8c8c"></uni-icons>
- </view>
- </view>
- <l-slider v-model="temp" :min="16" :max="30" :step="0.5"></l-slider>
- </view>
- <view class="aircondition-model">
- <view class="box" @click="openPopup('model')">
- <view class="content">
- <view class="title">模式</view>
- <view class="sub-title">制热</view>
- </view>
- <uni-icons type="icon-zhongtumoshi" custom-prefix="iconfont" color="#bcbcbc" size="26">
- </uni-icons>
- </view>
- <view class="bg"></view>
- <view class="box" @click="openPopup('windSpeed')">
- <view class="content">
- <view class="title">风速</view>
- <view class="sub-title">自动</view>
- </view>
- <uni-icons type="icon-fengsu" custom-prefix="iconfont" color="#bcbcbc" size="26">
- </uni-icons>
- </view>
- </view>
- <uni-popup ref="popup">
- <view class="popup-content">
- <view class="popup-operation">
- <view class="model-popup" v-if="type == 'model'">
- <view class="model-popup-item active">
- <uni-icons type="icon-zidong" custom-prefix="iconfont" color="#08979c" size="26">
- </uni-icons>
- <view class="model-popup-label">自动</view>
- </view>
- <view class="model-popup-item">
- <uni-icons type="icon-zhileng" custom-prefix="iconfont" color="#8c8c8c" size="26">
- </uni-icons>
- <view class="model-popup-label">制冷</view>
- </view>
- <view class="model-popup-item">
- <uni-icons type="icon-zhire" custom-prefix="iconfont" color="#8c8c8c" size="26">
- </uni-icons>
- <view class="model-popup-label">制热</view>
- </view>
- <view class="model-popup-item">
- <uni-icons type="icon-chushi" custom-prefix="iconfont" color="#8c8c8c" size="26">
- </uni-icons>
- <view class="model-popup-label">抽湿</view>
- </view>
- <view class="model-popup-item">
- <uni-icons type="icon-songfeng" custom-prefix="iconfont" color="#8c8c8c" size="26">
- </uni-icons>
- <view class="model-popup-label">送风</view>
- </view>
- </view>
- <view class="wind-popup" v-if="type == 'windSpeed'">
- <view class="wind-title">
- <view class="big-title">风速</view>
- <view class="line"></view>
- <view class="label">
- <text v-if="autoWind">自动风</text>
- <text v-else>{{windSpeed}}%</text>
- </view>
- </view>
- <view class="wind-auto">
- <uni-icons type="icon-zidong" custom-prefix="iconfont" color="#1f1f1f" size="26">
- </uni-icons>
- <view class="big-title">自动风</view>
- <uv-switch v-model="autoWind" size="40rpx"></uv-switch>
- </view>
- <view class="wind-hand">
- <l-slider v-model="windSpeed" :min="1" :max="100" :step="1"></l-slider>
- </view>
- <view class="hand-text">
- <text class="number1">1%</text>
- <text class="number20">20%</text>
- <text class="number40">40%</text>
- <text class="number60">60%</text>
- <text class="number80">80%</text>
- <text class="number100">100%</text>
- </view>
- </view>
- </view>
- <view class="popup-close" @click="closePopup">关闭</view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- export default {
- props: ['title'],
- data() {
- return {
- isOpen: true,
- temp: 26,
- type: '',
- autoWind: true,
- windSpeed: 20
- }
- },
- mounted() {},
- methods: {
- openPopup(type) {
- this.type = type;
- this.$refs.popup.open('bottom');
- },
- closePopup() {
- this.$refs.popup.close();
- }
- }
- }
- </script>
- <style lang="scss">
- .aircondition-box {
- padding: 30rpx;
- .popup-content {
- border-radius: 16rpx 16rpx 0 0;
- background: #fff;
- .popup-operation {
- padding: 30rpx 0;
- }
- .model-popup {
- display: flex;
- .model-popup-item {
- flex: 1;
- text-align: center;
- &.active {
- color: $uni-primary;
- }
- }
- .model-popup-label {
- font-size: 24rpx;
- margin-top: 10rpx;
- font-weight: 300;
- }
- }
- .wind-popup {
- padding: 0 30rpx;
- box-sizing: border-box;
- .wind-title {
- display: flex;
- align-items: center;
- }
- .big-title {
- font-size: 32rpx
- }
- .line {
- width: 2rpx;
- height: 26rpx;
- background: $uni-background-color;
- margin: 0 16rpx;
- }
- .wind-auto {
- padding: 20rpx 30rpx;
- border-radius: 26rpx;
- box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
- display: flex;
- align-items: center;
- margin: 30rpx 0;
- .big-title {
- flex: 1;
- margin-left: 20rpx;
- }
- }
- .wind-hand {
- padding-top: 20rpx;
- }
- .hand-text {
- position: relative;
- color: $uni-secondary-color;
- font-size: 24rpx;
- height: 34rpx;
- margin-top: 20rpx;
- .number20 {
- position: absolute;
- left: 20%;
- margin-left: -26rpx;
- }
- .number40 {
- position: absolute;
- left: 40%;
- margin-left: -26rpx;
- }
- .number60 {
- position: absolute;
- left: 60%;
- margin-left: -26rpx;
- }
- .number80 {
- position: absolute;
- left: 80%;
- margin-left: -26rpx;
- }
- .number100 {
- position: absolute;
- left: 100%;
- margin-left: -52rpx;
- }
- }
- }
- .popup-close {
- border-top: 20rpx solid $uni-background-color;
- padding: 24rpx 0;
- text-align: center;
- color: $uni-secondary-color;
- }
- }
- .aircondition-control {
- padding: 30rpx;
- background: #fff;
- border-radius: 16rpx;
- box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
- }
- .aircondition-toogle {
- display: flex;
- justify-content: space-between;
- margin-bottom: 40rpx;
- }
- .toogle-icon-text {
- display: flex;
- align-items: center;
- .text {
- font-size: 36rpx;
- margin-left: 20rpx;
- }
- }
- .toogle-icon {
- width: 80rpx;
- height: 80rpx;
- background: $uni-primary;
- text-align: center;
- line-height: 80rpx;
- border-radius: 8px;
- }
- .aircondition-show {
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0 40rpx 30rpx 40rpx;
- }
- .aircondition-icon {
- width: 60rpx;
- height: 60rpx;
- background-color: $uni-background-color;
- text-align: center;
- line-height: 60rpx;
- border-radius: 50%;
- }
- .aircondition-label {
- flex: 1;
- width: 0;
- display: flex;
- align-items: flex-end;
- justify-content: center;
- color: $uni-base-color;
- .value {
- font-size: 80rpx;
- height: 100rpx;
- }
- .unit {
- font-size: 40rpx;
- }
- }
- .aircondition-model {
- display: flex;
- margin-top: 30rpx;
- .box {
- flex: 1;
- background: #fff;
- border-radius: 16rpx;
- box-shadow: 0px 1px 12px rgba(3, 3, 3, 0.08);
- height: 160rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 60rpx 0 30rpx;
- box-sizing: border-box;
- .content {
- .title {
- font-size: 32rpx;
- font-weight: 300;
- }
- .sub-title {
- font-size: 24rpx;
- color: $uni-secondary-color;
- font-weight: 200;
- margin-top: 10rpx;
- }
- }
- }
- .bg {
- width: 30rpx;
- }
- }
- }
- </style>
|