ZhGridLayoutComponent.ets 1.18 KB
import { Action, CompDTO, ContentDTO, Params } from 'wdBean';
import { CompStyle } from 'wdConstant';
import { Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';

const TAG = 'Zh_Grid_Layout-03';
const FULL_PARENT: string = '100%';

/**
 * 金刚卡位
 * 枚举值Zh_Grid_Layout-03
 * Zh_Grid_Layout-03
 *
 */
@Entry
@Component
export struct ZhGridLayoutComponent {
  @State compDTO: CompDTO = {} as CompDTO

  aboutToAppear() {
    // Logger.info(TAG + ' comp:'+ JSON.stringify(this.compDTO))
  }

  build() {
    Column() {
      Flex({ wrap: FlexWrap.Wrap,
        justifyContent: FlexAlign.SpaceEvenly,
        alignItems: ItemAlign.End }) {
        ForEach(this.compDTO.operDataList, (item: ContentDTO) => {
          Column() {
            Image(item.coverUrl)
              .width(44)
              .borderRadius(5)
              .aspectRatio(1 / 1)
              .autoResize(true)
            Text(item.newsTitle)
              .fontSize(13)
              .padding({ top: 8 })
          }.height(68).width(75)
        }, (item: ContentDTO) => JSON.stringify(item))
      }
      .backgroundColor(Color.White)
      .padding({
        top: 14,
        bottom: 14
      })
    }
  }
}