Showing
2 changed files
with
45 additions
and
31 deletions
| @@ -5,44 +5,53 @@ export struct CustomTitleUI { | @@ -5,44 +5,53 @@ export struct CustomTitleUI { | ||
| 5 | imgBack:boolean = true | 5 | imgBack:boolean = true |
| 6 | titleName:ResourceStr = "默认标题" | 6 | titleName:ResourceStr = "默认标题" |
| 7 | @Prop percent:number = 1 | 7 | @Prop percent:number = 1 |
| 8 | + isShowBottomLine:boolean = false | ||
| 8 | 9 | ||
| 9 | build() { | 10 | build() { |
| 10 | - RelativeContainer() { | ||
| 11 | - //标题栏目 | ||
| 12 | - if(this.imgBack){ | ||
| 13 | - Image($r('app.media.back_icon')) | ||
| 14 | - .width(24) | ||
| 15 | - .height(24) | ||
| 16 | - .objectFit(ImageFit.Auto) | ||
| 17 | - .interpolation(ImageInterpolation.High) | ||
| 18 | - .id("back_icon") | 11 | + Column(){ |
| 12 | + RelativeContainer() { | ||
| 13 | + //标题栏目 | ||
| 14 | + if(this.imgBack){ | ||
| 15 | + Image($r('app.media.back_icon')) | ||
| 16 | + .width(24) | ||
| 17 | + .height(24) | ||
| 18 | + .objectFit(ImageFit.Auto) | ||
| 19 | + .interpolation(ImageInterpolation.High) | ||
| 20 | + .id("back_icon") | ||
| 21 | + .alignRules({ | ||
| 22 | + center: {anchor: "__container__", align: VerticalAlign.Center}, | ||
| 23 | + left: {anchor: "__container__", align: HorizontalAlign.Start} | ||
| 24 | + }) | ||
| 25 | + .margin({left: 16}) | ||
| 26 | + .onClick(()=>{ | ||
| 27 | + router.back() | ||
| 28 | + }) | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + Text(this.titleName) | ||
| 32 | + .maxLines(1) | ||
| 33 | + .id("title") | ||
| 34 | + .fontFamily('PingFang SC-Regular') | ||
| 35 | + .fontSize(18) | ||
| 36 | + .fontWeight(400) | ||
| 37 | + .fontColor($r('app.color.color_222222')) | ||
| 38 | + .lineHeight(26) | ||
| 19 | .alignRules({ | 39 | .alignRules({ |
| 20 | center: {anchor: "__container__", align: VerticalAlign.Center}, | 40 | center: {anchor: "__container__", align: VerticalAlign.Center}, |
| 21 | - left: {anchor: "__container__", align: HorizontalAlign.Start} | ||
| 22 | - }) | ||
| 23 | - .margin({left: 16}) | ||
| 24 | - .onClick(()=>{ | ||
| 25 | - router.back() | 41 | + middle: {anchor: "__container__", align: HorizontalAlign.Center} |
| 26 | }) | 42 | }) |
| 27 | - } | ||
| 28 | 43 | ||
| 29 | - Text(this.titleName) | ||
| 30 | - .maxLines(1) | ||
| 31 | - .id("title") | ||
| 32 | - .fontFamily('PingFang SC-Regular') | ||
| 33 | - .fontSize(18) | ||
| 34 | - .fontWeight(400) | ||
| 35 | - .fontColor($r('app.color.color_222222')) | ||
| 36 | - .lineHeight(26) | ||
| 37 | - .alignRules({ | ||
| 38 | - center: {anchor: "__container__", align: VerticalAlign.Center}, | ||
| 39 | - middle: {anchor: "__container__", align: HorizontalAlign.Center} | ||
| 40 | - }) | 44 | + } |
| 45 | + .height(44) | ||
| 46 | + .width('100%') | ||
| 47 | + .backgroundColor($r('app.color.white')) | ||
| 41 | 48 | ||
| 49 | + if(this.isShowBottomLine){ | ||
| 50 | + Text().backgroundColor($r('app.color.color_EDEDED')) | ||
| 51 | + .width('100%') | ||
| 52 | + .height(1) | ||
| 53 | + } | ||
| 42 | } | 54 | } |
| 43 | - .height(44) | ||
| 44 | - .width('100%') | ||
| 45 | - .backgroundColor($r('app.color.white')) | ||
| 46 | } | 55 | } |
| 47 | 56 | ||
| 48 | calcHeight(value:number): number{ | 57 | calcHeight(value:number): number{ |
| @@ -70,7 +70,12 @@ struct LoginProtocolWebview { | @@ -70,7 +70,12 @@ struct LoginProtocolWebview { | ||
| 70 | } | 70 | } |
| 71 | .alignItems(VerticalAlign.Center) | 71 | .alignItems(VerticalAlign.Center) |
| 72 | .width('100%') | 72 | .width('100%') |
| 73 | - .height(44) | 73 | + .height(43) |
| 74 | + | ||
| 75 | + Text().backgroundColor("#EDEDED") | ||
| 76 | + .width('100%') | ||
| 77 | + .height(1) | ||
| 78 | + | ||
| 74 | if(this.isConnectNetwork){ | 79 | if(this.isConnectNetwork){ |
| 75 | Web({ src: this.webUrl, controller: this.webviewController }) | 80 | Web({ src: this.webUrl, controller: this.webviewController }) |
| 76 | .backgroundColor(Color.White) | 81 | .backgroundColor(Color.White) |
-
Please register or login to post a comment