Commit 519ea7e7 by sunchao

ng识别不了

parent 91d1c304
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,7 +32,6 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.0",
"@angular/cli": "~7.3.5",
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0",
"@types/jasmine": "~2.8.8",
......
......@@ -26,6 +26,7 @@ import { BusinessCardComponent } from "./business-card/business-card.component";
import { OrderDetailComponent } from './order-detail/order-detail.component';
import { SalaryComponent } from './salary/salary.component';
import { TodoListComponent } from './todo-list/todo-list.component';
import {AddTaskComponent} from './add-task/add-task.component';
const myRoutes: Routes = [
{ path: '', component: MyCenterHomeComponent, canActivate: [AuthGuard], data: [{ title: '银盾保险经纪 - 工作台' }] },
......@@ -53,8 +54,8 @@ const myRoutes: Routes = [
{ path: 'businessCard', component: BusinessCardComponent, canActivate: [AuthGuard] },
{ path: 'orderDetail', component: OrderDetailComponent, canActivate: [AuthGuard] },
{ path: 'salary', component: SalaryComponent, canActivate: [AuthGuard] },
{ path: 'todo', component: TodoListComponent, canActivate: [AuthGuard] }
{ path: 'todo', component: TodoListComponent, canActivate: [AuthGuard] },
{ path: 'addtask',component:AddTaskComponent,canActivate:[AuthGuard]}
];
@NgModule({
......
......@@ -8,13 +8,33 @@
<ul class="week">
<li *ngFor="let weekItem of weekArr;index as i;" [ngClass]="{'selected':weekItem.selected}" (click)="selectDay(weekItem)">
<div>{{weekItem.day}}</div>
<span>{{lifeCommonService.getWeek(i+1)}}</span>
<span>{{lifeCommonService.getWeek(weekItem.week)}}</span>
</li>
</ul>
</div>
<div class="todoList">
<img style="max-width: 80%;" src="assets/images/noListBg.png" >
<div class="addBtn">
<div class="task_wrapper">
<div class="noTask" *ngIf="taskList?.length==0">
<img src="assets/images/noListBg.png" >
</div>
<div class="taskList" *ngIf="taskList?.length>0">
<div class="taskTime">
<div class="title">时间</div>
<ul>
<li *ngFor="let taskTimeItem of taskTimeList">{{taskTimeItem.time}}</li>
</ul>
</div>
<div class="taskContent">
<div class="title">任务数量(3)</div>
<ul>
<li *ngFor="let taskItem of taskList">
<span>{{taskItem.time}}</span>
<div>(重要){{taskItem.taskTitle}}</div>
<div>{{taskItem.taskContent}}</div>
</li>
</ul>
</div>
</div>
<div class="addBtn" (click)="addTask()" [ngStyle]="{'background':taskList?.length? '#ff002b' : '#eb6100','bottom':taskList?.length?'4%':'-15%'}" [routerLink]="['/addtask'">
<i class="iconfont icon-jiahao" ></i>
</div>
</div>
......
......@@ -3,6 +3,7 @@ ul,ol{
}
.todo_wrapper{
.top{
margin-bottom: 20px;
.head{
display: flex;
height: 50px;
......@@ -39,29 +40,82 @@ ul,ol{
}
}
}
.todoList{
.task_wrapper{
position: relative;
.noTask{
margin-top: 15%;
font-size: 20px;
color: #9a9fb4;
position: relative;
margin: 0 auto;
display: flex;
justify-content: center;
img{
max-width: 70%;
}
.addtips{
text-align: center;
}
}
.taskList{
background: #f6f6f6;
padding: 20px 10px;
overflow: auto;
.taskTime{
float: left;
width: 20%;
div.title{
height: 35px;
line-height: 35px;
text-align: center;
font-size: 20px;
}
ul {
border-right: 1px #e6e6e6 solid;
margin-top: 15px;
li{
color: #8a8a8a;
height: 35px;
line-height: 35px;
text-align: center;
}
}
}
.taskContent{
float: left;
padding: 0 10px 0 20px;
width: 80%;
div.title{
height: 35px;
line-height: 35px;
text-align: left;
font-size: 20px;
}
ul {
margin-top: 15px;
li{
background: #fff;
padding: 10px 18px;
border-radius: 10px;
margin-bottom: 10px;
}
}
}
}
.addBtn{
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background: #eb6100;
color: #fff;
text-align: center;
line-height: 55px;
bottom: 0;
right: 35px;
bottom: -15%;
right: 8%;
.iconfont{
font-size: 30px;
}
}
}
}
\ No newline at end of file
......@@ -26,6 +26,8 @@ for (let key in extra) {
})
export class TodoListComponent implements OnInit {
weekArr: Array<any>;
taskList:Array<any> = [];
taskTimeList:Array<any> = [];
state: any = {
en: false,
date: null,
......@@ -42,7 +44,22 @@ export class TodoListComponent implements OnInit {
maxDate: new Date(+now + 31536000000),
onSelect: undefined,
}
constructor(private lifeCommonService: LifeCommonService) { }
constructor(private lifeCommonService: LifeCommonService) {
this.taskTimeList = [
{id:1,time:'8:00'},
{id:2,time:'9:00'},
{id:3,time:'10:00'},
{id:4,time:'11:00'},
{id:5,time:'12:00'},
{id:6,time:'13:00'},
{id:7,time:'14:00'},
{id:8,time:'15:00'},
{id:9,time:'16:00'},
{id:10,time:'17:00'},
{id:11,time:'18:00'},
{id:12,time:'19:00'},
]
}
ngOnInit() {
this.weekArr = this.lifeCommonService.makeDate();
......@@ -53,7 +70,15 @@ export class TodoListComponent implements OnInit {
}
selectDay(weekItem){
weekItem.selected = true;
for(let i=0;i<this.weekArr.length;i++){
this.weekArr[i].selected = false;
if(weekItem.day == this.weekArr[i]['day']){
this.weekArr[i].selected = true;
}
}
}
addTask(){
this.taskList.push({time:'8:00-9:00',isImportant:true,taskTitle:'今天要完成的计划1',taskContent:'app界面和网页界面的设计'});
}
}
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