Commit bbeb70e7 authored by van.chen's avatar van.chen

我的页面加个顶部

parent d5796a0b
......@@ -43,7 +43,7 @@
<div class="bottomPart">
<ListItem multipleLine *ngFor="let a of devices;let i = index">
{{a.fieldDeviceName}}
<v-switch [value]="a.value" (click)="toggle(a)" [loading]="a.loading"></v-switch>
<v-switch [value]="a.value" [disabled]="true" (click)="toggle(a)" [loading]="a.loading"></v-switch>
</ListItem>
</div>
</PullToRefresh>
......
......@@ -40,8 +40,8 @@
<img [src]="'../../assets/img/' + item.img">
</div>
<div class="rightCon">
<div class="block1">池体液位: &nbsp;&nbsp;{{item.yewei}} m</div>
<div class="block2">液体温度: &nbsp;&nbsp;{{item.temp}} ℃</div>
<div class="block1" *ngIf="item.yewei || item.yewei === 0">池体液位: &nbsp;&nbsp;{{item.yewei}} m</div>
<div class="block2" *ngIf="item.temp || item.temp === 0">液体温度: &nbsp;&nbsp;{{item.temp}} ℃</div>
<div class="block2">运行状态: &nbsp;&nbsp;{{item.state ? '工作中' : '离线'}} </div>
</div>
</div>
......
<div class="mainContent">
<Navbar [leftContent]="icon"
(onLeftClick)="onLeftClick()"
style="background-color: #28c9bd"
>
个人中心
</Navbar>
<div class="topBar">
<div class="top">
<div class="imgPart">
......@@ -28,3 +34,7 @@
<div Button class="button" (click)="loginOut()" [type]="'primary'" style="letter-spacing: 2px">退出登录</div>
</div>
</div>
<ng-template #icon>
<span class="vo v-back"></span>
</ng-template>
......@@ -5,7 +5,7 @@
}
.topBar {
height: 25%;
padding-top: 15%;
padding-top: 8%;
background-color: rgba(40, 201, 189, 0.6);
.top {
......
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {Api} from '../service/api';
import {Transfer} from '../service/transfer';
@Component({
selector: 'v-mine',
templateUrl: './mine.page.html',
styleUrls: ['./mine.page.scss'],
selector: 'v-mine',
templateUrl: './mine.page.html',
styleUrls: ['./mine.page.scss'],
})
export class MinePage implements OnInit {
user: any = {};
user: any = {};
constructor(private api: Api, private tf: Transfer) {
}
constructor(private api: Api, private tf: Transfer) {
}
ngOnInit() {
this.getSelfInfo();
}
ngOnInit() {
this.getSelfInfo();
}
getSelfInfo() {
this.api.user.getSelfInfo(['', (data) => {
if (data) {
this.user = data;
} else {
this.api.presentMsgToast(data && data.message ? data.message : '登录失败');
}
}]);
}
getSelfInfo() {
this.api.user.getSelfInfo(['', (data) => {
if (data) {
this.user = data;
} else {
this.api.presentMsgToast(data && data.message ? data.message : '登录失败');
}
}]);
}
loginOut() {
this.api.login.logout(['', (data) => {
if (data) {
window.localStorage.removeItem('token');
this.tf.transfer({url: '/login'});
} else {
this.api.presentMsgToast(data && data.message ? data.message : '登录失败');
}
}]);
}
loginOut() {
this.api.login.logout(['', (data) => {
if (data) {
window.localStorage.removeItem('token');
this.tf.transfer({url: '/login'});
} else {
this.api.presentMsgToast(data && data.message ? data.message : '登录失败');
}
}]);
}
onLeftClick() {
this.tf.transfer({url: '/home'});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment