import router from '@ohos.router' import NoticeInfo from '../../model/NoticeInfo' @CustomDialog struct factoryCardDialog { @Link SmartFactoryCardDelete:number controller: CustomDialogController cancel: () => void confirm: () => void build(){ Column(){ Column(){ Text('卡片服务') .margin(px2vp(5)) .width('100%') .fontWeight(FontWeight.Medium) .fontSize(px2vp(38)) .height('50%') .textAlign(TextAlign.Start) .onClick(()=>{ this.controller.close() this.SmartFactoryCardDelete=0 }) Divider().width('80%') Text('删除卡片') .height('50%') .margin(px2vp(5)) .width('100%') .fontWeight(FontWeight.Medium) .fontSize(px2vp(38)) .textAlign(TextAlign.Start) .onClick(()=>{ this.SmartFactoryCardDelete=1 this.controller.close() }) } .borderRadius(px2vp(15)) .width('100%') .height('40%') .backgroundColor($r('app.color.process_divider_white_color')) Image($r('app.media.jg_circular_icon')) .width(px2vp(150)) .height(px2vp(150)) .borderRadius(15) } .alignItems(HorizontalAlign.Start) .width('10%') .height('30%') } } /* * 底部操作栏 * */ @Component export struct BottomOperateComp { @Link SmartFactoryCardDelete:number private isHomePage?: boolean = false @State isClick:boolean = false //弹窗 dialogController: CustomDialogController = new CustomDialogController({ builder: NoticeDialog({}), alignment: DialogAlignment.Center, customStyle:true, cancel:()=>{ this.isClick =! this.isClick } }) SmartFactoryCardDialogController: CustomDialogController = new CustomDialogController({ builder:factoryCardDialog({ SmartFactoryCardDelete:this.SmartFactoryCardDelete } ), alignment: DialogAlignment.Bottom, autoCancel:true, customStyle:true, offset: { dx: 20, dy: 50 } }) build() { Stack() { Text() .width('100%') .height('100%') .backgroundColor($r('app.color.bottom_bar_background')) .opacity(this.isHomePage ? $r('app.float.bottom_bar_home_page_opacity') : $r('app.float.bottom_bar_general_opacity')) .backdropBlur(this.isHomePage ? 13 : 0) Row() { Row () { Image($r('app.media.home_page')) .height($r('app.float.robot_image_select_size')) .width($r('app.float.robot_image_select_size')) } .height('100%') .width('7%') .justifyContent(FlexAlign.Center) .onClick(()=>{ router.replaceUrl({ url:'pages/Index' }) }) Row(){ Image($r('app.media.notice')) .height($r('app.float.robot_image_select_size')) .width($r('app.float.robot_image_select_size')) } .height('100%') .width('7%') .justifyContent(FlexAlign.Center) Row(){ Image($r('app.media.jg_circular_icon')) .height($r('app.float.storage_space_set_size')) .width($r('app.float.storage_space_set_size')) } .height('100%') .width('7%') .justifyContent(FlexAlign.Center) .onClick(()=>{ router.pushUrl({ url:'pages/SmartFactory' }) }) .gesture( LongPressGesture({ repeat: false }) .onActionEnd(() => { this.SmartFactoryCardDialogController.open() }) ) Row(){ Image($r('app.media.page_flow')) .height($r('app.float.robot_image_select_size')) .width($r('app.float.robot_image_select_size')) } .height('100%') .width('7%') .justifyContent(FlexAlign.Center) Row(){ Image($r('app.media.camera')) .height($r('app.float.robot_image_select_size')) .width($r('app.float.robot_image_select_size')) } .height('100%') .width('7%') .justifyContent(FlexAlign.Center) // Image($r('app.media.volume')) // .height($r('app.float.general_icon_size')) // .width($r('app.float.general_icon_size')) } .width('100%') .height('100%') .justifyContent(FlexAlign.Center) } .width('100%') .height('8%') } } //弹窗组件 @CustomDialog struct NoticeDialog { controller: CustomDialogController Notices: NoticeInfo[] build() { Column({space: 10}) { Row() { Text('通知') .fontSize($r('app.float.notice_font_size')) .fontWeight(FontWeight.Medium) .fontColor($r('app.color.general_font_color')) .opacity($r('app.float.general_font_opacity')) } Row(){ List(){ ForEach(this.Notices, (item:NoticeInfo) => { ListItem(){ Row(){ Text(item.Notice) .fontSize($r('app.float.notice_fontSize_size')) .fontColor($r('app.color.general_font_color')) .opacity($r('app.float.general_font_opacity')) Text(item.NoticeDate) .fontSize($r('app.float.notice_fontSize_size')) .fontColor($r('app.color.general_font_color')) .opacity($r('app.float.card_font_default_opacity')) } .justifyContent(FlexAlign.SpaceBetween) .width('100%') } }) } } .width('90%') .height('80%') .alignItems(VerticalAlign.Top) .borderRadius($r('app.float.notice_size')) .borderWidth($r('app.float.general_border_width')) .borderColor($r('app.color.general_border_color')) } .width('45%') .height('70%') .justifyContent(FlexAlign.Center) .backgroundColor($r('app.color.page_general_background')) .borderRadius($r('app.float.notice_size')) } }