Ver código fonte

修改首页名称

hh 1 semana atrás
pai
commit
9fdce8aa46

+ 1 - 1
entry/src/main/ets/common/constants/CommonConstants.ets

@@ -9,7 +9,7 @@ export default class CommonConstants {
   static FILE_URL_PREFIX: string = 'http://192.168.1.3:9000'
 
   // 当前登录用户相关信息
-  static USER_ID?: number = 1
+  static USER_ID?: number
   static USER_NAME: string = ''
   static USER_AVATAR: string = ''
   static STATION_NANE: string = ''

+ 1 - 1
entry/src/main/ets/entryability/EntryAbility.ets

@@ -40,7 +40,7 @@ export default class EntryAbility extends UIAbility {
       windowClass.setWindowLayoutFullScreen(true)
     })
 
-    windowStage.loadContent('pages/Index', (err) => {
+    windowStage.loadContent('pages/ProcessIndex', (err) => {
       if (err.code) {
         hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
         return;

+ 7 - 1
entry/src/main/ets/pages/Index.ets

@@ -13,7 +13,7 @@ import promptAction from '@ohos.promptAction';
 
 @Entry
 @Component
-struct Index {
+struct ProcessIndex {
   // 工单列表
   @State workOrders: WorkOrderInfo[] = []
   // 选中工单
@@ -291,6 +291,7 @@ struct Index {
           .height('77.2%')
           .backgroundColor($r('app.color.20FFFFFF'))
           .borderRadius($r('app.float.fontSize_16'))
+          .opacity(!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID ? 0.3 : 1)
         }
         .height('100%')
         .width('19.8%')
@@ -389,6 +390,7 @@ struct Index {
         .justifyContent(FlexAlign.Center)
         .backgroundColor($r('app.color.20FFFFFF'))
         .borderRadius($r('app.float.fontSize_16'))
+        .opacity(!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID ? 0.3 : 1)
       }
       .height('80%')
       .width('94.8%')
@@ -494,6 +496,9 @@ struct Index {
           .backgroundColor($r('app.color.20FFFFFF'))
           .borderRadius($r('app.float.fontSize_16'))
           .onClick(()=>{
+            if (!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID) {
+              return
+            }
             this.switchingProductDialogController.open()
           })
           Row().width('1.5%')
@@ -516,6 +521,7 @@ struct Index {
         .height('90.6%')
         .width('100%')
         .padding({left: '2.6%', right: '2.6%'})
+        .opacity(!this.seqNo || !CommonConstants.USER_ID || !CommonConstants.STATION_ID ? 0.3 : 1)
       }
       .width('100%')
       .height('9.8%')

+ 1 - 1
entry/src/main/resources/base/profile/main_pages.json

@@ -1,5 +1,5 @@
 {
   "src": [
-    "pages/Index"
+    "pages/ProcessIndex"
   ]
 }