Преглед на файлове

feat:
1. 调整登录、注册、重置密码页面的样式
2. 新增一些注释

YuJing преди 2 месеца
родител
ревизия
670255b7a1

+ 7 - 3
commons/basic/src/main/ets/components/generalComp/AgreePrivacy.ets

@@ -39,9 +39,13 @@ export function agreePrivacy(item: BasicType<undefined>) {
           item.loginType!.isAgreePrivacy = true
 
           item.loginType?.executeLogin()
-
-
-        }
+        },
+        btlinear: {
+          colors: [ ['#B9FD2A', 0.5], ['#F5FD6D', 1] ],
+          angle: 135
+        },
+        btFontColor: '#212245',
+        btFontSize: 14,
       })
       YTButton({
         btContent: '不同意',

+ 3 - 1
commons/basic/src/main/ets/components/generalComp/YTButton.ets

@@ -10,6 +10,7 @@ export struct YTButton {
   btBorder?: BorderOptions
   btState: boolean = true
   btBorderRadius: Length | BorderRadiuses | LocalizedBorderRadiuses = this.btHeight / 2
+  btlinear?: LinearGradientOptions
 
   click = () => {
 
@@ -18,7 +19,7 @@ export struct YTButton {
   build() {
     Button(this.btContent)
       .buttonStyle(ButtonStyleMode.NORMAL)
-      .fontSize($r(`app.float.page_text_font_size_${this.btFontSize}`))
+      .fontSize(this.btFontSize)
       .fontColor(this.btFontColor)
       .backgroundColor(this.bgc)
       .height(this.btHeight)
@@ -28,5 +29,6 @@ export struct YTButton {
       .border(this.btBorder)
       .enabled(this.btState)
       .borderRadius(this.btBorderRadius)
+      .linearGradient(this.btlinear)
   }
 }

+ 1 - 1
features/feature/src/main/ets/models/BasicDataSource.ets

@@ -1,4 +1,4 @@
-// 拿走即用
+// 《记录》页面中日历使用的懒加载数据源
 export class BasicDataSource<T> implements IDataSource {
   private listeners: DataChangeListener[] = [];
   private dataArray: T[] = [];

+ 5 - 2
features/user/src/main/ets/components/LoginInput.ets

@@ -46,9 +46,12 @@ export struct LoginInput {
         Text(this.time == 61 ? '获取验证码' : this.time + '后重新发送')
           .height(30)
           .fontSize(12)
-          .fontColor(Color.White)
+          .fontColor('#212245')
           .borderRadius(16)
-          .backgroundColor($r('[basic].color.main_ac_color_dark'))
+          .linearGradient({
+            colors: [ ['#B9FD2A', 0.5], ['#F5FD6D', 1] ],
+            angle: 135
+          })
           .onClick(() => {
             this.loginCollect.requestSmsCode((res) => {
               if (res.smsCode) {

+ 1 - 1
features/user/src/main/ets/components/Terms.ets

@@ -4,7 +4,7 @@ import { yTRouter } from 'basic'
 @Extend(Span)
 function spanEx(click: () => void) {
   // .decoration({ type: TextDecorationType.Underline, color: $r('[basic].color.main_ac_color_dark') })
-  .fontColor($r('[basic].color.main_ac_color_dark'))
+  .fontColor($r('[basic].color.main_blank'))
   .onClick(click)
 }
 

+ 37 - 38
features/user/src/main/ets/pages/LoginPage.ets

@@ -3,9 +3,6 @@ import { LoginCollect } from 'basic/src/main/ets/models/LoginCollect'
 import { RegisterOrResetPassComp } from '../views/RegisterOrResetPassView'
 import { LoginView } from '../views/LoginView'
 
-// import { OtherLoginMethods } from '../views/OtherLoginMethods'
-
-
 @Builder
 function LoginBuilder() {
   NavDestination() {
@@ -34,7 +31,7 @@ struct LoginPage {
             .fontWeight(400)
             .alignSelf(ItemAlign.End)
             .textAlign(TextAlign.Center)
-            .fontColor($r('[basic].color.main_ac_color_light'))
+            .fontColor('#3E5100')
             .onClick(() => {
               yTRouter.routerBack()
             })
@@ -47,20 +44,25 @@ struct LoginPage {
             .lineHeight(40)
             .fontSize(28)
             .fontWeight(600)
-            .fontColor($r('[basic].color.main_ac_color_dark'))
+            .fontColor('#0E2E1A')
         }
         .padding({ left: 16, })
         .height(193)
         .width('100%')
         .alignItems(HorizontalAlign.Start)
+      }
+      .padding({ top: this.safeTop })
+      .backgroundImage($r('app.media.loginPage_Bg'))
+      .backgroundImageSize(ImageSize.Cover)
 
+      Column(){
         Row() {
           Text('注册')
             .fontSize(16)
             .fontWeight(600)
             .layoutWeight(1)
-            .fontColor(this.tabBarIndex == 0 || this.tabBarIndex == 2 ? '#FF141111' : '#80141111')
-            .backgroundColor(this.tabBarIndex == 0 || this.tabBarIndex == 2 ? Color.White : Color.Transparent)
+            .fontColor(this.tabBarIndex == 0 ? '#FF141111' : '#80141111')
+            // .backgroundColor(this.tabBarIndex == 0 || this.tabBarIndex == 2 ? 'rgba(255,255,255,0.5)' : Color.Transparent)
             .textAlign(TextAlign.Center)
             .height(48)
             .borderRadius({ topLeft: 12, topRight: 12, bottomRight: this.tabBarIndex == 1 ? 12 : 0 })
@@ -68,19 +70,20 @@ struct LoginPage {
               this.tabBarIndex = 0
               this.tabController.changeIndex(0)
             })
+
           Text('登录')
             .fontSize(16)
             .fontWeight(600)
             .borderRadius({
               topLeft: 12,
               topRight: 12,
-              bottomLeft: this.tabBarIndex == 0 || this.tabBarIndex == 2 ? 12 : 0
+              bottomLeft: this.tabBarIndex == 0 ? 12 : 0
             })
-            .backgroundColor(this.tabBarIndex == 1 ? Color.White : Color.Transparent)
+            // .backgroundColor(this.tabBarIndex == 1 ? 'rgba(255,255,255,0.5)' : Color.Transparent)
             .layoutWeight(1)
             .height(48)
             .textAlign(TextAlign.Center)
-            .fontColor(this.tabBarIndex == 1 ? '#FF141111' : '#80141111')
+            .fontColor(this.tabBarIndex == 1 || this.tabBarIndex == 2 ? '#FF141111' : '#80141111')
             .onClick(() => {
               this.tabBarIndex = 1
               this.tabController.changeIndex(1)
@@ -91,38 +94,35 @@ struct LoginPage {
         .justifyContent(FlexAlign.SpaceBetween)
         .width('100%')
 
-      }
-      .padding({ top: this.safeTop })
-      .linearGradient({ angle: 135, colors: [['#CAE2F9', -0.1571], ['#D4D1F4', 0.4709], ['#EDF5FD', 1.1235]] })
-      .margin({ bottom: 20 })
-
-
-      Tabs({ controller: this.tabController }) {
-        TabContent() {
-          RegisterOrResetPassComp({ loginCollect: new LoginCollect("register") })
+        Tabs({ controller: this.tabController }) {
+          TabContent() {
+            RegisterOrResetPassComp({ loginCollect: new LoginCollect("register") })
 
-        }
-        .padding({ left: 20, right: 20 })
+          }
+          .padding({ left: 20, right: 20 })
 
-        TabContent() {
-          LoginView({
-            forgetPassClick: () => {
-              this.tabBarIndex = 2
-              this.tabController.changeIndex(2)
-            }
-          })
-        }
-        .padding({ left: 20, right: 20 })
+          TabContent() {
+            LoginView({
+              forgetPassClick: () => {
+                this.tabBarIndex = 2
+                this.tabController.changeIndex(2)
+              }
+            })
+          }
+          .padding({ left: 20, right: 20 })
 
-        TabContent() {
-          RegisterOrResetPassComp({ loginCollect: new LoginCollect("reset") })
+          TabContent() {
+            RegisterOrResetPassComp({ loginCollect: new LoginCollect("reset") })
+          }
+          .padding({ left: 20, right: 20 })
         }
-        .padding({ left: 20, right: 20 })
+        .scrollable(false)
+        .layoutWeight(1)
+        .barHeight(0)
+        .padding({top: 20})
       }
-      .scrollable(false)
-      .layoutWeight(1)
-      .barHeight(0)
-
+      .backgroundImage(this.tabBarIndex == 0 ? $r('app.media.loginPage_Bg_left') : $r('app.media.loginPage_Bg_right'))
+      .backgroundImageSize(ImageSize.Contain)
     }
 
     .padding({
@@ -132,4 +132,3 @@ struct LoginPage {
     .height('100%')
   }
 }
-

+ 19 - 6
features/user/src/main/ets/views/LoginView.ets

@@ -73,7 +73,8 @@ export struct LoginView {
           inputChange: (value: string) => {
             this.loginCollect.smsCode = value
           },
-          marginBottom: 19
+          marginBottom: 19,
+
         })
       }
 
@@ -86,7 +87,7 @@ export struct LoginView {
       Row() {
         if (!this.isPassword) {
           Text('密码登录')
-            .fontColor($r('[basic].color.main_ac_color_dark'))
+            .fontColor($r('[basic].color.main_blank'))
             .fontSize(12)
             .fontWeight(700)
             .onClick(() => {
@@ -95,7 +96,7 @@ export struct LoginView {
           Blank()
         } else {
           Text('验证码登录')
-            .fontColor($r('[basic].color.main_ac_color_dark'))
+            .fontColor($r('[basic].color.main_blank'))
             .fontWeight(700)
             .fontSize(12)
             .onClick(() => {
@@ -103,7 +104,7 @@ export struct LoginView {
             })
           Blank()
           Text('忘记密码?')
-            .fontColor($r('[basic].color.main_ac_color_dark'))
+            .fontColor($r('[basic].color.main_blank'))
             .fontSize(12)
             .fontWeight(700)
             .onClick(() => {
@@ -119,12 +120,24 @@ export struct LoginView {
         btContent: '登录',
         click: () => {
           this.loginCollect.executeLogin("common")
-        }
+        },
+        btFontColor: Color.Black,
+        btFontSize: 18,
+        btlinear: {
+          colors: [ ['#B9FD2A', 0.5], ['#F5FD6D', 1] ],
+          angle: 135
+        },
+        btPadding: {
+          top: 12,
+          bottom: 12,
+        },
+        btHeight: 48
       })
 
 
+
       Text('未注册的手机号码登陆后将自动注册')
-        .fontColor($r('[basic].color.main_ac_color_dark'))
+        .fontColor($r('[basic].color.main_blank'))
         .fontSize(12)
         .margin({ top: 16, bottom: 56 })
         .alignSelf(ItemAlign.Start)

+ 13 - 2
features/user/src/main/ets/views/RegisterOrResetPassView.ets

@@ -76,12 +76,23 @@ export struct RegisterOrResetPassComp {
         click: () => {
           this.loginCollect.executeLogin("common")
         },
-        btBorderRadius: 32
+        btBorderRadius: 32,
+        btlinear: {
+          colors: [ ['#B9FD2A', 0.5], ['#F5FD6D', 1] ],
+          angle: 135
+        },
+        btPadding: {
+          top: 12,
+          bottom: 12,
+        },
+        btHeight: 48,
+        btFontColor: Color.Black,
+        btFontSize: 18
       })
 
       Text('注册成功后将自动登录')
         .fontSize(10)
-        .fontColor($r('[basic].color.main_ac_color_dark'))
+        .fontColor($r('[basic].color.main_blank'))
         .margin({ top: 16 })
     }
     .width('100%')

BIN
features/user/src/main/resources/base/media/loginPage_Bg.png


BIN
features/user/src/main/resources/base/media/loginPage_Bg_left.png


BIN
features/user/src/main/resources/base/media/loginPage_Bg_right.png