Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
7 changed files
with
57 additions
and
33 deletions
| @@ -42,7 +42,7 @@ export struct H5NewsWebPageComponent { | @@ -42,7 +42,7 @@ export struct H5NewsWebPageComponent { | ||
| 42 | action: Action = {} as Action | 42 | action: Action = {} as Action |
| 43 | @State webUrl: string = ''; | 43 | @State webUrl: string = ''; |
| 44 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 44 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 45 | - @State recommendList: ContentDTO[] = [] | 45 | + // @State recommendList: ContentDTO[] = [] |
| 46 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 46 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 47 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 47 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 48 | @State isPageEnd: boolean = false | 48 | @State isPageEnd: boolean = false |
| @@ -58,7 +58,7 @@ export struct H5NewsWebPageComponent { | @@ -58,7 +58,7 @@ export struct H5NewsWebPageComponent { | ||
| 58 | @State showCommentList: boolean = false | 58 | @State showCommentList: boolean = false |
| 59 | @State index: number = 0 | 59 | @State index: number = 0 |
| 60 | @State currentIndex: number = 0 | 60 | @State currentIndex: number = 0 |
| 61 | - private navTitle = '人民日报'; | 61 | + @State navTitle: string = "" |
| 62 | 62 | ||
| 63 | build() { | 63 | build() { |
| 64 | Stack({ alignContent: Alignment.Top }){ | 64 | Stack({ alignContent: Alignment.Top }){ |
| @@ -137,13 +137,14 @@ export struct H5NewsWebPageComponent { | @@ -137,13 +137,14 @@ export struct H5NewsWebPageComponent { | ||
| 137 | console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0])) | 137 | console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0])) |
| 138 | if (detailBeans && detailBeans.length > 0) { | 138 | if (detailBeans && detailBeans.length > 0) { |
| 139 | this.contentDetailData = detailBeans[0]; | 139 | this.contentDetailData = detailBeans[0]; |
| 140 | + this.navTitle = this.contentDetailData.newsTitle | ||
| 140 | let dateTime = | 141 | let dateTime = |
| 141 | DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); | 142 | DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); |
| 142 | // let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) | 143 | // let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN) |
| 143 | // this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime) | 144 | // this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime) |
| 144 | - if (this.contentDetailData?.recommendShow === 1) { | ||
| 145 | - this.getRecommend() | ||
| 146 | - } | 145 | + // if (this.contentDetailData?.recommendShow === 1) { |
| 146 | + // this.getRecommend() | ||
| 147 | + // } | ||
| 147 | if (this.contentDetailData?.openLikes === 1) { | 148 | if (this.contentDetailData?.openLikes === 1) { |
| 148 | console.log(TAG, '点赞this.getInteractDataStatus()') | 149 | console.log(TAG, '点赞this.getInteractDataStatus()') |
| 149 | this.getInteractDataStatus() | 150 | this.getInteractDataStatus() |
| @@ -167,10 +168,10 @@ export struct H5NewsWebPageComponent { | @@ -167,10 +168,10 @@ export struct H5NewsWebPageComponent { | ||
| 167 | if (this.contentDetailData.openLikes === 1) { | 168 | if (this.contentDetailData.openLikes === 1) { |
| 168 | this.operationButtonList.push('like') | 169 | this.operationButtonList.push('like') |
| 169 | } | 170 | } |
| 170 | - if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length && | ||
| 171 | - this.contentDetailData?.audioList[0].audioUrl) { | ||
| 172 | - this.operationButtonList.push('listen') | ||
| 173 | - } | 171 | + // if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length && |
| 172 | + // this.contentDetailData?.audioList[0].audioUrl) { | ||
| 173 | + // this.operationButtonList.push('listen') | ||
| 174 | + // } | ||
| 174 | this.operationButtonList.push('collect') | 175 | this.operationButtonList.push('collect') |
| 175 | if (this.contentDetailData.shareInfo?.shareOpen === 1) { | 176 | if (this.contentDetailData.shareInfo?.shareOpen === 1) { |
| 176 | this.operationButtonList.push('share') | 177 | this.operationButtonList.push('share') |
| @@ -179,23 +180,23 @@ export struct H5NewsWebPageComponent { | @@ -179,23 +180,23 @@ export struct H5NewsWebPageComponent { | ||
| 179 | } | 180 | } |
| 180 | } | 181 | } |
| 181 | 182 | ||
| 182 | - private async getRecommend() { | ||
| 183 | - let params: postRecommendListParams = { | ||
| 184 | - imei: HttpUtils.getImei(), | ||
| 185 | - userId: HttpUtils.getUserId(), | ||
| 186 | - contentId: String(this.contentDetailData?.newsId), | ||
| 187 | - recType: 1, | ||
| 188 | - contentType: this.contentDetailData?.newsType, | ||
| 189 | - relId: this.contentDetailData?.reLInfo?.relId, | ||
| 190 | - // channelId: String(this.contentDetailData?.reLInfo?.channelId) | ||
| 191 | - } | ||
| 192 | - let recommendList = await DetailViewModel.postRecommendList(params) | ||
| 193 | - if (recommendList.length > 0) { | ||
| 194 | - //推荐列表过滤音频和活动入口 | ||
| 195 | - this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13'); | ||
| 196 | - } | ||
| 197 | - | ||
| 198 | - } | 183 | + // private async getRecommend() { |
| 184 | + // let params: postRecommendListParams = { | ||
| 185 | + // imei: HttpUtils.getImei(), | ||
| 186 | + // userId: HttpUtils.getUserId(), | ||
| 187 | + // contentId: String(this.contentDetailData?.newsId), | ||
| 188 | + // recType: 1, | ||
| 189 | + // contentType: this.contentDetailData?.newsType, | ||
| 190 | + // relId: this.contentDetailData?.reLInfo?.relId, | ||
| 191 | + // // channelId: String(this.contentDetailData?.reLInfo?.channelId) | ||
| 192 | + // } | ||
| 193 | + // let recommendList = await DetailViewModel.postRecommendList(params) | ||
| 194 | + // if (recommendList.length > 0) { | ||
| 195 | + // //推荐列表过滤音频和活动入口 | ||
| 196 | + // this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13'); | ||
| 197 | + // } | ||
| 198 | + // | ||
| 199 | + // } | ||
| 199 | 200 | ||
| 200 | // 已登录->查询用户对作品点赞、收藏状态 | 201 | // 已登录->查询用户对作品点赞、收藏状态 |
| 201 | private async getInteractDataStatus() { | 202 | private async getInteractDataStatus() { |
| @@ -48,7 +48,7 @@ export struct CommentTabComponent { | @@ -48,7 +48,7 @@ export struct CommentTabComponent { | ||
| 48 | dx: 0, | 48 | dx: 0, |
| 49 | dy: -20 | 49 | dy: -20 |
| 50 | }, | 50 | }, |
| 51 | - backgroundColor: "#50000000", | 51 | + maskColor: "#50000000", |
| 52 | }) | 52 | }) |
| 53 | 53 | ||
| 54 | this.onLoad(this.dialogController) | 54 | this.onLoad(this.dialogController) |
| @@ -3,7 +3,7 @@ import router from '@ohos.router' | @@ -3,7 +3,7 @@ import router from '@ohos.router' | ||
| 3 | @Component | 3 | @Component |
| 4 | export struct CustomTitleUI { | 4 | export struct CustomTitleUI { |
| 5 | imgBack:boolean = true | 5 | imgBack:boolean = true |
| 6 | - titleName:ResourceStr = "默认标题" | 6 | + @Prop titleName: ResourceStr = "" |
| 7 | @Prop percent:number = 1 | 7 | @Prop percent:number = 1 |
| 8 | isShowBottomLine:boolean = false | 8 | isShowBottomLine:boolean = false |
| 9 | 9 |
| @@ -377,7 +377,7 @@ export struct LiveOperRowListView { | @@ -377,7 +377,7 @@ export struct LiveOperRowListView { | ||
| 377 | dx: 0, | 377 | dx: 0, |
| 378 | dy: -20 | 378 | dy: -20 |
| 379 | }, | 379 | }, |
| 380 | - backgroundColor: "#50000000", | 380 | + maskColor: "#50000000", |
| 381 | }) | 381 | }) |
| 382 | this.publishCommentModel.rootCommentId = '-1'; | 382 | this.publishCommentModel.rootCommentId = '-1'; |
| 383 | this.publishCommentModel.parentId = '-1'; | 383 | this.publishCommentModel.parentId = '-1'; |
| @@ -12,7 +12,19 @@ const DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subTyp | @@ -12,7 +12,19 @@ const DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subTyp | ||
| 12 | struct DailyNewspaperWidgetCard { | 12 | struct DailyNewspaperWidgetCard { |
| 13 | @LocalStorageProp('paperType') paperType: FormNewspaperPaperType = FormNewspaperPaperType.unknown; | 13 | @LocalStorageProp('paperType') paperType: FormNewspaperPaperType = FormNewspaperPaperType.unknown; |
| 14 | @LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo; | 14 | @LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo; |
| 15 | - @LocalStorageProp('paperContents') paperContents: FormNewspaperPaperContent[] = []; | 15 | + @LocalStorageProp('paperContents') @Watch("paperContentsUpdates") paperContents: FormNewspaperPaperContent[] = []; |
| 16 | + @State needShowNumber: boolean = false | ||
| 17 | + | ||
| 18 | + aboutToAppear(): void { | ||
| 19 | + | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + paperContentsUpdates() { | ||
| 23 | + const hasAnyRightImages = this.paperContents.filter((content) => { | ||
| 24 | + return content.coverUrl && content.coverUrl.length > 0 | ||
| 25 | + }).length > 0 | ||
| 26 | + this.needShowNumber = !this.paperInfo.showLeftImage && !hasAnyRightImages | ||
| 27 | + } | ||
| 16 | 28 | ||
| 17 | build() { | 29 | build() { |
| 18 | 30 | ||
| @@ -73,7 +85,12 @@ struct DailyNewspaperWidgetCard { | @@ -73,7 +85,12 @@ struct DailyNewspaperWidgetCard { | ||
| 73 | List() { | 85 | List() { |
| 74 | ForEach(this.paperContents, (item: FormNewspaperPaperContent, index: number) => { | 86 | ForEach(this.paperContents, (item: FormNewspaperPaperContent, index: number) => { |
| 75 | ListItem() { | 87 | ListItem() { |
| 76 | - ContentCellView({content: item, index: index, hasImage: (item.coverUrl && item.coverUrl.length > 0 ? true : false)}) | 88 | + ContentCellView({ |
| 89 | + content: item, | ||
| 90 | + index: index, | ||
| 91 | + needShowNumber: this.needShowNumber, | ||
| 92 | + hasImage: (item.coverUrl && item.coverUrl.length > 0 ? true : false) | ||
| 93 | + }) | ||
| 77 | } | 94 | } |
| 78 | }, (item: FormNewspaperPaperContent, index) => index + JSON.stringify(item)) | 95 | }, (item: FormNewspaperPaperContent, index) => index + JSON.stringify(item)) |
| 79 | } | 96 | } |
| @@ -90,11 +107,17 @@ struct DailyNewspaperWidgetCard { | @@ -90,11 +107,17 @@ struct DailyNewspaperWidgetCard { | ||
| 90 | 107 | ||
| 91 | @Component | 108 | @Component |
| 92 | struct ContentCellView { | 109 | struct ContentCellView { |
| 110 | + @Prop needShowNumber: boolean = false | ||
| 93 | @Prop content: FormNewspaperPaperContent | 111 | @Prop content: FormNewspaperPaperContent |
| 94 | private index : number = 0 | 112 | private index : number = 0 |
| 95 | private hasImage: boolean = false | 113 | private hasImage: boolean = false |
| 96 | build() { | 114 | build() { |
| 97 | Row() { | 115 | Row() { |
| 116 | + if (this.needShowNumber) { | ||
| 117 | + Text((this.index + 1) + "") | ||
| 118 | + .fontColor("#ED2800") | ||
| 119 | + .margin({left: 4, right: 4}) | ||
| 120 | + } | ||
| 98 | Text(this.content.title) | 121 | Text(this.content.title) |
| 99 | .maxLines((this.content.coverUrl && this.content.coverUrl.length > 0 ? 2 : 1)) | 122 | .maxLines((this.content.coverUrl && this.content.coverUrl.length > 0 ? 2 : 1)) |
| 100 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 123 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
-
Please register or login to post a comment