HarmonyOS-记账本-统计卡片

今天完成标题与统计卡片

import { CommonConstants } from '../../common/constants/CommonConstants'
@Component
export default struct header {
  build() {
    Row(){
      Text('阳的记账本')
        .fontWeight(500)
        .fontColor('#FF6600')
        .fontSize(25)
    }
    .width(CommonConstants.THOUSANDTH_940)
    . justifyContent(FlexAlign.Center)
    .padding({top:20})

  }
}
import { CommonConstants } from '../../common/constants/CommonConstants'
import DateUtil from '../../common/utils/DateUtil'
import Accountant from './Accountant'
import DatePick from  './DatePick'
import RecordList from './RecordList'
@Component
export default struct StatsCard {
  @StorageProp('selectedDate') selectedDate :number = DateUtil.beginTimeOfDay(new Date())
  controller:CustomDialogController = new CustomDialogController({
    builder:DatePick({selectedDate:new Date(this.selectedDate)})
  })
  build() {
    Column(){
      //1.日期信息
      Row(){
        Text(DateUtil.formatDate(this.selectedDate))
          .fontColor('#ff6600')
        Image($r('app.media.ic_public_spinner'))
          .width(20)
          .fillColor('#ff6600')
      }
      .padding(CommonConstants.SPACE_12)
      .onClick(()=> this.controller.open())

      //2.统计信息
      Accountant()


    }
    .width(CommonConstants.THOUSANDTH_940)
    .backgroundColor('#ffcc99')
    .borderRadius(CommonConstants.DEFAULT_18)
  }
}

 

posted @ 2024-02-22 20:42  菜鸟de博客  阅读(22)  评论(0)    收藏  举报