陈剑华

Merge remote-tracking branch 'origin/main'

Showing 23 changed files with 628 additions and 269 deletions
@@ -14,6 +14,9 @@ export class AppUtils { @@ -14,6 +14,9 @@ export class AppUtils {
14 AppUtils.buildVersion = BuildProfile.BUILD_VERSION; 14 AppUtils.buildVersion = BuildProfile.BUILD_VERSION;
15 } 15 }
16 16
  17 + // 全局应用context
  18 + public static gotApplicationContextFunc?: () => common.UIAbilityContext
  19 +
17 /** 20 /**
18 * 获取应用名称 21 * 获取应用名称
19 * 即:人民日报 22 * 即:人民日报
@@ -49,5 +49,8 @@ export enum EmitterEventId { @@ -49,5 +49,8 @@ export enum EmitterEventId {
49 // 全屏 49 // 全屏
50 FULL_SCREEN = 14, 50 FULL_SCREEN = 14,
51 51
  52 + // 图文详情页点赞状态
  53 + LIKE_CHANGE_STATUS = 15,
  54 +
52 } 55 }
53 56
@@ -6,6 +6,7 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' @@ -6,6 +6,7 @@ import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
6 import { Logger } from 'wdKit/Index' 6 import { Logger } from 'wdKit/Index'
7 import { ContentType } from '../common/ContentType' 7 import { ContentType } from '../common/ContentType'
8 import { WDRouterRule } from '../router/WDRouterRule' 8 import { WDRouterRule } from '../router/WDRouterRule'
  9 +import HomeChannelUtils from './HomeChannelUtils'
9 import { ProcessUtils } from './ProcessUtils' 10 import { ProcessUtils } from './ProcessUtils'
10 11
11 const TAG = "AppInnerLink" 12 const TAG = "AppInnerLink"
@@ -123,8 +124,18 @@ export class AppInnerLink { @@ -123,8 +124,18 @@ export class AppInnerLink {
123 WDRouterRule.jumpWithAction(taskAction) 124 WDRouterRule.jumpWithAction(taskAction)
124 } 125 }
125 126
126 - if (params.type == "channel") { 127 + if (params.type == "topic" && params.subType == "audio_news") {
  128 + }
  129 + if (params.type == "topic" && params.subType == "moring_evening_news") {
  130 + ProcessUtils.gotoMorningEveningPaper()
  131 + }
127 132
  133 + if (params.type == "channel") {
  134 + if (params.subType == "electronic_newspapers") {
  135 + ProcessUtils.gotoENewsPaper();
  136 + return
  137 + }
  138 + HomeChannelUtils.jumpChannelTab(params.firstChannelId ?? "", params.pageId ?? "", "")
128 } 139 }
129 140
130 } 141 }
@@ -12,14 +12,16 @@ export class AppInnerLinkGenerator { @@ -12,14 +12,16 @@ export class AppInnerLinkGenerator {
12 12
13 static generateDeepLinkWithProgram(content: ContentDTO) { 13 static generateDeepLinkWithProgram(content: ContentDTO) {
14 14
15 - return AppInnerLinkGenerator.generate(Number(content.objectType), content.objectId +'', content.relId, content.linkUrl) 15 + return AppInnerLinkGenerator.generate(Number(content.objectType), content.objectId +'', content.relId
  16 + , content.linkUrl, content.pageId, Number(content.objectLevel))
16 } 17 }
17 18
18 static generateDeepLinkWithFrontObjectLink(content: FrontLinkObject) { 19 static generateDeepLinkWithFrontObjectLink(content: FrontLinkObject) {
19 - return AppInnerLinkGenerator.generate(Number(content.newsType), content.newsId +'', content.newsRelId + '', content.linkUrl) 20 + return AppInnerLinkGenerator.generate(Number(content.newsType), content.newsId +''
  21 + , content.newsRelId + '', content.linkUrl, content.newsPageId, Number(content.newsLevel))
20 } 22 }
21 23
22 - static generate(contentType: number, contentId?: string, relId?: string, link?: string): string { 24 + static generate(contentType: number, contentId?: string, relId?: string, link?: string, pageId?: string, objectLevel?: number): string {
23 let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX 25 let deeplink = AppInnerLinkGenerator.DEEP_LINK_PREFIX
24 26
25 let pubParam = `&contentId=${contentId ?? ""}&relId=${relId ?? ""}&skipType=1` 27 let pubParam = `&contentId=${contentId ?? ""}&relId=${relId ?? ""}&skipType=1`
@@ -55,6 +57,20 @@ export class AppInnerLinkGenerator { @@ -55,6 +57,20 @@ export class AppInnerLinkGenerator {
55 case ContentType.Ask: 57 case ContentType.Ask:
56 deeplink += "?type=ask" 58 deeplink += "?type=ask"
57 break 59 break
  60 + case ContentType.Subject:
  61 + if (objectLevel && objectLevel == 25) { // 早晚报专题
  62 + deeplink += `?type=topic&subType=moring_evening_news&pageId=${pageId}&relId=${relId}&skipType=1`
  63 + return deeplink
  64 + }
  65 + if (objectLevel && objectLevel == 22) { // 音频专题
  66 + deeplink += `?type=topic&subType=audio_news&pageId=${pageId}&relId=${relId}&skipType=1`
  67 + return deeplink
  68 + }
  69 + if (link) {
  70 + deeplink += `?type=topic&subType=h5&pageId=${pageId}&relId=&url=${encodeURIComponent(link)}&skipType=1`
  71 + return deeplink
  72 + }
  73 + break
58 default: 74 default:
59 pubParam = "" 75 pubParam = ""
60 break; 76 break;
@@ -315,8 +315,7 @@ export struct WdWebLocalComponent { @@ -315,8 +315,7 @@ export struct WdWebLocalComponent {
315 315
316 Text('重播').fontColor(Color.White).fontSize(14) 316 Text('重播').fontColor(Color.White).fontSize(14)
317 } 317 }
318 - .backgroundColor(Color.Black)  
319 - .opacity(0.5) 318 + .backgroundColor("#80000000")
320 .justifyContent(FlexAlign.Center) 319 .justifyContent(FlexAlign.Center)
321 .width(this.positionWidth) 320 .width(this.positionWidth)
322 .height(this.positionHeight) 321 .height(this.positionHeight)
@@ -4,9 +4,9 @@ export interface FrontLinkObject { @@ -4,9 +4,9 @@ export interface FrontLinkObject {
4 linkUrl: string; 4 linkUrl: string;
5 newsId: string; 5 newsId: string;
6 newsLevel: string; 6 newsLevel: string;
7 - // newsPageId?: any; 7 + newsPageId: string;
8 newsRelId: number; 8 newsRelId: number;
9 - // newsRelType?: any; 9 + newsRelType: string;
10 newsType: number; 10 newsType: number;
11 publishTime: string; 11 publishTime: string;
12 source: string; 12 source: string;
1 -import { SPHelper, Logger, ToastUtils } from 'wdKit'; 1 +import { SPHelper, Logger, ToastUtils, EmitterUtils, EmitterEventId } from 'wdKit';
2 import { ContentDetailDTO, Action, ContentDTO, batchLikeAndCollectResult } from 'wdBean'; 2 import { ContentDetailDTO, Action, ContentDTO, batchLikeAndCollectResult } from 'wdBean';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
4 import router from '@ohos.router'; 4 import router from '@ohos.router';
@@ -11,6 +11,11 @@ import { TrackConstants } from 'wdTracking/Index'; @@ -11,6 +11,11 @@ import { TrackConstants } from 'wdTracking/Index';
11 11
12 const TAG = 'CarderInteraction' 12 const TAG = 'CarderInteraction'
13 13
  14 +interface parsedObj {
  15 + contentId: string,
  16 + likeStatus: string
  17 +}
  18 +
14 /** 19 /**
15 * 卡片 分享、评论、点赞公用组件 20 * 卡片 分享、评论、点赞公用组件
16 */ 21 */
@@ -47,6 +52,25 @@ export struct CarderInteraction { @@ -47,6 +52,25 @@ export struct CarderInteraction {
47 // console.log(TAG, 'this.isShowComment', this.isShowComment) 52 // console.log(TAG, 'this.isShowComment', this.isShowComment)
48 // console.log(TAG, 'this.isShowLike', this.isShowLike) 53 // console.log(TAG, 'this.isShowLike', this.isShowLike)
49 // console.log(TAG, 'router.getState().name', router.getState().name) 54 // console.log(TAG, 'router.getState().name', router.getState().name)
  55 + EmitterUtils.receiveEvent(EmitterEventId.LIKE_CHANGE_STATUS, (val: string | undefined) => {
  56 + // console.log(TAG,'val点赞', val)
  57 + if (val === undefined) {
  58 + console.error('Value is undefined');
  59 + return;
  60 + }
  61 +
  62 + try {
  63 + const parsedVal: parsedObj = JSON.parse(val);
  64 + if (parsedVal.contentId === this.contentDetailData.newsId + '') {
  65 + // console.log(TAG,'params点赞状态', parsedVal.likeStatus)
  66 + this.likeBean['likeStatus'] = parsedVal.likeStatus
  67 + // console.log(TAG,'this.likeBean点赞状态', this.likeBean['likeStatus'])
  68 + }
  69 + } catch (error) {
  70 + console.error('Error parsing JSON:', error);
  71 + }
  72 + });
  73 +
50 } 74 }
51 75
52 76
@@ -48,9 +48,16 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' @@ -48,9 +48,16 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
48 import { common } from '@kit.AbilityKit'; 48 import { common } from '@kit.AbilityKit';
49 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; 49 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
50 import { componentUtils, window } from '@kit.ArkUI'; 50 import { componentUtils, window } from '@kit.ArkUI';
  51 +import { onlyWifiLoadImg } from '../utils/lazyloadImg';
  52 +
51 const TAG = 'DynamicDetailComponent' 53 const TAG = 'DynamicDetailComponent'
52 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm'; 54 const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
53 55
  56 +interface parsedObj {
  57 + contentId: string,
  58 + likeStatus: string
  59 +}
  60 +
54 61
55 /** 62 /**
56 * 动态详情页UI 63 * 动态详情页UI
@@ -124,6 +131,7 @@ export struct DynamicDetailComponent { @@ -124,6 +131,7 @@ export struct DynamicDetailComponent {
124 } 131 }
125 aboutToDisappear() { 132 aboutToDisappear() {
126 this.viewBlogInsightIntentShare() 133 this.viewBlogInsightIntentShare()
  134 +
127 } 135 }
128 onPageHide() { 136 onPageHide() {
129 137
@@ -308,214 +316,215 @@ export struct DynamicDetailComponent { @@ -308,214 +316,215 @@ export struct DynamicDetailComponent {
308 //附件内容:图片/视频 316 //附件内容:图片/视频
309 if (this.contentDetailData.photoList != null && this.contentDetailData.photoList.length > 0) { 317 if (this.contentDetailData.photoList != null && this.contentDetailData.photoList.length > 0) {
310 // 图片-从无图到9图展示 318 // 图片-从无图到9图展示
311 - GridRow({  
312 - gutter: { x: 2, y: 2 }  
313 - }) {  
314 - ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {  
315 - if (this.contentDetailData.photoList.length === 1) {  
316 - if (this.getPicType(item) !== 3) {  
317 - GridCol({  
318 - span: this.getPicType(item) === 1 ? 12 : 8  
319 - }) {  
320 - Stack({  
321 - alignContent: Alignment.BottomEnd  
322 - }) {  
323 - if (this.getPicType(item) === 1) {  
324 - Image(item.picPath)  
325 - .width('100%')  
326 - .height(172)  
327 - .autoResize(true)  
328 - .borderRadius(this.caclImageRadius(index))  
329 - } else if (this.getPicType(item) === 2) {  
330 - Image(item.picPath)  
331 - .width('100%')  
332 - .height(305)  
333 - .autoResize(true)  
334 - .borderRadius(this.caclImageRadius(index))  
335 - }  
336 - Flex({ direction: FlexDirection.Row }) {  
337 - Image($r('app.media.icon_long_pic'))  
338 - .width(12)  
339 - .height(12)  
340 - .margin({ right: 4 })  
341 - Text('长图')  
342 - .fontSize(10)  
343 - .fontWeight(400)  
344 - .textShadow({  
345 - radius: 1,  
346 - color: `rgba(0,0,0,0.5)`,  
347 - offsetY:1,  
348 - offsetX:1  
349 - })  
350 - .fontColor(0xffffff)  
351 - .fontFamily('PingFang SC')  
352 - }  
353 - .width(48)  
354 - .padding({ bottom: 9 })  
355 - }  
356 -  
357 - }  
358 - .onClick(async (event: ClickEvent) => {  
359 - let retvalue = await FastClickUtil.isMinDelayTime()  
360 - if(retvalue){  
361 - return  
362 - }  
363 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)  
364 - })  
365 - } else {  
366 - // GridCol({  
367 - // span: { xs: 8 }  
368 - // }) {  
369 - // Image(item.picPath)  
370 - // .width('100%')  
371 - // .borderRadius(this.caclImageRadius(index))  
372 - // .autoResize(true)  
373 - // .opacity(!item.width && !item.height ? 0 : 1)  
374 - // .onComplete(callback => {  
375 - // item.width = callback?.width || 0;  
376 - // item.height = callback?.height || 0;  
377 - // })  
378 - // }  
379 - GridCol({  
380 - span: this.onePicW > this.onePicH ? 12 : 8  
381 - }) {  
382 - Stack({alignContent: Alignment.BottomEnd}) {  
383 - Image(item.picPath)  
384 - .backgroundColor(0xf5f5f5)  
385 - .width('100%')  
386 - .autoResize(true)  
387 - .objectFit(ImageFit.Cover)  
388 - .autoResize(true)  
389 - .aspectRatio(3/4)  
390 - .borderRadius(this.caclImageRadius(index))  
391 - .borderStyle(BorderStyle.Solid)  
392 - .borderWidth(0.5)  
393 - .borderColor($r('app.color.color_0D000000'))  
394 - .opacity(!item.width && !item.height ? 0 : 1)  
395 - .onComplete((event?) => {  
396 - this.onePicW = event?.width || 0;  
397 - this.onePicH = event?.height || 0;  
398 - })  
399 - if(this.getPicType(item) !== 3){  
400 - Flex({ direction: FlexDirection.Row }) {  
401 - Image($r('app.media.icon_long_pic'))  
402 - .width(12)  
403 - .height(12)  
404 - .margin({ right: 4 })  
405 - Text('长图')  
406 - .fontSize(10)  
407 - .fontWeight(400)  
408 - .textShadow({  
409 - radius: 1,  
410 - color: `rgba(0,0,0,0.5)`,  
411 - offsetY:1,  
412 - offsetX:1  
413 - })  
414 - .fontColor(0xffffff)  
415 - .fontFamily('PingFang SC')  
416 - }  
417 - .width(48)  
418 - .align(Alignment.BottomEnd)  
419 - .padding({ bottom: 3 })  
420 - }  
421 - }  
422 - }  
423 - .onClick(async (event: ClickEvent) => {  
424 - let retvalue = await FastClickUtil.isMinDelayTime()  
425 - if(retvalue){  
426 - return  
427 - }  
428 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)  
429 - })  
430 - }  
431 - }  
432 - // else if (this.contentDetailData.photoList.length === 4) {  
433 - // GridCol({  
434 - // span: { xs: 4 }  
435 - // }) {  
436 - // Stack({alignContent: Alignment.BottomEnd}) {  
437 - // Image(item.picPath)  
438 - // .aspectRatio(1)  
439 - // .borderRadius(this.caclImageRadius(index))  
440 - // if(this.getPicType(item) !== 3){  
441 - // Flex({ direction: FlexDirection.Row }) {  
442 - // Image($r('app.media.icon_long_pic'))  
443 - // .width(12)  
444 - // .height(12)  
445 - // .margin({ right: 4 })  
446 - // Text('长图')  
447 - // .fontSize(10)  
448 - // .fontWeight(400)  
449 - // .textShadow({  
450 - // radius: 1,  
451 - // color: `rgba(0,0,0,0.5)`,  
452 - // offsetY:1,  
453 - // offsetX:1  
454 - // })  
455 - // .fontColor(0xffffff)  
456 - // .fontFamily('PingFang SC')  
457 - // }  
458 - // .width(48)  
459 - // .align(Alignment.BottomEnd)  
460 - // .padding({ bottom: 3 })  
461 - // }  
462 - // }  
463 - // }  
464 - // .onClick(async (event: ClickEvent) => {  
465 - // let retvalue = await FastClickUtil.isMinDelayTime()  
466 - // if(retvalue){  
467 - // return  
468 - // }  
469 - // ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)  
470 - // })  
471 - // }  
472 - else {  
473 - GridCol({  
474 - span: { sm: 4, lg: 3 }  
475 - }) {  
476 - Stack({alignContent: Alignment.BottomEnd}) {  
477 - Image(item.picPath)  
478 - .aspectRatio(1)  
479 - .borderRadius(this.caclImageRadius(index))  
480 - if(this.getPicType(item) !== 3){  
481 - Flex({ direction: FlexDirection.Row }) {  
482 - Image($r('app.media.icon_long_pic'))  
483 - .width(12)  
484 - .height(12)  
485 - .margin({ right: 4 })  
486 - Text('长图')  
487 - .fontSize(10)  
488 - .fontWeight(400)  
489 - .textShadow({  
490 - radius: 1,  
491 - color: `rgba(0,0,0,0.5)`,  
492 - offsetY:1,  
493 - offsetX:1  
494 - })  
495 - .fontColor(0xffffff)  
496 - .fontFamily('PingFang SC')  
497 - }  
498 - .width(48)  
499 - .align(Alignment.BottomEnd)  
500 - .padding({ bottom: 3})  
501 - }  
502 - }  
503 - }  
504 - .onClick(async (event: ClickEvent) => {  
505 - let retvalue = await FastClickUtil.isMinDelayTime()  
506 - if(retvalue){  
507 - return  
508 - }  
509 - ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)  
510 - })  
511 - }  
512 - })  
513 - }  
514 - .margin({  
515 - left: $r('app.float.margin_16'),  
516 - right: $r('app.float.margin_16'),  
517 - top: $r('app.float.margin_8')  
518 - }) 319 + createImg({fullColumnImgUrls:this.contentDetailData.photoList})
  320 + // GridRow({
  321 + // gutter: { x: 2, y: 2 }
  322 + // }) {
  323 + // ForEach(this.contentDetailData.photoList, (item: PhotoListBean, index: number) => {
  324 + // if (this.contentDetailData.photoList.length === 1) {
  325 + // if (this.getPicType(item) !== 3) {
  326 + // GridCol({
  327 + // span: this.getPicType(item) === 1 ? 12 : 8
  328 + // }) {
  329 + // Stack({
  330 + // alignContent: Alignment.BottomEnd
  331 + // }) {
  332 + // if (this.getPicType(item) === 1) {
  333 + // Image(item.picPath)
  334 + // .width('100%')
  335 + // .height(172)
  336 + // .autoResize(true)
  337 + // .borderRadius(this.caclImageRadius(index))
  338 + // } else if (this.getPicType(item) === 2) {
  339 + // Image(item.picPath)
  340 + // .width('100%')
  341 + // .height(305)
  342 + // .autoResize(true)
  343 + // .borderRadius(this.caclImageRadius(index))
  344 + // }
  345 + // Flex({ direction: FlexDirection.Row }) {
  346 + // Image($r('app.media.icon_long_pic'))
  347 + // .width(12)
  348 + // .height(12)
  349 + // .margin({ right: 4 })
  350 + // Text('长图')
  351 + // .fontSize(10)
  352 + // .fontWeight(400)
  353 + // .textShadow({
  354 + // radius: 1,
  355 + // color: `rgba(0,0,0,0.5)`,
  356 + // offsetY:1,
  357 + // offsetX:1
  358 + // })
  359 + // .fontColor(0xffffff)
  360 + // .fontFamily('PingFang SC')
  361 + // }
  362 + // .width(48)
  363 + // .padding({ bottom: 9 })
  364 + // }
  365 + //
  366 + // }
  367 + // .onClick(async (event: ClickEvent) => {
  368 + // let retvalue = await FastClickUtil.isMinDelayTime()
  369 + // if(retvalue){
  370 + // return
  371 + // }
  372 + // ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  373 + // })
  374 + // } else {
  375 + // // GridCol({
  376 + // // span: { xs: 8 }
  377 + // // }) {
  378 + // // Image(item.picPath)
  379 + // // .width('100%')
  380 + // // .borderRadius(this.caclImageRadius(index))
  381 + // // .autoResize(true)
  382 + // // .opacity(!item.width && !item.height ? 0 : 1)
  383 + // // .onComplete(callback => {
  384 + // // item.width = callback?.width || 0;
  385 + // // item.height = callback?.height || 0;
  386 + // // })
  387 + // // }
  388 + // GridCol({
  389 + // span: this.onePicW > this.onePicH ? 12 : 8
  390 + // }) {
  391 + // Stack({alignContent: Alignment.BottomEnd}) {
  392 + // Image(item.picPath)
  393 + // .backgroundColor(0xf5f5f5)
  394 + // .width('100%')
  395 + // .autoResize(true)
  396 + // .objectFit(ImageFit.Cover)
  397 + // .autoResize(true)
  398 + // .aspectRatio(3/4)
  399 + // .borderRadius(this.caclImageRadius(index))
  400 + // .borderStyle(BorderStyle.Solid)
  401 + // .borderWidth(0.5)
  402 + // .borderColor($r('app.color.color_0D000000'))
  403 + // .opacity(!item.width && !item.height ? 0 : 1)
  404 + // .onComplete((event?) => {
  405 + // this.onePicW = event?.width || 0;
  406 + // this.onePicH = event?.height || 0;
  407 + // })
  408 + // if(this.getPicType(item) !== 3){
  409 + // Flex({ direction: FlexDirection.Row }) {
  410 + // Image($r('app.media.icon_long_pic'))
  411 + // .width(12)
  412 + // .height(12)
  413 + // .margin({ right: 4 })
  414 + // Text('长图')
  415 + // .fontSize(10)
  416 + // .fontWeight(400)
  417 + // .textShadow({
  418 + // radius: 1,
  419 + // color: `rgba(0,0,0,0.5)`,
  420 + // offsetY:1,
  421 + // offsetX:1
  422 + // })
  423 + // .fontColor(0xffffff)
  424 + // .fontFamily('PingFang SC')
  425 + // }
  426 + // .width(48)
  427 + // .align(Alignment.BottomEnd)
  428 + // .padding({ bottom: 3 })
  429 + // }
  430 + // }
  431 + // }
  432 + // .onClick(async (event: ClickEvent) => {
  433 + // let retvalue = await FastClickUtil.isMinDelayTime()
  434 + // if(retvalue){
  435 + // return
  436 + // }
  437 + // ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  438 + // })
  439 + // }
  440 + // }
  441 + // else if (this.contentDetailData.photoList.length === 4) {
  442 + // GridCol({
  443 + // span: { xs: 4 }
  444 + // }) {
  445 + // Stack({alignContent: Alignment.BottomEnd}) {
  446 + // Image(item.picPath)
  447 + // .aspectRatio(1)
  448 + // .borderRadius(this.caclImageRadius(index))
  449 + // if(this.getPicType(item) !== 3){
  450 + // Flex({ direction: FlexDirection.Row }) {
  451 + // Image($r('app.media.icon_long_pic'))
  452 + // .width(12)
  453 + // .height(12)
  454 + // .margin({ right: 4 })
  455 + // Text('长图')
  456 + // .fontSize(10)
  457 + // .fontWeight(400)
  458 + // .textShadow({
  459 + // radius: 1,
  460 + // color: `rgba(0,0,0,0.5)`,
  461 + // offsetY:1,
  462 + // offsetX:1
  463 + // })
  464 + // .fontColor(0xffffff)
  465 + // .fontFamily('PingFang SC')
  466 + // }
  467 + // .width(48)
  468 + // .align(Alignment.BottomEnd)
  469 + // .padding({ bottom: 3 })
  470 + // }
  471 + // }
  472 + // }
  473 + // .onClick(async (event: ClickEvent) => {
  474 + // let retvalue = await FastClickUtil.isMinDelayTime()
  475 + // if(retvalue){
  476 + // return
  477 + // }
  478 + // ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  479 + // })
  480 + // }
  481 + // else {
  482 + // GridCol({
  483 + // span: { sm: 4, lg: 3 }
  484 + // }) {
  485 + // Stack({alignContent: Alignment.BottomEnd}) {
  486 + // Image(item.picPath)
  487 + // .aspectRatio(1)
  488 + // .borderRadius(this.caclImageRadius(index))
  489 + // if(this.getPicType(item) !== 3){
  490 + // Flex({ direction: FlexDirection.Row }) {
  491 + // Image($r('app.media.icon_long_pic'))
  492 + // .width(12)
  493 + // .height(12)
  494 + // .margin({ right: 4 })
  495 + // Text('长图')
  496 + // .fontSize(10)
  497 + // .fontWeight(400)
  498 + // .textShadow({
  499 + // radius: 1,
  500 + // color: `rgba(0,0,0,0.5)`,
  501 + // offsetY:1,
  502 + // offsetX:1
  503 + // })
  504 + // .fontColor(0xffffff)
  505 + // .fontFamily('PingFang SC')
  506 + // }
  507 + // .width(48)
  508 + // .align(Alignment.BottomEnd)
  509 + // .padding({ bottom: 3})
  510 + // }
  511 + // }
  512 + // }
  513 + // .onClick(async (event: ClickEvent) => {
  514 + // let retvalue = await FastClickUtil.isMinDelayTime()
  515 + // if(retvalue){
  516 + // return
  517 + // }
  518 + // ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
  519 + // })
  520 + // }
  521 + // })
  522 + // }
  523 + // .margin({
  524 + // left: $r('app.float.margin_16'),
  525 + // right: $r('app.float.margin_16'),
  526 + // top: $r('app.float.margin_8')
  527 + // })
519 } 528 }
520 } else { 529 } else {
521 if (this.contentDetailData.videoInfo != null && this.contentDetailData.videoInfo.length > 0) { 530 if (this.contentDetailData.videoInfo != null && this.contentDetailData.videoInfo.length > 0) {
@@ -637,7 +646,7 @@ export struct DynamicDetailComponent { @@ -637,7 +646,7 @@ export struct DynamicDetailComponent {
637 646
638 // 评论 647 // 评论
639 if (this.contentDetailData?.openComment) { 648 if (this.contentDetailData?.openComment) {
640 - Divider().strokeWidth(6).color('#f5f5f5').margin({ top: $r('app.float.margin_24') }) 649 + Divider().strokeWidth(8).color('#f5f5f5').margin({ top: $r('app.float.margin_24') })
641 CommentComponent({ 650 CommentComponent({
642 publishCommentModel: this.publishCommentModel 651 publishCommentModel: this.publishCommentModel
643 }) 652 })
@@ -778,11 +787,11 @@ export struct DynamicDetailComponent { @@ -778,11 +787,11 @@ export struct DynamicDetailComponent {
778 } 787 }
779 ] 788 ]
780 } 789 }
781 - console.error(TAG, JSON.stringify(this.contentDetailData)) 790 + // console.error(TAG,'CarderInteraction', JSON.stringify(params.contentList))
782 let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) 791 let data = await MultiPictureDetailViewModel.getInteractDataStatus(params)
783 - console.error(TAG, '查询用户对作品点赞、收藏状态', JSON.stringify(data)) 792 + // console.error(TAG, 'CarderInteraction 查询用户对作品点赞、收藏状态', JSON.stringify(data))
784 this.newsStatusOfUser = data[0]; 793 this.newsStatusOfUser = data[0];
785 - Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`) 794 + // Logger.info(TAG, `newsStatusOfUser:${JSON.stringify(this.newsStatusOfUser)}`)
786 } catch (exception) { 795 } catch (exception) {
787 console.error(TAG, JSON.stringify(exception)) 796 console.error(TAG, JSON.stringify(exception))
788 } 797 }
@@ -804,7 +813,7 @@ export struct DynamicDetailComponent { @@ -804,7 +813,7 @@ export struct DynamicDetailComponent {
804 } 813 }
805 let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params) 814 let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params)
806 this.followStatus = data[0]?.status; 815 this.followStatus = data[0]?.status;
807 - Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`) 816 + // Logger.info(TAG, `followStatus:${JSON.stringify(this.followStatus)}`)
808 } catch (exception) { 817 } catch (exception) {
809 this.followStatus = '0'; 818 this.followStatus = '0';
810 } 819 }
@@ -878,7 +887,7 @@ export struct DynamicDetailComponent { @@ -878,7 +887,7 @@ export struct DynamicDetailComponent {
878 status: this.followStatus == '0' ? 1 : 0, 887 status: this.followStatus == '0' ? 1 : 0,
879 } 888 }
880 ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { 889 ContentDetailRequest.postInteractAccentionOperate(params2).then(res => {
881 - console.log('关注号主==', JSON.stringify(res.data)) 890 + // console.log('关注号主==', JSON.stringify(res.data))
882 if (this.followStatus == '1') { 891 if (this.followStatus == '1') {
883 this.followStatus = '0' 892 this.followStatus = '0'
884 TrackingContent.follow(true,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhName,TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,this.pageParam) 893 TrackingContent.follow(true,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhId,this.contentDetailData.rmhInfo == null ?"":this.contentDetailData.rmhInfo.rmhName,TrackConstants.PageName.DynamicDetail,TrackConstants.PageName.DynamicDetail,this.pageParam)
@@ -911,7 +920,14 @@ export struct DynamicDetailComponent { @@ -911,7 +920,14 @@ export struct DynamicDetailComponent {
911 } else { 920 } else {
912 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1 921 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
913 } 922 }
914 - console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) 923 + let parsedVal: parsedObj = {
  924 + contentId: params.contentId,
  925 + likeStatus: this.newsStatusOfUser.likeStatus
  926 + }
  927 +
  928 + EmitterUtils.sendEvent(EmitterEventId.LIKE_CHANGE_STATUS, JSON.stringify(parsedVal))
  929 + // console.log(TAG, 'CarderInteraction 点赞parsedVal', JSON.stringify(parsedVal))
  930 + // console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
915 931
916 //内容点赞、取消点赞Tracking 1点赞 0取消点赞 932 //内容点赞、取消点赞Tracking 1点赞 0取消点赞
917 TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, 933 TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,
@@ -955,6 +971,259 @@ export struct DynamicDetailComponent { @@ -955,6 +971,259 @@ export struct DynamicDetailComponent {
955 } 971 }
956 } 972 }
957 973
  974 +@Component
  975 +struct createImg {
  976 + @State fullColumnImgUrls: PhotoListBean[] = []
  977 + @State loadImg: boolean = false;
  978 + @State onePicW: number = 0; // 只有一张图时候图片的宽度
  979 + @State onePicH: number = 0; // 只有一张图时候图片的高度
  980 +
  981 + async aboutToAppear(): Promise<void> {
  982 + if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
  983 + this.fullColumnImgUrls.splice(2, 0, {
  984 + picPath: ''
  985 + } as PhotoListBean)
  986 + }
  987 + this.loadImg = await onlyWifiLoadImg();
  988 + console.log('card19-this.fullColumnImgUrls',JSON.stringify(this.fullColumnImgUrls))
  989 + }
  990 +
  991 + caclImageRadius(index: number) {
  992 + let radius: radiusType = {
  993 + topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
  994 + topRight: 0,
  995 + bottomLeft: 0,
  996 + bottomRight: 0,
  997 + }
  998 + if (this.fullColumnImgUrls.length === 1) {
  999 + radius.topRight = index === 0 ? $r('app.float.image_border_radius') : 0
  1000 + radius.bottomLeft = index === 0 ? $r('app.float.image_border_radius') : 0
  1001 + radius.bottomRight = index === 0 ? $r('app.float.image_border_radius') : 0
  1002 + } else if (this.fullColumnImgUrls.length === 2) {
  1003 + radius.bottomLeft = index === 0 ? $r('app.float.image_border_radius') : 0
  1004 + radius.topRight = index === 1 ? $r('app.float.image_border_radius') : 0
  1005 + radius.bottomRight = index === 1 ? $r('app.float.image_border_radius') : 0
  1006 + } else if (this.fullColumnImgUrls.length === 3) {
  1007 + radius.bottomLeft = index === 0 ? $r('app.float.image_border_radius') : 0
  1008 + radius.topRight = index === 2 ? $r('app.float.image_border_radius') : 0
  1009 + radius.bottomRight = index === 2 ? $r('app.float.image_border_radius') : 0
  1010 + } else if (this.fullColumnImgUrls.length === 6) {
  1011 + radius.topRight = index === 2 ? $r('app.float.image_border_radius') : 0
  1012 + radius.bottomLeft = index === 3 ? $r('app.float.image_border_radius') : 0
  1013 + radius.bottomRight = index === 5 ? $r('app.float.image_border_radius') : 0
  1014 + } else if (this.fullColumnImgUrls.length === 5 && !this.fullColumnImgUrls[2].picPath) {
  1015 + radius.topRight = index === 1 ? $r('app.float.image_border_radius') : 0
  1016 + radius.bottomLeft = index === 3 ? $r('app.float.image_border_radius') : 0
  1017 + radius.bottomRight = index === 4 ? $r('app.float.image_border_radius') : 0
  1018 + } else {
  1019 + radius.topRight = index === 2 ? $r('app.float.image_border_radius') : 0
  1020 + radius.bottomLeft = index === 6 ? $r('app.float.image_border_radius') : 0
  1021 + radius.bottomRight = index === 8 ? $r('app.float.image_border_radius') : 0
  1022 + }
  1023 + return radius
  1024 + }
  1025 +
  1026 + getPicType(picWidth: number, picHeight: number) {
  1027 + //console.info(`cj2024 getPicType picWidth = ${picWidth} picHeight = ${picHeight} picWidth / picHeight = ${picWidth / picHeight}`)
  1028 + if (picWidth && picHeight) {
  1029 + if (picWidth / picHeight > 2/1) {
  1030 + return 1; //横长图
  1031 + } else if (picWidth/picHeight > 1/2 && picWidth/picHeight < 3/4) { //截取图片
  1032 + return 4;
  1033 + } else if (picWidth/picHeight < 1/2) {
  1034 + return 2; //竖长图
  1035 + } else {
  1036 + return 3
  1037 + }
  1038 + } else {
  1039 + return 3; //普通图
  1040 + }
  1041 + }
  1042 +
  1043 + @Builder
  1044 + longPicTip(weight: number, height: number) {
  1045 + Flex({ direction: FlexDirection.Row }) {
  1046 + Image($r('app.media.icon_long_pic'))
  1047 + .width(12)
  1048 + .height(12)
  1049 + .margin({ right: 4 })
  1050 + Text('长图')
  1051 + .fontSize(10)
  1052 + .fontWeight(400)
  1053 + .textShadow({
  1054 + radius: 1,
  1055 + color: `rgba(0,0,0,0.5)`,
  1056 + offsetY:1,
  1057 + offsetX:1
  1058 + })
  1059 + .fontColor(0xffffff)
  1060 + .fontFamily('PingFang SC')
  1061 + .visibility(
  1062 + weight / height > 2 || height / weight > 2
  1063 + ? Visibility.Visible : Visibility.None
  1064 + )
  1065 + }
  1066 + .width(48)
  1067 + .align(Alignment.BottomEnd)
  1068 + .padding({ bottom: 8 })
  1069 + }
  1070 +
  1071 + build() {
  1072 + GridRow({
  1073 + gutter: { x: 2, y: 2 }
  1074 + }) {
  1075 + ForEach(this.fullColumnImgUrls, (item: PhotoListBean, index: number) => {
  1076 + if (this.fullColumnImgUrls.length === 1) {
  1077 + if (this.getPicType(item.width, item.height) < 3) {
  1078 + GridCol({
  1079 + span: this.getPicType(item.width, item.height) === 1 ? 12 : 8
  1080 + }){
  1081 + Stack({
  1082 + alignContent: Alignment.BottomEnd
  1083 + }) {
  1084 + if (this.getPicType(item.width, item.height) === 1) {
  1085 + Image(this.loadImg ? item.picPath : '')
  1086 + .backgroundColor(0xf5f5f5)
  1087 + .width('100%')
  1088 + .height(198)
  1089 + .autoResize(true)
  1090 + .borderRadius(this.caclImageRadius(index))
  1091 + .borderStyle(BorderStyle.Solid)
  1092 + .borderWidth(0.5)
  1093 + .borderColor($r('app.color.color_0D000000'))
  1094 + .onClick(() => {
  1095 + ProcessUtils.gotoMultiPictureListPage(this.fullColumnImgUrls, index)
  1096 + })
  1097 + } else if (this.getPicType(item.width, item.height) === 2) {
  1098 + Image(this.loadImg ? item.picPath : '')
  1099 + .width('100%')
  1100 + .height(305)
  1101 + .autoResize(true)
  1102 + .borderRadius(this.caclImageRadius(index))
  1103 + .borderStyle(BorderStyle.Solid)
  1104 + .borderWidth(0.5)
  1105 + .borderColor($r('app.color.color_0D000000'))
  1106 + .onClick(() => {
  1107 + ProcessUtils.gotoMultiPictureListPage(this.fullColumnImgUrls, index)
  1108 + })
  1109 + }
  1110 + this.longPicTip(item.width, item.height)
  1111 +
  1112 + }
  1113 + }
  1114 + } else if (this.getPicType(item.width, item.height) === 4) {
  1115 + GridCol({
  1116 + span: this.onePicW > this.onePicH ? 12 : 8
  1117 + }) {
  1118 + Image(this.loadImg ? item.picPath : '')
  1119 + .backgroundColor(0xf5f5f5)
  1120 + // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
  1121 + .width('100%')
  1122 + .autoResize(true)
  1123 + .objectFit(ImageFit.Cover)
  1124 + .autoResize(true)
  1125 + .aspectRatio(3/4)
  1126 + .borderRadius(this.caclImageRadius(index))
  1127 + .borderStyle(BorderStyle.Solid)
  1128 + .borderWidth(0.5)
  1129 + .borderColor($r('app.color.color_0D000000'))
  1130 + .opacity(!item.width && !item.height ? 0 : 1)
  1131 + .onComplete((event?) => {
  1132 + this.onePicW = event?.width || 0;
  1133 + this.onePicH = event?.height || 0;
  1134 + })
  1135 + .onClick(() => {
  1136 + ProcessUtils.gotoMultiPictureListPage(this.fullColumnImgUrls, index)
  1137 + })
  1138 + }
  1139 + } else {
  1140 + GridCol({
  1141 + span: this.onePicW > this.onePicH ? 12 : 8
  1142 + }) {
  1143 + Stack({alignContent: Alignment.BottomEnd}) {
  1144 + Image(this.loadImg ? item.picPath : '')
  1145 + .backgroundColor(0xf5f5f5)
  1146 + // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305)
  1147 + .width('100%')
  1148 + .constraintSize({
  1149 + maxHeight: this.onePicW > this.onePicH ? 198 : 305
  1150 + })
  1151 + .autoResize(true)
  1152 + .borderRadius(this.caclImageRadius(index))
  1153 + .borderStyle(BorderStyle.Solid)
  1154 + .borderWidth(0.5)
  1155 + .borderColor($r('app.color.color_0D000000'))
  1156 + .opacity(!item.width && !item.height ? 0 : 1)
  1157 + .onComplete((event?) => {
  1158 + this.onePicW = event?.width || 0;
  1159 + this.onePicH = event?.height || 0;
  1160 + })
  1161 + if (this.onePicW && this.onePicH) {
  1162 + this.longPicTip(this.onePicW, this.onePicH)
  1163 + }
  1164 + }
  1165 + .onClick(() => {
  1166 + ProcessUtils.gotoMultiPictureListPage(this.fullColumnImgUrls, index)
  1167 + })
  1168 + }
  1169 + }
  1170 + } else if (this.fullColumnImgUrls.length === 5) {
  1171 + // 四图卡里面塞了一张补位卡
  1172 + GridCol({
  1173 + span: { xs: 4 }
  1174 + }) {
  1175 + Stack({alignContent: Alignment.BottomEnd}) {
  1176 + Image(this.loadImg ? item.picPath : '')
  1177 + .backgroundColor(index === 2 ? 0xffffff : 0xf5f5f5)
  1178 + .aspectRatio(1)
  1179 + .width('226lvp')
  1180 + .height('226lvp')
  1181 + .borderRadius(this.caclImageRadius(index))
  1182 + .borderStyle(BorderStyle.Solid)
  1183 + .borderWidth(0.5)
  1184 + .borderColor($r('app.color.color_0D000000'))
  1185 + if(this.getPicType(item.width, item.height) !== 3){
  1186 + this.longPicTip(item.width, item.height)
  1187 + }
  1188 + }
  1189 + .onClick(() => {
  1190 + const photoList: PhotoListBean[] = []
  1191 + this.fullColumnImgUrls.forEach((element,index) => {
  1192 + if (index !== 2) {
  1193 + photoList.push(element)
  1194 + }
  1195 + })
  1196 + ProcessUtils.gotoMultiPictureListPage(photoList, index>2?index-1:index)
  1197 + })
  1198 + }
  1199 + } else {
  1200 + GridCol({
  1201 + span: { sm: 4, lg: 3 }
  1202 + }) {
  1203 + Stack({ alignContent: Alignment.BottomEnd }) {
  1204 + Image(this.loadImg ? item.picPath : '')
  1205 + .backgroundColor(0xf5f5f5)
  1206 + .aspectRatio(1)
  1207 + .borderRadius(this.caclImageRadius(index))
  1208 + .borderStyle(BorderStyle.Solid)
  1209 + .borderWidth(0.5)
  1210 + .borderColor($r('app.color.color_0D000000'))
  1211 + .width('100%')
  1212 + .autoResize(true)
  1213 + if (this.getPicType(item.width, item.height) !== 3) {
  1214 + this.longPicTip(item.width, item.height)
  1215 + }
  1216 + }
  1217 + .onClick(() => {
  1218 + ProcessUtils.gotoMultiPictureListPage(this.fullColumnImgUrls, index)
  1219 + })
  1220 + }
  1221 + }
  1222 + })
  1223 + }
  1224 + }
  1225 +}
  1226 +
958 interface radiusType { 1227 interface radiusType {
959 topLeft: number | Resource; 1228 topLeft: number | Resource;
960 topRight: number | Resource; 1229 topRight: number | Resource;
@@ -190,12 +190,12 @@ export struct ImageAndTextPageComponent { @@ -190,12 +190,12 @@ export struct ImageAndTextPageComponent {
190 .justifyContent(FlexAlign.Center) 190 .justifyContent(FlexAlign.Center)
191 } 191 }
192 if (this.recommendList.length > 0) { 192 if (this.recommendList.length > 0) {
193 - Divider().strokeWidth(6).color('#f5f5f5') 193 + Divider().strokeWidth(8).color('#f5f5f5')
194 RecommendList({ recommendList: this.recommendList }) 194 RecommendList({ recommendList: this.recommendList })
195 } 195 }
196 // 评论 196 // 评论
197 if (this.contentDetailData?.openComment) { 197 if (this.contentDetailData?.openComment) {
198 - Divider().strokeWidth(6).color('#f5f5f5') 198 + Divider().strokeWidth(8).color('#f5f5f5')
199 CommentComponent({ 199 CommentComponent({
200 publishCommentModel: this.publishCommentModel, 200 publishCommentModel: this.publishCommentModel,
201 fixedHeightMode: false, 201 fixedHeightMode: false,
@@ -440,10 +440,10 @@ export struct ImageAndTextPageComponent { @@ -440,10 +440,10 @@ export struct ImageAndTextPageComponent {
440 userName:this.contentDetailData?.userInfo?.userName || '' + '', 440 userName:this.contentDetailData?.userInfo?.userName || '' + '',
441 channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + '' 441 channelId:String(this.contentDetailData?.reLInfo?.channelId) || '' + ''
442 } 442 }
443 - console.log(TAG, '点赞、取消点赞params', JSON.stringify(params)) 443 + // console.log(TAG, '点赞、取消点赞params', JSON.stringify(params))
444 PageRepository.postExecuteLike(params).then(res => { 444 PageRepository.postExecuteLike(params).then(res => {
445 // console.log(TAG, '点赞、res', JSON.stringify(res)) 445 // console.log(TAG, '点赞、res', JSON.stringify(res))
446 - console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) 446 + // console.log(TAG, '点赞、取消点赞 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
447 if (this.newsStatusOfUser) { 447 if (this.newsStatusOfUser) {
448 //内容点赞、取消点赞Tracking 1点赞 0取消点赞 448 //内容点赞、取消点赞Tracking 1点赞 0取消点赞
449 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' 449 this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
@@ -452,7 +452,7 @@ export struct ImageAndTextPageComponent { @@ -452,7 +452,7 @@ export struct ImageAndTextPageComponent {
452 } else { 452 } else {
453 this.likeNum = Number(this.likeNum) - 1 453 this.likeNum = Number(this.likeNum) - 1
454 } 454 }
455 - console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus) 455 + // console.log(TAG, '点赞newsStatusOfUser.likeStatus ', this.newsStatusOfUser.likeStatus)
456 // this.queryContentInteractCount() 456 // this.queryContentInteractCount()
457 TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My) 457 TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.My, TrackConstants.PageName.My)
458 } else { 458 } else {
@@ -28,7 +28,7 @@ export struct Card19Component { @@ -28,7 +28,7 @@ export struct Card19Component {
28 this.titleInit(); 28 this.titleInit();
29 const curRouter = router.getState().name; 29 const curRouter = router.getState().name;
30 this.clicked = hasClicked(this.contentDTO.objectId, curRouter) 30 this.clicked = hasClicked(this.contentDTO.objectId, curRouter)
31 - console.log('card19',JSON.stringify(this.contentDTO)) 31 + // console.log('card19',JSON.stringify(this.contentDTO))
32 } 32 }
33 33
34 titleInit() { 34 titleInit() {
@@ -132,7 +132,7 @@ export struct CommentComponent { @@ -132,7 +132,7 @@ export struct CommentComponent {
132 Column() { 132 Column() {
133 if (showGapLine) { 133 if (showGapLine) {
134 Blank().height(12) 134 Blank().height(12)
135 - Divider().strokeWidth(6).color('#f5f5f5') 135 + Divider().strokeWidth(8).color('#f5f5f5')
136 } 136 }
137 137
138 Row() { 138 Row() {
@@ -427,7 +427,7 @@ struct ChildCommentItem { @@ -427,7 +427,7 @@ struct ChildCommentItem {
427 @Link dialogController: CustomDialogController | null 427 @Link dialogController: CustomDialogController | null
428 @ObjectLink item: commentItemModel 428 @ObjectLink item: commentItemModel
429 @Consume contentDetailData: ContentDetailDTO 429 @Consume contentDetailData: ContentDetailDTO
430 - 430 + private leftGap: number = 95 + 4
431 @Consume inDialog: boolean 431 @Consume inDialog: boolean
432 private dialogBeforeJumpOtherPageAction: () => void = () => {} 432 private dialogBeforeJumpOtherPageAction: () => void = () => {}
433 433
@@ -490,14 +490,14 @@ struct ChildCommentItem { @@ -490,14 +490,14 @@ struct ChildCommentItem {
490 fontWeight: FontWeight.Regular, 490 fontWeight: FontWeight.Regular,
491 marginWidth: (95 + 16) 491 marginWidth: (95 + 16)
492 }) 492 })
493 - .margin({ left: 95, right: 16, top: -15 }) 493 + .margin({ left: this.leftGap, right: 16, top: -15 })
494 .onClick(() => { 494 .onClick(() => {
495 this.replyComment() 495 this.replyComment()
496 }) 496 })
497 if (this.item.commentPics.length > 0) { 497 if (this.item.commentPics.length > 0) {
498 Image(this.item.commentPics) 498 Image(this.item.commentPics)
499 .width(88).height(88) 499 .width(88).height(88)
500 - .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 95}) 500 + .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
501 } 501 }
502 502
503 commentFooterView({ 503 commentFooterView({
@@ -505,7 +505,7 @@ struct ChildCommentItem { @@ -505,7 +505,7 @@ struct ChildCommentItem {
505 dialogController: this.dialogController, 505 dialogController: this.dialogController,
506 publishCommentModel: this.publishCommentModel, 506 publishCommentModel: this.publishCommentModel,
507 dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction 507 dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
508 - }).margin({ left: 95, right: 16 }) 508 + }).margin({ left: this.leftGap, right: 16 })
509 }.alignItems(HorizontalAlign.Start) 509 }.alignItems(HorizontalAlign.Start)
510 .width('100%') 510 .width('100%')
511 } 511 }
@@ -540,7 +540,7 @@ struct ChildCommentItem { @@ -540,7 +540,7 @@ struct ChildCommentItem {
540 } 540 }
541 } 541 }
542 .width(48).height(48) 542 .width(48).height(48)
543 - .margin({ left: 47 }) 543 + .margin({ left: 47 + 4 })
544 .alignContent(Alignment.Center) 544 .alignContent(Alignment.Center)
545 .onClick(() => { 545 .onClick(() => {
546 546
@@ -628,6 +628,7 @@ struct footerExpandedView { @@ -628,6 +628,7 @@ struct footerExpandedView {
628 }.height(20) 628 }.height(20)
629 // .backgroundColor(Color.Green) 629 // .backgroundColor(Color.Green)
630 }.height(24) 630 }.height(24)
  631 + .padding({left: 4})
631 .alignItems(VerticalAlign.Top) 632 .alignItems(VerticalAlign.Top)
632 // .backgroundColor(Color.Gray) 633 // .backgroundColor(Color.Gray)
633 } 634 }
@@ -663,6 +664,7 @@ struct commentHeaderView { @@ -663,6 +664,7 @@ struct commentHeaderView {
663 664
664 @Consume inDialog: boolean 665 @Consume inDialog: boolean
665 private dialogBeforeJumpOtherPageAction: () => void = () => {} 666 private dialogBeforeJumpOtherPageAction: () => void = () => {}
  667 + private leftGap: number = 64
666 668
667 build() { 669 build() {
668 Column() { 670 Column() {
@@ -712,7 +714,7 @@ struct commentHeaderView { @@ -712,7 +714,7 @@ struct commentHeaderView {
712 fontWeight: FontWeight.Regular, 714 fontWeight: FontWeight.Regular,
713 marginWidth: (59 + 16) 715 marginWidth: (59 + 16)
714 }) 716 })
715 - .margin({ left: 60, right: 16,top:-15 }) 717 + .margin({ left: this.leftGap, right: 16,top:-12 })
716 .onClick(() => { 718 .onClick(() => {
717 this.replyComment() 719 this.replyComment()
718 }) 720 })
@@ -720,7 +722,7 @@ struct commentHeaderView { @@ -720,7 +722,7 @@ struct commentHeaderView {
720 if (this.item.commentPics.length > 0) { 722 if (this.item.commentPics.length > 0) {
721 Image(this.item.commentPics) 723 Image(this.item.commentPics)
722 .width(88).height(88) 724 .width(88).height(88)
723 - .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: 60}) 725 + .margin({top: 6 + (this.item.commentContent.length > 0 ? 0 : 15), left: this.leftGap})
724 } 726 }
725 727
726 commentFooterView({ 728 commentFooterView({
@@ -728,7 +730,7 @@ struct commentHeaderView { @@ -728,7 +730,7 @@ struct commentHeaderView {
728 dialogController: this.dialogController, 730 dialogController: this.dialogController,
729 publishCommentModel: this.publishCommentModel, 731 publishCommentModel: this.publishCommentModel,
730 dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction 732 dialogBeforeJumpOtherPageAction: this.dialogBeforeJumpOtherPageAction
731 - }).margin({ left: 60, right: 16 }) 733 + }).margin({ left: this.leftGap, right: 16 })
732 }.alignItems(HorizontalAlign.Start) 734 }.alignItems(HorizontalAlign.Start)
733 .padding({bottom: 0}) 735 .padding({bottom: 0})
734 } 736 }
@@ -763,7 +765,7 @@ struct commentHeaderView { @@ -763,7 +765,7 @@ struct commentHeaderView {
763 } 765 }
764 } 766 }
765 .width(48).height(48) 767 .width(48).height(48)
766 - .margin({ left: 8 }) 768 + .margin({ left: 8 + 4 })
767 .alignContent(Alignment.Center) 769 .alignContent(Alignment.Center)
768 .onClick(() => { 770 .onClick(() => {
769 771
@@ -58,7 +58,7 @@ export default struct MinePageUserSimpleInfoUI { @@ -58,7 +58,7 @@ export default struct MinePageUserSimpleInfoUI {
58 .alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon')) 58 .alt(this.userType === "1"?$r('app.media.default_head_userPage'):$r('app.media.AccountOwner_DefaultIcon'))
59 .width(63.21) 59 .width(63.21)
60 .height(63.21) 60 .height(63.21)
61 - .objectFit(ImageFit.Fill) 61 + .objectFit(ImageFit.Cover)
62 .borderRadius(50) 62 .borderRadius(50)
63 63
64 if(StringUtils.isNotEmpty(this.levelHead)){ 64 if(StringUtils.isNotEmpty(this.levelHead)){
@@ -358,7 +358,7 @@ export struct FollowChildComponent{ @@ -358,7 +358,7 @@ export struct FollowChildComponent{
358 358
359 jumpCreatorHomePage() { 359 jumpCreatorHomePage() {
360 if(this.data.mainControl === 0){ 360 if(this.data.mainControl === 0){
361 - ToastUtils.shortToast("无法查看此用户主页") 361 + ToastUtils.shortToast("暂时无法查看该创作者主页")
362 }else if(this.data.banControl === 1){ 362 }else if(this.data.banControl === 1){
363 ToastUtils.shortToast("该账号已封禁,不予访问") 363 ToastUtils.shortToast("该账号已封禁,不予访问")
364 }else{ 364 }else{
@@ -69,7 +69,7 @@ export struct SearchCreatorComponent{ @@ -69,7 +69,7 @@ export struct SearchCreatorComponent{
69 69
70 jumpCreatorHomePage() { 70 jumpCreatorHomePage() {
71 if(Number.parseInt(this.item.mainControl) === 0){ 71 if(Number.parseInt(this.item.mainControl) === 0){
72 - ToastUtils.shortToast("无法查看此用户主页") 72 + ToastUtils.shortToast("暂时无法查看该创作者主页")
73 }else if(Number.parseInt(this.item.banControl) === 1){ 73 }else if(Number.parseInt(this.item.banControl) === 1){
74 ToastUtils.shortToast("该账号已封禁,不予访问") 74 ToastUtils.shortToast("该账号已封禁,不予访问")
75 }else{ 75 }else{
@@ -19,6 +19,10 @@ interface ILikeStyleResp { @@ -19,6 +19,10 @@ interface ILikeStyleResp {
19 url: Resource; 19 url: Resource;
20 name: string; 20 name: string;
21 } 21 }
  22 +interface parsedObj {
  23 + contentId: string,
  24 + likeStatus: string
  25 +}
22 26
23 @Component 27 @Component
24 export struct LikeComponent { 28 export struct LikeComponent {
@@ -59,18 +63,18 @@ export struct LikeComponent { @@ -59,18 +63,18 @@ export struct LikeComponent {
59 this.likesStyle = this.contentDetailData.likesStyle 63 this.likesStyle = this.contentDetailData.likesStyle
60 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false 64 this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
61 } 65 }
62 - console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))  
63 - console.log(TAG, 'this.componentType', this.componentType)  
64 - console.log(TAG, 'this.likesStyle', this.likesStyle)  
65 - console.log(TAG, 'this.openLikes', this.openLikes) 66 + // console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
  67 + // console.log(TAG, 'this.componentType', this.componentType)
  68 + // console.log(TAG, 'this.likesStyle', this.likesStyle)
  69 + // console.log(TAG, 'this.openLikes', this.openLikes)
66 this.onDataUpdated() 70 this.onDataUpdated()
67 this.contentTrackingDict() 71 this.contentTrackingDict()
68 } 72 }
69 73
70 onDataUpdated() { 74 onDataUpdated() {
71 - console.log(TAG, '点赞点击')  
72 if (this.data) { 75 if (this.data) {
73 if (this.data['contentType'] !== undefined ) { 76 if (this.data['contentType'] !== undefined ) {
  77 + console.log(TAG, 'CarderInteraction 点赞点击')
74 //获取点赞状态 78 //获取点赞状态
75 this.getLikeStatus() 79 this.getLikeStatus()
76 //获取点赞数 80 //获取点赞数
@@ -458,6 +462,7 @@ export struct LikeComponent { @@ -458,6 +462,7 @@ export struct LikeComponent {
458 this.likeCount-- 462 this.likeCount--
459 TrackingContent.like(false,this.pageId,this.pageName,this.pageParam) 463 TrackingContent.like(false,this.pageId,this.pageName,this.pageParam)
460 } 464 }
  465 +
461 } 466 }
462 467
463 if (this.likeCount <= 0) { 468 if (this.likeCount <= 0) {
@@ -479,19 +484,25 @@ export struct LikeComponent { @@ -479,19 +484,25 @@ export struct LikeComponent {
479 { 484 {
480 contentId: this.data['contentId'], 485 contentId: this.data['contentId'],
481 contentType: this.data['contentType'], 486 contentType: this.data['contentType'],
482 - contentRelId: this.data['contentRelId'] || '' + '', 487 + contentRelId: this.data['contentRelId'] == "0" ? '' : this.data['contentRelId'] || '' + '',
483 } 488 }
484 ] 489 ]
485 } 490 }
486 - console.log(TAG, "查询点赞状态params", JSON.stringify(params)) 491 + // console.log(TAG, "CarderInteraction 查询点赞状态params", JSON.stringify(params))
487 ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => { 492 ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => {
488 - console.log(TAG, '查询点赞、收藏状态==', JSON.stringify(res.data)) 493 + // console.log(TAG, 'CarderInteraction 查询点赞、收藏状态==', JSON.stringify(res.data))
489 if (res.data) { 494 if (res.data) {
490 if(res.data[0].likeStatus) { 495 if(res.data[0].likeStatus) {
491 this.likeStatus = res.data[0].likeStatus ? true : false 496 this.likeStatus = res.data[0].likeStatus ? true : false
492 } else { 497 } else {
493 this.likeStatus = false 498 this.likeStatus = false
494 } 499 }
  500 + // CarderInteraction组件交互
  501 + if (this.data['likeStatus'] == "1") {
  502 + this.likeStatus = true
  503 + } else if (this.data['likeStatus'] == "0") {
  504 + this.likeStatus = false
  505 + }
495 } 506 }
496 }).catch(() => { 507 }).catch(() => {
497 this.likeStatus = false 508 this.likeStatus = false
@@ -30,7 +30,7 @@ export struct RecommendList { @@ -30,7 +30,7 @@ export struct RecommendList {
30 ForEach(this.recommendList, (item: ContentDTO, index: number) => { 30 ForEach(this.recommendList, (item: ContentDTO, index: number) => {
31 Row() { 31 Row() {
32 CardParser({ compDTO:new CompDTO,contentDTO: item }); 32 CardParser({ compDTO:new CompDTO,contentDTO: item });
33 - } 33 + }.padding({ left: 6, right: 6 })
34 if (this.recommendList.length !== index + 1) { 34 if (this.recommendList.length !== index + 1) {
35 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) 35 Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
36 } 36 }
@@ -102,9 +102,10 @@ export struct DetailPlayLiveCommon { @@ -102,9 +102,10 @@ export struct DetailPlayLiveCommon {
102 } 102 }
103 103
104 const detailData = data[0]; 104 const detailData = data[0];
105 - 105 + ///直播方式 0 视频直播 1 文字直播
  106 + const liveWay = detailData.liveInfo?.liveWay as number;
106 // 人民号类型单独获取直播地址 107 // 人民号类型单独获取直播地址
107 - if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { 108 + if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running' && liveWay == 0) {
108 const vliveId = detailData.liveInfo.vlive[0].vliveId as string; 109 const vliveId = detailData.liveInfo.vlive[0].vliveId as string;
109 const pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean; 110 const pullStreamAddressData = await this.liveViewModel.getLiveRoomPullAddress(vliveId) as GetPullAddressBean;
110 111
@@ -135,13 +136,14 @@ export struct DetailPlayLiveCommon { @@ -135,13 +136,14 @@ export struct DetailPlayLiveCommon {
135 publishCommentModel.commentContent = ''; 136 publishCommentModel.commentContent = '';
136 this.liveStyle = detailData.liveInfo?.liveStyle; 137 this.liveStyle = detailData.liveInfo?.liveStyle;
137 138
138 - if (detailData.liveInfo?.liveState === 'end') { 139 + if (detailData.liveInfo?.liveState === 'end' && liveWay == 0) {
139 this.playUrl = detailData.liveInfo.vlive[0].replayUri; 140 this.playUrl = detailData.liveInfo.vlive[0].replayUri;
140 } 141 }
141 142
142 resolve(); 143 resolve();
143 }) 144 })
144 - .catch(() => { 145 + .catch((error:Error) => {
  146 + Logger.debug(TAG + "error",error.message,error.name)
145 this.isHideLoading = true; 147 this.isHideLoading = true;
146 ToastUtils.shortToast('内容不存在'); 148 ToastUtils.shortToast('内容不存在');
147 router.back(); 149 router.back();
@@ -79,8 +79,9 @@ export class LiveDetailPageLogic { @@ -79,8 +79,9 @@ export class LiveDetailPageLogic {
79 79
80 // 只有直播中的才会有垫片 80 // 只有直播中的才会有垫片
81 if(this.liveState === 'running'){ 81 if(this.liveState === 'running'){
82 -  
83 - this.showPad = this.contentDetailData.liveInfo.vlive[index].showPad 82 + if (this.contentDetailData.liveInfo.vlive.count > 0) {
  83 + this.showPad = this.contentDetailData.liveInfo.vlive[index].showPad
  84 + }
84 } 85 }
85 86
86 } 87 }
@@ -99,7 +99,7 @@ export struct DetailVideoListPage { @@ -99,7 +99,7 @@ export struct DetailVideoListPage {
99 aboutToAppear() { 99 aboutToAppear() {
100 // 在视频详情页 100 // 在视频详情页
101 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || ''; 101 this.peopleShipHomeCreatorId = AppStorage.get<string>('peopleShipHomeCreatorId') || '';
102 - // console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`) 102 + console.info(TAG, `cj2024 peopleShipHomeCreatorId = ${this.peopleShipHomeCreatorId}`)
103 if (this.peopleShipHomeCreatorId) { 103 if (this.peopleShipHomeCreatorId) {
104 // 从人民号号主传过来的 104 // 从人民号号主传过来的
105 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId); 105 this.getPeopleShipHomeDetail(this.peopleShipHomeCreatorId);
@@ -120,13 +120,16 @@ export struct DetailVideoListPage { @@ -120,13 +120,16 @@ export struct DetailVideoListPage {
120 if (action) { 120 if (action) {
121 this.contentId = action.params?.contentID || ''; 121 this.contentId = action.params?.contentID || '';
122 if (action.params && action.params.extra) { 122 if (action.params && action.params.extra) {
123 - this.relId = action.params.extra.relId || '';  
124 - this.relType = action.params.extra.relType || ''; 123 + this.relId = action.params.extra.relId != "undefined" && action.params.extra.relId != '' ? action.params.extra.relId : '';
  124 + this.relType = action.params.extra.relType != "undefined" && action.params.extra.relType != '' ? action.params.extra.relType : '';
125 } 125 }
126 // console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`) 126 // console.info(TAG, `cj2024 getPeopleShipHomeDetail contentId = ${this.contentId}`)
  127 + // console.info(TAG, `cj2024 getPeopleShipHomeDetail relId = ${this.relId}`)
  128 + // console.info(TAG, `cj2024 getPeopleShipHomeDetail relType = ${this.relType}`)
127 await this.getRmhContentDetail(this.contentId, this.relId, this.relType) 129 await this.getRmhContentDetail(this.contentId, this.relId, this.relType)
128 this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false)); 130 this.getRmhPublishNexts(peopleShipHomeCreatorId, this.contentId, 1, 1, 10, systemDateTime.getTime(false));
129 } 131 }
  132 + // console.log(TAG, 'aboutToAppear', JSON.stringify(action.params))
130 } else { 133 } else {
131 // 无网络 134 // 无网络
132 this.netStatus = 1 135 this.netStatus = 1
@@ -71,6 +71,8 @@ export class GetuiPush { @@ -71,6 +71,8 @@ export class GetuiPush {
71 Logger.error(TAG, "个推SDK初始化失败,error = " + error) 71 Logger.error(TAG, "个推SDK初始化失败,error = " + error)
72 } 72 }
73 }) 73 })
  74 +
  75 + this.setBadgeNumber(0)
74 } 76 }
75 77
76 async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> { 78 async requestEnableNotifications(context: common.UIAbilityContext) : Promise<boolean> {
@@ -120,6 +122,9 @@ export class GetuiPush { @@ -120,6 +122,9 @@ export class GetuiPush {
120 this.setAlias(false, this.currentUserId) 122 this.setAlias(false, this.currentUserId)
121 } 123 }
122 }) 124 })
  125 + EmitterUtils.receiveEvent(EmitterEventId.APP_ENTER_FOREGROUD, () => {
  126 + this.setBadgeNumber(0)
  127 + })
123 128
124 PushManager.setPushCallback({ 129 PushManager.setPushCallback({
125 // cid 130 // cid
@@ -387,6 +392,7 @@ export class GetuiPush { @@ -387,6 +392,7 @@ export class GetuiPush {
387 }, 392 },
388 notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION, 393 notificationSlotType: notificationManager.SlotType.CONTENT_INFORMATION,
389 wantAgent:want, 394 wantAgent:want,
  395 + badgeNumber:1
390 }; 396 };
391 notificationManager.publish(notificationRequest).then(() => { 397 notificationManager.publish(notificationRequest).then(() => {
392 Logger.debug(TAG, "本地发送系统通知完成") 398 Logger.debug(TAG, "本地发送系统通知完成")
1 import { Logger } from 'wdKit/src/main/ets/utils/Logger' 1 import { Logger } from 'wdKit/src/main/ets/utils/Logger'
2 import { LoginModel } from './LoginModel' 2 import { LoginModel } from './LoginModel'
3 import { LoginBean } from './LoginBean' 3 import { LoginBean } from './LoginBean'
4 -import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit' 4 +import { AppUtils, EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit'
5 import { CheckVerifyBean } from './CheckVerifyBean' 5 import { CheckVerifyBean } from './CheckVerifyBean'
6 import cryptoFramework from '@ohos.security.cryptoFramework' 6 import cryptoFramework from '@ohos.security.cryptoFramework'
7 import buffer from '@ohos.buffer' 7 import buffer from '@ohos.buffer'
@@ -105,7 +105,7 @@ export class LoginViewModel { @@ -105,7 +105,7 @@ export class LoginViewModel {
105 SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName ?? "") 105 SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName ?? "")
106 EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) 106 EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS)
107 107
108 - LoginModule.reportDeviceInfo() 108 + LoginModule.reportDeviceInfo(AppUtils.gotApplicationContextFunc!())
109 } 109 }
110 110
111 async appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { 111 async appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) {
@@ -5,6 +5,8 @@ import { NewspaperWidgetCommon } from "../common/NewspaperWidgetCommon" @@ -5,6 +5,8 @@ import { NewspaperWidgetCommon } from "../common/NewspaperWidgetCommon"
5 const TAG = "DailyNewspaperWidgetCard" 5 const TAG = "DailyNewspaperWidgetCard"
6 let storageWidgetImageUpdate = new LocalStorage(); 6 let storageWidgetImageUpdate = new LocalStorage();
7 7
  8 +const DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subType=moring_evening_news&pageId=&relId=&skipType=1"
  9 +
8 @Entry(storageWidgetImageUpdate) 10 @Entry(storageWidgetImageUpdate)
9 @Component 11 @Component
10 struct DailyNewspaperWidgetCard { 12 struct DailyNewspaperWidgetCard {
@@ -12,8 +14,6 @@ struct DailyNewspaperWidgetCard { @@ -12,8 +14,6 @@ struct DailyNewspaperWidgetCard {
12 @LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo; 14 @LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo;
13 @LocalStorageProp('paperContents') paperContents: FormNewspaperPaperContent[] = []; 15 @LocalStorageProp('paperContents') paperContents: FormNewspaperPaperContent[] = [];
14 16
15 - private DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subType=moring_evening_news&pageId=&relId=&skipType=1"  
16 -  
17 build() { 17 build() {
18 18
19 Column() { 19 Column() {
@@ -23,7 +23,7 @@ struct DailyNewspaperWidgetCard { @@ -23,7 +23,7 @@ struct DailyNewspaperWidgetCard {
23 .width("100%").height(36) 23 .width("100%").height(36)
24 // .margin({top: 3}) 24 // .margin({top: 3})
25 .onClick(() => { 25 .onClick(() => {
26 - jumpWithDeepLink(this.DAILY_NEWSPAPER_DEEP_LINK, this) 26 + jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this)
27 }) 27 })
28 28
29 Row() { 29 Row() {
@@ -51,7 +51,8 @@ struct DailyNewspaperWidgetCard { @@ -51,7 +51,8 @@ struct DailyNewspaperWidgetCard {
51 .autoResize(true) 51 .autoResize(true)
52 .borderRadius(6) 52 .borderRadius(6)
53 .onClick(() => { 53 .onClick(() => {
54 - jumpWithDeepLink(this.paperInfo.leftDeepLink || "", this) 54 + // jumpWithDeepLink(this.paperInfo.leftDeepLink || "", this)
  55 + jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this)
55 }) 56 })
56 57
57 Text(this.paperInfo.leftTitle) 58 Text(this.paperInfo.leftTitle)
@@ -123,7 +124,8 @@ struct ContentCellView { @@ -123,7 +124,8 @@ struct ContentCellView {
123 } 124 }
124 .justifyContent(FlexAlign.Start) 125 .justifyContent(FlexAlign.Start)
125 .onClick(() => { 126 .onClick(() => {
126 - jumpWithDeepLink(this.content.deepLink || "", this) 127 + // jumpWithDeepLink(this.content.deepLink || "", this)
  128 + jumpWithDeepLink(DAILY_NEWSPAPER_DEEP_LINK, this)
127 }) 129 })
128 } 130 }
129 } 131 }
1 import { AbilityConstant, common, Want } from '@kit.AbilityKit' 1 import { AbilityConstant, common, Want } from '@kit.AbilityKit'
2 -import { DeviceUtil, 2 +import {
  3 + AppUtils,
  4 + DeviceUtil,
3 EmitterEventId, 5 EmitterEventId,
4 EmitterUtils, 6 EmitterUtils,
5 KVStoreHelper, 7 KVStoreHelper,
@@ -58,6 +60,11 @@ export class StartupManager { @@ -58,6 +60,11 @@ export class StartupManager {
58 // 路由注册 60 // 路由注册
59 registerRouter(); 61 registerRouter();
60 62
  63 + // 设置全局context
  64 + AppUtils.gotApplicationContextFunc = () => {
  65 + return this.context!
  66 + }
  67 +
61 // 网络模块 68 // 网络模块
62 NetworkManager.getInstance().init() 69 NetworkManager.getInstance().init()
63 70