123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597 |
- <template>
- <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title='智慧空调' bgColor='transparent'></cus-header>
- <image class="bg" :src="imgBase+'home/kongtiao_bg.png'" mode="widthFix"></image>
- <div class="nums">
- <div class="pre">空调:<span class="mr">{{8}}</span></div>
- <div class="pre">正常:<span class="zc">{{20}}</span></div>
- <div class="pre">离线:<span class="lx">{{1}}</span></div>
- </div>
- <div class="boxs" v-if="list.length">
- <div class="box" v-for="(item,index) in list" :key="index" :class="bgcolorCfg[item.type]" @tap="showDetail(item)">
- <image :src="imgCfg[item.type]" class="type" mode="widthFix"></image>
- <div class="place">{{item.place}}</div>
- <div class="position">{{item.position}}</div>
- <div class="temperature" :class="{'off':item.status==2}">{{item.temperature}}℃</div>
- <div class="text">温度</div>
- <div class="btn" v-if="item.status==1">
- <div class="circle"></div>
- <text style="margin-left: 4rpx;">ON</text>
- </div>
- <div class="btn" v-else-if="item.status==2">
- <text style="margin-right: 4rpx;">OFF</text>
- <div class="circle off"></div>
- </div>
- </div>
- </div>
- <template v-else>
- <page-empty :height="'calc(100vh - '+(mt+65)+'px)'" marginTop="65px"></page-empty>
- </template>
- <u-popup :show="show" mode="bottom" :round="40" @close="ktClose">
- <div class="kt_info">
- <div class="top">
- <div class="left">
- <image :src="imgBase+'home/kongtiao_kt.png'"></image>
- <div class="addr">
- <text>{{ktInfo.place}}</text>
- <text class="ts">{{ktInfo.position}}</text>
- </div>
- </div>
- <div class="right" @tap="ktClose">
- <u-icon name="close" color="#333333" size="48"></u-icon>
- </div>
- </div>
- <template v-if="!setShow">
- <image class="setting" :src="imgBase+'home/kongtiao_set.png'" @tap="setShow = true"></image>
- <div class="wendu">
- <TemperatureControl :temperature="27" @changeTemperature="changeTemperature"></TemperatureControl>
- </div>
- <div class="type">
- <div class="pre" :class="{'active':ktInfo.type==1}" @tap="changeType(1)">
- <image :src="imgBase+'home/kongtiao_zl_bai.png'" v-if="ktInfo.type==1"></image>
- <image :src="imgBase+'home/kongtiao_zl_hui.png'" v-else></image>
- <text>制冷</text>
- </div>
- <div class="pre" :class="{'active':ktInfo.type==2}" @tap="changeType(2)">
- <image :src="imgBase+'home/kongtiao_zr_bai.png'" v-if="ktInfo.type==2"></image>
- <image :src="imgBase+'home/kongtiao_zr_hui.png'" v-else></image>
- <text>制热</text>
- </div>
- <div class="pre" :class="{'active':ktInfo.type==3}" @tap="changeType(3)">
- <image :src="imgBase+'home/kongtiao_cs_bai.png'" v-if="ktInfo.type==3"></image>
- <image :src="imgBase+'home/kongtiao_cs_hui.png'" v-else></image>
- <text>除湿</text>
- </div>
- <div class="pre" :class="{'active':ktInfo.type==4}" @tap="changeType(4)">
- <image :src="imgBase+'home/kongtiao_sf_bai.png'" v-if="ktInfo.type==4"></image>
- <image :src="imgBase+'home/kongtiao_sf_hui.png'" v-else></image>
- <text>送风</text>
- </div>
- </div>
- <div class="speend">
- <text>风速</text>
- <image class="jian" :src="imgBase+'home/kongtiao_jian.png'" @tap="changeWindSpeend(1)"></image>
- <div class="area">
- <div class="jd" :style="{'width':speend+'%'}"></div>
- </div>
- <image class="jia" :src="imgBase+'home/kongtiao_jia.png'" @tap="changeWindSpeend(2)"></image>
- </div>
- <div class="btns">
- <div class="btn" :class="{'blue':wtype==1}" @tap="changeWindFx(1)">左右扫风</div>
- <image :src="imgBase+'home/kongtiao_open1.png'" v-if="ktInfo.status==1" @tap="control(1)"></image>
- <image :src="imgBase+'home/kongtiao_open2.png'" v-else-if="ktInfo.status==2" @tap="control(2)"></image>
- <div class="btn" :class="{'blue':wtype==2}" @tap="changeWindFx(2)">上下扫风</div>
- </div>
- </template>
- <template v-else>
- <div class="form">
- <div class="item">
- <div class="left">所属楼栋</div>
- <div class="right">
- <input type="text" placeholder="请输入楼栋">
- </div>
- </div>
- <div class="item">
- <div class="left">所属楼层</div>
- <div class="right">
- <input type="text" placeholder="请输入楼层">
- </div>
- </div>
- <div class="item">
- <div class="left">房间号</div>
- <div class="right">
- <input type="text" placeholder="请输入房间号">
- </div>
- </div>
- <div class="item">
- <div class="left">设备序列号</div>
- <div class="right">
- <input type="text" placeholder="请输入设备序列号">
- </div>
- </div>
- <div class="item">
- <div class="left">空调名称</div>
- <div class="right">
- <input type="text" placeholder="请输入空调名称">
- </div>
- </div>
- <div class="item">
- <div class="left">空调编号</div>
- <div class="right">
- <input type="text" placeholder="请输入空调编号">
- </div>
- </div>
- <div class="item">
- <div class="left">是否为公共区域</div>
- <div class="right">
- <u-switch></u-switch>
- </div>
- </div>
- </div>
- <div class="confirm" @tap="confirmSet">确定</div>
- </template>
- </div>
- </u-popup>
- </view>
- </template>
- <script>
- import TemperatureControl from '@/pagesHome/components/TemperatureControl/index.vue'
- export default {
- components:{
- TemperatureControl
- },
- data(){
- return {
- imgCfg:{
- 1:this.$imgBase+'home/kongtiao_cold.png',
- 2:this.$imgBase+'home/kongtiao_sun.png',
- 3:this.$imgBase+'home/kongtiao_water.png',
- 4:this.$imgBase+'home/kongtiao_wind.png'
- },
- bgcolorCfg:{
- 1:'cold',
- 2:'hot',
- 3:'water',
- 4:'wind'
- },
- list:[
- {
- place:'B#/13F1301',
- position:'传秀-指挥中心东',
- temperature:18,
- status:1,//1开启 2关闭
- type:1//1制冷 2制热 3除湿 4送风
- },
- {
- place:'B#/13F1302',
- position:'传秀-指挥中心南',
- temperature:20.5,
- status:2,//1开启 2关闭
- type:3//1制冷 2制热 3除湿 4送风
- },
- {
- place:'B#/13F1303',
- position:'传秀-指挥中心西',
- temperature:28,
- status:1,//1开启 2关闭
- type:4//1制冷 2制热 3除湿 4送风
- },
- {
- place:'B#/13F1304',
- position:'传秀-指挥中心北',
- temperature:28,
- status:1,//1开启 2关闭
- type:2//1制冷 2制热 3除湿 4送风
- }
- ],
- show:false,
- setShow:false,
- ktInfo:{},
- speend:20,
- wtype:1
- }
- },
- methods:{
- showDetail(item){
- this.ktInfo = JSON.parse(JSON.stringify(item));
- if(item.status==2){
- this.speend = 0;
- this.wtype = '';
- this.ktInfo.type = '';
- }
- this.show = true;
- },
- changeType(type){
- if(this.ktInfo.status==2) return
- this.ktInfo.type = type;
- },
- changeWindSpeend(type){
- if(this.ktInfo.status==2) return
- if(type==1){
- if(this.speend<=20) return
- this.speend-=20;
- }else if(type==2){
- if(this.speend==100) return
- this.speend+=20;
- }
- },
- changeWindFx(type){
- if(this.ktInfo.status==2) return
- this.wtype = type;
- },
- control(type){
- this.show = false;
- },
- ktClose(){
- this.setShow = false;
- this.show = false;
- },
- confirmSet(){
- this.setShow = false;
- },
- changeTemperature(temperature){
- console.log(temperature,'temperature');
- }
- }
- }
- </script>
- <style scoped lang="less">
- .page{
- width: 100%;
- padding: 0 24rpx 20rpx;
- box-sizing: border-box;
- background: #F4F8FB;
-
- .bg{
- width: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 0;
- }
-
- .nums{
- width: 100%;
- background: #FFFFFF;
- border-radius: 16rpx;
- padding: 37rpx 24rpx;
- box-sizing: border-box;
- display: flex;
- margin-top: 20rpx;
- position: relative;
- .pre{
- width: calc(100% / 3);
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #4E5969;
- line-height: 36rpx;
- text-align: left;
- span{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- line-height: 36rpx;
- text-align: left;
- &.mr{
- color: #1D2129;
- }
- &.zc{
- color: #14CC8C;
- }
- &.lx{
- color: #F95050;
- }
- }
- }
- }
-
- .boxs{
- position: relative;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- margin-top: 4rpx;
- .box{
- width: calc(50% - 11rpx);
- box-shadow: 0rpx 4rpx 12rpx 0rpx rgba(35,130,255,0.1), inset 0rpx 3rpx 3rpx 0rpx #FFFFFF;
- border-radius: 16rpx;
- margin-top: 20rpx;
- padding: 32rpx 21rpx 42rpx 29rpx;
- box-sizing: border-box;
- position: relative;
- &.cold{
- background: linear-gradient( 180deg, #D7EBFF 0%, #FFFFFF 100%);
- }
- &.hot{
- background: linear-gradient( 180deg, #FFE7E4 0%, #FFFFFF 100%);
- }
- &.water{
- background: linear-gradient( 180deg, #ECF2F7 0%, #FFFFFF 100%);
- }
- &.wind{
- background: linear-gradient( 180deg, #ECF2F7 0%, #FFFFFF 100%);
- }
-
- .type{
- width: 164rpx;
- height: 164rpx;
- position: absolute;
- top: 0;
- right: 0;
- z-index: 9;
- }
- .place{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 30rpx;
- color: #1D2129;
- line-height: 42rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .position{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #86909C;
- line-height: 33rpx;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- margin-top: 16rpx;
- }
- .temperature{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 54rpx;
- color: #198CFF;
- line-height: 64rpx;
- margin-top: 33rpx;
- &.off{
- color: #4E5969;
- }
- }
- .text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #86909C;
- line-height: 33rpx;
- margin-top: 9rpx;
- }
- .btn{
- width: 98rpx;
- height: 54rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 2rpx 8rpx 0rpx rgba(0,0,0,0.06), inset 0rpx 2rpx 4rpx 0rpx #FFFFFF, inset 0rpx -1rpx 1rpx 0rpx #FFFFFF;
- border-radius: 27rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- position: absolute;
- right: 21rpx;
- bottom: 40rpx;
- .circle{
- width: 24rpx;
- height: 24rpx;
- background: #6FDD93;
- border-radius: 50%;
- &.off{
- background: #CCCCCC;
- }
- }
- text{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 24rpx;
- color: #1D2129;
- line-height: 33rpx;
- }
- }
- }
- }
-
- .kt_info{
- width: 100%;
- padding: 40rpx 30rpx 65rpx;
- box-sizing: border-box;
- background: #FFFFFF;
- position: relative;
- border-radius: 40rpx 40rpx 0 0;
- .top{
- display: flex;
- justify-content: space-between;
- .left{
- display: flex;
- image{
- width: 72rpx;
- height: 72rpx;
- }
- .addr{
- display: flex;
- flex-direction: column;
- margin-left: 20rpx;
- text{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 30rpx;
- color: #1D2129;
- line-height: 42rpx;
- text-align: left;
- &.ts{
- font-weight: 400;
- font-size: 24rpx;
- color: #86909C;
- margin-top: 16rpx;
- }
- }
- }
- }
- }
- .setting{
- width: 48rpx;
- height: 48rpx;
- position: absolute;
- right: 30rpx;
- top: 165rpx;
- z-index: 9;
- }
- .wendu{
- width: 484rpx;
- height: 484rpx;
- margin: 69rpx auto 0;
- }
- .type{
- display: flex;
- justify-content: space-around;
- margin-top: 20rpx;
- .pre{
- width: calc(25% - 20rpx);
- margin: 0 10rpx;
- padding: 36rpx 0;
- display: flex;
- flex-direction: column;
- align-items: center;
- background: linear-gradient( 180deg, #ECF2F7 0%, #FFFFFF 100%);
- box-shadow: 0rpx 4rpx 16rpx 0rpx #EDF4FF, inset 0rpx 3rpx 3rpx 0rpx #FFFFFF;
- border-radius: 16rpx;
- border: 2rpx solid #FFFFFF;
- image{
- width: 48rpx;
- height: 48rpx;
- }
- text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #1D2129;
- line-height: 40rpx;
- text-align: center;
- margin-top: 16rpx;
- }
- &.active{
- background: #198CFF;
- box-shadow: 0rpx 4rpx 16rpx 4rpx #EDF4FF;
- text{
- font-weight: bold;
- color: #FFFFFF;
- }
- }
- }
- }
- .speend{
- width: 100%;
- padding-left: 20rpx;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- margin-top: 80rpx;
- text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #1D2129;
- line-height: 40rpx;
- }
- image{
- width: 32rpx;
- height: 32rpx;
- margin: 0 20rpx;
- }
- .area{
- width: calc(100% - 200rpx);
- height: 20rpx;
- background: #EDF4FF;
- border-radius: 16rpx;
- position: relative;
- .jd{
- height: 100%;
- border-radius: 16rpx;
- background: linear-gradient( 90deg, #3A8DFF 0%, #0BC6FF 100%);
- box-shadow: 0rpx 4rpx 16rpx 4rpx #EFEFEF;
- position: absolute;
- left: 0;
- top: 0;
- }
- }
- }
- .btns{
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 28rpx;
- .btn{
- width: 210rpx;
- height: 88rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 4rpx 12rpx 4rpx #EDF4FF;
- border-radius: 16rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #1D2129;
- line-height: 88rpx;
- text-align: center;
- &.blue{
- background: #198CFF;
- color: #FFFFFF;
- }
- }
- image{
- width: 170rpx;
- height: 170rpx;
- }
- }
- .form{
- margin-top: 72rpx;
- .item{
- width: 100%;
- padding: 28rpx 30rpx;
- box-sizing: border-box;
- box-shadow: inset 0rpx -1rpx 0rpx 0rpx #EDF4FF;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #1D2129;
- line-height: 42rpx;
- letter-spacing: 2rpx;
- }
- .right{
- input{
- outline: none;
- border: none;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #4E5969;
- line-height: 42rpx;
- text-align: right;
- }
- }
- }
- }
- .confirm{
- width: calc(100% - 48rpx);
- height: 88rpx;
- background: #198CFF;
- border-radius: 16rpx;
- margin: 234rpx 24rpx 0;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 88rpx;
- text-align: center;
- letter-spacing: 2rpx;
- }
- }
- }
- </style>
|