Showing
10 changed files
with
59 additions
and
40 deletions
| @@ -163,7 +163,7 @@ function buildErrorMsg(httpStatus: number): string { | @@ -163,7 +163,7 @@ function buildErrorMsg(httpStatus: number): string { | ||
| 163 | if(httpStatus != undefined){ | 163 | if(httpStatus != undefined){ |
| 164 | message = `连接出错(${httpStatus})!`; | 164 | message = `连接出错(${httpStatus})!`; |
| 165 | }else{ | 165 | }else{ |
| 166 | - message = `连接出错!`; | 166 | + message = `网络出小差了,请检查网络后重试`; |
| 167 | } | 167 | } |
| 168 | } | 168 | } |
| 169 | 169 |
| @@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent { | @@ -61,6 +61,7 @@ export struct ImageAndTextPageComponent { | ||
| 61 | @State likeNum: number = 0 | 61 | @State likeNum: number = 0 |
| 62 | @State reachEndIncreament: number = 0 | 62 | @State reachEndIncreament: number = 0 |
| 63 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 63 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 64 | + @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | ||
| 64 | @State isScrollTop: boolean = true | 65 | @State isScrollTop: boolean = true |
| 65 | @State offsetY: number = 0 | 66 | @State offsetY: number = 0 |
| 66 | pageShowTime:number = 0; | 67 | pageShowTime:number = 0; |
| @@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent { | @@ -88,7 +89,7 @@ export struct ImageAndTextPageComponent { | ||
| 88 | action: this.action, | 89 | action: this.action, |
| 89 | isPageEnd: $isPageEnd | 90 | isPageEnd: $isPageEnd |
| 90 | }) | 91 | }) |
| 91 | - .padding({ top: 15, bottom: 10 }) | 92 | + .padding({ bottom: 10 }) |
| 92 | Column() { | 93 | Column() { |
| 93 | // 点赞 | 94 | // 点赞 |
| 94 | if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { | 95 | if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { |
| @@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent { | @@ -159,8 +160,8 @@ export struct ImageAndTextPageComponent { | ||
| 159 | } | 160 | } |
| 160 | .id('imgTextContainer') | 161 | .id('imgTextContainer') |
| 161 | } | 162 | } |
| 163 | + .padding({bottom: 44}) | ||
| 162 | .width(CommonConstants.FULL_WIDTH) | 164 | .width(CommonConstants.FULL_WIDTH) |
| 163 | - .height(CommonConstants.FULL_HEIGHT) | ||
| 164 | .scrollBar(BarState.Off) | 165 | .scrollBar(BarState.Off) |
| 165 | .align(Alignment.Top) | 166 | .align(Alignment.Top) |
| 166 | .onReachEnd(() => { | 167 | .onReachEnd(() => { |
| @@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent { | @@ -174,10 +175,10 @@ export struct ImageAndTextPageComponent { | ||
| 174 | retry: () => { | 175 | retry: () => { |
| 175 | this.getDetail() | 176 | this.getDetail() |
| 176 | } | 177 | } |
| 177 | - }).padding({ bottom: 200 }) | 178 | + }).padding({ bottom: 44 }) |
| 178 | } else { | 179 | } else { |
| 179 | if (!this.isPageEnd) { | 180 | if (!this.isPageEnd) { |
| 180 | - detailedSkeleton().padding({ bottom: this.bottomSafeHeight }) | 181 | + detailedSkeleton().padding({ bottom: 44 }) |
| 181 | } | 182 | } |
| 182 | } | 183 | } |
| 183 | // 底部交互区 | 184 | // 底部交互区 |
| @@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent { | @@ -206,12 +207,10 @@ export struct ImageAndTextPageComponent { | ||
| 206 | this.isScrollTop = !this.isScrollTop | 207 | this.isScrollTop = !this.isScrollTop |
| 207 | } | 208 | } |
| 208 | }) | 209 | }) |
| 209 | - .position({ y: '100%' }) | ||
| 210 | } | 210 | } |
| 211 | + .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`}) | ||
| 211 | .width(CommonConstants.FULL_WIDTH) | 212 | .width(CommonConstants.FULL_WIDTH) |
| 212 | - .height(CommonConstants.FULL_HEIGHT) | ||
| 213 | - .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 214 | - .padding({ top: 38 }) | 213 | + // .height(CommonConstants.FULL_HEIGHT) |
| 215 | 214 | ||
| 216 | // 发布时间 | 215 | // 发布时间 |
| 217 | Column() { | 216 | Column() { |
| @@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent { | @@ -242,6 +241,7 @@ export struct ImageAndTextPageComponent { | ||
| 242 | .backgroundColor(Color.White) | 241 | .backgroundColor(Color.White) |
| 243 | }.backgroundColor(Color.White) | 242 | }.backgroundColor(Color.White) |
| 244 | } | 243 | } |
| 244 | + .margin({top: `${this.topSafeHeight}px`, bottom: `${this.bottomSafeHeight}px`}) | ||
| 245 | .width(CommonConstants.FULL_WIDTH) | 245 | .width(CommonConstants.FULL_WIDTH) |
| 246 | .height(CommonConstants.FULL_HEIGHT) | 246 | .height(CommonConstants.FULL_HEIGHT) |
| 247 | .backgroundColor(Color.White) | 247 | .backgroundColor(Color.White) |
| @@ -239,7 +239,7 @@ struct createImg { | @@ -239,7 +239,7 @@ struct createImg { | ||
| 239 | }) { | 239 | }) { |
| 240 | Stack({alignContent: Alignment.BottomEnd}) { | 240 | Stack({alignContent: Alignment.BottomEnd}) { |
| 241 | Image(this.loadImg ? item.fullUrl : '') | 241 | Image(this.loadImg ? item.fullUrl : '') |
| 242 | - .backgroundColor(0xf5f5f5) | 242 | + .backgroundColor(index === 2 ? 0xffffff : 0xf5f5f5) |
| 243 | .aspectRatio(1) | 243 | .aspectRatio(1) |
| 244 | .width(113) | 244 | .width(113) |
| 245 | .height(113) | 245 | .height(113) |
| @@ -108,7 +108,7 @@ export struct Card9Component { | @@ -108,7 +108,7 @@ export struct Card9Component { | ||
| 108 | // 时间线--后端返回三个, | 108 | // 时间线--后端返回三个, |
| 109 | Column() { | 109 | Column() { |
| 110 | ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | 110 | ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { |
| 111 | - this.timelineItem(item, index) | 111 | + this.timelineItem(item, index, index === this.contentDTO.slideShows.length - 1) |
| 112 | }) | 112 | }) |
| 113 | } | 113 | } |
| 114 | 114 | ||
| @@ -149,25 +149,41 @@ export struct Card9Component { | @@ -149,25 +149,41 @@ export struct Card9Component { | ||
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | @Builder | 151 | @Builder |
| 152 | - timelineItem(item: slideShows, index: number) { | 152 | + timelineItem(item: slideShows, index: number, isLastOne: boolean) { |
| 153 | Column() { | 153 | Column() { |
| 154 | Stack() { | 154 | Stack() { |
| 155 | - if (index < this.contentDTO.slideShows.length - 1) { | 155 | + if (index === 0) { |
| 156 | Divider() | 156 | Divider() |
| 157 | .vertical(true) | 157 | .vertical(true) |
| 158 | .color($r('app.color.color_EDEDED')) | 158 | .color($r('app.color.color_EDEDED')) |
| 159 | .strokeWidth(1) | 159 | .strokeWidth(1) |
| 160 | - .margin({ top: index > 0 ? 0 : 16, left: 4 }) | ||
| 161 | - } | ||
| 162 | - if (index > 0 && index == this.contentDTO.slideShows.length - 1) { | 160 | + .margin({ top: 16, left: 4 }) |
| 161 | + .height(16) | ||
| 162 | + } else { | ||
| 163 | Divider() | 163 | Divider() |
| 164 | .vertical(true) | 164 | .vertical(true) |
| 165 | .color($r('app.color.color_EDEDED')) | 165 | .color($r('app.color.color_EDEDED')) |
| 166 | .strokeWidth(1) | 166 | .strokeWidth(1) |
| 167 | + .margin({ top: 0, left: 4 }) | ||
| 167 | .height(16) | 168 | .height(16) |
| 168 | - .margin({ left: 4 }) | 169 | + if (!isLastOne) |
| 170 | + { | ||
| 171 | + Divider() | ||
| 172 | + .vertical(true) | ||
| 173 | + .color($r('app.color.color_EDEDED')) | ||
| 174 | + .strokeWidth(1) | ||
| 175 | + .margin({ top: 16, left: 4 }) | ||
| 176 | + .height(16) | ||
| 177 | + } | ||
| 169 | } | 178 | } |
| 170 | 179 | ||
| 180 | + // Divider() | ||
| 181 | + // .vertical(true) | ||
| 182 | + // .color($r('app.color.color_EDEDED')) | ||
| 183 | + // .strokeWidth(1) | ||
| 184 | + // .margin({ top: index > 0 ? 0 : 32, left: 4 }) | ||
| 185 | + // .height(16) | ||
| 186 | + | ||
| 171 | Column() { | 187 | Column() { |
| 172 | Row() { | 188 | Row() { |
| 173 | // 标题 | 189 | // 标题 |
| @@ -195,21 +211,14 @@ export struct Card9Component { | @@ -195,21 +211,14 @@ export struct Card9Component { | ||
| 195 | .maxLines(2) | 211 | .maxLines(2) |
| 196 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 212 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 197 | .alignSelf(ItemAlign.Center) | 213 | .alignSelf(ItemAlign.Center) |
| 198 | - .margin({ left: 12 }) | ||
| 199 | - // .padding({bottom: 20}) | ||
| 200 | - // if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 201 | - // Image(this.loadImg? item.fullColumnImgUrls[0].url : '') | ||
| 202 | - // .backgroundColor(0xf5f5f5) | ||
| 203 | - // .width(90) | ||
| 204 | - // .height(60) | ||
| 205 | - // .borderRadius($r('app.float.image_border_radius')) | ||
| 206 | - // } | 214 | + .margin({ left: 4 }) |
| 215 | + .padding({ bottom: 20, left: 12 }) | ||
| 216 | + .border({ width: { left: isLastOne ? 0 : 1 }, color: 0xededed}) | ||
| 207 | } | 217 | } |
| 208 | } | 218 | } |
| 209 | } | 219 | } |
| 210 | .alignContent(Alignment.TopStart) | 220 | .alignContent(Alignment.TopStart) |
| 211 | } | 221 | } |
| 212 | - .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 50) | ||
| 213 | .alignItems(HorizontalAlign.Start) | 222 | .alignItems(HorizontalAlign.Start) |
| 214 | } | 223 | } |
| 215 | } | 224 | } |
| @@ -109,6 +109,7 @@ struct localCard { | @@ -109,6 +109,7 @@ struct localCard { | ||
| 109 | .width('100%') | 109 | .width('100%') |
| 110 | .margin({ bottom: 6 }) | 110 | .margin({ bottom: 6 }) |
| 111 | .flexShrink(0) | 111 | .flexShrink(0) |
| 112 | + .maxLines(1) | ||
| 112 | 113 | ||
| 113 | Text(this.operDataListItem.newsTitle) | 114 | Text(this.operDataListItem.newsTitle) |
| 114 | .width(CommonConstants.FULL_PARENT) | 115 | .width(CommonConstants.FULL_PARENT) |
| @@ -214,12 +214,7 @@ struct MineHomePage { | @@ -214,12 +214,7 @@ struct MineHomePage { | ||
| 214 | .fontWeight('400lpx') | 214 | .fontWeight('400lpx') |
| 215 | .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999')) | 215 | .fontColor(this.isHasIntroduction?$r('app.color.color_222222'):$r('app.color.color_999999')) |
| 216 | .textAlign(TextAlign.Start) | 216 | .textAlign(TextAlign.Start) |
| 217 | - .onClick(()=>{ | ||
| 218 | - let params: editModelParams = { | ||
| 219 | - editContent: this.isHasIntroduction?this.desc:'' | ||
| 220 | - } | ||
| 221 | - WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params) | ||
| 222 | - }) | 217 | + |
| 223 | if(!this.isHasIntroduction){ | 218 | if(!this.isHasIntroduction){ |
| 224 | Image($r('app.media.user_info_edit_icon')) | 219 | Image($r('app.media.user_info_edit_icon')) |
| 225 | .width('27lpx') | 220 | .width('27lpx') |
| @@ -227,7 +222,12 @@ struct MineHomePage { | @@ -227,7 +222,12 @@ struct MineHomePage { | ||
| 227 | .interpolation(ImageInterpolation.High) | 222 | .interpolation(ImageInterpolation.High) |
| 228 | .objectFit(ImageFit.Auto) | 223 | .objectFit(ImageFit.Auto) |
| 229 | } | 224 | } |
| 230 | - } | 225 | + }.onClick(()=>{ |
| 226 | + let params: editModelParams = { | ||
| 227 | + editContent: this.isHasIntroduction?this.desc:'' | ||
| 228 | + } | ||
| 229 | + WDRouterRule.jumpWithPage(WDRouterPage.editUserIntroductionPage,params) | ||
| 230 | + }) | ||
| 231 | 231 | ||
| 232 | 232 | ||
| 233 | Text(`来到人民日报${this.registerTimeForDay}天`) | 233 | Text(`来到人民日报${this.registerTimeForDay}天`) |
| @@ -102,6 +102,7 @@ struct VisitorCommentPage { | @@ -102,6 +102,7 @@ struct VisitorCommentPage { | ||
| 102 | .width('100%') | 102 | .width('100%') |
| 103 | }.width("100%") | 103 | }.width("100%") |
| 104 | .height("100%") | 104 | .height("100%") |
| 105 | + .backgroundColor(Color.White) | ||
| 105 | .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) | 106 | .padding({top:px2vp(this.topSafeHeight),bottom:px2vp(this.bottomSafeHeight)}) |
| 106 | 107 | ||
| 107 | } | 108 | } |
| @@ -115,7 +115,7 @@ struct LaunchAdvertisingPage { | @@ -115,7 +115,7 @@ struct LaunchAdvertisingPage { | ||
| 115 | if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){ | 115 | if (this.defaultModel.linkUrl.length > 0 || this.defaultModel.objectId.length > 0){ |
| 116 | Button(){ | 116 | Button(){ |
| 117 | Row(){ | 117 | Row(){ |
| 118 | - Text('点击跳转至详情') | 118 | + Text(this.defaultModel.isAd == '1'?'点击跳转至详情或第三方应用':'点击跳转至详情') |
| 119 | .fontSize('31lpx') | 119 | .fontSize('31lpx') |
| 120 | .fontColor(Color.White) | 120 | .fontColor(Color.White) |
| 121 | .margin({ | 121 | .margin({ |
| @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter'; | @@ -3,6 +3,7 @@ import { WDRouterRule } from 'wdRouter'; | ||
| 3 | import { WDRouterPage } from 'wdRouter'; | 3 | import { WDRouterPage } from 'wdRouter'; |
| 4 | import { SPHelper } from 'wdKit/Index'; | 4 | import { SPHelper } from 'wdKit/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | +import { CustomToast} from 'wdKit' | ||
| 6 | import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; | 7 | import { ButtonOptions, promptAction, window } from '@kit.ArkUI'; |
| 7 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; | 8 | import { ParamType, TrackConstants, TrackingContent } from 'wdTracking/Index'; |
| 8 | import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife'; | 9 | import { ImageKnifeComponent,ScaleType } from '@ohos/imageknife'; |
| @@ -16,6 +17,16 @@ struct LaunchInterestsHobbiesPage { | @@ -16,6 +17,16 @@ struct LaunchInterestsHobbiesPage { | ||
| 16 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 17 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 17 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 18 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 18 | 19 | ||
| 20 | + dialogToast: CustomDialogController = new CustomDialogController({ | ||
| 21 | + builder: CustomToast({ | ||
| 22 | + msg: '请先选择您感兴趣的内容哦', | ||
| 23 | + }), | ||
| 24 | + autoCancel: false, | ||
| 25 | + alignment: DialogAlignment.Center, | ||
| 26 | + customStyle: true, | ||
| 27 | + maskColor:"#00000000" | ||
| 28 | + }) | ||
| 29 | + | ||
| 19 | aboutToAppear(){ | 30 | aboutToAppear(){ |
| 20 | //请求接口,获取兴趣偏好数据 | 31 | //请求接口,获取兴趣偏好数据 |
| 21 | this.requestInterestsData() | 32 | this.requestInterestsData() |
| @@ -153,11 +164,7 @@ struct LaunchInterestsHobbiesPage { | @@ -153,11 +164,7 @@ struct LaunchInterestsHobbiesPage { | ||
| 153 | .borderRadius('10lpx') | 164 | .borderRadius('10lpx') |
| 154 | .onClick(()=>{ | 165 | .onClick(()=>{ |
| 155 | if (this.selectCount == 0) { | 166 | if (this.selectCount == 0) { |
| 156 | - promptAction.showToast({ | ||
| 157 | - message : '请先选择您感兴趣的内容哦', | ||
| 158 | - duration: 2000, | ||
| 159 | - bottom: '50%', | ||
| 160 | - }) | 167 | + this.dialogToast.open() |
| 161 | return | 168 | return |
| 162 | } | 169 | } |
| 163 | this.saveTagIds() | 170 | this.saveTagIds() |
| @@ -139,6 +139,7 @@ export struct BottomNavigationComponent { | @@ -139,6 +139,7 @@ export struct BottomNavigationComponent { | ||
| 139 | .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) | 139 | .opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY) |
| 140 | } | 140 | } |
| 141 | .zIndex(10) | 141 | .zIndex(10) |
| 142 | + .width('100%') | ||
| 142 | .height($r('app.float.bottom_navigation_barHeight')) | 143 | .height($r('app.float.bottom_navigation_barHeight')) |
| 143 | .hoverEffect(HoverEffect.Highlight) | 144 | .hoverEffect(HoverEffect.Highlight) |
| 144 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 145 | .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
-
Please register or login to post a comment