Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
# Conflicts: # sight_harmony/products/phone/src/main/ets/pages/viewModel/LaunchPageModel.ets
Showing
24 changed files
with
258 additions
and
46 deletions
| 1 | import { TopicInfo } from '../morningevening/TopicInfo'; | 1 | import { TopicInfo } from '../morningevening/TopicInfo'; |
| 2 | import { ArrayList } from '@kit.ArkTS'; | 2 | import { ArrayList } from '@kit.ArkTS'; |
| 3 | +import { AdvRuleBean, CompAdvBean } from '../adv/AdvsRuleBean'; | ||
| 3 | 4 | ||
| 4 | export interface GroupItem { | 5 | export interface GroupItem { |
| 5 | id: number; | 6 | id: number; |
| @@ -15,7 +16,6 @@ export interface TopicDetailData { | @@ -15,7 +16,6 @@ export interface TopicDetailData { | ||
| 15 | shareSummary: string; | 16 | shareSummary: string; |
| 16 | id: number; | 17 | id: number; |
| 17 | baselineCopywriting: string; | 18 | baselineCopywriting: string; |
| 18 | - cornersAdv: string; | ||
| 19 | backgroundImgUrl: string; | 19 | backgroundImgUrl: string; |
| 20 | description: string; | 20 | description: string; |
| 21 | imgSize: string; | 21 | imgSize: string; |
| @@ -38,4 +38,12 @@ export interface TopicDetailData { | @@ -38,4 +38,12 @@ export interface TopicDetailData { | ||
| 38 | topicInfo: TopicInfo; | 38 | topicInfo: TopicInfo; |
| 39 | baselineColor: string; | 39 | baselineColor: string; |
| 40 | groups: ArrayList<GroupItem>; | 40 | groups: ArrayList<GroupItem>; |
| 41 | + /** | ||
| 42 | + * 挂角广告数据 | ||
| 43 | + */ | ||
| 44 | + cornersAdv: AdvRuleBean; | ||
| 45 | + /** | ||
| 46 | + * 广告中心-挂角广告信息 | ||
| 47 | + */ | ||
| 48 | + cornersAdv2: CompAdvBean[]; | ||
| 41 | } | 49 | } |
| @@ -146,6 +146,7 @@ export struct ENewspaperPageComponent { | @@ -146,6 +146,7 @@ export struct ENewspaperPageComponent { | ||
| 146 | 146 | ||
| 147 | let ratio = this.ratio == '100%' ? 1 : 0.5 | 147 | let ratio = this.ratio == '100%' ? 1 : 0.5 |
| 148 | this.picWidth = this.picWidth * ratio | 148 | this.picWidth = this.picWidth * ratio |
| 149 | + this.picHeight = (this.picWidth * 506)/355 | ||
| 149 | // 默认日期 | 150 | // 默认日期 |
| 150 | const date = new Date() | 151 | const date = new Date() |
| 151 | const month = date.getMonth() + 1 | 152 | const month = date.getMonth() + 1 |
| @@ -520,6 +520,11 @@ export struct ImageAndTextPageComponent { | @@ -520,6 +520,11 @@ export struct ImageAndTextPageComponent { | ||
| 520 | this.lastTimeoutId = setTimeout(() => { | 520 | this.lastTimeoutId = setTimeout(() => { |
| 521 | let offSetY = this.info?.globalPosition.y as number | 521 | let offSetY = this.info?.globalPosition.y as number |
| 522 | Logger.debug(TAG, "即将滚动至yOffset: " + (offSetY - 100)) | 522 | Logger.debug(TAG, "即将滚动至yOffset: " + (offSetY - 100)) |
| 523 | + if (offSetY >= (this.screenHeight-this.bottomHeight) ) { | ||
| 524 | + this.showMainText = true | ||
| 525 | + }else { | ||
| 526 | + this.showMainText = false | ||
| 527 | + } | ||
| 523 | //头部距离48 | 528 | //头部距离48 |
| 524 | this.scroller.scrollTo({ | 529 | this.scroller.scrollTo({ |
| 525 | yOffset: offSetY - 100, | 530 | yOffset: offSetY - 100, |
| @@ -4,7 +4,8 @@ import { | @@ -4,7 +4,8 @@ import { | ||
| 4 | PageInfoBean, | 4 | PageInfoBean, |
| 5 | ContentDTO, | 5 | ContentDTO, |
| 6 | contentListParams, | 6 | contentListParams, |
| 7 | - InteractDataDTO, TopicInfo | 7 | + InteractDataDTO, TopicInfo, |
| 8 | + CompInfoBean | ||
| 8 | } from 'wdBean'; | 9 | } from 'wdBean'; |
| 9 | import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'; | 10 | import { DateTimeUtils, Logger, SPHelper, WindowModel } from 'wdKit/Index'; |
| 10 | import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog'; | 11 | import { PaperReaderSimpleDialog } from '../../dialog/PaperReaderDialog'; |
| @@ -137,8 +138,6 @@ export struct MorningEveningPaperComponent { | @@ -137,8 +138,6 @@ export struct MorningEveningPaperComponent { | ||
| 137 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) //"25091" | 138 | let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) //"25091" |
| 138 | this.pageInfoBean = pageInfoBean; | 139 | this.pageInfoBean = pageInfoBean; |
| 139 | 140 | ||
| 140 | - let compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | ||
| 141 | - | ||
| 142 | // this.title = this.pageInfoBean?.topicInfo?.title | 141 | // this.title = this.pageInfoBean?.topicInfo?.title |
| 143 | this.setComponentTitle() | 142 | this.setComponentTitle() |
| 144 | this.topicInfo = this.pageInfoBean?.topicInfo | 143 | this.topicInfo = this.pageInfoBean?.topicInfo |
| @@ -158,6 +157,17 @@ export struct MorningEveningPaperComponent { | @@ -158,6 +157,17 @@ export struct MorningEveningPaperComponent { | ||
| 158 | this.setComponentBgColor(coverUrl) | 157 | this.setComponentBgColor(coverUrl) |
| 159 | 158 | ||
| 160 | // this.compInfoBean = compInfoBean | 159 | // this.compInfoBean = compInfoBean |
| 160 | + //信息流缓存 | ||
| 161 | + let BeanString = SPHelper.default.getSync('MorningEveningComp'+this.dailyPaperTopicPageId,'') as string | ||
| 162 | + let compInfoBean = {} as CompInfoBean | ||
| 163 | + if (BeanString.length > 0) { | ||
| 164 | + compInfoBean = JSON.parse(BeanString) | ||
| 165 | + }else { | ||
| 166 | + SPHelper.default.delete('MorningEveningComp'+this.dailyPaperTopicPageId) | ||
| 167 | + compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | ||
| 168 | + SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) | ||
| 169 | + } | ||
| 170 | + | ||
| 161 | console.log(TAG, "compInfoBean = " + JSON.stringify(compInfoBean)) | 171 | console.log(TAG, "compInfoBean = " + JSON.stringify(compInfoBean)) |
| 162 | if (compInfoBean?.compList[0]) { | 172 | if (compInfoBean?.compList[0]) { |
| 163 | this.compListItem = compInfoBean?.compList[0] | 173 | this.compListItem = compInfoBean?.compList[0] |
| @@ -180,6 +190,11 @@ export struct MorningEveningPaperComponent { | @@ -180,6 +190,11 @@ export struct MorningEveningPaperComponent { | ||
| 180 | this.progressVal = Math.floor(position * 100 / duration); | 190 | this.progressVal = Math.floor(position * 100 / duration); |
| 181 | } | 191 | } |
| 182 | this.isNoListContent = this.compListItem && this.compListItem?.operDataList?.length > 0 ?false:true | 192 | this.isNoListContent = this.compListItem && this.compListItem?.operDataList?.length > 0 ?false:true |
| 193 | + | ||
| 194 | + if (BeanString.length > 0) { | ||
| 195 | + compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | ||
| 196 | + SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) | ||
| 197 | + } | ||
| 183 | } catch (exception) { | 198 | } catch (exception) { |
| 184 | this.isContentFailed = true | 199 | this.isContentFailed = true |
| 185 | 200 |
| @@ -22,6 +22,9 @@ import { PageRepository } from '../repository/PageRepository'; | @@ -22,6 +22,9 @@ import { PageRepository } from '../repository/PageRepository'; | ||
| 22 | import { CommentDialogView } from './CommentDialogView'; | 22 | import { CommentDialogView } from './CommentDialogView'; |
| 23 | import { faceDetector } from '@kit.CoreVisionKit'; | 23 | import { faceDetector } from '@kit.CoreVisionKit'; |
| 24 | import { channelSkeleton } from './skeleton/channelSkeleton'; | 24 | import { channelSkeleton } from './skeleton/channelSkeleton'; |
| 25 | +import PageAdModel from '../viewmodel/PageAdvModel'; | ||
| 26 | +import { ProcessUtils } from 'wdRouter/Index'; | ||
| 27 | +import { GrayManageModel } from '../viewmodel/GrayManageModel'; | ||
| 25 | 28 | ||
| 26 | const TAG: string = 'SpacialTopicPageComponent' | 29 | const TAG: string = 'SpacialTopicPageComponent' |
| 27 | 30 | ||
| @@ -51,10 +54,14 @@ export struct SpacialTopicPageComponent { | @@ -51,10 +54,14 @@ export struct SpacialTopicPageComponent { | ||
| 51 | @State showComment: boolean = false | 54 | @State showComment: boolean = false |
| 52 | @State topicInfo: TopicInfo = {} as TopicInfo | 55 | @State topicInfo: TopicInfo = {} as TopicInfo |
| 53 | @State topicDetail: TopicDetailData = {} as TopicDetailData | 56 | @State topicDetail: TopicDetailData = {} as TopicDetailData |
| 57 | + @State private pageAdvModel: PageAdModel = new PageAdModel(); | ||
| 54 | @State shareInfo: ShareInfoDTO = {} as ShareInfoDTO | 58 | @State shareInfo: ShareInfoDTO = {} as ShareInfoDTO |
| 55 | @State showBottomView: boolean = false; | 59 | @State showBottomView: boolean = false; |
| 56 | @State executedStartTime: number = new Date().getTime() | 60 | @State executedStartTime: number = new Date().getTime() |
| 57 | 61 | ||
| 62 | + // 国殇灰度管理 | ||
| 63 | + GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') | ||
| 64 | + | ||
| 58 | private trySendData2H5() { | 65 | private trySendData2H5() { |
| 59 | if (!this.webPrepared) { | 66 | if (!this.webPrepared) { |
| 60 | return | 67 | return |
| @@ -85,7 +92,7 @@ export struct SpacialTopicPageComponent { | @@ -85,7 +92,7 @@ export struct SpacialTopicPageComponent { | ||
| 85 | 92 | ||
| 86 | this.topicDetail = JSON.parse(dataString); | 93 | this.topicDetail = JSON.parse(dataString); |
| 87 | this.topicInfo = this.topicDetail.topicInfo; | 94 | this.topicInfo = this.topicDetail.topicInfo; |
| 88 | - | 95 | + this.pageAdvModel.analysisTopicAdvSource(this.topicDetail) |
| 89 | if (this.topicInfo) { | 96 | if (this.topicInfo) { |
| 90 | // 转换详情数据 | 97 | // 转换详情数据 |
| 91 | this.contentDetailData.openComment = Number(this.topicInfo.commentFlag) | 98 | this.contentDetailData.openComment = Number(this.topicInfo.commentFlag) |
| @@ -105,7 +112,6 @@ export struct SpacialTopicPageComponent { | @@ -105,7 +112,6 @@ export struct SpacialTopicPageComponent { | ||
| 105 | this.shareInfo.shareUrl = this.topicInfo.shareUrl | 112 | this.shareInfo.shareUrl = this.topicInfo.shareUrl |
| 106 | this.contentDetailData.shareInfo = this.shareInfo | 113 | this.contentDetailData.shareInfo = this.shareInfo |
| 107 | 114 | ||
| 108 | - console.log('contentDetailData111', JSON.stringify(this.contentDetailData)) | ||
| 109 | // if(this.topicInfo.shareOpen === 1){ | 115 | // if(this.topicInfo.shareOpen === 1){ |
| 110 | // if (!this.operationButtonList.includes('share')) { | 116 | // if (!this.operationButtonList.includes('share')) { |
| 111 | // this.operationButtonList.push('share'); | 117 | // this.operationButtonList.push('share'); |
| @@ -161,6 +167,11 @@ export struct SpacialTopicPageComponent { | @@ -161,6 +167,11 @@ export struct SpacialTopicPageComponent { | ||
| 161 | .height(CommonConstants.FULL_HEIGHT) | 167 | .height(CommonConstants.FULL_HEIGHT) |
| 162 | .padding({ bottom: this.action?.params?.backVisibility ? 115 : 75 }) | 168 | .padding({ bottom: this.action?.params?.backVisibility ? 115 : 75 }) |
| 163 | 169 | ||
| 170 | + RelativeContainer() { | ||
| 171 | + // 挂角广告 | ||
| 172 | + this.pageHornAd() | ||
| 173 | + } | ||
| 174 | + | ||
| 164 | if (!this.isNetConnected) { | 175 | if (!this.isNetConnected) { |
| 165 | EmptyComponent({ | 176 | EmptyComponent({ |
| 166 | emptyType: 1, | 177 | emptyType: 1, |
| @@ -200,6 +211,102 @@ export struct SpacialTopicPageComponent { | @@ -200,6 +211,102 @@ export struct SpacialTopicPageComponent { | ||
| 200 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 211 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 201 | } | 212 | } |
| 202 | 213 | ||
| 214 | + /** | ||
| 215 | + * 页面挂角广告 | ||
| 216 | + */ | ||
| 217 | + @Builder | ||
| 218 | + pageHornAd() { | ||
| 219 | + | ||
| 220 | + if (this.pageAdvModel.isShowAds) { | ||
| 221 | + if (this.pageAdvModel.pageCornerAdv.matInfo != null && this.pageAdvModel.pageCornerAdv.matInfo.linkType != '2') { | ||
| 222 | + // 广告中心的挂角广告 | ||
| 223 | + this.drawPageCornerAdvView(1, 1 == this.pageAdvModel.isRightAdv) | ||
| 224 | + } else if (this.pageAdvModel.pageCornerContentInfo.advert != null ) { | ||
| 225 | + // 展现中心的挂角广告业务 | ||
| 226 | + this.drawPageCornerAdvView(2, 1 == this.pageAdvModel.isRightAdv) | ||
| 227 | + } | ||
| 228 | + } | ||
| 229 | + } | ||
| 230 | + | ||
| 231 | + /** | ||
| 232 | + * 绘制页面挂角 | ||
| 233 | + * | ||
| 234 | + * @param type 1:广告中心的挂角广告;2:展现中心的挂角广告 | ||
| 235 | + * @param isRightCorne true:右挂角;false:左挂角 | ||
| 236 | + */ | ||
| 237 | + @Builder | ||
| 238 | + drawPageCornerAdvView(type: number, isRightCorne: boolean) { | ||
| 239 | + // 页面左挂角 | ||
| 240 | + Image(type === 1 ? this.pageAdvModel.pageCornerAdv.matInfo.matImageUrl[0] | ||
| 241 | + : this.pageAdvModel.pageCornerContentInfo.advert.displayUrl) | ||
| 242 | + .width($r('app.float.vp_80')) | ||
| 243 | + .height($r('app.float.vp_80')) | ||
| 244 | + .id("left_iv") | ||
| 245 | + .alignRules({ | ||
| 246 | + bottom: { anchor: '__container__', align: VerticalAlign.Bottom }, | ||
| 247 | + left: { anchor: isRightCorne ? "" : '__container__', align: HorizontalAlign.Start }, | ||
| 248 | + right: { anchor: isRightCorne ? '__container__' : "", align: HorizontalAlign.End }, | ||
| 249 | + }) | ||
| 250 | + .margin({ | ||
| 251 | + bottom: "105vp", | ||
| 252 | + left: isRightCorne ? 0 : $r('app.float.card_comp_pagePadding_lf'), | ||
| 253 | + right: isRightCorne ? $r('app.float.card_comp_pagePadding_lf') : 0, | ||
| 254 | + | ||
| 255 | + }) | ||
| 256 | + .onClick(() => { | ||
| 257 | + if (type === 1) { | ||
| 258 | + // 广告业务跳转 | ||
| 259 | + ProcessUtils.openAdvDetail(this.pageAdvModel.pageCornerAdv.matInfo); | ||
| 260 | + } else { | ||
| 261 | + // 展现中心的业务跳转 | ||
| 262 | + ProcessUtils.advJumpMainPage(this.pageAdvModel.pageCornerContentInfo.advert) | ||
| 263 | + } | ||
| 264 | + }) | ||
| 265 | + .grayscale(this.GrayManage.get().isMourning() ? 1 : 0) | ||
| 266 | + // 关闭按钮 | ||
| 267 | + Image($r('app.media.icon_adv_horn_close')) | ||
| 268 | + .id('left_close') | ||
| 269 | + .width($r('app.float.vp_16')) | ||
| 270 | + .alignRules({ | ||
| 271 | + top: { anchor: 'left_iv', align: VerticalAlign.Top }, | ||
| 272 | + left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start }, | ||
| 273 | + right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End }, | ||
| 274 | + }) | ||
| 275 | + .offset({ | ||
| 276 | + x: isRightCorne ? 10 : -10, | ||
| 277 | + y: isRightCorne ? -10 : -10 | ||
| 278 | + }) | ||
| 279 | + .onClick(() => { | ||
| 280 | + // 关闭挂角广告 | ||
| 281 | + this.pageAdvModel.isShowAds = false; | ||
| 282 | + | ||
| 283 | + }) | ||
| 284 | + .grayscale(this.GrayManage.get().isMourning() ? 1 : 0) | ||
| 285 | + | ||
| 286 | + if (type == 1) { | ||
| 287 | + Text($r('app.string.comp_advertisement')) | ||
| 288 | + .width($r('app.float.vp_28')) | ||
| 289 | + .height($r('app.float.vp_16')) | ||
| 290 | + .fontSize($r('app.float.font_size_10')) | ||
| 291 | + .fontColor(Color.White) | ||
| 292 | + .id('left_tag') | ||
| 293 | + .alignRules({ | ||
| 294 | + bottom: { anchor: 'left_iv', align: VerticalAlign.Bottom }, | ||
| 295 | + left: { anchor: isRightCorne ? '' : 'left_iv', align: HorizontalAlign.Start }, | ||
| 296 | + right: { anchor: isRightCorne ? 'left_iv' : '', align: HorizontalAlign.End }, | ||
| 297 | + }) | ||
| 298 | + .textAlign(TextAlign.Center) | ||
| 299 | + .backgroundColor($r('app.color.res_color_general_000000_30')) | ||
| 300 | + .borderRadius({ | ||
| 301 | + topLeft: $r('app.float.vp_2'), | ||
| 302 | + topRight: $r('app.float.vp_2'), | ||
| 303 | + bottomLeft: $r('app.float.vp_2'), | ||
| 304 | + bottomRight: $r('app.float.vp_2') | ||
| 305 | + }) | ||
| 306 | + .grayscale(this.GrayManage.get().isMourning() ? 1 : 0) | ||
| 307 | + } | ||
| 308 | + } | ||
| 309 | + | ||
| 203 | aboutToAppear() { | 310 | aboutToAppear() { |
| 204 | if (!this.action?.params?.backVisibility) { | 311 | if (!this.action?.params?.backVisibility) { |
| 205 | // WindowModel.shared.setWindowLayoutFullScreen(true) | 312 | // WindowModel.shared.setWindowLayoutFullScreen(true) |
| @@ -50,16 +50,16 @@ export struct Card4Component { | @@ -50,16 +50,16 @@ export struct Card4Component { | ||
| 50 | Column() { | 50 | Column() { |
| 51 | Stack() { | 51 | Stack() { |
| 52 | if(this.contentDTO.objectType == '5'){ | 52 | if(this.contentDTO.objectType == '5'){ |
| 53 | - Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(19).align(Alignment.Center) | 53 | + Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(28).align(Alignment.Center) |
| 54 | } else { | 54 | } else { |
| 55 | if (this.contentDTO.seoTags) { | 55 | if (this.contentDTO.seoTags) { |
| 56 | - Notes({ newTags: this.contentDTO.seoTags }).height(19).align(Alignment.Center) | 56 | + Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center) |
| 57 | } | 57 | } |
| 58 | if (this.contentDTO.newTags) { | 58 | if (this.contentDTO.newTags) { |
| 59 | - Notes({ newTags: this.contentDTO.newTags }).height(19).align(Alignment.Center) | 59 | + Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) |
| 60 | } | 60 | } |
| 61 | if (this.contentDTO.top === 1) { | 61 | if (this.contentDTO.top === 1) { |
| 62 | - Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) | 62 | + Notes({ newTags: '置顶' }).height(28).align(Alignment.Center) |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | Text() { | 65 | Text() { |
| @@ -275,6 +275,7 @@ export struct CommentComponent { | @@ -275,6 +275,7 @@ export struct CommentComponent { | ||
| 275 | 275 | ||
| 276 | // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 | 276 | // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 |
| 277 | this.currentPage = pageIndex + 1 | 277 | this.currentPage = pageIndex + 1 |
| 278 | + | ||
| 278 | if (Number.parseInt(commentListModel.totalCommentNum) > | 279 | if (Number.parseInt(commentListModel.totalCommentNum) > |
| 279 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 280 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 280 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' | 281 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' |
| 1 | -import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils } from 'wdKit/Index' | 1 | +import { DisplayUtils, EmitterEventId, EmitterUtils, ToastUtils, NumberFormatterUtils } from 'wdKit/Index' |
| 2 | import { publishCommentModel } from '../model/PublishCommentModel' | 2 | import { publishCommentModel } from '../model/PublishCommentModel' |
| 3 | import { CommentCustomDialog } from './CommentCustomDialog' | 3 | import { CommentCustomDialog } from './CommentCustomDialog' |
| 4 | import measure from '@ohos.measure' | 4 | import measure from '@ohos.measure' |
| @@ -206,7 +206,7 @@ export struct CommentIconComponent { | @@ -206,7 +206,7 @@ export struct CommentIconComponent { | ||
| 206 | // x:-6 | 206 | // x:-6 |
| 207 | // }) | 207 | // }) |
| 208 | .id("Image") | 208 | .id("Image") |
| 209 | - Text(this.showMainText?'正文':this.publishCommentModel.totalCommentNumer)// Text("44444444") | 209 | + Text(this.showMainText?'正文':NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer))// Text("44444444") |
| 210 | .fontSize(8) | 210 | .fontSize(8) |
| 211 | .fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800') | 211 | .fontColor(this.showMainText?'#222222':'#ffffff')// .backgroundColor('#ED2800') |
| 212 | .height(12) | 212 | .height(12) |
| @@ -217,7 +217,7 @@ export struct CommentIconComponent { | @@ -217,7 +217,7 @@ export struct CommentIconComponent { | ||
| 217 | })// .margin({left: 4,right:4 | 217 | })// .margin({left: 4,right:4 |
| 218 | // }) | 218 | // }) |
| 219 | /*动态计算文字宽度*/ | 219 | /*动态计算文字宽度*/ |
| 220 | - .width(this.getMeasureText(this.publishCommentModel.totalCommentNumer) + | 220 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.publishCommentModel.totalCommentNumer)) + |
| 221 | 12)// .backgroundColor(Color.Green) | 221 | 12)// .backgroundColor(Color.Green) |
| 222 | .id("Text") | 222 | .id("Text") |
| 223 | .visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden) | 223 | .visibility(this.publishCommentModel.totalCommentNumer ? Visibility.Visible : Visibility.Hidden) |
| @@ -214,8 +214,9 @@ struct CarouselLayout01CardView { | @@ -214,8 +214,9 @@ struct CarouselLayout01CardView { | ||
| 214 | colors: [[0x7508111A, 0.0], [0x7508111A, 0.3], [Color.Transparent, 1.0]] | 214 | colors: [[0x7508111A, 0.0], [0x7508111A, 0.3], [Color.Transparent, 1.0]] |
| 215 | }) | 215 | }) |
| 216 | .position({ | 216 | .position({ |
| 217 | - bottom: 10 | 217 | + bottom: 0 |
| 218 | }) | 218 | }) |
| 219 | + .borderRadius($r('app.float.image_border_radius')) | ||
| 219 | } | 220 | } |
| 220 | .width(CommonConstants.FULL_PARENT) | 221 | .width(CommonConstants.FULL_PARENT) |
| 221 | .height(CommonConstants.FULL_PARENT) | 222 | .height(CommonConstants.FULL_PARENT) |
| @@ -14,7 +14,7 @@ const TAG = 'Zh_Single_Column-09' | @@ -14,7 +14,7 @@ const TAG = 'Zh_Single_Column-09' | ||
| 14 | @Entry | 14 | @Entry |
| 15 | @Component | 15 | @Component |
| 16 | export struct ZhSingleColumn09 { | 16 | export struct ZhSingleColumn09 { |
| 17 | - @State fullyTraversed: boolean = false; | 17 | + @State fullyTraversed: boolean = false; //换一换置灰标记 |
| 18 | @State private pageModel: PageModel = new PageModel(); | 18 | @State private pageModel: PageModel = new PageModel(); |
| 19 | @State pageId: string = ''; | 19 | @State pageId: string = ''; |
| 20 | @State pageName: string = ''; | 20 | @State pageName: string = ''; |
| @@ -26,11 +26,46 @@ export struct ZhSingleColumn09 { | @@ -26,11 +26,46 @@ export struct ZhSingleColumn09 { | ||
| 26 | @State compIndex: number = 0; | 26 | @State compIndex: number = 0; |
| 27 | @State currentOperDataListIndex: number = 0; //记录换一换点击次数 | 27 | @State currentOperDataListIndex: number = 0; //记录换一换点击次数 |
| 28 | @State visitedIndices: Set<number> = new Set<number>(); | 28 | @State visitedIndices: Set<number> = new Set<number>(); |
| 29 | + private currentIndex: number = 0; | ||
| 30 | + @State currentDataList: ContentDTO[] = [] | ||
| 29 | 31 | ||
| 30 | async aboutToAppear(): Promise<void> { | 32 | async aboutToAppear(): Promise<void> { |
| 31 | this.loadImg = await onlyWifiLoadImg(); | 33 | this.loadImg = await onlyWifiLoadImg(); |
| 32 | - this.operDataList = this.shuffleArray(this.compDTO?.operDataList) | 34 | + // this.operDataList = this.shuffleArray(this.compDTO?.operDataList) |
| 35 | + this.operDataList = this.padData(this.compDTO?.operDataList) | ||
| 33 | this.currentOperDataListIndex = this.compDTO?.operDataList.length | 36 | this.currentOperDataListIndex = this.compDTO?.operDataList.length |
| 37 | + this.currentDataList = this.getNextBatch() | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 若数据不满足8个以上直接返回 | ||
| 42 | + * 若最后一屏不够补齐至8个 | ||
| 43 | + * */ | ||
| 44 | + private padData(data: ContentDTO[]): ContentDTO[] { | ||
| 45 | + if (data.length < 9) { | ||
| 46 | + return data | ||
| 47 | + } | ||
| 48 | + const remainder = data.length % 8; | ||
| 49 | + if (remainder === 0) { | ||
| 50 | + return data; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + const paddingCount = 8 - remainder; | ||
| 54 | + const padding = data.slice(0, paddingCount); | ||
| 55 | + | ||
| 56 | + return [...data, ...padding]; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + /** | ||
| 60 | + * 换一换切换数据 | ||
| 61 | + * */ | ||
| 62 | + public getNextBatch(): ContentDTO[] { | ||
| 63 | + const batch = this.operDataList.slice(this.currentIndex, this.currentIndex + 8); | ||
| 64 | + this.currentIndex += 8; | ||
| 65 | + if (this.currentIndex >= this.operDataList.length) { | ||
| 66 | + this.fullyTraversed = true //数据展现完毕,置灰标记 | ||
| 67 | + } | ||
| 68 | + return batch; | ||
| 34 | } | 69 | } |
| 35 | 70 | ||
| 36 | trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') { | 71 | trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') { |
| @@ -142,8 +177,8 @@ export struct ZhSingleColumn09 { | @@ -142,8 +177,8 @@ export struct ZhSingleColumn09 { | ||
| 142 | .justifyContent(FlexAlign.SpaceBetween) | 177 | .justifyContent(FlexAlign.SpaceBetween) |
| 143 | .width('100%') | 178 | .width('100%') |
| 144 | 179 | ||
| 145 | - Flex({wrap: FlexWrap.Wrap}) { | ||
| 146 | - ForEach(this.operDataList.slice(0, 8), (item: ContentDTO, index: number) => { | 180 | + Flex({ wrap: FlexWrap.Wrap }) { |
| 181 | + ForEach(this.currentDataList, (item: ContentDTO, index: number) => { | ||
| 147 | Row() { | 182 | Row() { |
| 148 | Stack({ alignContent: Alignment.TopEnd }) { | 183 | Stack({ alignContent: Alignment.TopEnd }) { |
| 149 | Image(this.loadImg ? item.coverUrl : '') | 184 | Image(this.loadImg ? item.coverUrl : '') |
| @@ -156,7 +191,7 @@ export struct ZhSingleColumn09 { | @@ -156,7 +191,7 @@ export struct ZhSingleColumn09 { | ||
| 156 | .width('100%') | 191 | .width('100%') |
| 157 | .height('100%') | 192 | .height('100%') |
| 158 | .backgroundColor('rgba(0, 0, 0, 1)') | 193 | .backgroundColor('rgba(0, 0, 0, 1)') |
| 159 | - .opacity(0.4) | 194 | + .opacity(this.activeIndexs.includes(index) ? 0.8 : 0.4) |
| 160 | .borderRadius(3) | 195 | .borderRadius(3) |
| 161 | 196 | ||
| 162 | Text(item.newsTitle) | 197 | Text(item.newsTitle) |
| @@ -204,10 +239,14 @@ export struct ZhSingleColumn09 { | @@ -204,10 +239,14 @@ export struct ZhSingleColumn09 { | ||
| 204 | return | 239 | return |
| 205 | } | 240 | } |
| 206 | if (this.compDTO?.operDataList.length > 8) { | 241 | if (this.compDTO?.operDataList.length > 8) { |
| 207 | - this.operDataList = this.shuffleArray(this.operDataList) | 242 | + // this.operDataList = this.shuffleArray(this.operDataList) |
| 208 | // if (this.pageModel) { | 243 | // if (this.pageModel) { |
| 209 | // this.pageModel.compList.deleteItem(this.compIndex) | 244 | // this.pageModel.compList.deleteItem(this.compIndex) |
| 210 | // } | 245 | // } |
| 246 | + if (this.fullyTraversed) { | ||
| 247 | + return; // 所有数据已取完 | ||
| 248 | + } | ||
| 249 | + this.currentDataList = this.getNextBatch() | ||
| 211 | this.activeIndexs = []; | 250 | this.activeIndexs = []; |
| 212 | } | 251 | } |
| 213 | }) | 252 | }) |
| @@ -372,7 +372,7 @@ export struct ZhSingleRow03 { | @@ -372,7 +372,7 @@ export struct ZhSingleRow03 { | ||
| 372 | }) | 372 | }) |
| 373 | 373 | ||
| 374 | Text(item.newsTitle) | 374 | Text(item.newsTitle) |
| 375 | - .width(201) | 375 | + .width('calc(100% - 106vp - 12vp)') |
| 376 | .height(60) | 376 | .height(60) |
| 377 | .maxLines(3) | 377 | .maxLines(3) |
| 378 | .textOverflow({overflow: TextOverflow.Ellipsis}) | 378 | .textOverflow({overflow: TextOverflow.Ellipsis}) |
| @@ -380,6 +380,7 @@ export struct ZhSingleRow03 { | @@ -380,6 +380,7 @@ export struct ZhSingleRow03 { | ||
| 380 | } | 380 | } |
| 381 | .margin({bottom: 16}) | 381 | .margin({bottom: 16}) |
| 382 | .justifyContent(FlexAlign.Start) | 382 | .justifyContent(FlexAlign.Start) |
| 383 | + .width('100%') | ||
| 383 | 384 | ||
| 384 | Row() { | 385 | Row() { |
| 385 | Flex({justifyContent: FlexAlign.SpaceBetween}){ | 386 | Flex({justifyContent: FlexAlign.SpaceBetween}){ |
| 1 | -import { LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; | 1 | +import { DisplayUtils, LazyDataSource, SPHelper, UserDataLocal } from 'wdKit'; |
| 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 2 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel'; |
| 4 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; | 4 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'; |
| @@ -23,6 +23,8 @@ export struct HomePageBottomFollowComponent { | @@ -23,6 +23,8 @@ export struct HomePageBottomFollowComponent { | ||
| 23 | @State count: number = 0; | 23 | @State count: number = 0; |
| 24 | preferences: dataPreferences.Preferences | null = null; | 24 | preferences: dataPreferences.Preferences | null = null; |
| 25 | @State isGetRequest: boolean = false | 25 | @State isGetRequest: boolean = false |
| 26 | + | ||
| 27 | + @State bottomCompH:number = 200 | ||
| 26 | observer = (key: string) => { | 28 | observer = (key: string) => { |
| 27 | if (key == UserDataLocal.USER_FOLLOW_OPERATION) { | 29 | if (key == UserDataLocal.USER_FOLLOW_OPERATION) { |
| 28 | let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION, "") as string | 30 | let value = SPHelper.default.getSync(UserDataLocal.USER_FOLLOW_OPERATION, "") as string |
| @@ -174,7 +176,8 @@ export struct HomePageBottomFollowComponent { | @@ -174,7 +176,8 @@ export struct HomePageBottomFollowComponent { | ||
| 174 | //没有更多数据 显示提示 | 176 | //没有更多数据 显示提示 |
| 175 | if (!this.hasMore) { | 177 | if (!this.hasMore) { |
| 176 | ListItem() { | 178 | ListItem() { |
| 177 | - ListHasNoMoreDataUI() | 179 | + ///ToDo 数据过少时,达不到滑动条件 后续优化 |
| 180 | + ListHasNoMoreDataUI().height(this.bottomCompH > 150?this.bottomCompH:150) | ||
| 178 | } | 181 | } |
| 179 | } | 182 | } |
| 180 | } | 183 | } |
| @@ -230,6 +233,8 @@ export struct HomePageBottomFollowComponent { | @@ -230,6 +233,8 @@ export struct HomePageBottomFollowComponent { | ||
| 230 | this.hasMore = false | 233 | this.hasMore = false |
| 231 | } | 234 | } |
| 232 | } | 235 | } |
| 236 | + this.bottomCompH = DisplayUtils.getDeviceHeight() - this.data_follow.totalCount()*100 | ||
| 237 | + console.log(TAG, `${this.bottomCompH}`); | ||
| 233 | this.isLoading = false | 238 | this.isLoading = false |
| 234 | this.isGetRequest = true | 239 | this.isGetRequest = true |
| 235 | }).catch((err: Error) => { | 240 | }).catch((err: Error) => { |
| @@ -20,6 +20,9 @@ import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel | @@ -20,6 +20,9 @@ import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel | ||
| 20 | @Entry | 20 | @Entry |
| 21 | @Component | 21 | @Component |
| 22 | struct MyCollectionListPage { | 22 | struct MyCollectionListPage { |
| 23 | + //RmhTitle组件刷新需要设置 该界面为用户主页,所以不需要刷新操作 | ||
| 24 | + @Provide pageShow: number = -1 | ||
| 25 | + | ||
| 23 | @State private browSingModel: PageModel = new PageModel() | 26 | @State private browSingModel: PageModel = new PageModel() |
| 24 | isloading : boolean = false | 27 | isloading : boolean = false |
| 25 | @Provide isEditState:boolean = false | 28 | @Provide isEditState:boolean = false |
| @@ -60,6 +63,7 @@ struct MyCollectionListPage { | @@ -60,6 +63,7 @@ struct MyCollectionListPage { | ||
| 60 | } | 63 | } |
| 61 | 64 | ||
| 62 | onPageShow(){ | 65 | onPageShow(){ |
| 66 | + this.pageShow = Math.random() | ||
| 63 | TrackingPageBrowseUtils.TrackingPageBrowseExposureStart() | 67 | TrackingPageBrowseUtils.TrackingPageBrowseExposureStart() |
| 64 | } | 68 | } |
| 65 | 69 |
| @@ -120,9 +120,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -120,9 +120,9 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 120 | .textAlign(TextAlign.Start) | 120 | .textAlign(TextAlign.Start) |
| 121 | .margin({ top: 8 }) | 121 | .margin({ top: 8 }) |
| 122 | .width(this.compDTO.operDataList.length == 2 ? 210 : 150) | 122 | .width(this.compDTO.operDataList.length == 2 ? 210 : 150) |
| 123 | - .lineHeight(21) | 123 | + .lineHeight(19) |
| 124 | } | 124 | } |
| 125 | - .height(this.compDTO.operDataList.length == 2 ? 180 : 148) | 125 | + .height(this.compDTO.operDataList.length == 2 ? 190 : 148) |
| 126 | .padding({ right: 16 }) | 126 | .padding({ right: 16 }) |
| 127 | // .offset({x:16}) | 127 | // .offset({x:16}) |
| 128 | .onClick(() => { | 128 | .onClick(() => { |
| @@ -160,7 +160,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -160,7 +160,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 160 | } | 160 | } |
| 161 | } | 161 | } |
| 162 | .align(Alignment.Start) | 162 | .align(Alignment.Start) |
| 163 | - .scrollable(this.compDTO.operDataList.length > 2 ? ScrollDirection.Horizontal : ScrollDirection.None) | 163 | + .scrollable(this.compDTO.operDataList.length >= 2 ? ScrollDirection.Horizontal : ScrollDirection.None) |
| 164 | .scrollBar(BarState.Off) | 164 | .scrollBar(BarState.Off) |
| 165 | .edgeEffect(EdgeEffect.None) | 165 | .edgeEffect(EdgeEffect.None) |
| 166 | .onReachEnd(() => { | 166 | .onReachEnd(() => { |
| @@ -242,7 +242,7 @@ export struct LiveOperRowListView { | @@ -242,7 +242,7 @@ export struct LiveOperRowListView { | ||
| 242 | } | 242 | } |
| 243 | .padding({top:10}) | 243 | .padding({top:10}) |
| 244 | .layoutWeight(1) | 244 | .layoutWeight(1) |
| 245 | - .margin({ left: 16 }) | 245 | + .margin({ left: 0 }) |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | /** | 248 | /** |
| @@ -542,16 +542,15 @@ export struct OperRowListView { | @@ -542,16 +542,15 @@ export struct OperRowListView { | ||
| 542 | if (res.data) { | 542 | if (res.data) { |
| 543 | this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) | 543 | this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) |
| 544 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | 544 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) |
| 545 | - this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) | 545 | + // this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) |
| 546 | + this.interactData.commentNum = res.data[0]?.commentNum | ||
| 546 | // 评论组件需要数据 | 547 | // 评论组件需要数据 |
| 547 | - if (Number.parseInt(this.interactData.commentNum) > | 548 | + if (Number.parseInt(this.interactData.commentNum + '') > |
| 548 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 549 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 549 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' | 550 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' |
| 550 | } | 551 | } |
| 551 | } | 552 | } |
| 552 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) | 553 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) |
| 553 | - console.log(TAG, 'this.interactData44', JSON.stringify(this.interactData)) | ||
| 554 | - console.log(TAG, 'this.publishCommentModel', JSON.stringify(this.publishCommentModel)) | ||
| 555 | }) | 554 | }) |
| 556 | } | 555 | } |
| 557 | } | 556 | } |
| @@ -6,6 +6,9 @@ import { router } from '@kit.ArkUI'; | @@ -6,6 +6,9 @@ import { router } from '@kit.ArkUI'; | ||
| 6 | @Entry | 6 | @Entry |
| 7 | @Component | 7 | @Component |
| 8 | struct SearchPage { | 8 | struct SearchPage { |
| 9 | + //RmhTitle组件刷新需要设置 | ||
| 10 | + @Provide pageShow: number = -1 | ||
| 11 | + | ||
| 9 | @State params:Record<string, string> = router.getParams() as Record<string, string>; | 12 | @State params:Record<string, string> = router.getParams() as Record<string, string>; |
| 10 | @State fromTabName: string = 'NEWS'; | 13 | @State fromTabName: string = 'NEWS'; |
| 11 | pageShowTime:number = 0; | 14 | pageShowTime:number = 0; |
| @@ -14,6 +17,7 @@ struct SearchPage { | @@ -14,6 +17,7 @@ struct SearchPage { | ||
| 14 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 17 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 15 | 18 | ||
| 16 | onPageShow() { | 19 | onPageShow() { |
| 20 | + this.pageShow = Math.random() | ||
| 17 | this.fromTabName = this.params?.['tabName']; | 21 | this.fromTabName = this.params?.['tabName']; |
| 18 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 22 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 19 | WindowModel.shared.setWindowSystemBarProperties({ | 23 | WindowModel.shared.setWindowSystemBarProperties({ |
| 1 | -import { PageInfoDTO } from 'wdBean/Index'; | 1 | +import { PageInfoDTO,TopicDetailData } from 'wdBean/Index'; |
| 2 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | 2 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; |
| 3 | import { DateTimeUtils, SPHelper } from 'wdKit/Index'; | 3 | import { DateTimeUtils, SPHelper } from 'wdKit/Index'; |
| 4 | import { ArrayList } from '@kit.ArkTS'; | 4 | import { ArrayList } from '@kit.ArkTS'; |
| @@ -21,15 +21,23 @@ export default class PageAdModel { | @@ -21,15 +21,23 @@ export default class PageAdModel { | ||
| 21 | // 1:右边;2:左边 -> 默认右边 | 21 | // 1:右边;2:左边 -> 默认右边 |
| 22 | pageCornerContentInfo: AdvRuleBean = {} as AdvRuleBean | 22 | pageCornerContentInfo: AdvRuleBean = {} as AdvRuleBean |
| 23 | 23 | ||
| 24 | + | ||
| 25 | + analysisAdvSource(pageInfo: PageInfoDTO) { | ||
| 26 | + this.analysisAllAdvSource(pageInfo.hasAdInfo,pageInfo.cornersAdv,pageInfo.cornersAdv2,pageInfo.id) | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + analysisTopicAdvSource(topicDetail: TopicDetailData) { | ||
| 30 | + this.analysisAllAdvSource(topicDetail.hasAdInfo,topicDetail.cornersAdv,topicDetail.cornersAdv2,topicDetail.id) | ||
| 31 | + } | ||
| 32 | + | ||
| 24 | /** | 33 | /** |
| 25 | * 解析广告资源 | 34 | * 解析广告资源 |
| 26 | * @param pageInfo | 35 | * @param pageInfo |
| 27 | */ | 36 | */ |
| 28 | - async analysisAdvSource(pageInfo: PageInfoDTO) { | ||
| 29 | - | ||
| 30 | - if (pageInfo.hasAdInfo === 1 && pageInfo.cornersAdv != null) { | 37 | + private async analysisAllAdvSource(hasAdInfo: number,cornersAd: AdvRuleBean,cornersAd2: CompAdvBean[],id: number) { |
| 38 | + if (hasAdInfo === 1 && cornersAd != null) { | ||
| 31 | // 优先展示展现中心广告 | 39 | // 优先展示展现中心广告 |
| 32 | - let cornersAdv = pageInfo.cornersAdv | 40 | + let cornersAdv = cornersAd |
| 33 | 41 | ||
| 34 | if (cornersAdv == null) { | 42 | if (cornersAdv == null) { |
| 35 | return | 43 | return |
| @@ -50,9 +58,9 @@ export default class PageAdModel { | @@ -50,9 +58,9 @@ export default class PageAdModel { | ||
| 50 | this.pageCornerContentInfo = cornersAdv; | 58 | this.pageCornerContentInfo = cornersAdv; |
| 51 | this.isShowAds = true | 59 | this.isShowAds = true |
| 52 | 60 | ||
| 53 | - } else if (pageInfo.cornersAdv2 != null && pageInfo.cornersAdv2.length > 0) { | 61 | + } else if (cornersAd2 != null && cornersAd2.length > 0) { |
| 54 | // 广告中心-挂角广告信息 | 62 | // 广告中心-挂角广告信息 |
| 55 | - let cornersAdv2 = pageInfo.cornersAdv2 | 63 | + let cornersAdv2 = cornersAd2 |
| 56 | 64 | ||
| 57 | if (cornersAdv2.length == 0) { | 65 | if (cornersAdv2.length == 0) { |
| 58 | return | 66 | return |
| @@ -61,7 +69,7 @@ export default class PageAdModel { | @@ -61,7 +69,7 @@ export default class PageAdModel { | ||
| 61 | let pageCoreAdvArray = this.treatPageInfoAdsData(cornersAdv2); | 69 | let pageCoreAdvArray = this.treatPageInfoAdsData(cornersAdv2); |
| 62 | 70 | ||
| 63 | let advLength = pageCoreAdvArray.length; | 71 | let advLength = pageCoreAdvArray.length; |
| 64 | - let pageId = pageInfo.id.toString(); | 72 | + let pageId = id.toString(); |
| 65 | let a = 0; | 73 | let a = 0; |
| 66 | if (advLength > 1) { | 74 | if (advLength > 1) { |
| 67 | a = await this.calPageAdvIndex(pageId,advLength) | 75 | a = await this.calPageAdvIndex(pageId,advLength) |
| @@ -86,8 +94,8 @@ export default class PageAdModel { | @@ -86,8 +94,8 @@ export default class PageAdModel { | ||
| 86 | this.pageCornerAdv = showCompAdvBean | 94 | this.pageCornerAdv = showCompAdvBean |
| 87 | this.isShowAds = true | 95 | this.isShowAds = true |
| 88 | } | 96 | } |
| 89 | - | ||
| 90 | } | 97 | } |
| 98 | + | ||
| 91 | /** | 99 | /** |
| 92 | * 计算投放广告的序列号 | 100 | * 计算投放广告的序列号 |
| 93 | * @param pageId | 101 | * @param pageId |
| @@ -148,12 +148,20 @@ export struct DetailPlayVLivePage { | @@ -148,12 +148,20 @@ export struct DetailPlayVLivePage { | ||
| 148 | .width('100%') | 148 | .width('100%') |
| 149 | .blur(100) | 149 | .blur(100) |
| 150 | .renderFit(RenderFit.RESIZE_COVER) | 150 | .renderFit(RenderFit.RESIZE_COVER) |
| 151 | + RelativeContainer() | ||
| 152 | + .backgroundColor(Color.Black) | ||
| 153 | + .visibility(this.isPlayerError ? Visibility.Visible : | ||
| 154 | + Visibility.None) | ||
| 155 | + | ||
| 151 | // 直播结束且无回看 | 156 | // 直播结束且无回看 |
| 152 | if (this.liveState === 'end' && StringUtils.isEmpty(this.playUrl)) { | 157 | if (this.liveState === 'end' && StringUtils.isEmpty(this.playUrl)) { |
| 153 | PlayerEndView() | 158 | PlayerEndView() |
| 154 | } else { | 159 | } else { |
| 155 | // 直播暂停,仍然可以评论 | 160 | // 直播暂停,仍然可以评论 |
| 156 | if (this.liveState === 'pause') { | 161 | if (this.liveState === 'pause') { |
| 162 | + RelativeContainer() | ||
| 163 | + .backgroundColor('#000000') | ||
| 164 | + .opacity(0.5) | ||
| 157 | LiveEmptyComponent({ | 165 | LiveEmptyComponent({ |
| 158 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 166 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 159 | }) | 167 | }) |
| @@ -168,6 +176,9 @@ export struct DetailPlayVLivePage { | @@ -168,6 +176,9 @@ export struct DetailPlayVLivePage { | ||
| 168 | 176 | ||
| 169 | } else { | 177 | } else { |
| 170 | // 没有配置垫片资源 | 178 | // 没有配置垫片资源 |
| 179 | + RelativeContainer() | ||
| 180 | + .backgroundColor('#000000') | ||
| 181 | + .opacity(0.5) | ||
| 171 | LiveEmptyComponent({ | 182 | LiveEmptyComponent({ |
| 172 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend | 183 | emptyType: WDLiveViewDefaultType.WDViewDefaultType_NoLiveSuspend |
| 173 | }) | 184 | }) |
| @@ -98,11 +98,10 @@ export struct TabComponent { | @@ -98,11 +98,10 @@ export struct TabComponent { | ||
| 98 | .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) | 98 | .fontColor(this.currentIndex === index ? this.selectedFontColor : this.fontColor) |
| 99 | .fontSize('18vp') | 99 | .fontSize('18vp') |
| 100 | .fontWeight(this.currentIndex === index ? 600 : 400) | 100 | .fontWeight(this.currentIndex === index ? 600 : 400) |
| 101 | - Divider() | ||
| 102 | - .strokeWidth(2) | 101 | + Image($r('app.media.icon_tab_indictor_line')) |
| 103 | .margin({ top: 6 }) | 102 | .margin({ top: 6 }) |
| 104 | - .width(15) | ||
| 105 | - .color('#CB0000') | 103 | + .width(18) |
| 104 | + .height(2) | ||
| 106 | .visibility(this.currentIndex === index ? Visibility.Visible : Visibility.Hidden) | 105 | .visibility(this.currentIndex === index ? Visibility.Visible : Visibility.Hidden) |
| 107 | }.justifyContent(FlexAlign.Center) | 106 | }.justifyContent(FlexAlign.Center) |
| 108 | .constraintSize({ minWidth: 35 }) | 107 | .constraintSize({ minWidth: 35 }) |
| @@ -173,7 +173,7 @@ export struct PlayUIComponent { | @@ -173,7 +173,7 @@ export struct PlayUIComponent { | ||
| 173 | .width('100%') | 173 | .width('100%') |
| 174 | // .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)') | 174 | // .width(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? 'calc(100% - 80vp)' : 'calc(100% - 32vp)') |
| 175 | .padding({ | 175 | .padding({ |
| 176 | - top: 15, | 176 | + top: 11, |
| 177 | bottom: 6, | 177 | bottom: 6, |
| 178 | left: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp', | 178 | left: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp', |
| 179 | right: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp' | 179 | right: this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '40vp' : '16vp' |
sight_harmony/features/wdDetailPlayLive/src/main/resources/base/media/icon_tab_indictor_line.png
0 → 100644
188 Bytes
| @@ -76,6 +76,10 @@ export struct PlayerProgressView { | @@ -76,6 +76,10 @@ export struct PlayerProgressView { | ||
| 76 | // .markAnchor({ x: 0, y: '100%' }) | 76 | // .markAnchor({ x: 0, y: '100%' }) |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | + aboutToDisappear(): void { | ||
| 80 | + clearTimeout(this.timer) | ||
| 81 | + } | ||
| 82 | + | ||
| 79 | build() { | 83 | build() { |
| 80 | Stack() { | 84 | Stack() { |
| 81 | this.playerLoadingBuilder() | 85 | this.playerLoadingBuilder() |
| 1 | 1 | ||
| 2 | -import LaunchDataModel, { mournsInfoModel } from '../viewModel/LaunchDataModel' | 2 | +import LaunchDataModel from '../viewModel/LaunchDataModel' |
| 3 | 3 | ||
| 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 4 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 5 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; | 5 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork/Index'; |
-
Please register or login to post a comment