douaojie

Merge remote-tracking branch 'origin/main'

@@ -245,7 +245,6 @@ export class HttpUrlUtils { @@ -245,7 +245,6 @@ export class HttpUrlUtils {
245 * pageSize=20&pageNum=1&topicId=10000009445 245 * pageSize=20&pageNum=1&topicId=10000009445
246 * */ 246 * */
247 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo"; 247 static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo";
248 - static readonly MORNING_EVENING_COMP_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/compInfo";  
249 /** 248 /**
250 * 直播回顾 249 * 直播回顾
251 * */ 250 * */
1 -import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils } from 'wdKit'; 1 +import { AccountManagerUtils, Logger, DateTimeUtils, SPHelper, NumberFormatterUtils, DisplayUtils,
  2 + NetworkUtil } from 'wdKit';
2 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel'; 3 import { MultiPictureDetailViewModel } from '../viewmodel/MultiPictureDetailViewModel';
3 import { ContentDetailDTO,postBatchAttentionStatusParams, 4 import { ContentDetailDTO,postBatchAttentionStatusParams,
4 PhotoListBean, 5 PhotoListBean,
@@ -27,6 +28,8 @@ import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo' @@ -27,6 +28,8 @@ import { CardMediaInfo } from '../components/cardCommon/CardMediaInfo'
27 import router from '@ohos.router'; 28 import router from '@ohos.router';
28 import { publishCommentModel } from './comment/model/PublishCommentModel'; 29 import { publishCommentModel } from './comment/model/PublishCommentModel';
29 import { CommentComponent } from './comment/view/CommentComponent'; 30 import { CommentComponent } from './comment/view/CommentComponent';
  31 +import { EmptyComponent } from './view/EmptyComponent';
  32 +import { detailedSkeleton } from './skeleton/detailSkeleton';
30 33
31 const TAG = 'DynamicDetailComponent' 34 const TAG = 'DynamicDetailComponent'
32 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 35 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
@@ -55,6 +58,8 @@ export struct DynamicDetailComponent { @@ -55,6 +58,8 @@ export struct DynamicDetailComponent {
55 private mJumpInfo: ContentDTO = {} as ContentDTO; 58 private mJumpInfo: ContentDTO = {} as ContentDTO;
56 59
57 @State publishTime: string = '' 60 @State publishTime: string = ''
  61 + @State isNetConnected: boolean = true
  62 + @State isPageEnd: boolean = false
58 63
59 64
60 async aboutToAppear() { 65 async aboutToAppear() {
@@ -89,328 +94,342 @@ export struct DynamicDetailComponent { @@ -89,328 +94,342 @@ export struct DynamicDetailComponent {
89 .height($r('app.float.margin_7')) 94 .height($r('app.float.margin_7'))
90 .padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} ) 95 .padding({left: $r('app.float.margin_16'), right: $r('app.float.margin_16')} )
91 Stack({ alignContent: Alignment.Bottom }) { 96 Stack({ alignContent: Alignment.Bottom }) {
92 - Scroll(this.scroller) {  
93 - Column() {  
94 - //号主信息  
95 - Row() {  
96 - //头像  
97 - Stack() {  
98 - Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)  
99 - .alt(this.contentDetailData.rmhInfo?.userType=='1'?$r('app.media.default_head'):$r('app.media.icon_default_head_mater'))  
100 - .width($r('app.float.margin_32'))  
101 - .height($r('app.float.margin_32'))  
102 - .objectFit(ImageFit.Cover)  
103 - .borderRadius($r('app.float.margin_16'))  
104 - Image(this.contentDetailData.rmhInfo?.honoraryIcon)  
105 - .width($r('app.float.margin_48'))  
106 - .height($r('app.float.margin_48'))  
107 - .objectFit(ImageFit.Cover)  
108 - .borderRadius($r('app.float.margin_24'))  
109 - if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){ 97 + if (!this.isNetConnected) {
  98 + EmptyComponent({
  99 + emptyType: 1,
  100 + emptyButton: true,
  101 + retry: () => {
  102 + this.getContentDetailData()
  103 + }
  104 + }).padding({ bottom: 200 })
  105 + } else {
  106 + if (!this.isPageEnd) {
  107 + detailedSkeleton()
  108 + }else{
  109 + Scroll(this.scroller) {
  110 + Column() {
  111 + //号主信息
  112 + Row() {
  113 + //头像
110 Stack() { 114 Stack() {
111 - Image(this.contentDetailData.rmhInfo?.authIcon)  
112 - .width($r('app.float.vp_12'))  
113 - .height($r('app.float.vp_12')) 115 + Image(this.contentDetailData.rmhInfo?.rmhHeadUrl)
  116 + .alt(this.contentDetailData.rmhInfo?.userType=='1'?$r('app.media.default_head'):$r('app.media.icon_default_head_mater'))
  117 + .width($r('app.float.margin_32'))
  118 + .height($r('app.float.margin_32'))
114 .objectFit(ImageFit.Cover) 119 .objectFit(ImageFit.Cover)
  120 + .borderRadius($r('app.float.margin_16'))
  121 + Image(this.contentDetailData.rmhInfo?.honoraryIcon)
  122 + .width($r('app.float.margin_48'))
  123 + .height($r('app.float.margin_48'))
  124 + .objectFit(ImageFit.Cover)
  125 + .borderRadius($r('app.float.margin_24'))
  126 + if(!StringUtils.isEmpty(this.contentDetailData.rmhInfo?.authIcon)){
  127 + Stack() {
  128 + Image(this.contentDetailData.rmhInfo?.authIcon)
  129 + .width($r('app.float.vp_12'))
  130 + .height($r('app.float.vp_12'))
  131 + .objectFit(ImageFit.Cover)
  132 + }
  133 + .width($r('app.float.margin_48'))
  134 + .height($r('app.float.margin_48'))
  135 + .alignContent(Alignment.BottomEnd)
  136 + }
115 } 137 }
116 .width($r('app.float.margin_48')) 138 .width($r('app.float.margin_48'))
117 .height($r('app.float.margin_48')) 139 .height($r('app.float.margin_48'))
118 - .alignContent(Alignment.BottomEnd) 140 + .alignContent(Alignment.Center)
  141 + .onClick(() => {
  142 + ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId)
  143 + })
  144 + Column(){
  145 + //昵称
  146 + Text(this.contentDetailData.rmhInfo?.rmhName)
  147 + .fontSize($r('app.float.font_size_14'))
  148 + .fontColor($r('app.color.color_222222'))
  149 + .fontWeight(FontWeight.Medium)
  150 + .margin({ left: $r('app.float.margin_5') })
  151 + .alignSelf(ItemAlign.Start)
  152 + //简介
  153 + Text(this.contentDetailData.rmhInfo?.rmhDesc)
  154 + .fontSize($r('app.float.font_size_14'))
  155 + .fontColor($r('app.color.color_B0B0B0'))
  156 + .fontWeight(FontWeight.Medium)
  157 + .maxLines(1)
  158 + .textOverflow({ overflow: TextOverflow.Ellipsis })
  159 + .margin({ left: $r('app.float.margin_5') })
  160 + .alignSelf(ItemAlign.Start)
  161 + }
  162 + .width('63%')
  163 + .margin({right: $r('app.float.margin_6')})
  164 + if(!StringUtils.isEmpty(this.followStatus)){
  165 + if (this.followStatus == '0') {
  166 + Row() {
  167 + Blank().layoutWeight(1)
  168 + Image($r('app.media.icon_add_attention'))
  169 + .width($r('app.float.vp_12'))
  170 + .height($r('app.float.vp_12'))
  171 + .margin({right:2})
  172 + Text('关注')
  173 + .textAlign(TextAlign.Center)
  174 + .fontSize($r('app.float.font_size_12'))
  175 + .fontColor($r('app.color.color_fff'))
  176 + Blank().layoutWeight(1)
  177 + }
  178 + .width($r('app.float.margin_54'))
  179 + .height($r('app.float.margin_24'))
  180 + .borderRadius($r('app.float.vp_3'))
  181 + .backgroundColor($r('app.color.color_ED2800'))
  182 + .onClick(() => {
  183 + this.handleAccention()
  184 + })
  185 + } else {
  186 + Text('已关注')
  187 + .width($r('app.float.margin_54'))
  188 + .height($r('app.float.margin_24'))
  189 + .borderWidth(1)
  190 + .textAlign(TextAlign.Center)
  191 + .fontSize($r('app.float.font_size_12'))
  192 + .borderRadius($r('app.float.vp_3'))
  193 + .borderColor($r('app.color.color_CCCCCC_1A'))
  194 + .backgroundColor($r('app.color.color_CCCCCC_1A'))
  195 + .fontColor($r('app.color.color_CCCCCC'))
  196 + .onClick(() => {
  197 + this.handleAccention()
  198 + })
  199 + }
  200 + }
119 } 201 }
120 - }  
121 - .width($r('app.float.margin_48'))  
122 - .height($r('app.float.margin_48'))  
123 - .alignContent(Alignment.Center)  
124 - .onClick(() => {  
125 - ProcessUtils.gotoPeopleShipHomePage(this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId)  
126 - })  
127 - Column(){  
128 - //昵称  
129 - Text(this.contentDetailData.rmhInfo?.rmhName)  
130 - .fontSize($r('app.float.font_size_14')) 202 + .width('100%')
  203 + .margin({ left: $r('app.float.margin_16')})
  204 + //内容
  205 + Text(StringUtils.isEmpty(this.contentDetailData.newsContent)
  206 + ?StringUtils.isEmpty(this.contentDetailData.newsSummary)
  207 + ?this.contentDetailData.newsTitle
  208 + :this.contentDetailData.newsSummary
  209 + :this.contentDetailData.newsContent)
131 .fontColor($r('app.color.color_222222')) 210 .fontColor($r('app.color.color_222222'))
132 - .fontWeight(FontWeight.Medium)  
133 - .margin({ left: $r('app.float.margin_5') }) 211 + .fontSize($r('app.float.font_size_18'))
  212 + .lineHeight($r('app.float.margin_25'))
  213 + .margin({ top: $r('app.float.margin_6')
  214 + ,left: $r('app.float.margin_16')
  215 + ,right: $r('app.float.margin_16') })
134 .alignSelf(ItemAlign.Start) 216 .alignSelf(ItemAlign.Start)
135 - //简介  
136 - Text(this.contentDetailData.rmhInfo?.rmhDesc)  
137 - .fontSize($r('app.float.font_size_14'))  
138 - .fontColor($r('app.color.color_B0B0B0'))  
139 - .fontWeight(FontWeight.Medium)  
140 - .maxLines(1)  
141 - .textOverflow({ overflow: TextOverflow.Ellipsis })  
142 - .margin({ left: $r('app.float.margin_5') })  
143 - .alignSelf(ItemAlign.Start)  
144 - }  
145 - .width('63%')  
146 - .margin({right: $r('app.float.margin_6')})  
147 - if(!StringUtils.isEmpty(this.followStatus)){  
148 - if (this.followStatus == '0') {  
149 - Row() {  
150 - Blank().layoutWeight(1)  
151 - Image($r('app.media.icon_add_attention'))  
152 - .width($r('app.float.vp_12'))  
153 - .height($r('app.float.vp_12'))  
154 - .margin({right:2})  
155 - Text('关注')  
156 - .textAlign(TextAlign.Center)  
157 - .fontSize($r('app.float.font_size_12'))  
158 - .fontColor($r('app.color.color_fff'))  
159 - Blank().layoutWeight(1)  
160 - }  
161 - .width($r('app.float.margin_54'))  
162 - .height($r('app.float.margin_24'))  
163 - .borderRadius($r('app.float.vp_3'))  
164 - .backgroundColor($r('app.color.color_ED2800'))  
165 - .onClick(() => {  
166 - this.handleAccention()  
167 - })  
168 - } else {  
169 - Text('已关注')  
170 - .width($r('app.float.margin_54'))  
171 - .height($r('app.float.margin_24'))  
172 - .borderWidth(1)  
173 - .textAlign(TextAlign.Center)  
174 - .fontSize($r('app.float.font_size_12'))  
175 - .borderRadius($r('app.float.vp_3'))  
176 - .borderColor($r('app.color.color_CCCCCC_1A'))  
177 - .backgroundColor($r('app.color.color_CCCCCC_1A'))  
178 - .fontColor($r('app.color.color_CCCCCC'))  
179 - .onClick(() => {  
180 - this.handleAccention()  
181 - })  
182 - }  
183 - }  
184 - }  
185 - .width('100%')  
186 - .margin({ left: $r('app.float.margin_16')})  
187 - //内容  
188 - Text(StringUtils.isEmpty(this.contentDetailData.newsContent)  
189 - ?StringUtils.isEmpty(this.contentDetailData.newsSummary)  
190 - ?this.contentDetailData.newsTitle  
191 - :this.contentDetailData.newsSummary  
192 - :this.contentDetailData.newsContent)  
193 - .fontColor($r('app.color.color_222222'))  
194 - .fontSize($r('app.float.font_size_18'))  
195 - .lineHeight($r('app.float.margin_25'))  
196 - .margin({ top: $r('app.float.margin_6')  
197 - ,left: $r('app.float.margin_16')  
198 - ,right: $r('app.float.margin_16') })  
199 - .alignSelf(ItemAlign.Start)  
200 - if(this.contentDetailData.newsType+"" == ContentConstants.TYPE_FOURTEEN){  
201 - //附件内容:图片/视频  
202 - if(this.contentDetailData.photoList!= null && this.contentDetailData.photoList.length>0){  
203 - // 图片-从无图到9图展示  
204 - GridRow({  
205 - gutter: { x: 2, y: 2 }  
206 - }) {  
207 - ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {  
208 - if (this.contentDetailData.photoList.length === 1) {  
209 - if (this.getPicType(item) !== 3) {  
210 - GridCol({  
211 - span: this.getPicType(item) === 1 ? 12 : 8  
212 - }){  
213 - Stack({  
214 - alignContent: Alignment.BottomEnd  
215 - }) {  
216 - if (this.getPicType(item) === 1) { 217 + if(this.contentDetailData.newsType+"" == ContentConstants.TYPE_FOURTEEN){
  218 + //附件内容:图片/视频
  219 + if(this.contentDetailData.photoList!= null && this.contentDetailData.photoList.length>0){
  220 + // 图片-从无图到9图展示
  221 + GridRow({
  222 + gutter: { x: 2, y: 2 }
  223 + }) {
  224 + ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {
  225 + if (this.contentDetailData.photoList.length === 1) {
  226 + if (this.getPicType(item) !== 3) {
  227 + GridCol({
  228 + span: this.getPicType(item) === 1 ? 12 : 8
  229 + }){
  230 + Stack({
  231 + alignContent: Alignment.BottomEnd
  232 + }) {
  233 + if (this.getPicType(item) === 1) {
  234 + Image(item.picPath)
  235 + .width('100%')
  236 + .height(172)
  237 + .autoResize(true)
  238 + .borderRadius(this.caclImageRadius(index))
  239 + } else if (this.getPicType(item) === 2) {
  240 + Image(item.picPath)
  241 + .width('100%')
  242 + .height(305)
  243 + .autoResize(true)
  244 + .borderRadius(this.caclImageRadius(index))
  245 + }
  246 + Flex({ direction: FlexDirection.Row }) {
  247 + Image($r('app.media.icon_long_pic'))
  248 + .width(14)
  249 + .height(14)
  250 + .margin({right: 4})
  251 + Text('长图')
  252 + .fontSize(12)
  253 + .fontWeight(400)
  254 + .fontColor(0xffffff)
  255 + .fontFamily('PingFang SC')
  256 + }
  257 + .width(48)
  258 + .padding({bottom: 9})
  259 +
  260 + }
  261 + }
  262 + .onClick((event: ClickEvent) => {
  263 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
  264 + })
  265 + } else {
  266 + GridCol({
  267 + span: { xs: 8 }
  268 + }) {
217 Image(item.picPath) 269 Image(item.picPath)
218 .width('100%') 270 .width('100%')
219 - .height(172)  
220 - .autoResize(true)  
221 .borderRadius(this.caclImageRadius(index)) 271 .borderRadius(this.caclImageRadius(index))
222 - } else if (this.getPicType(item) === 2) {  
223 - Image(item.picPath)  
224 - .width('100%')  
225 - .height(305)  
226 .autoResize(true) 272 .autoResize(true)
227 - .borderRadius(this.caclImageRadius(index)) 273 + .opacity(!item.width && !item.height ? 0 : 1)
  274 + .onComplete(callback => {
  275 + item.width = callback?.width || 0;
  276 + item.height = callback?.height || 0;
  277 + })
228 } 278 }
229 - Flex({ direction: FlexDirection.Row }) {  
230 - Image($r('app.media.icon_long_pic'))  
231 - .width(14)  
232 - .height(14)  
233 - .margin({right: 4})  
234 - Text('长图')  
235 - .fontSize(12)  
236 - .fontWeight(400)  
237 - .fontColor(0xffffff)  
238 - .fontFamily('PingFang SC')  
239 - }  
240 - .width(48)  
241 - .padding({bottom: 9})  
242 - 279 + .onClick((event: ClickEvent) => {
  280 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
  281 + })
  282 + }
  283 + } else if (this.contentDetailData.photoList.length === 4) {
  284 + GridCol({
  285 + span: { xs: 4 }
  286 + }) {
  287 + Image(item.picPath)
  288 + .aspectRatio(1)
  289 + .borderRadius(this.caclImageRadius(index))
  290 + }
  291 + .onClick((event: ClickEvent) => {
  292 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
  293 + })
  294 + } else {
  295 + GridCol({
  296 + span: { sm: 4, lg: 3 }
  297 + }) {
  298 + Image(item.picPath)
  299 + .aspectRatio(1)
  300 + .borderRadius(this.caclImageRadius(index))
243 } 301 }
  302 + .onClick((event: ClickEvent) => {
  303 + ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)
  304 + })
  305 + }
  306 + })
  307 + }
  308 + .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})
  309 + }
  310 + }else{
  311 + if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){
  312 + GridRow() {
  313 + if (this.contentDetailData.videoInfo[0].videoLandScape === 1) {
  314 + // 横屏
  315 + GridCol({
  316 + span: { xs: 12 }
  317 + }) {
  318 + Stack() {
  319 + Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
  320 + this.contentDetailData.fullColumnImgUrls[0].url:
  321 + this.contentDetailData.videoInfo[0].firstFrameImageUri)
  322 + .width(DisplayUtils.getDeviceWidth()- 32)
  323 + .height((DisplayUtils.getDeviceWidth()-32)* 9 / 16)
  324 + .borderRadius($r('app.float.image_border_radius'))
  325 + CardMediaInfo({ contentDTO: this.mJumpInfo })
  326 + }
  327 + .align(Alignment.BottomEnd)
244 } 328 }
245 - .onClick((event: ClickEvent) => {  
246 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)  
247 - })  
248 } else { 329 } else {
  330 + // 竖图显示,宽度占50%,高度自适应
249 GridCol({ 331 GridCol({
250 - span: { xs: 8 } 332 + span: { xs: 6 }
251 }) { 333 }) {
252 - Image(item.picPath)  
253 - .width('100%')  
254 - .borderRadius(this.caclImageRadius(index))  
255 - .autoResize(true)  
256 - .opacity(!item.width && !item.height ? 0 : 1)  
257 - .onComplete(callback => {  
258 - item.width = callback?.width || 0;  
259 - item.height = callback?.height || 0;  
260 - }) 334 + Stack() {
  335 + Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?
  336 + this.contentDetailData.fullColumnImgUrls[0].url:
  337 + this.contentDetailData.videoInfo[0].firstFrameImageUri)
  338 + .width(DisplayUtils.getDeviceWidth()/2)
  339 + .height(DisplayUtils.getDeviceWidth()/2* 4 / 3)
  340 + .borderRadius($r('app.float.image_border_radius'))
  341 + CardMediaInfo({ contentDTO: this.mJumpInfo })
  342 + }
  343 + .align(Alignment.BottomEnd)
261 } 344 }
262 - .onClick((event: ClickEvent) => {  
263 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)  
264 - })  
265 - }  
266 - } else if (this.contentDetailData.photoList.length === 4) {  
267 - GridCol({  
268 - span: { xs: 4 }  
269 - }) {  
270 - Image(item.picPath)  
271 - .aspectRatio(1)  
272 - .borderRadius(this.caclImageRadius(index))  
273 - }  
274 - .onClick((event: ClickEvent) => {  
275 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)  
276 - })  
277 - } else {  
278 - GridCol({  
279 - span: { sm: 4, lg: 3 }  
280 - }) {  
281 - Image(item.picPath)  
282 - .aspectRatio(1)  
283 - .borderRadius(this.caclImageRadius(index))  
284 } 345 }
285 - .onClick((event: ClickEvent) => {  
286 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList,index)  
287 - })  
288 } 346 }
289 - }) 347 + .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 25,top: $r('app.float.margin_8')})
  348 + .onClick((event: ClickEvent) => {
  349 + ProcessUtils.processPage(this.mJumpInfo)
  350 + })
  351 + }
290 } 352 }
291 - .margin({ left: $r('app.float.margin_16'),right: $r('app.float.margin_16'),top: $r('app.float.margin_8')})  
292 - }  
293 - }else{  
294 - if(this.contentDetailData.videoInfo!= null && this.contentDetailData.videoInfo.length>0){  
295 - GridRow() {  
296 - if (this.contentDetailData.videoInfo[0].videoLandScape === 1) {  
297 - // 横屏  
298 - GridCol({  
299 - span: { xs: 12 }  
300 - }) {  
301 - Stack() {  
302 - Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?  
303 - this.contentDetailData.fullColumnImgUrls[0].url:  
304 - this.contentDetailData.videoInfo[0].firstFrameImageUri)  
305 - .width(DisplayUtils.getDeviceWidth()- 32)  
306 - .height((DisplayUtils.getDeviceWidth()-32)* 9 / 16)  
307 - .borderRadius($r('app.float.image_border_radius'))  
308 - CardMediaInfo({ contentDTO: this.mJumpInfo })  
309 - }  
310 - .align(Alignment.BottomEnd)  
311 - }  
312 - } else {  
313 - // 竖图显示,宽度占50%,高度自适应  
314 - GridCol({  
315 - span: { xs: 6 }  
316 - }) {  
317 - Stack() {  
318 - Image(this.contentDetailData.fullColumnImgUrls!= null && this.contentDetailData.fullColumnImgUrls.length>0&&!StringUtils.isEmpty(this.contentDetailData.fullColumnImgUrls[0].url)?  
319 - this.contentDetailData.fullColumnImgUrls[0].url:  
320 - this.contentDetailData.videoInfo[0].firstFrameImageUri)  
321 - .width(DisplayUtils.getDeviceWidth()/2)  
322 - .height(DisplayUtils.getDeviceWidth()/2* 4 / 3)  
323 - .borderRadius($r('app.float.image_border_radius'))  
324 - CardMediaInfo({ contentDTO: this.mJumpInfo })  
325 - }  
326 - .align(Alignment.BottomEnd)  
327 - } 353 + //特别声明
  354 + Text("特别声明:本文为人民日报新媒体平台“人民号”作者上传并发布,仅代表作者观点。人民日报仅提供信息发布平台。")
  355 + .fontColor($r('app.color.color_CCCCCC'))
  356 + .fontSize($r('app.float.font_size_12'))
  357 + .lineHeight($r('app.float.margin_16'))
  358 + .margin({ top: $r('app.float.margin_16')
  359 + ,left: $r('app.float.vp_12')
  360 + ,right: $r('app.float.vp_12') })
  361 + //微信/朋友圈/微博
  362 + // Row(){
  363 + // Image($r('app.media.xxhdpi_pic_wechat'))
  364 + // .width($r('app.float.margin_116'))
  365 + // .height($r('app.float.margin_36'))
  366 + // .objectFit(ImageFit.Cover)
  367 + // Image($r('app.media.xxhdpi_pic_pyq'))
  368 + // .width($r('app.float.margin_116'))
  369 + // .height($r('app.float.margin_36'))
  370 + // .margin({ left: $r('app.float.margin_4_negative')})
  371 + // .objectFit(ImageFit.Cover)
  372 + // Image($r('app.media.xxhdpi_pic_wb'))
  373 + // .width($r('app.float.margin_116'))
  374 + // .height($r('app.float.margin_36'))
  375 + // .margin({ left: $r('app.float.margin_4_negative')})
  376 + // .objectFit(ImageFit.Cover)
  377 + // }
  378 + // .margin({ top: $r('app.float.margin_24')})
  379 + //点赞
  380 + Row(){
  381 + Blank().layoutWeight(1)
  382 + Image(this.newsStatusOfUser?.likeStatus == '1'?
  383 + $r('app.media.icon_like_selected_redheart')
  384 + :$r('app.media.icon_like_unselect_grey_redheart'))
  385 + .width($r('app.float.margin_36'))
  386 + .height($r('app.float.margin_36'))
  387 + .objectFit(ImageFit.Cover)
  388 + .margin({ left: $r('app.float.margin_6_negative'),right: $r('app.float.margin_6_negative')})
  389 + if(this.interactDataDTO?.likeNum != 0){
  390 + Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))
  391 + .fontColor($r('app.color.color_999999'))
  392 + .fontSize($r('app.float.font_size_16'))
  393 + .lineHeight($r('app.float.margin_20'))
  394 + .margin({ left: $r('app.float.margin_2')})
328 } 395 }
  396 + Blank().layoutWeight(1)
329 } 397 }
330 - .padding({ left: this.contentDetailData.videoInfo[0].videoLandScape === 1?0: 25,top: $r('app.float.margin_8')}) 398 + .width($r('app.float.margin_154'))
  399 + .height($r('app.float.margin_40'))
  400 + .margin({top:$r('app.float.margin_16')})
  401 + .borderWidth($r('app.float.margin_1'))
  402 + .borderColor($r('app.color.color_EDEDED'))
  403 + .borderRadius($r('app.float.margin_20'))
331 .onClick((event: ClickEvent) => { 404 .onClick((event: ClickEvent) => {
332 - ProcessUtils.processPage(this.mJumpInfo) 405 + //点赞操作
  406 + this.toggleLikeStatus()
333 }) 407 })
  408 + // 评论
  409 + if (this.contentDetailData?.openComment) {
  410 + Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')})
  411 + CommentComponent({
  412 + publishCommentModel: {
  413 + targetId: String(this.contentDetailData?.newsId || ''),
  414 + targetRelId: this.contentDetailData?.reLInfo?.relId,
  415 + targetTitle: this.contentDetailData?.newsTitle,
  416 + targetRelType: this.contentDetailData?.reLInfo?.relType,
  417 + targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),
  418 + keyArticle: String(this.contentDetailData?.keyArticle),
  419 + targetType: String(this.contentDetailData?.newsType),
  420 + } as publishCommentModel
  421 + })
  422 + }
  423 + Blank().layoutWeight(1)
334 } 424 }
335 } 425 }
336 - //特别声明  
337 - Text("特别声明:本文为人民日报新媒体平台“人民号”作者上传并发布,仅代表作者观点。人民日报仅提供信息发布平台。")  
338 - .fontColor($r('app.color.color_CCCCCC'))  
339 - .fontSize($r('app.float.font_size_12'))  
340 - .lineHeight($r('app.float.margin_16'))  
341 - .margin({ top: $r('app.float.margin_16')  
342 - ,left: $r('app.float.vp_12')  
343 - ,right: $r('app.float.vp_12') })  
344 - //微信/朋友圈/微博  
345 - // Row(){  
346 - // Image($r('app.media.xxhdpi_pic_wechat'))  
347 - // .width($r('app.float.margin_116'))  
348 - // .height($r('app.float.margin_36'))  
349 - // .objectFit(ImageFit.Cover)  
350 - // Image($r('app.media.xxhdpi_pic_pyq'))  
351 - // .width($r('app.float.margin_116'))  
352 - // .height($r('app.float.margin_36'))  
353 - // .margin({ left: $r('app.float.margin_4_negative')})  
354 - // .objectFit(ImageFit.Cover)  
355 - // Image($r('app.media.xxhdpi_pic_wb'))  
356 - // .width($r('app.float.margin_116'))  
357 - // .height($r('app.float.margin_36'))  
358 - // .margin({ left: $r('app.float.margin_4_negative')})  
359 - // .objectFit(ImageFit.Cover)  
360 - // }  
361 - // .margin({ top: $r('app.float.margin_24')})  
362 - //点赞  
363 - Row(){  
364 - Blank().layoutWeight(1)  
365 - Image(this.newsStatusOfUser?.likeStatus == '1'?  
366 - $r('app.media.icon_like_selected_redheart')  
367 - :$r('app.media.icon_like_unselect_grey_redheart'))  
368 - .width($r('app.float.margin_36'))  
369 - .height($r('app.float.margin_36'))  
370 - .objectFit(ImageFit.Cover)  
371 - .margin({ left: $r('app.float.margin_6_negative'),right: $r('app.float.margin_6_negative')})  
372 - if(this.interactDataDTO?.likeNum != 0){  
373 - Text(NumberFormatterUtils.formatNumberWithWan(this.interactDataDTO?.likeNum))  
374 - .fontColor($r('app.color.color_999999'))  
375 - .fontSize($r('app.float.font_size_16'))  
376 - .lineHeight($r('app.float.margin_20'))  
377 - .margin({ left: $r('app.float.margin_2')})  
378 - }  
379 - Blank().layoutWeight(1)  
380 - }  
381 - .width($r('app.float.margin_154'))  
382 - .height($r('app.float.margin_40'))  
383 - .margin({top:$r('app.float.margin_16')})  
384 - .borderWidth($r('app.float.margin_1'))  
385 - .borderColor($r('app.color.color_EDEDED'))  
386 - .borderRadius($r('app.float.margin_20'))  
387 - .onClick((event: ClickEvent) => {  
388 - //点赞操作  
389 - this.toggleLikeStatus()  
390 - })  
391 - // 评论  
392 - if (this.contentDetailData?.openComment) {  
393 - Divider().strokeWidth(6).color('#f5f5f5').margin({top:$r('app.float.margin_24')})  
394 - CommentComponent({  
395 - publishCommentModel: {  
396 - targetId: String(this.contentDetailData?.newsId || ''),  
397 - targetRelId: this.contentDetailData?.reLInfo?.relId,  
398 - targetTitle: this.contentDetailData?.newsTitle,  
399 - targetRelType: this.contentDetailData?.reLInfo?.relType,  
400 - targetRelObjectId: String(this.contentDetailData?.reLInfo?.relObjectId),  
401 - keyArticle: String(this.contentDetailData?.keyArticle),  
402 - targetType: String(this.contentDetailData?.newsType),  
403 - } as publishCommentModel  
404 - })  
405 - }  
406 - Blank().layoutWeight(1) 426 + .width(CommonConstants.FULL_WIDTH)
  427 + .height(CommonConstants.FULL_HEIGHT)
  428 + .padding({ bottom: 76 })
  429 + .scrollBar(BarState.Off)
  430 + .alignSelf(ItemAlign.Start)
407 } 431 }
408 } 432 }
409 - .width(CommonConstants.FULL_WIDTH)  
410 - .height(CommonConstants.FULL_HEIGHT)  
411 - .padding({ bottom: 76 })  
412 - .scrollBar(BarState.Off)  
413 - .alignSelf(ItemAlign.Start)  
414 //底部交互区 433 //底部交互区
415 OperRowListView({ contentDetailData: this.contentDetailData 434 OperRowListView({ contentDetailData: this.contentDetailData
416 ,interactData:this.interactDataDTO 435 ,interactData:this.interactDataDTO
@@ -436,8 +455,10 @@ export struct DynamicDetailComponent { @@ -436,8 +455,10 @@ export struct DynamicDetailComponent {
436 * 请求(动态)详情页数据 455 * 请求(动态)详情页数据
437 * */ 456 * */
438 private async getContentDetailData() { 457 private async getContentDetailData() {
  458 + this.isNetConnected = NetworkUtil.isNetConnected()
439 try { 459 try {
440 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType) 460 let data = await MultiPictureDetailViewModel.getDetailData(this.relId, this.contentId, this.relType)
  461 + this.isPageEnd = true;
441 this.contentDetailData = data[0]; 462 this.contentDetailData = data[0];
442 let dateTime = 463 let dateTime =
443 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN); 464 DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
@@ -446,6 +467,7 @@ export struct DynamicDetailComponent { @@ -446,6 +467,7 @@ export struct DynamicDetailComponent {
446 console.log('动态详情',JSON.stringify(this.contentDetailData)) 467 console.log('动态详情',JSON.stringify(this.contentDetailData))
447 } catch (exception) { 468 } catch (exception) {
448 console.log('请求失败',JSON.stringify(exception)) 469 console.log('请求失败',JSON.stringify(exception))
  470 + this.isPageEnd = true;
449 } 471 }
450 this.getBatchAttentionStatus() 472 this.getBatchAttentionStatus()
451 this.getInteractDataStatus() 473 this.getInteractDataStatus()
@@ -13,12 +13,9 @@ import { image } from '@kit.ImageKit'; @@ -13,12 +13,9 @@ import { image } from '@kit.ImageKit';
13 import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils'; 13 import { getPicture, imageNet2PixelMap } from '../../utils/ImageUtils';
14 import { effectKit } from '@kit.ArkGraphics2D'; 14 import { effectKit } from '@kit.ArkGraphics2D';
15 import { window } from '@kit.ArkUI'; 15 import { window } from '@kit.ArkUI';
16 -import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'  
17 16
18 const TAG = 'MorningEveningPaperComponent'; 17 const TAG = 'MorningEveningPaperComponent';
19 18
20 -const PATTERN_DATE_CN_RN: string = 'yyyy年\nMM月dd日'; // 日期中包含包含中文年月日  
21 -  
22 @Entry 19 @Entry
23 @Component 20 @Component
24 export struct MorningEveningPaperComponent { 21 export struct MorningEveningPaperComponent {
@@ -106,17 +103,12 @@ export struct MorningEveningPaperComponent { @@ -106,17 +103,12 @@ export struct MorningEveningPaperComponent {
106 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) 103 WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
107 this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height) 104 this.topSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).topRect.height)
108 105
109 - let dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String 106 + const dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as String
110 console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId) 107 console.info(TAG, `aboutToAppear = ` + dailyPaperTopicPageId)
111 const currentTime = new Date().getTime() 108 const currentTime = new Date().getTime()
112 Logger.info(TAG, "currentTime = " + currentTime) 109 Logger.info(TAG, "currentTime = " + currentTime)
113 Logger.info(TAG, `currentTime = ${currentTime}`) 110 Logger.info(TAG, `currentTime = ${currentTime}`)
114 try { 111 try {
115 - let dailyPaperTopicBean = await DailyPaperTopicModel.getDailyPaperTopic()  
116 - if (dailyPaperTopicBean) {  
117 - dailyPaperTopicPageId = '' + dailyPaperTopicBean.id  
118 - Logger.info(TAG, "pageID = " + dailyPaperTopicPageId)  
119 - }  
120 112
121 // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) 113 // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId)
122 let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091" 114 let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + dailyPaperTopicPageId) //"25091"
@@ -157,7 +149,10 @@ export struct MorningEveningPaperComponent { @@ -157,7 +149,10 @@ export struct MorningEveningPaperComponent {
157 async setComponentBgColor(imageUrl: string) { 149 async setComponentBgColor(imageUrl: string) {
158 // 图片转换为PixelMap对象 150 // 图片转换为PixelMap对象
159 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); 151 // const pixelMap: image.PixelMap = await image2PixelMap(item.icon);
160 - const imageSource: image.ImageSource | undefined = await getPicture(imageUrl); 152 + Logger.debug(TAG, "compInfoBean compStyle = " + imageUrl)
  153 +
  154 + const imageSource: image.ImageSource | undefined = await getPicture(imageUrl)
  155 +
161 if (imageSource) { 156 if (imageSource) {
162 this.pickColor(imageSource) 157 this.pickColor(imageSource)
163 158
@@ -172,6 +167,8 @@ export struct MorningEveningPaperComponent { @@ -172,6 +167,8 @@ export struct MorningEveningPaperComponent {
172 const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); 167 const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource);
173 effectKit.createColorPicker(pixelMap, (err, colorPicker) => { 168 effectKit.createColorPicker(pixelMap, (err, colorPicker) => {
174 let color = colorPicker.getMainColorSync(); 169 let color = colorPicker.getMainColorSync();
  170 + Logger.debug(TAG, "compInfoBean compStyle = " + color)
  171 +
175 // 将取色器选取的color示例转换为十六进制颜色代码 172 // 将取色器选取的color示例转换为十六进制颜色代码
176 this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16); 173 this.mixedBgColor = "#" + color.alpha.toString(16) + color.red.toString(16) + color.green.toString(16) + color.blue.toString(16);
177 Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor) 174 Logger.debug(TAG, "compInfoBean compStyle = " + this.mixedBgColor)
@@ -212,7 +209,7 @@ export struct MorningEveningPaperComponent { @@ -212,7 +209,7 @@ export struct MorningEveningPaperComponent {
212 }) 209 })
213 } 210 }
214 } 211 }
215 - // .backgroundColor('#FFF1F3F5') 212 + // .backgroundColor('#fff7b348')
216 // .backgroundColor(Color.Blue) 213 // .backgroundColor(Color.Blue)
217 .height('100%') 214 .height('100%')
218 215
@@ -200,7 +200,7 @@ export class PageRepository { @@ -200,7 +200,7 @@ export class PageRepository {
200 * topicId:专题id 200 * topicId:专题id
201 * */ 201 * */
202 static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) { 202 static getMorningEveningCompInfoUrl(pageId: number, groupId: number, refreshTime: string, topicId: string, pageNum: number, pageSize: number) {
203 - let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; 203 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMP_PATH;
204 url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId=" 204 url = url + "?loadStrategy=first_load&pageNum=" + pageNum + "&refreshTime=" + refreshTime + "&pageId="
205 + pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize; 205 + pageId + "&channelStrategy=2&groupId=" + groupId + "&topicId=" + topicId + "&pageSize=" + pageSize;
206 Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url) 206 Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
@@ -391,7 +391,7 @@ export class PageRepository { @@ -391,7 +391,7 @@ export class PageRepository {
391 * */ 391 * */
392 static fetchBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId: 392 static fetchBroadcastCompInfo(pageId: number, groupId: number, refreshTime: string, topicId:
393 string, channelId: string) { 393 string, channelId: string) {
394 - let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_COMP_INFO_PATH; 394 + let url = HttpUrlUtils.getHost() + HttpUrlUtils.COMP_PATH;
395 url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}` 395 url = `${url}?topicId=${topicId}&channelStrategy=2&groupId=${groupId}&refreshTime=${refreshTime}&pageSize=50&recommend=0&pageId=${pageId}&loadStrategy=first_load&pageNum=1&channelId=${channelId}`
396 Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url) 396 Logger.info(TAG, "getMorningEveningCompInfoUrl url = " + url)
397 return WDHttp.get<ResponseDTO<CompInfoBean>>(url) 397 return WDHttp.get<ResponseDTO<CompInfoBean>>(url)
@@ -90,7 +90,7 @@ export async function image2PixelMap(icon: string): Promise<image.PixelMap> { @@ -90,7 +90,7 @@ export async function image2PixelMap(icon: string): Promise<image.PixelMap> {
90 // 假设http和image是之前正确导入或定义的模块 90 // 假设http和image是之前正确导入或定义的模块
91 export async function getPicture(imageUrl: string): Promise<image.ImageSource | undefined> { 91 export async function getPicture(imageUrl: string): Promise<image.ImageSource | undefined> {
92 // const url: string = 'https://rmrbcmsonline.peopleapp.com/upload/image/202312/rmrb_86691703594454.png'; 92 // const url: string = 'https://rmrbcmsonline.peopleapp.com/upload/image/202312/rmrb_86691703594454.png';
93 - const url: string = 'https://rmrbcmsonline.peopleapp.com/upload/image/201912/rmrb_24141576767688.png?x-oss-process=image/resize,w_550/quality,q_90/format,jpg'; 93 + const url: string = imageUrl;
94 94
95 return new Promise((resolve, reject) => { 95 return new Promise((resolve, reject) => {
96 http.createHttp().request(url, (error: BusinessError, data: http.HttpResponse) => { 96 http.createHttp().request(url, (error: BusinessError, data: http.HttpResponse) => {
@@ -2,6 +2,7 @@ import { LiveDetailsBean } from 'wdBean/Index'; @@ -2,6 +2,7 @@ import { LiveDetailsBean } from 'wdBean/Index';
2 import { StringUtils } from 'wdKit/Index'; 2 import { StringUtils } from 'wdKit/Index';
3 import { WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; 3 import { WDPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index';
4 import { PlayUIComponent } from './PlayUIComponent'; 4 import { PlayUIComponent } from './PlayUIComponent';
  5 +import { Logger } from 'wdKit/Index';
5 6
6 @Component 7 @Component
7 export struct TopPlayComponent { 8 export struct TopPlayComponent {
@@ -39,6 +40,7 @@ export struct TopPlayComponent { @@ -39,6 +40,7 @@ export struct TopPlayComponent {
39 } 40 }
40 // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4'); 41 // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4');
41 if (StringUtils.isNotEmpty(playUrl)) { 42 if (StringUtils.isNotEmpty(playUrl)) {
  43 + Logger.debug('TopPlayComponent', `${playUrl}`)
42 this.playerController?.firstPlay(playUrl); 44 this.playerController?.firstPlay(playUrl);
43 } 45 }
44 } 46 }
@@ -202,10 +202,13 @@ export struct PlayerRightView { @@ -202,10 +202,13 @@ export struct PlayerRightView {
202 .borderRadius(12) 202 .borderRadius(12)
203 .position({ x: '50%', y: '100%' }) 203 .position({ x: '50%', y: '100%' })
204 .markAnchor({ x: '50%', y: '50%' }) 204 .markAnchor({ x: '50%', y: '50%' })
  205 + .visibility(this.followStatus == '1' ? Visibility.None : Visibility.Visible)
205 .onClick(() => { 206 .onClick(() => {
206 // TODO:关注动画 207 // TODO:关注动画
207 this.handleAccention() 208 this.handleAccention()
208 }) 209 })
  210 +
  211 +
209 } 212 }
210 .height(48) 213 .height(48)
211 .width('100%') 214 .width('100%')