AboutPageUI.ets 2.79 KB
import { Params } from 'wdBean';
import { WDRouterPage, WDRouterRule } from 'wdRouter';
import featureAbility from '@ohos.ability.featureAbility';

const TAG = 'AboutPageUI';

@Component
export  struct AboutPageUI {
  @State listData: Array<string | Array<string>> = ['隐私授权协议', '软件许可及用户协议'];
  @State message: string = '京ICP备16066560号-6A   Copyright © 人民日报客户端\nall rights reserved.'
  @State version: string = '版本号:v'


  build() {
    Navigation() {
      //滑动区域
      this.aboutUi()
    }.titleMode(NavigationTitleMode.Mini)
    .title('关于')
  }

  aboutToAppear(){
    let context = getContext();
    context.getApplicationContext();
  }

  @Builder aboutUi()  {
    Column() {
      Image($r('app.media.setting_about_logo'))
        .width('278lpx')
        .height('154lpx')
        .margin({top:'173lpx',bottom:'154lpx'})

      // Row(){
      //
      // }.backgroundColor(Color.Yellow)
      // .width('100%')
      // .height('97lpx')

      // Row(){
      //
      // }.backgroundColor(Color.Yellow)
      // .width('100%')
      // .height('97lpx')




      List(){
        ForEach(this.listData, (item:string, index : number) =>{
          ListItem() {
            this.getArrowCell(item, index)
          }.onClick(() =>{
            if (index == 0) {
              let bean={contentId:"1",pageID:""} as Params
              WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
            }else{
              let bean={contentId:"2",pageID:""} as Params
              WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage,bean)
            }
          })
        })
      }.divider({
        strokeWidth: 1,
        startMargin: '29lpx',
        endMargin: '29lpx',
        color: '#EDEDED'
      })

      Blank()

      Image($r('app.media.about_us_code'))
        .width('192lpx')
        .height('192lpx')

      Text(this.version)
        .fontSize('25lpx')
        .textAlign(TextAlign.Center)
        .fontColor($r("app.color.color_666666"))
        .margin({bottom:'31lpx'})

      Text(this.message)
        .fontSize('19lpx')
        .textAlign(TextAlign.Center)
        .fontColor($r("app.color.color_999999"))
        .margin({bottom:'35lpx'})
    }
    .width('100%')
    .height('100%')
  }



  // 右文字+箭头cell
  @Builder getArrowCell(item:string, index:number) {

      Row() {
        // 左侧标题
          Text(`${item}`)
            .fontColor('#666666')
            .fontSize('31lpx')

          Image($r('app.media.mine_user_arrow'))
            .width('27lpx')
            .height('27lpx')
            .objectFit(ImageFit.Auto)
      }
      .alignItems(VerticalAlign.Center)
      .justifyContent(FlexAlign.SpaceBetween)
      .height('97lpx')
      .width('100%')
      .padding({left:'29lpx',right:'29lpx'})
  }


}