123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- 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'))
- }
- }
|