Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix: 18829 【必现】搜索结果-展开更多样式卡,点击多次后客户端闪退 fix: 18755 0评-搜索结果页中评论数为0的数据未能隐藏评论 ref |> 解决定位权限弹框提示问题 图集滑动优化 频道列表点击已下线视频,未展示内容找不到了缺省页,而是推荐其它视频播放
Showing
7 changed files
with
355 additions
and
318 deletions
| @@ -151,7 +151,7 @@ export struct CardSourceInfo { | @@ -151,7 +151,7 @@ export struct CardSourceInfo { | ||
| 151 | .flexShrink(0) | 151 | .flexShrink(0) |
| 152 | .margin({right: 4}) | 152 | .margin({right: 4}) |
| 153 | } | 153 | } |
| 154 | - if (this.getContentDtoBean()?.interactData?.commentNum && this.showCommentNum()) { | 154 | + if (Number(this.getContentDtoBean()?.interactData?.commentNum) > 0 && this.showCommentNum()) { |
| 155 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) | 155 | Text(`${this.handlerNum(this.getContentDtoBean()?.interactData?.commentNum.toString())}评`) |
| 156 | .fontSize($r("app.float.font_size_11")) | 156 | .fontSize($r("app.float.font_size_11")) |
| 157 | .fontColor($r("app.color.color_B0B0B0")) | 157 | .fontColor($r("app.color.color_B0B0B0")) |
| @@ -291,7 +291,7 @@ export struct SearchResultContentComponent { | @@ -291,7 +291,7 @@ export struct SearchResultContentComponent { | ||
| 291 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 291 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 292 | } | 292 | } |
| 293 | } else { | 293 | } else { |
| 294 | - if(this.data.get(index + 1).sameContentListSize > 0) { | 294 | + if(this.data?.get(index + 1)?.sameContentListSize > 0) { |
| 295 | Divider() | 295 | Divider() |
| 296 | .width('100%') | 296 | .width('100%') |
| 297 | .color($r('app.color.color_F5F5F5')) | 297 | .color($r('app.color.color_F5F5F5')) |
| @@ -129,6 +129,7 @@ export struct EmptyComponent { | @@ -129,6 +129,7 @@ export struct EmptyComponent { | ||
| 129 | .fontWeight(FontWeight.Normal) | 129 | .fontWeight(FontWeight.Normal) |
| 130 | .opacity(this.TEXT_OPACITY) | 130 | .opacity(this.TEXT_OPACITY) |
| 131 | .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) | 131 | .margin({ top: this.EMPTY_TIP_TEXT_MARGIN_TOP }) |
| 132 | + .fontColor(this.emptyType !== 15 ? '#FFCCCCCC' : '#999999') | ||
| 132 | .onClick((event: ClickEvent) => { | 133 | .onClick((event: ClickEvent) => { |
| 133 | Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); | 134 | Logger.info(TAG, `noProgrammeData onClick event?.source: ${event.source}`); |
| 134 | }) | 135 | }) |
| @@ -36,6 +36,7 @@ export struct DetailVideoListPage { | @@ -36,6 +36,7 @@ export struct DetailVideoListPage { | ||
| 36 | @State data: ContentDetailDTO[] = [] | 36 | @State data: ContentDetailDTO[] = [] |
| 37 | @State currentIndex: number = 0 | 37 | @State currentIndex: number = 0 |
| 38 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 | 38 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 |
| 39 | + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图 | ||
| 39 | @State interactDataList: InteractDataDTO[] = [] | 40 | @State interactDataList: InteractDataDTO[] = [] |
| 40 | pageShowTime:number = 0; | 41 | pageShowTime:number = 0; |
| 41 | pageHideTime:number = 0; | 42 | pageHideTime:number = 0; |
| @@ -140,6 +141,7 @@ export struct DetailVideoListPage { | @@ -140,6 +141,7 @@ export struct DetailVideoListPage { | ||
| 140 | relType: relType | 141 | relType: relType |
| 141 | }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | 142 | }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { |
| 142 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | 143 | console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) |
| 144 | + this.isOffLine = resDTO.data == null ? true : false | ||
| 143 | if (resDTO.data) { | 145 | if (resDTO.data) { |
| 144 | const params: contentListParams = { | 146 | const params: contentListParams = { |
| 145 | contentList: [{ | 147 | contentList: [{ |
| @@ -202,7 +204,7 @@ export struct DetailVideoListPage { | @@ -202,7 +204,7 @@ export struct DetailVideoListPage { | ||
| 202 | build() { | 204 | build() { |
| 203 | if (this.netStatus !== undefined) { | 205 | if (this.netStatus !== undefined) { |
| 204 | EmptyComponent({ | 206 | EmptyComponent({ |
| 205 | - emptyType: this.netStatus, emptyButton: true, retry: () => { | 207 | + emptyType: 1, emptyButton: true, retry: () => { |
| 206 | this.getContentDetail(this.contentId, this.relId, this.relType) | 208 | this.getContentDetail(this.contentId, this.relId, this.relType) |
| 207 | } | 209 | } |
| 208 | }) | 210 | }) |
| @@ -211,6 +213,18 @@ export struct DetailVideoListPage { | @@ -211,6 +213,18 @@ export struct DetailVideoListPage { | ||
| 211 | center: { anchor: "__container__", align: VerticalAlign.Center }, | 213 | center: { anchor: "__container__", align: VerticalAlign.Center }, |
| 212 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 214 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 213 | }) | 215 | }) |
| 216 | + } else if (this.isOffLine) { | ||
| 217 | + EmptyComponent({ | ||
| 218 | + emptyType: 15, emptyButton: true, retry: () => { | ||
| 219 | + this.getContentDetail(this.contentId, this.relId, this.relType) | ||
| 220 | + } | ||
| 221 | + }) | ||
| 222 | + .id('e_empty_content') | ||
| 223 | + .alignRules({ | ||
| 224 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 225 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 226 | + }) | ||
| 227 | + .backgroundColor(Color.Black) | ||
| 214 | } else { | 228 | } else { |
| 215 | Column() { | 229 | Column() { |
| 216 | Swiper(this.swiperController) { | 230 | Swiper(this.swiperController) { |
| @@ -11,17 +11,5 @@ | @@ -11,17 +11,5 @@ | ||
| 11 | "compressNativeLibs": true, | 11 | "compressNativeLibs": true, |
| 12 | "deliveryWithInstall": true, | 12 | "deliveryWithInstall": true, |
| 13 | "pages": "$profile:main_pages", | 13 | "pages": "$profile:main_pages", |
| 14 | - "requestPermissions": [ | ||
| 15 | - { | ||
| 16 | - "name": "ohos.permission.APPROXIMATELY_LOCATION", | ||
| 17 | - "reason": "$string:location_reason", | ||
| 18 | - "usedScene": { | ||
| 19 | - "abilities": [ | ||
| 20 | - "FormAbility" | ||
| 21 | - ], | ||
| 22 | - "when": "inuse" | ||
| 23 | - } | ||
| 24 | - } | ||
| 25 | - ] | ||
| 26 | } | 14 | } |
| 27 | } | 15 | } |
| 1 | -import { LogoutViewModel, PermissionDesComponent } from 'wdComponent'; | 1 | +import { LogoutViewModel } from 'wdComponent'; |
| 2 | import { BreakpointConstants } from 'wdConstant'; | 2 | import { BreakpointConstants } from 'wdConstant'; |
| 3 | 3 | ||
| 4 | -import { common } from '@kit.AbilityKit'; | ||
| 5 | import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit'; | 4 | import { BreakpointSystem, EmitterEventId, EmitterUtils, Logger, MpaasUpgradeCheck, WindowModel } from 'wdKit'; |
| 6 | import { promptAction, window } from '@kit.ArkUI'; | 5 | import { promptAction, window } from '@kit.ArkUI'; |
| 7 | import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog" | 6 | import { UpgradeTipDialog } from "./upgradePage/UpgradeTipDialog" |
| @@ -20,7 +19,6 @@ struct MainPage { | @@ -20,7 +19,6 @@ struct MainPage { | ||
| 20 | private breakpointSystem: BreakpointSystem = new BreakpointSystem() | 19 | private breakpointSystem: BreakpointSystem = new BreakpointSystem() |
| 21 | @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = | 20 | @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = |
| 22 | BreakpointConstants.BREAKPOINT_XS; | 21 | BreakpointConstants.BREAKPOINT_XS; |
| 23 | - @State isPermission: boolean = false | ||
| 24 | upgradeDialogController?: CustomDialogController | 22 | upgradeDialogController?: CustomDialogController |
| 25 | 23 | ||
| 26 | watchCurrentBreakpoint() { | 24 | watchCurrentBreakpoint() { |
| @@ -37,9 +35,6 @@ struct MainPage { | @@ -37,9 +35,6 @@ struct MainPage { | ||
| 37 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { | 35 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { |
| 38 | LogoutViewModel.clearLoginInfo() | 36 | LogoutViewModel.clearLoginInfo() |
| 39 | }) | 37 | }) |
| 40 | - EmitterUtils.receiveEvent(EmitterEventId.LOCATION, () => { | ||
| 41 | - this.isPermission = true | ||
| 42 | - }) | ||
| 43 | } | 38 | } |
| 44 | 39 | ||
| 45 | pageTransition() { | 40 | pageTransition() { |
| @@ -114,9 +109,6 @@ struct MainPage { | @@ -114,9 +109,6 @@ struct MainPage { | ||
| 114 | build() { | 109 | build() { |
| 115 | Stack({ alignContent: Alignment.Top }) { | 110 | Stack({ alignContent: Alignment.Top }) { |
| 116 | BottomNavigationComponent() | 111 | BottomNavigationComponent() |
| 117 | - if (this.isPermission) { | ||
| 118 | - PermissionDesComponent() | ||
| 119 | - } | ||
| 120 | } | 112 | } |
| 121 | } | 113 | } |
| 122 | } | 114 | } |
| @@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent { | @@ -55,6 +55,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 55 | @Provide showCommentList: boolean = false | 55 | @Provide showCommentList: boolean = false |
| 56 | private scroller: Scroller = new Scroller() | 56 | private scroller: Scroller = new Scroller() |
| 57 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 | 57 | @State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图 |
| 58 | + @State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图 | ||
| 58 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 | 59 | @State showDownload: Boolean = false // 控制是否显示下载默认隐藏 |
| 59 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 60 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 60 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | 61 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] |
| @@ -113,7 +114,32 @@ export struct MultiPictureDetailPageComponent { | @@ -113,7 +114,32 @@ export struct MultiPictureDetailPageComponent { | ||
| 113 | 114 | ||
| 114 | build() { | 115 | build() { |
| 115 | RelativeContainer() { | 116 | RelativeContainer() { |
| 116 | - this.init() | 117 | + if (this.contentDetailData.rmhPlatform == 1) { |
| 118 | + this.rmh() | ||
| 119 | + } | ||
| 120 | + if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | ||
| 121 | + this.imgSwiper() | ||
| 122 | + } | ||
| 123 | + if (this.netStatus !== undefined) { | ||
| 124 | + this.noNet() | ||
| 125 | + } | ||
| 126 | + if (this.isOffLine) { | ||
| 127 | + this.offLine() | ||
| 128 | + } | ||
| 129 | + Column() { | ||
| 130 | + if (!this.showDownload) { | ||
| 131 | + this.NShowDownload() | ||
| 132 | + } | ||
| 133 | + if (this.showDownload) { | ||
| 134 | + this.YShowDownload() | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + .zIndex(10) | ||
| 138 | + .id('e_swiper_bottom') | ||
| 139 | + .alignRules({ | ||
| 140 | + bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 141 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 142 | + }) | ||
| 117 | CommentDialogView({ | 143 | CommentDialogView({ |
| 118 | index: $index, | 144 | index: $index, |
| 119 | currentIndex: $currentIndex, | 145 | currentIndex: $currentIndex, |
| @@ -130,310 +156,215 @@ export struct MultiPictureDetailPageComponent { | @@ -130,310 +156,215 @@ export struct MultiPictureDetailPageComponent { | ||
| 130 | } | 156 | } |
| 131 | 157 | ||
| 132 | @Builder | 158 | @Builder |
| 133 | - init() { | ||
| 134 | - if (this.contentDetailData.rmhPlatform == 1) { | ||
| 135 | - if (!this.showDownload) { | ||
| 136 | - Row() { | ||
| 137 | - Row({ space: 8 }) { | ||
| 138 | - if (this.getImgUrl()) { | ||
| 139 | - Row() { | ||
| 140 | - Stack() { | ||
| 141 | - Image(this.getImgUrl()) | ||
| 142 | - .borderRadius(18) | ||
| 143 | - .aspectRatio(1) | ||
| 144 | - .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 145 | - .width(36) | ||
| 146 | - .height(36) | ||
| 147 | - .objectFit(ImageFit.Fill) | ||
| 148 | - .interpolation(ImageInterpolation.High) | ||
| 149 | - if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) { | ||
| 150 | - Stack() { | ||
| 151 | - Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 152 | - .width($r('app.float.vp_13')) | ||
| 153 | - .height($r('app.float.vp_13')) | ||
| 154 | - .objectFit(ImageFit.Cover) | ||
| 155 | - } | ||
| 156 | - .width(36) | ||
| 157 | - .height(36) | ||
| 158 | - .alignContent(Alignment.BottomEnd) | 159 | + rmh() { |
| 160 | + if (!this.showDownload) { | ||
| 161 | + Row() { | ||
| 162 | + Row({ space: 8 }) { | ||
| 163 | + if (this.getImgUrl()) { | ||
| 164 | + Row() { | ||
| 165 | + Stack() { | ||
| 166 | + Image(this.getImgUrl()) | ||
| 167 | + .borderRadius(18) | ||
| 168 | + .aspectRatio(1) | ||
| 169 | + .border({ width: 1, color: Color.White, style: BorderStyle.Solid }) | ||
| 170 | + .width(36) | ||
| 171 | + .height(36) | ||
| 172 | + .objectFit(ImageFit.Fill) | ||
| 173 | + .interpolation(ImageInterpolation.High) | ||
| 174 | + if (!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)) { | ||
| 175 | + Stack() { | ||
| 176 | + Image(this.contentDetailData.rmhInfo?.authIcon) | ||
| 177 | + .width($r('app.float.vp_13')) | ||
| 178 | + .height($r('app.float.vp_13')) | ||
| 179 | + .objectFit(ImageFit.Cover) | ||
| 159 | } | 180 | } |
| 181 | + .width(36) | ||
| 182 | + .height(36) | ||
| 183 | + .alignContent(Alignment.BottomEnd) | ||
| 160 | } | 184 | } |
| 161 | - .width(36) | ||
| 162 | - .height(36) | ||
| 163 | - .alignContent(Alignment.Center) | ||
| 164 | - .onClick(() => { | ||
| 165 | - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 166 | - // 号主页 | ||
| 167 | - const params: Params = { | ||
| 168 | - creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 169 | - pageID: '' | ||
| 170 | - } | ||
| 171 | - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - }) | ||
| 175 | } | 185 | } |
| 176 | - .width('13%') | ||
| 177 | - .height('100%') | ||
| 178 | - } | 186 | + .width(36) |
| 187 | + .height(36) | ||
| 188 | + .alignContent(Alignment.Center) | ||
| 189 | + .onClick(() => { | ||
| 190 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 191 | + // 号主页 | ||
| 192 | + const params: Params = { | ||
| 193 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 194 | + pageID: '' | ||
| 195 | + } | ||
| 196 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 197 | + } | ||
| 179 | 198 | ||
| 180 | - Row() { | ||
| 181 | - Flex({ | ||
| 182 | - direction: FlexDirection.Column, | ||
| 183 | - justifyContent: FlexAlign.SpaceAround, | ||
| 184 | - alignItems: ItemAlign.Start | ||
| 185 | - }) { | ||
| 186 | - Text(`${this.contentDetailData?.rmhInfo?.rmhName}`) | ||
| 187 | - .fontColor(Color.White) | ||
| 188 | - .fontSize(14) | ||
| 189 | - .fontFamily('PingFang PingFang SC-Medium') | ||
| 190 | - .fontWeight(500) | ||
| 191 | - .lineHeight(17) | ||
| 192 | - .margin(0) | ||
| 193 | - .height(17) | ||
| 194 | - Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`) | ||
| 195 | - .fontColor(Color.White) | ||
| 196 | - .fontSize(12) | ||
| 197 | - .fontFamily('PingFang SC-Regular') | ||
| 198 | - .fontWeight(400) | ||
| 199 | - .lineHeight(14) | ||
| 200 | - .height(14) | ||
| 201 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 202 | - .margin(0) | ||
| 203 | - .maxLines(1) | ||
| 204 | - } | 199 | + }) |
| 205 | } | 200 | } |
| 206 | - .width('81%') | 201 | + .width('13%') |
| 207 | .height('100%') | 202 | .height('100%') |
| 208 | } | 203 | } |
| 209 | - .width('74.4%') | ||
| 210 | - .height('100%') | ||
| 211 | - .margin({ | ||
| 212 | - top: 0, | ||
| 213 | - bottom: 0, | ||
| 214 | - left: 16, | ||
| 215 | - right: 0 | ||
| 216 | - }) | ||
| 217 | - .onClick(() => { | ||
| 218 | - if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 219 | - // 号主页 | ||
| 220 | - const params: Params = { | ||
| 221 | - creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 222 | - pageID: '' | ||
| 223 | - } | ||
| 224 | - WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 225 | - } | ||
| 226 | - | ||
| 227 | - }) | ||
| 228 | 204 | ||
| 229 | Row() { | 205 | Row() { |
| 230 | - if (this.followStatus == '0') { | ||
| 231 | - Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 232 | - Row() { | ||
| 233 | - Text('+关注').fontSize(12).fontColor(0xffffff) | ||
| 234 | - }.alignItems(VerticalAlign.Center) | ||
| 235 | - } | ||
| 236 | - .borderRadius(4) | ||
| 237 | - .backgroundColor('#ED2800') | ||
| 238 | - .width(48) | ||
| 239 | - .height(24) | ||
| 240 | - .onClick(() => { | ||
| 241 | - this.handleAccention() | ||
| 242 | - }) | ||
| 243 | - } else { | ||
| 244 | - Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 245 | - Row() { | ||
| 246 | - Text('已关注').fontSize(12).fontColor(0xffffff) | ||
| 247 | - }.alignItems(VerticalAlign.Center) | ||
| 248 | - } | ||
| 249 | - .borderRadius(4) | ||
| 250 | - .backgroundColor('#333333') | ||
| 251 | - .width(54) | ||
| 252 | - .height(24) | ||
| 253 | - .onClick(() => { | ||
| 254 | - this.handleAccention() | ||
| 255 | - }) | 206 | + Flex({ |
| 207 | + direction: FlexDirection.Column, | ||
| 208 | + justifyContent: FlexAlign.SpaceAround, | ||
| 209 | + alignItems: ItemAlign.Start | ||
| 210 | + }) { | ||
| 211 | + Text(`${this.contentDetailData?.rmhInfo?.rmhName}`) | ||
| 212 | + .fontColor(Color.White) | ||
| 213 | + .fontSize(14) | ||
| 214 | + .fontFamily('PingFang PingFang SC-Medium') | ||
| 215 | + .fontWeight(500) | ||
| 216 | + .lineHeight(17) | ||
| 217 | + .margin(0) | ||
| 218 | + .height(17) | ||
| 219 | + Text(`${this.contentDetailData?.rmhInfo?.rmhDesc}`) | ||
| 220 | + .fontColor(Color.White) | ||
| 221 | + .fontSize(12) | ||
| 222 | + .fontFamily('PingFang SC-Regular') | ||
| 223 | + .fontWeight(400) | ||
| 224 | + .lineHeight(14) | ||
| 225 | + .height(14) | ||
| 226 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 227 | + .margin(0) | ||
| 228 | + .maxLines(1) | ||
| 256 | } | 229 | } |
| 257 | - | ||
| 258 | } | 230 | } |
| 259 | - .justifyContent(FlexAlign.Center) | ||
| 260 | - .alignItems(VerticalAlign.Center) | ||
| 261 | - .width('21.6%') | 231 | + .width('81%') |
| 262 | .height('100%') | 232 | .height('100%') |
| 263 | } | 233 | } |
| 264 | - .width('100%') | ||
| 265 | - .height(44) | ||
| 266 | - .zIndex(10) | ||
| 267 | - .margin({ top: `${this.topSafeHeight + 12}px` }) | ||
| 268 | - .alignRules({ | ||
| 269 | - top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 270 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | 234 | + .width('74.4%') |
| 235 | + .height('100%') | ||
| 236 | + .margin({ | ||
| 237 | + top: 0, | ||
| 238 | + bottom: 0, | ||
| 239 | + left: 16, | ||
| 240 | + right: 0 | ||
| 271 | }) | 241 | }) |
| 272 | - .id('e_attention') | ||
| 273 | - .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | ||
| 274 | - TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` }) | ||
| 275 | - )) | ||
| 276 | - } | ||
| 277 | - | ||
| 278 | - } | ||
| 279 | - if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | ||
| 280 | - Swiper(this.swiperController) { | ||
| 281 | - ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { | ||
| 282 | - Swiper(this.swiperControllerItem) { | ||
| 283 | - MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | 242 | + .onClick(() => { |
| 243 | + if (this.contentDetailData.rmhInfo?.cnMainControl === 1) { | ||
| 244 | + // 号主页 | ||
| 245 | + const params: Params = { | ||
| 246 | + creatorId: this.contentDetailData.rmhInfo.rmhId, | ||
| 247 | + pageID: '' | ||
| 248 | + } | ||
| 249 | + WDRouterRule.jumpWithPage(WDRouterPage.peopleShipHomePage, params) | ||
| 284 | } | 250 | } |
| 285 | - .width('100%') | ||
| 286 | - .height('100%') | ||
| 287 | - .vertical(true) | ||
| 288 | - .autoPlay(false) | ||
| 289 | - .cachedCount(1) | ||
| 290 | - .indicator(false) | ||
| 291 | - .displayCount(1) | ||
| 292 | - .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { | ||
| 293 | - console.info("onGestureSwipe current offset: " + extraInfo.currentOffset) | ||
| 294 | - this.currentOffset = Math.abs(extraInfo.currentOffset) | ||
| 295 | - }) | ||
| 296 | - .onTouch((event: TouchEvent) => { | ||
| 297 | - if (this.duration === 0) { | ||
| 298 | - this.duration = 500 | 251 | + |
| 252 | + }) | ||
| 253 | + | ||
| 254 | + Row() { | ||
| 255 | + if (this.followStatus == '0') { | ||
| 256 | + Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 257 | + Row() { | ||
| 258 | + Text('+关注').fontSize(12).fontColor(0xffffff) | ||
| 259 | + }.alignItems(VerticalAlign.Center) | ||
| 299 | } | 260 | } |
| 300 | - if (event.type === 1) { | ||
| 301 | - // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { | ||
| 302 | - if (this.currentOffset > 160) { | ||
| 303 | - router.back() | ||
| 304 | - } | 261 | + .borderRadius(4) |
| 262 | + .backgroundColor('#ED2800') | ||
| 263 | + .width(48) | ||
| 264 | + .height(24) | ||
| 265 | + .onClick(() => { | ||
| 266 | + this.handleAccention() | ||
| 267 | + }) | ||
| 268 | + } else { | ||
| 269 | + Button({ type: ButtonType.Normal, stateEffect: true }) { | ||
| 270 | + Row() { | ||
| 271 | + Text('已关注').fontSize(12).fontColor(0xffffff) | ||
| 272 | + }.alignItems(VerticalAlign.Center) | ||
| 305 | } | 273 | } |
| 306 | - }) | ||
| 307 | - }) | 274 | + .borderRadius(4) |
| 275 | + .backgroundColor('#333333') | ||
| 276 | + .width(54) | ||
| 277 | + .height(24) | ||
| 278 | + .onClick(() => { | ||
| 279 | + this.handleAccention() | ||
| 280 | + }) | ||
| 281 | + } | ||
| 282 | + | ||
| 283 | + } | ||
| 284 | + .justifyContent(FlexAlign.Center) | ||
| 285 | + .alignItems(VerticalAlign.Center) | ||
| 286 | + .width('21.6%') | ||
| 287 | + .height('100%') | ||
| 308 | } | 288 | } |
| 309 | - .index(this.swiperIndex) | ||
| 310 | .width('100%') | 289 | .width('100%') |
| 311 | - .height('100%') | ||
| 312 | - .vertical(false) | ||
| 313 | - .autoPlay(false) | ||
| 314 | - .indicator(false) | ||
| 315 | - .displayCount(1) | ||
| 316 | - .loop(false) | ||
| 317 | - .effectMode(EdgeEffect.None) | ||
| 318 | - .id('e_swiper_content') | 290 | + .height(44) |
| 291 | + .zIndex(10) | ||
| 292 | + .margin({ top: `${this.topSafeHeight + 12}px` }) | ||
| 319 | .alignRules({ | 293 | .alignRules({ |
| 320 | - center: { anchor: "__container__", align: VerticalAlign.Center }, | 294 | + top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 321 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 295 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 322 | }) | 296 | }) |
| 323 | - .zIndex(1) | ||
| 324 | - .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { | ||
| 325 | - this.swiperIndex = targetIndex | ||
| 326 | - }) | ||
| 327 | - .onClick(() => { | ||
| 328 | - this.showDownload = !this.showDownload | ||
| 329 | - }) | 297 | + .id('e_attention') |
| 298 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | ||
| 299 | + TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` }) | ||
| 300 | + )) | ||
| 330 | } | 301 | } |
| 331 | - if (this.netStatus !== undefined) { | ||
| 332 | - EmptyComponent({ | ||
| 333 | - emptyType: this.netStatus, emptyButton: true, retry: () => { | ||
| 334 | - this.getContentDetailData() | 302 | + } |
| 303 | + | ||
| 304 | + @Builder | ||
| 305 | + imgSwiper() { | ||
| 306 | + Swiper(this.swiperController) { | ||
| 307 | + ForEach(this.contentDetailData.photoList, (item: PhotoListBean) => { | ||
| 308 | + Swiper(this.swiperControllerItem) { | ||
| 309 | + MultiPictureDetailItemComponent({ MultiPictureDetailItem: item }) | ||
| 335 | } | 310 | } |
| 336 | - }) | ||
| 337 | - .id('e_empty_content') | ||
| 338 | - .alignRules({ | ||
| 339 | - center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 340 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | 311 | + .width('100%') |
| 312 | + .height('100%') | ||
| 313 | + .vertical(true) | ||
| 314 | + .autoPlay(false) | ||
| 315 | + .cachedCount(1) | ||
| 316 | + .indicator(false) | ||
| 317 | + .displayCount(1) | ||
| 318 | + .loop(false) | ||
| 319 | + .onGestureSwipe((index: number, extraInfo: SwiperAnimationEvent) => { | ||
| 320 | + console.info("onGestureSwipe current offset: " + extraInfo.currentOffset) | ||
| 321 | + this.currentOffset = Math.abs(extraInfo.currentOffset) | ||
| 341 | }) | 322 | }) |
| 342 | - } | ||
| 343 | - Column() { | ||
| 344 | - if (!this.showDownload) { | ||
| 345 | - Column() { | ||
| 346 | - Row() { | ||
| 347 | - Scroll(this.scroller) { | ||
| 348 | - Row() { | ||
| 349 | - Flex({ | ||
| 350 | - direction: FlexDirection.Column, | ||
| 351 | - justifyContent: FlexAlign.Start | ||
| 352 | - }) { | ||
| 353 | - if (this.contentDetailData?.photoList?.length) { | ||
| 354 | - Text() { | ||
| 355 | - Span(`${this.swiperIndex + 1}`) | ||
| 356 | - .fontSize(24) | ||
| 357 | - .fontFamily('PingFang SC-Medium') | ||
| 358 | - .fontWeight(500) | ||
| 359 | - .lineHeight(28) | ||
| 360 | - Span(`/${this.contentDetailData?.photoList?.length}`) | ||
| 361 | - .fontSize(14) | ||
| 362 | - .fontFamily('PingFang SC-Medium') | ||
| 363 | - .fontWeight(500) | ||
| 364 | - .lineHeight(19) | ||
| 365 | - } | ||
| 366 | - .fontColor(Color.White) | ||
| 367 | - .margin({ | ||
| 368 | - top: 4, | ||
| 369 | - left: 18, | ||
| 370 | - bottom: 4, | ||
| 371 | - right: 4 | ||
| 372 | - }) | ||
| 373 | - } | ||
| 374 | - if (this.contentDetailData.newsTitle) { | ||
| 375 | - Text(`${this.contentDetailData.newsTitle}`) | ||
| 376 | - .fontColor(Color.White) | ||
| 377 | - .fontSize(16) | ||
| 378 | - .fontFamily('PingFang SC-Semibold') | ||
| 379 | - .fontWeight(600) | ||
| 380 | - .lineHeight(24) | ||
| 381 | - .margin({ | ||
| 382 | - top: 4, | ||
| 383 | - left: 18, | ||
| 384 | - bottom: 4, | ||
| 385 | - right: 18 | ||
| 386 | - }) | ||
| 387 | - } | ||
| 388 | - if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { | ||
| 389 | - Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) | ||
| 390 | - .fontColor(Color.White) | ||
| 391 | - .fontSize(14) | ||
| 392 | - .fontFamily('PingFang SC-Regular') | ||
| 393 | - .fontWeight(400) | ||
| 394 | - .lineHeight(22) | ||
| 395 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 396 | - .margin({ | ||
| 397 | - top: 4, | ||
| 398 | - left: 0, | ||
| 399 | - bottom: 4, | ||
| 400 | - right: 18 | ||
| 401 | - }) | ||
| 402 | - .maxLines(32) | ||
| 403 | - } | ||
| 404 | - } | ||
| 405 | - } | ||
| 406 | - .width('100%') | ||
| 407 | - } | ||
| 408 | - .scrollable(ScrollDirection.Vertical) | ||
| 409 | - .scrollBarWidth(0) | ||
| 410 | - .height(px2vp(this.titleHeight)) | ||
| 411 | - .align(Alignment.Bottom) | 323 | + .onTouch((event: TouchEvent) => { |
| 324 | + if (this.duration === 0) { | ||
| 325 | + this.duration = 500 | ||
| 412 | } | 326 | } |
| 413 | - | ||
| 414 | - OperRowListView({ | ||
| 415 | - contentDetailData: this.contentDetailData, | ||
| 416 | - publishCommentModel: this.publishCommentModel, | ||
| 417 | - operationButtonList: this.operationButtonList, | ||
| 418 | - styleType: 2, | ||
| 419 | - componentType: 5, | ||
| 420 | - pageComponentType: 3, | ||
| 421 | - onCommentIconClick: () => { | ||
| 422 | - this.showCommentList = true | 327 | + if (event.type === 1) { |
| 328 | + // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { | ||
| 329 | + if (this.currentOffset > 160) { | ||
| 330 | + router.back() | ||
| 423 | } | 331 | } |
| 424 | - }) | 332 | + } |
| 333 | + }) | ||
| 334 | + }) | ||
| 335 | + } | ||
| 336 | + .index(this.swiperIndex) | ||
| 337 | + .width('100%') | ||
| 338 | + .height('100%') | ||
| 339 | + .vertical(false) | ||
| 340 | + .autoPlay(false) | ||
| 341 | + .indicator(false) | ||
| 342 | + .displayCount(1) | ||
| 343 | + .loop(false) | ||
| 344 | + .effectMode(EdgeEffect.Spring) | ||
| 345 | + .id('e_swiper_content') | ||
| 346 | + .alignRules({ | ||
| 347 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 348 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 349 | + }) | ||
| 350 | + .zIndex(1) | ||
| 351 | + .onAnimationStart((index: number, targetIndex: number, extraInfo: SwiperAnimationEvent) => { | ||
| 352 | + this.swiperIndex = targetIndex | ||
| 353 | + }) | ||
| 354 | + .onClick(() => { | ||
| 355 | + this.showDownload = !this.showDownload | ||
| 356 | + }) | ||
| 357 | + } | ||
| 425 | 358 | ||
| 426 | - } | ||
| 427 | - .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | ||
| 428 | - TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` }) | ||
| 429 | - )) | ||
| 430 | - } | ||
| 431 | - if (this.showDownload) { | ||
| 432 | - Column() { | 359 | + @Builder |
| 360 | + NShowDownload() { | ||
| 361 | + Column() { | ||
| 362 | + Row() { | ||
| 363 | + Scroll(this.scroller) { | ||
| 433 | Row() { | 364 | Row() { |
| 434 | Flex({ | 365 | Flex({ |
| 435 | - direction: FlexDirection.Row, | ||
| 436 | - justifyContent: FlexAlign.SpaceBetween | 366 | + direction: FlexDirection.Column, |
| 367 | + justifyContent: FlexAlign.Start | ||
| 437 | }) { | 368 | }) { |
| 438 | if (this.contentDetailData?.photoList?.length) { | 369 | if (this.contentDetailData?.photoList?.length) { |
| 439 | Text() { | 370 | Text() { |
| @@ -449,44 +380,155 @@ export struct MultiPictureDetailPageComponent { | @@ -449,44 +380,155 @@ export struct MultiPictureDetailPageComponent { | ||
| 449 | .lineHeight(19) | 380 | .lineHeight(19) |
| 450 | } | 381 | } |
| 451 | .fontColor(Color.White) | 382 | .fontColor(Color.White) |
| 452 | - .margin(4) | 383 | + .margin({ |
| 384 | + top: 4, | ||
| 385 | + left: 18, | ||
| 386 | + bottom: 4, | ||
| 387 | + right: 4 | ||
| 388 | + }) | ||
| 453 | } | 389 | } |
| 454 | - | ||
| 455 | - if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) { | ||
| 456 | - ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) | 390 | + if (this.contentDetailData.newsTitle) { |
| 391 | + Text(`${this.contentDetailData.newsTitle}`) | ||
| 392 | + .fontColor(Color.White) | ||
| 393 | + .fontSize(16) | ||
| 394 | + .fontFamily('PingFang SC-Semibold') | ||
| 395 | + .fontWeight(600) | ||
| 396 | + .lineHeight(24) | ||
| 457 | .margin({ | 397 | .margin({ |
| 458 | - top: 8, | 398 | + top: 4, |
| 459 | left: 18, | 399 | left: 18, |
| 460 | - bottom: 24, | 400 | + bottom: 4, |
| 401 | + right: 18 | ||
| 402 | + }) | ||
| 403 | + } | ||
| 404 | + if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { | ||
| 405 | + Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) | ||
| 406 | + .fontColor(Color.White) | ||
| 407 | + .fontSize(14) | ||
| 408 | + .fontFamily('PingFang SC-Regular') | ||
| 409 | + .fontWeight(400) | ||
| 410 | + .lineHeight(22) | ||
| 411 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 412 | + .margin({ | ||
| 413 | + top: 4, | ||
| 414 | + left: 0, | ||
| 415 | + bottom: 4, | ||
| 461 | right: 18 | 416 | right: 18 |
| 462 | }) | 417 | }) |
| 463 | - .parallelGesture( | ||
| 464 | - TapGesture() | ||
| 465 | - .onAction((event: GestureEvent) => { | ||
| 466 | - TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) | ||
| 467 | - })) | 418 | + .maxLines(32) |
| 468 | } | 419 | } |
| 469 | } | 420 | } |
| 470 | } | 421 | } |
| 471 | .width('100%') | 422 | .width('100%') |
| 472 | } | 423 | } |
| 473 | - .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | ||
| 474 | - TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` }) | ||
| 475 | - )) | 424 | + .scrollable(ScrollDirection.Vertical) |
| 425 | + .scrollBarWidth(0) | ||
| 426 | + .constraintSize({ | ||
| 427 | + maxHeight: px2vp(this.titleHeight) | ||
| 428 | + }) | ||
| 429 | + .align(Alignment.Bottom) | ||
| 476 | } | 430 | } |
| 431 | + | ||
| 432 | + OperRowListView({ | ||
| 433 | + contentDetailData: this.contentDetailData, | ||
| 434 | + publishCommentModel: this.publishCommentModel, | ||
| 435 | + operationButtonList: this.operationButtonList, | ||
| 436 | + styleType: 2, | ||
| 437 | + componentType: 5, | ||
| 438 | + pageComponentType: 3, | ||
| 439 | + onCommentIconClick: () => { | ||
| 440 | + this.showCommentList = true | ||
| 441 | + } | ||
| 442 | + }) | ||
| 443 | + | ||
| 477 | } | 444 | } |
| 478 | - .zIndex(10) | ||
| 479 | - .id('e_swiper_bottom') | ||
| 480 | - .alignRules({ | ||
| 481 | - bottom: { anchor: "__container__", align: VerticalAlign.Bottom }, | ||
| 482 | - middle: { anchor: "__container__", align: HorizontalAlign.Center } | 445 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| 446 | + TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` }) | ||
| 447 | + )) | ||
| 448 | + } | ||
| 449 | + | ||
| 450 | + @Builder | ||
| 451 | + YShowDownload() { | ||
| 452 | + Column() { | ||
| 453 | + Row() { | ||
| 454 | + Flex({ | ||
| 455 | + direction: FlexDirection.Row, | ||
| 456 | + justifyContent: FlexAlign.SpaceBetween | ||
| 457 | + }) { | ||
| 458 | + if (this.contentDetailData?.photoList?.length) { | ||
| 459 | + Text() { | ||
| 460 | + Span(`${this.swiperIndex + 1}`) | ||
| 461 | + .fontSize(24) | ||
| 462 | + .fontFamily('PingFang SC-Medium') | ||
| 463 | + .fontWeight(500) | ||
| 464 | + .lineHeight(28) | ||
| 465 | + Span(`/${this.contentDetailData?.photoList?.length}`) | ||
| 466 | + .fontSize(14) | ||
| 467 | + .fontFamily('PingFang SC-Medium') | ||
| 468 | + .fontWeight(500) | ||
| 469 | + .lineHeight(19) | ||
| 470 | + } | ||
| 471 | + .fontColor(Color.White) | ||
| 472 | + .margin(4) | ||
| 473 | + } | ||
| 474 | + | ||
| 475 | + if (this.contentDetailData.photoList?.[this.swiperIndex].picPath) { | ||
| 476 | + ImageDownloadComponent({ url: this.contentDetailData.photoList?.[this.swiperIndex].picPath }) | ||
| 477 | + .margin({ | ||
| 478 | + top: 8, | ||
| 479 | + left: 18, | ||
| 480 | + bottom: 24, | ||
| 481 | + right: 18 | ||
| 482 | + }) | ||
| 483 | + .parallelGesture( | ||
| 484 | + TapGesture() | ||
| 485 | + .onAction((event: GestureEvent) => { | ||
| 486 | + TrackingContent.download(1,TrackConstants.PageName.Atlas_Detail,TrackConstants.PageName.Atlas_Detail,this.pageParam) | ||
| 487 | + })) | ||
| 488 | + } | ||
| 489 | + } | ||
| 490 | + } | ||
| 491 | + .width('100%') | ||
| 492 | + } | ||
| 493 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( | ||
| 494 | + TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` }) | ||
| 495 | + )) | ||
| 496 | + } | ||
| 497 | + | ||
| 498 | + @Builder | ||
| 499 | + noNet() { | ||
| 500 | + EmptyComponent({ | ||
| 501 | + emptyType: 1, emptyButton: true, retry: () => { | ||
| 502 | + this.getContentDetailData() | ||
| 503 | + } | ||
| 504 | + }) | ||
| 505 | + .id('e_empty_content') | ||
| 506 | + .alignRules({ | ||
| 507 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 508 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 509 | + }) | ||
| 510 | + } | ||
| 511 | + | ||
| 512 | + @Builder | ||
| 513 | + offLine() { | ||
| 514 | + EmptyComponent({ | ||
| 515 | + emptyType: 15, emptyButton: true, retry: () => { | ||
| 516 | + this.getContentDetailData | ||
| 517 | + } | ||
| 483 | }) | 518 | }) |
| 519 | + .id('e_empty_content') | ||
| 520 | + .alignRules({ | ||
| 521 | + center: { anchor: "__container__", align: VerticalAlign.Center }, | ||
| 522 | + middle: { anchor: "__container__", align: HorizontalAlign.Center } | ||
| 523 | + }) | ||
| 524 | + .backgroundColor(Color.Black) | ||
| 484 | } | 525 | } |
| 485 | 526 | ||
| 486 | getContentDetailData() { | 527 | getContentDetailData() { |
| 487 | try { | 528 | try { |
| 488 | PageRepository.fetchDetailData(this.relId, this.contentId, this.relType) | 529 | PageRepository.fetchDetailData(this.relId, this.contentId, this.relType) |
| 489 | .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | 530 | .then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { |
| 531 | + this.isOffLine = resDTO.data == null ? true : false | ||
| 490 | if (!resDTO || !resDTO.data) { | 532 | if (!resDTO || !resDTO.data) { |
| 491 | Logger.error(TAG, 'fetchDetailData is empty'); | 533 | Logger.error(TAG, 'fetchDetailData is empty'); |
| 492 | return | 534 | return |
-
Please register or login to post a comment