瀏覽代碼

首页,入库,出库,底部和头部组件修改

yixiaojun 1 年之前
父節點
當前提交
8cb86b3034
共有 1 個文件被更改,包括 67 次插入2 次删除
  1. 67 2
      entry/src/main/ets/common/component/BottomOperateComp.ets

+ 67 - 2
entry/src/main/ets/common/component/BottomOperateComp.ets

@@ -1,11 +1,60 @@
 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
   //弹窗
@@ -17,6 +66,16 @@ export struct BottomOperateComp {
       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() {
@@ -65,6 +124,12 @@ export struct BottomOperateComp {
             url:'pages/SmartFactory'
           })
         })
+        .gesture(
+          LongPressGesture({ repeat: false })
+            .onActionEnd(() => {
+             this.SmartFactoryCardDialogController.open()
+            })
+        )
 
         Row(){
           Image($r('app.media.page_flow'))
@@ -88,9 +153,9 @@ export struct BottomOperateComp {
         //   .height($r('app.float.general_icon_size'))
         //   .width($r('app.float.general_icon_size'))
       }
-      .width('36%')
+      .width('100%')
       .height('100%')
-      .justifyContent(FlexAlign.SpaceEvenly)
+      .justifyContent(FlexAlign.Center)
     }
     .width('100%')
     .height('8%')