主页

主界面

  1import { TaskFlow } from '../view/TaskFlow'   2import { TaskList } from '../view/TaskList'   3   4@Entry   5@Component   6struct Page02_TaskList {   7 build() {   8 RelativeContainer() {   9 Column() {  10 /**  11 * 第1个模块, 显示标题  12 */  13 Text('你好,小王')  14 .fontSize(30)  15 .fontWeight(FontWeight.Bold)  16 .fontColor($r('app.color.title_color'))  17  18 Text('每天的工作,都拥有价值')  19 .fontSize(14)  20 .fontColor(Color.Gray)  21 .margin({  22 top: 6  23 })  24  25 Text('我的计划')  26 .fontSize(26)  27 .fontWeight(FontWeight.Bold)  28 .fontColor($r('app.color.title_color'))  29 .margin({  30 top: 10  31 })  32  33 // 第2个模块, 显示模块列表  34 TaskList()  35  36 // 第3个模块, 当天任务列表  37 Column() {  38 // 标题板块  39 Row() {  40 Text('今日任务')  41 .fontSize(26)  42 .fontWeight(FontWeight.Bold)  43 .fontColor($r('app.color.title_color'))  44 Text('查看更多')  45 .fontSize(14)  46 .fontColor($r('app.color.title_color'))  47 }  48 .width('100%')  49 .justifyContent(FlexAlign.SpaceBetween)  50 .alignItems(VerticalAlign.Bottom)  51 }  52 .width('100%')  53 .margin({  54 top: 10  55 })  56  57 // 第3个模块, 任务进度列表  58 Scroll() {  59 Column({  60 space: 10  61 }) {  62 TaskFlow()  63 TaskFlow()  64 TaskFlow()  65 TaskFlow()  66 TaskFlow()  67 }  68 }  69 .height(250)  70 .width('100%')  71 .margin({  72 top: 10,  73 bottom: 10  74 })  75 .edgeEffect(EdgeEffect.Fade)  76 .scrollable(ScrollDirection.Vertical)  77 .scrollBar(BarState.Off)  78 }  79 .height('100%')  80 .width('100%')  81 .backgroundColor('#f1f3f5')  82 .alignItems(HorizontalAlign.Start)  83 .padding(6)  84  85 Stack({  86 alignContent: Alignment.Center  87 }) {  88 Image($r('app.media.square'))  89 .width(28)  90 Image($r('app.media.square'))  91 .width(28)  92 }  93 .alignRules({  94 right: {  95 anchor: '__container__', align: HorizontalAlign.End  96 },  97 bottom: {  98 anchor: '__container__', align: VerticalAlign.Bottom  99 } 100 }) 101 .offset({ 102 x: -30, 103 y: -80 104 }) 105 } 106 } 107}
import { TaskFlow } from '../view/TaskFlow' import { TaskList } from '../view/TaskList' @Entry @Component struct Page02_TaskList { build() { RelativeContainer() { Column() { /** * 第1个模块, 显示标题 */ Text('你好,小王') .fontSize(30) .fontWeight(FontWeight.Bold) .fontColor($r('app.color.title_color')) Text('每天的工作,都拥有价值') .fontSize(14) .fontColor(Color.Gray) .margin({ top: 6 }) Text('我的计划') .fontSize(26) .fontWeight(FontWeight.Bold) .fontColor($r('app.color.title_color')) .margin({ top: 10 }) // 第2个模块, 显示模块列表 TaskList() // 第3个模块, 当天任务列表 Column() { // 标题板块 Row() { Text('今日任务') .fontSize(26) .fontWeight(FontWeight.Bold) .fontColor($r('app.color.title_color')) Text('查看更多') .fontSize(14) .fontColor($r('app.color.title_color')) } .width('100%') .justifyContent(FlexAlign.SpaceBetween) .alignItems(VerticalAlign.Bottom) } .width('100%') .margin({ top: 10 }) // 第3个模块, 任务进度列表 Scroll() { Column({ space: 10 }) { TaskFlow() TaskFlow() TaskFlow() TaskFlow() TaskFlow() } } .height(250) .width('100%') .margin({ top: 10, bottom: 10 }) .edgeEffect(EdgeEffect.Fade) .scrollable(ScrollDirection.Vertical) .scrollBar(BarState.Off) } .height('100%') .width('100%') .backgroundColor('#f1f3f5') .alignItems(HorizontalAlign.Start) .padding(6) Stack({ alignContent: Alignment.Center }) { Image($r('app.media.square')) .width(28) Image($r('app.media.square')) .width(28) } .alignRules({ right: { anchor: '__container__', align: HorizontalAlign.End }, bottom: { anchor: '__container__', align: VerticalAlign.Bottom } }) .offset({ x: -30, y: -80 }) } } }

Powered By 可尔物语

浙ICP备11005866号-12