fix:17516 稿件详情页-相关推荐不该展示音频相关数据;17488 图文稿件详情,查看大图,极限左滑或右滑,不应支持滑动,如从第1张左滑到最后一张。见附件视频
Showing
4 changed files
with
66 additions
and
38 deletions
| @@ -52,35 +52,11 @@ export struct ImageAndTextPageComponent { | @@ -52,35 +52,11 @@ export struct ImageAndTextPageComponent { | ||
| 52 | @State isNetConnected: boolean = true | 52 | @State isNetConnected: boolean = true |
| 53 | @State info: Area | null = null | 53 | @State info: Area | null = null |
| 54 | @State likeNum: number = 0 | 54 | @State likeNum: number = 0 |
| 55 | - @State reachEndIncreament : number = 0 | 55 | + @State reachEndIncreament: number = 0 |
| 56 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 56 | 57 | ||
| 57 | build() { | 58 | build() { |
| 58 | - Column() { | ||
| 59 | - // 发布时间 | ||
| 60 | - Row() { | ||
| 61 | - Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) | ||
| 62 | - .width(80) | ||
| 63 | - .height(28) | ||
| 64 | - Text(this.publishTime) | ||
| 65 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 66 | - .fontSize(13) | ||
| 67 | - } | ||
| 68 | - .width(CommonConstants.FULL_WIDTH) | ||
| 69 | - .height(32) | ||
| 70 | - .padding({ left: 15, right: 15, }) | ||
| 71 | - .justifyContent(FlexAlign.SpaceBetween) | ||
| 72 | - .alignItems(VerticalAlign.Bottom) | ||
| 73 | - | ||
| 74 | - Row() { | ||
| 75 | - Image($r('app.media.line')) | ||
| 76 | - .width('100%') | ||
| 77 | - .height(6) | ||
| 78 | - .objectFit(ImageFit.Cover) | ||
| 79 | - .margin({ top: 10 }) | ||
| 80 | - } | ||
| 81 | - .padding({ left: 15, right: 15 }) | ||
| 82 | - .backgroundColor(Color.White) | ||
| 83 | - | 59 | + Stack({ alignContent: Alignment.Top }) { |
| 84 | Stack({ alignContent: Alignment.Bottom }) { | 60 | Stack({ alignContent: Alignment.Bottom }) { |
| 85 | Scroll(this.scroller) { | 61 | Scroll(this.scroller) { |
| 86 | Column() { | 62 | Column() { |
| @@ -89,7 +65,7 @@ export struct ImageAndTextPageComponent { | @@ -89,7 +65,7 @@ export struct ImageAndTextPageComponent { | ||
| 89 | action: this.action, | 65 | action: this.action, |
| 90 | isPageEnd: $isPageEnd | 66 | isPageEnd: $isPageEnd |
| 91 | }) | 67 | }) |
| 92 | - .padding({ bottom: 10 }) | 68 | + .padding({ top: 15, bottom: 10 }) |
| 93 | Column() { | 69 | Column() { |
| 94 | // 点赞 | 70 | // 点赞 |
| 95 | if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { | 71 | if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle !== 4) { |
| @@ -156,11 +132,9 @@ export struct ImageAndTextPageComponent { | @@ -156,11 +132,9 @@ export struct ImageAndTextPageComponent { | ||
| 156 | } | 132 | } |
| 157 | } | 133 | } |
| 158 | } | 134 | } |
| 159 | - | ||
| 160 | } | 135 | } |
| 161 | .width(CommonConstants.FULL_WIDTH) | 136 | .width(CommonConstants.FULL_WIDTH) |
| 162 | - // .height(CommonConstants.FULL_HEIGHT) | ||
| 163 | - .padding({ bottom: 76 }) | 137 | + .height(CommonConstants.FULL_HEIGHT) |
| 164 | .scrollBar(BarState.Off) | 138 | .scrollBar(BarState.Off) |
| 165 | .align(Alignment.Top) | 139 | .align(Alignment.Top) |
| 166 | .onReachEnd(() => { | 140 | .onReachEnd(() => { |
| @@ -177,11 +151,10 @@ export struct ImageAndTextPageComponent { | @@ -177,11 +151,10 @@ export struct ImageAndTextPageComponent { | ||
| 177 | }).padding({ bottom: 200 }) | 151 | }).padding({ bottom: 200 }) |
| 178 | } else { | 152 | } else { |
| 179 | if (!this.isPageEnd) { | 153 | if (!this.isPageEnd) { |
| 180 | - detailedSkeleton() | 154 | + detailedSkeleton().padding({ bottom: this.bottomSafeHeight }) |
| 181 | } | 155 | } |
| 182 | } | 156 | } |
| 183 | - //底部交互区 | ||
| 184 | - if (this.operationButtonList.length) { | 157 | + // 底部交互区 |
| 185 | OperRowListView({ | 158 | OperRowListView({ |
| 186 | contentDetailData: this.contentDetailData, | 159 | contentDetailData: this.contentDetailData, |
| 187 | publishCommentModel: this.publishCommentModel, | 160 | publishCommentModel: this.publishCommentModel, |
| @@ -189,12 +162,41 @@ export struct ImageAndTextPageComponent { | @@ -189,12 +162,41 @@ export struct ImageAndTextPageComponent { | ||
| 189 | styleType: 1, | 162 | styleType: 1, |
| 190 | }) | 163 | }) |
| 191 | } | 164 | } |
| 165 | + .width(CommonConstants.FULL_WIDTH) | ||
| 166 | + .height(CommonConstants.FULL_HEIGHT) | ||
| 167 | + .padding({ top: 38 }) | ||
| 168 | + | ||
| 169 | + // 发布时间 | ||
| 170 | + Column() { | ||
| 171 | + Row() { | ||
| 172 | + Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb')) | ||
| 173 | + .width(80) | ||
| 174 | + .height(28) | ||
| 175 | + Text(this.publishTime) | ||
| 176 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 177 | + .fontSize(13) | ||
| 192 | } | 178 | } |
| 179 | + .width(CommonConstants.FULL_WIDTH) | ||
| 180 | + .height(32) | ||
| 181 | + .padding({ left: 15, right: 15, }) | ||
| 182 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 183 | + .alignItems(VerticalAlign.Bottom) | ||
| 193 | 184 | ||
| 185 | + Row() { | ||
| 186 | + Image($r('app.media.line')) | ||
| 187 | + .width('100%') | ||
| 188 | + .height(6) | ||
| 189 | + .objectFit(ImageFit.Cover) | ||
| 190 | + .margin({ top: 10 }) | ||
| 191 | + } | ||
| 192 | + .padding({ left: 15, right: 15 }) | ||
| 193 | + .backgroundColor(Color.White) | ||
| 194 | + }.backgroundColor(Color.White) | ||
| 194 | } | 195 | } |
| 195 | .width(CommonConstants.FULL_WIDTH) | 196 | .width(CommonConstants.FULL_WIDTH) |
| 196 | .height(CommonConstants.FULL_HEIGHT) | 197 | .height(CommonConstants.FULL_HEIGHT) |
| 197 | .backgroundColor(Color.White) | 198 | .backgroundColor(Color.White) |
| 199 | + | ||
| 198 | } | 200 | } |
| 199 | 201 | ||
| 200 | private async getDetail() { | 202 | private async getDetail() { |
| @@ -260,7 +262,11 @@ export struct ImageAndTextPageComponent { | @@ -260,7 +262,11 @@ export struct ImageAndTextPageComponent { | ||
| 260 | channelId: String(this.contentDetailData?.reLInfo?.channelId) | 262 | channelId: String(this.contentDetailData?.reLInfo?.channelId) |
| 261 | } | 263 | } |
| 262 | let recommendList = await DetailViewModel.postRecommendList(params) | 264 | let recommendList = await DetailViewModel.postRecommendList(params) |
| 263 | - this.recommendList = recommendList; | 265 | + if (recommendList.length > 0) { |
| 266 | + //推荐列表过滤音频和活动入口 | ||
| 267 | + this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13'); | ||
| 268 | + } | ||
| 269 | + | ||
| 264 | } | 270 | } |
| 265 | 271 | ||
| 266 | // 已登录->查询用户对作品点赞、收藏状态 | 272 | // 已登录->查询用户对作品点赞、收藏状态 |
| @@ -8,6 +8,8 @@ import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5 | @@ -8,6 +8,8 @@ import { NativeCallH5Type } from 'wdWebComponent/src/main/ets/pages/NativeCallH5 | ||
| 8 | import { OperRowListView } from './view/OperRowListView'; | 8 | import { OperRowListView } from './view/OperRowListView'; |
| 9 | import DetailViewModel from '../viewmodel/DetailViewModel'; | 9 | import DetailViewModel from '../viewmodel/DetailViewModel'; |
| 10 | import { publishCommentModel } from '../components/comment/model/PublishCommentModel'; | 10 | import { publishCommentModel } from '../components/comment/model/PublishCommentModel'; |
| 11 | +import { EmptyComponent } from '../components/view/EmptyComponent'; | ||
| 12 | +import { NetworkUtil } from 'wdKit'; | ||
| 11 | 13 | ||
| 12 | const TAG: string = 'SpacialTopicPageComponent' | 14 | const TAG: string = 'SpacialTopicPageComponent' |
| 13 | 15 | ||
| @@ -24,6 +26,8 @@ export struct SpacialTopicPageComponent { | @@ -24,6 +26,8 @@ export struct SpacialTopicPageComponent { | ||
| 24 | private dataPrepared = false; | 26 | private dataPrepared = false; |
| 25 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 27 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 26 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] | 28 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] |
| 29 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | ||
| 30 | + @State isNetConnected: boolean = true | ||
| 27 | 31 | ||
| 28 | private trySendData2H5() { | 32 | private trySendData2H5() { |
| 29 | if (!this.webPrepared || !this.dataPrepared) { | 33 | if (!this.webPrepared || !this.dataPrepared) { |
| @@ -45,6 +49,8 @@ export struct SpacialTopicPageComponent { | @@ -45,6 +49,8 @@ export struct SpacialTopicPageComponent { | ||
| 45 | } | 49 | } |
| 46 | 50 | ||
| 47 | private async getDetail() { | 51 | private async getDetail() { |
| 52 | + this.isNetConnected = NetworkUtil.isNetConnected() | ||
| 53 | + | ||
| 48 | let contentId: string = '' | 54 | let contentId: string = '' |
| 49 | let relId: string = '' | 55 | let relId: string = '' |
| 50 | let relType: string = '' | 56 | let relType: string = '' |
| @@ -95,15 +101,28 @@ export struct SpacialTopicPageComponent { | @@ -95,15 +101,28 @@ export struct SpacialTopicPageComponent { | ||
| 95 | .height(CommonConstants.FULL_HEIGHT) | 101 | .height(CommonConstants.FULL_HEIGHT) |
| 96 | .padding({ bottom: 75 }) | 102 | .padding({ bottom: 75 }) |
| 97 | 103 | ||
| 104 | + if (!this.isNetConnected) { | ||
| 105 | + EmptyComponent({ | ||
| 106 | + emptyType: 1, | ||
| 107 | + emptyButton: true, | ||
| 108 | + retry: () => { | ||
| 109 | + this.getDetail() | ||
| 110 | + } | ||
| 111 | + }).padding({ bottom: 200 }) | ||
| 112 | + } else { | ||
| 98 | if (!this.isPageEnd) { | 113 | if (!this.isPageEnd) { |
| 99 | detailedSkeleton() | 114 | detailedSkeleton() |
| 100 | } | 115 | } |
| 116 | + } | ||
| 101 | //底部交互区 | 117 | //底部交互区 |
| 102 | OperRowListView({ | 118 | OperRowListView({ |
| 103 | contentDetailData: this.contentDetailData, | 119 | contentDetailData: this.contentDetailData, |
| 104 | publishCommentModel: this.publishCommentModel, | 120 | publishCommentModel: this.publishCommentModel, |
| 105 | operationButtonList: this.operationButtonList, | 121 | operationButtonList: this.operationButtonList, |
| 106 | }) | 122 | }) |
| 123 | + .padding({ | ||
| 124 | + bottom: `${this.bottomSafeHeight}px` | ||
| 125 | + }) | ||
| 107 | } | 126 | } |
| 108 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 127 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 109 | } | 128 | } |
| @@ -61,7 +61,7 @@ export struct OperRowListView { | @@ -61,7 +61,7 @@ export struct OperRowListView { | ||
| 61 | @Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 | 61 | @Prop componentType: number = 1 //1: 底部栏目样式 2: 新闻页中间位置样式 3:动态Tab内容下的互动入口 |
| 62 | @Prop pageComponentType: number = -1 //1:视频详情页 | 62 | @Prop pageComponentType: number = -1 //1:视频详情页 |
| 63 | @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 63 | @State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 64 | - @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 | 64 | + @Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件 |
| 65 | @State needLike: boolean = true | 65 | @State needLike: boolean = true |
| 66 | @ObjectLink publishCommentModel: publishCommentModel | 66 | @ObjectLink publishCommentModel: publishCommentModel |
| 67 | @State styleType: number = 1 | 67 | @State styleType: number = 1 |
| @@ -138,7 +138,7 @@ export struct OperRowListView { | @@ -138,7 +138,7 @@ export struct OperRowListView { | ||
| 138 | }) | 138 | }) |
| 139 | .width(42) | 139 | .width(42) |
| 140 | 140 | ||
| 141 | - if (this.contentDetailData) { | 141 | + if (this.contentDetailData?.newsId) { |
| 142 | ForEach(this.operationButtonList, (item: string, index: number) => { | 142 | ForEach(this.operationButtonList, (item: string, index: number) => { |
| 143 | if (item == 'comment') { | 143 | if (item == 'comment') { |
| 144 | this.builderComment() | 144 | this.builderComment() |
| @@ -162,7 +162,8 @@ export struct OperRowListView { | @@ -162,7 +162,8 @@ export struct OperRowListView { | ||
| 162 | .backgroundColor(this.bgColor) | 162 | .backgroundColor(this.bgColor) |
| 163 | .padding({ | 163 | .padding({ |
| 164 | top: 10, | 164 | top: 10, |
| 165 | - bottom: `${this.bottomSafeHeight}px` | 165 | + bottom: 10 |
| 166 | + // bottom: `${this.bottomSafeHeight}px` | ||
| 166 | // bottom: 50 | 167 | // bottom: 50 |
| 167 | }) | 168 | }) |
| 168 | 169 |
| @@ -65,6 +65,8 @@ export struct MultiPictureListPage { | @@ -65,6 +65,8 @@ export struct MultiPictureListPage { | ||
| 65 | .height(px2vp(this.picHeight) + 32) | 65 | .height(px2vp(this.picHeight) + 32) |
| 66 | .vertical(false) | 66 | .vertical(false) |
| 67 | .autoPlay(false) | 67 | .autoPlay(false) |
| 68 | + .loop(false) | ||
| 69 | + .effectMode(EdgeEffect.None) | ||
| 68 | .cachedCount(3) | 70 | .cachedCount(3) |
| 69 | .indicator(false) | 71 | .indicator(false) |
| 70 | .displayCount(1) | 72 | .displayCount(1) |
-
Please register or login to post a comment