Browse Source

更改view结构至entry

wangcy 4 months ago
parent
commit
72b7f38cbc

+ 0 - 1
features/user/Index.ets

@@ -1 +0,0 @@
-export { Mine } from './src/main/ets/views/Mine';

+ 7 - 4
products/entry/src/main/ets/pages/Index.ets

@@ -1,5 +1,8 @@
 import { BasicType, YtAvoid, yTRouter, yTToast } from 'basic';
-import { Mine } from 'user';
+import { Mine } from '../views/Mine';
+import { MainView } from '../views/MineView';
+import { View2 } from '../views/View2';
+import { View3 } from '../views/View3';
 
 @Entry
 @Component
@@ -46,11 +49,11 @@ struct Index {
             TabContent() {
               if (index == 0) {
                 //放对应组件
-                Text(_.text)
+                MainView()
               } else if (index == 1) {
-                Text(_.text)
+                View2()
               } else if (index == 2) {
-                Text(_.text)
+                View3()
               } else {
                 Mine()
               }

+ 7 - 7
features/user/src/main/ets/views/Mine.ets → products/entry/src/main/ets/views/Mine.ets

@@ -16,21 +16,21 @@ export struct Mine {
         }
 
       },
-      src: $r('app.media.right_arrow')
+      src: $r('[user].media.right_arrow')
     },
     {
       text: '给个好评',
       click: () => {
 
       },
-      src: $r('app.media.right_arrow')
+      src: $r('[user].media.right_arrow')
     },
     {
       text: '关于我们',
       click: () => {
         yTRouter.router2AboutUS()
       },
-      src: $r('app.media.right_arrow')
+      src: $r('[user].media.right_arrow')
     }
   ]
 
@@ -49,7 +49,7 @@ export struct Mine {
               .borderRadius(20)
               .margin({ right: 9 })
           } else {
-            Image($r('app.media.app_icon'))
+            Image($r('[user].media.app_icon'))
               .width(50)
               .height(40)
               .margin({ right: 9 })
@@ -62,7 +62,7 @@ export struct Mine {
               .fontColor('#FF000000')
             Text() {
               Span('ID:' + (this.userInfo.getId()?.toString().padStart(8, '0') ?? '00000000'))
-              ImageSpan($r('app.media.copy'))
+              ImageSpan($r('[user].media.copy'))
                 .width(7)
                 .height(8)
                 .margin({ left: 4 })
@@ -102,12 +102,12 @@ export struct Mine {
                   Text(this.userInfo.getAiNum()?.toString() ?? '')
                     .fontWeight(600)
                     .fontSize($r('[basic].float.page_text_font_size_14'))
-                  Image($r('app.media.right_arrow'))
+                  Image($r('[user].media.right_arrow'))
                     .width(24)
                     .aspectRatio(1)
                 }
               } else {
-                Image($r('app.media.right_arrow'))
+                Image($r('[user].media.right_arrow'))
                   .width(24)
                   .aspectRatio(1)
               }

+ 6 - 0
products/entry/src/main/ets/views/MineView.ets

@@ -0,0 +1,6 @@
+@Component
+export struct MainView {
+  build() {
+    Text('1')
+  }
+}

+ 6 - 0
products/entry/src/main/ets/views/View2.ets

@@ -0,0 +1,6 @@
+@Component
+export struct View2 {
+  build() {
+    Text('2')
+  }
+}

+ 6 - 0
products/entry/src/main/ets/views/View3.ets

@@ -0,0 +1,6 @@
+@Component
+export struct View3 {
+  build() {
+    Text('3')
+  }
+}