wwf
4 天以前 7f2343d38fa048f6ce179ea0ab2c1a04f41a213c
entry/src/main/ets/pages/account/AccountPage.ets
@@ -1,6 +1,73 @@
import { ComponentContent, router } from "@kit.ArkUI"
import { PromptActionClass } from '../../utils/PromptActionClass';
class accountListItem {
  title: string = ''
  icon: string | Resource = ''
}
class DialogParams {
  text: string = "";
  constructor(text: string) {
    this.text = text;
  }
}
@Builder
function buildText(params: DialogParams) {
  Column({ space: 12 }) {
    Text('已沟通')
      .width('100%')
      .fontSize(18)
      .fontWeight(700)
      .textAlign(TextAlign.Center)
    Text('4')
      .fontSize(26)
      .fontWeight(700)
      .fontColor('#1761f4')
      .width('100%')
      .textAlign(TextAlign.Center)
    Text('累计沟通岗位数')
      .fontSize(14)
      .fontColor('#666666')
    Text('您是职场中的中流砥柱')
      .width('100%')
      .textAlign(TextAlign.Center)
      .padding(16)
      .fontSize(14)
      .fontColor(Color.Black)
      .fontWeight(500)
      .backgroundColor('#f6f7fa')
  }
  .width(300)
  .padding(20)
  .borderRadius(14)
  .backgroundColor(Color.White)
}
@Builder
function buildText1(params: DialogParams) {
  Column({ space: 12 }) {
    Text('帮助中心')
      .width('100%')
      .fontSize(18)
      .fontWeight(700)
      .fontColor(Color.Black)
      .textAlign(TextAlign.Center)
    Text('400-100-1212')
      .fontSize(26)
      .fontWeight(700)
      .fontColor(Color.Black)
      .width('100%')
      .textAlign(TextAlign.Center)
    Button('拨打电话')
      .width('100%')
      .type(ButtonType.Normal)
      .borderRadius(8)
  }
  .width(300)
  .padding(20)
  .borderRadius(14)
  .backgroundColor(Color.White)
}
@Entry
@@ -12,6 +79,17 @@
    { title: '帮助中心', icon: $r('app.media.account_help') },
    { title: '关于我们', icon: $r('app.media.account_info') },
  ]
  @State dialogMessage: string = '注册成功';
  private ctx: UIContext = this.getUIContext();
  private contentNode: ComponentContent<Object> =
    new ComponentContent(this.ctx, wrapBuilder(buildText), new DialogParams((this.dialogMessage)));
  params: DialogParams = new DialogParams('注册成功')
  aboutToAppear(): void {
    PromptActionClass.setContext(this.ctx);
    PromptActionClass.setContentNode(this.contentNode);
    PromptActionClass.setOptions({ alignment: DialogAlignment.Center, offset: { dx: 0, dy: 0 } });
  }
  build() {
    Column() {
      Text('个人中心')
@@ -50,6 +128,11 @@
            .height(18)
        }
        .width('100%')
        .onClick(() =>{
          router.pushUrl({
            url: ''
          })
        })
        Column({ space: 16 }) {
          Row() {
@@ -132,7 +215,7 @@
            .fontColor(Color.Black)
        }
        Column({ space: 6 }) {
          Image($r('app.media.account_jianli'))
          Image($r('app.media.account_vitae'))
            .width(40)
            .height(40)
          Text('个人简历')
@@ -149,6 +232,12 @@
            .fontWeight(500)
            .fontColor(Color.Black)
        }
        .onClick(() => {
          console.log('点击')
          this.contentNode = new ComponentContent(this.ctx, wrapBuilder(buildText), new DialogParams((this.dialogMessage)));
          PromptActionClass.setContentNode(this.contentNode);
          PromptActionClass.openDialog()
        })
      }
      .width('100%')
      .backgroundColor(Color.White)
@@ -176,6 +265,21 @@
              }
              .width('100%')
              .padding(8)
              .onClick(() => {
                if (item.title == '隐私设置') {
                  router.pushUrl({
                    url: ''
                  })
                } else if (item.title == '消息通知') {
                } else if (item.title == '帮助中心') {
                  this.contentNode = new ComponentContent(this.ctx, wrapBuilder(buildText1), new DialogParams((this.dialogMessage)));
                  PromptActionClass.setContentNode(this.contentNode);
                  PromptActionClass.openDialog()
                } else if (item.title == '关于我们') {
                }
              })
            }
          })
        }