Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
23 changed files
with
169 additions
and
124 deletions
| @@ -44,7 +44,7 @@ export struct CardParser { | @@ -44,7 +44,7 @@ export struct CardParser { | ||
| 44 | } else if (contentDTO.appStyle === CompStyle.Card_04) { | 44 | } else if (contentDTO.appStyle === CompStyle.Card_04) { |
| 45 | Card4Component({ compDTO: this.compDTO, contentDTO }) | 45 | Card4Component({ compDTO: this.compDTO, contentDTO }) |
| 46 | } else if (contentDTO.appStyle === CompStyle.Card_05) { | 46 | } else if (contentDTO.appStyle === CompStyle.Card_05) { |
| 47 | - Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy }) | 47 | + Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, compDTO: this.compDTO }) |
| 48 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle | 48 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle |
| 49 | .Card_13) { | 49 | .Card_13) { |
| 50 | Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 50 | Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| @@ -103,7 +103,7 @@ export struct DynamicDetailComponent { | @@ -103,7 +103,7 @@ export struct DynamicDetailComponent { | ||
| 103 | //分割线 | 103 | //分割线 |
| 104 | Image($r('app.media.ic_news_detail_division')) | 104 | Image($r('app.media.ic_news_detail_division')) |
| 105 | .width('100%') | 105 | .width('100%') |
| 106 | - .height($r('app.float.margin_9')) | 106 | + .height($r('app.float.margin_12')) |
| 107 | .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | 107 | .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) |
| 108 | Stack({ alignContent: Alignment.Bottom }) { | 108 | Stack({ alignContent: Alignment.Bottom }) { |
| 109 | if (!this.isNetConnected) { | 109 | if (!this.isNetConnected) { |
| @@ -25,6 +25,7 @@ export struct ImageDownloadComponent { | @@ -25,6 +25,7 @@ export struct ImageDownloadComponent { | ||
| 25 | build() { | 25 | build() { |
| 26 | Column() { | 26 | Column() { |
| 27 | SaveButton({ icon: SaveIconStyle.LINES }) | 27 | SaveButton({ icon: SaveIconStyle.LINES }) |
| 28 | + .iconSize(24) | ||
| 28 | .iconColor(Color.White) | 29 | .iconColor(Color.White) |
| 29 | .onClick(async () => { | 30 | .onClick(async () => { |
| 30 | console.info(`cj2024 onClick ${this.imageBuffer}`) | 31 | console.info(`cj2024 onClick ${this.imageBuffer}`) |
| @@ -42,7 +42,7 @@ export struct InteractMComponent { | @@ -42,7 +42,7 @@ export struct InteractMComponent { | ||
| 42 | .constraintSize({maxHeight:500}) | 42 | .constraintSize({maxHeight:500}) |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | - if(this.messageModel.contentType != '211' && this.messageModel.contentType != '210'){ | 45 | + if(this.messageModel.contentType != '211'){ |
| 46 | Column(){ | 46 | Column(){ |
| 47 | if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ | 47 | if (this.messageModel.contentType === '207' || this.messageModel.contentType === '209'){ |
| 48 | Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) | 48 | Text('[你的评论]'+this.buildCommentContent()).fontSize('14fp').fontColor('#666666').constraintSize({maxHeight:500}) |
| @@ -20,7 +20,7 @@ export struct SpacialTopicPageComponent { | @@ -20,7 +20,7 @@ export struct SpacialTopicPageComponent { | ||
| 20 | action: Action = {} as Action | 20 | action: Action = {} as Action |
| 21 | @State webUrl: string = ''; | 21 | @State webUrl: string = ''; |
| 22 | @State isPageEnd: boolean = false | 22 | @State isPageEnd: boolean = false |
| 23 | - @State reload: number = 0; | 23 | + @Prop reload: number = 0; |
| 24 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 24 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 25 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean | 25 | private h5ReceiveAppData: H5ReceiveDetailBean = { dataSource: '2' } as H5ReceiveDetailBean |
| 26 | private webPrepared = false; | 26 | private webPrepared = false; |
| @@ -134,13 +134,6 @@ export struct SpacialTopicPageComponent { | @@ -134,13 +134,6 @@ export struct SpacialTopicPageComponent { | ||
| 134 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 134 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | - onPageShow() { | ||
| 138 | - if (!this.action?.params?.backVisibility) { | ||
| 139 | - WindowModel.shared.setWindowLayoutFullScreen(true) | ||
| 140 | - } | ||
| 141 | - this.reload++ | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | aboutToAppear() { | 137 | aboutToAppear() { |
| 145 | if (!this.action?.params?.backVisibility) { | 138 | if (!this.action?.params?.backVisibility) { |
| 146 | WindowModel.shared.setWindowLayoutFullScreen(true) | 139 | WindowModel.shared.setWindowLayoutFullScreen(true) |
| @@ -149,12 +142,6 @@ export struct SpacialTopicPageComponent { | @@ -149,12 +142,6 @@ export struct SpacialTopicPageComponent { | ||
| 149 | this.getDetail() | 142 | this.getDetail() |
| 150 | } | 143 | } |
| 151 | 144 | ||
| 152 | - onPageHide() { | ||
| 153 | - if (!this.action?.params?.backVisibility) { | ||
| 154 | - WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 155 | - } | ||
| 156 | - } | ||
| 157 | - | ||
| 158 | aboutToDisappear() { | 145 | aboutToDisappear() { |
| 159 | if (!this.action?.params?.backVisibility) { | 146 | if (!this.action?.params?.backVisibility) { |
| 160 | WindowModel.shared.setWindowLayoutFullScreen(false) | 147 | WindowModel.shared.setWindowLayoutFullScreen(false) |
| @@ -11,19 +11,19 @@ export struct CardSourceInfo { | @@ -11,19 +11,19 @@ export struct CardSourceInfo { | ||
| 11 | Flex() { | 11 | Flex() { |
| 12 | if (this.contentDTO.corner) { | 12 | if (this.contentDTO.corner) { |
| 13 | Text(this.contentDTO.corner) | 13 | Text(this.contentDTO.corner) |
| 14 | - .fontSize($r("app.float.font_size_12")) | 14 | + .fontSize($r("app.float.font_size_11")) |
| 15 | .fontColor($r("app.color.color_ED2800")) | 15 | .fontColor($r("app.color.color_ED2800")) |
| 16 | .margin({ right: 2 }) | 16 | .margin({ right: 2 }) |
| 17 | } | 17 | } |
| 18 | if (this.contentDTO.rmhPlatform === 1) { | 18 | if (this.contentDTO.rmhPlatform === 1) { |
| 19 | Text(this.contentDTO.rmhInfo?.rmhName) | 19 | Text(this.contentDTO.rmhInfo?.rmhName) |
| 20 | - .fontSize($r("app.float.font_size_12")) | 20 | + .fontSize($r("app.float.font_size_11")) |
| 21 | .fontColor($r("app.color.color_B0B0B0")) | 21 | .fontColor($r("app.color.color_B0B0B0")) |
| 22 | .maxLines(1) | 22 | .maxLines(1) |
| 23 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 23 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 24 | } else if (this.contentDTO.source) { | 24 | } else if (this.contentDTO.source) { |
| 25 | Text(`${this.contentDTO.source}`) | 25 | Text(`${this.contentDTO.source}`) |
| 26 | - .fontSize($r("app.float.font_size_12")) | 26 | + .fontSize($r("app.float.font_size_11")) |
| 27 | .fontColor($r("app.color.color_B0B0B0")) | 27 | .fontColor($r("app.color.color_B0B0B0")) |
| 28 | .maxLines(1) | 28 | .maxLines(1) |
| 29 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 29 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| @@ -43,13 +43,13 @@ export struct CardSourceInfo { | @@ -43,13 +43,13 @@ export struct CardSourceInfo { | ||
| 43 | .height(16) | 43 | .height(16) |
| 44 | } | 44 | } |
| 45 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) | 45 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) |
| 46 | - .fontSize($r("app.float.font_size_12")) | 46 | + .fontSize($r("app.float.font_size_11")) |
| 47 | .fontColor($r("app.color.color_B0B0B0")) | 47 | .fontColor($r("app.color.color_B0B0B0")) |
| 48 | .flexShrink(0) | 48 | .flexShrink(0) |
| 49 | } | 49 | } |
| 50 | if (this.getContentDtoBean()?.interactData?.commentNum) { | 50 | if (this.getContentDtoBean()?.interactData?.commentNum) { |
| 51 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) | 51 | Text(`${this.getContentDtoBean()?.interactData?.commentNum}评`) |
| 52 | - .fontSize($r("app.float.font_size_12")) | 52 | + .fontSize($r("app.float.font_size_11")) |
| 53 | .fontColor($r("app.color.color_B0B0B0")) | 53 | .fontColor($r("app.color.color_B0B0B0")) |
| 54 | .flexShrink(0) | 54 | .flexShrink(0) |
| 55 | .margin({ left: 6 }) | 55 | .margin({ left: 6 }) |
| @@ -13,11 +13,13 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -13,11 +13,13 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 13 | import router from '@ohos.router' | 13 | import router from '@ohos.router' |
| 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; | 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; |
| 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' | 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' |
| 16 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 16 | 17 | ||
| 17 | @Component | 18 | @Component |
| 18 | export struct RmhTitle { | 19 | export struct RmhTitle { |
| 19 | @Prop rmhInfo: RmhInfoDTO | 20 | @Prop rmhInfo: RmhInfoDTO |
| 20 | @Prop publishTime: string | undefined | 21 | @Prop publishTime: string | undefined |
| 22 | + @State loadImg: boolean = false; | ||
| 21 | /** | 23 | /** |
| 22 | * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏 | 24 | * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏 |
| 23 | */ | 25 | */ |
| @@ -76,13 +78,15 @@ export struct RmhTitle { | @@ -76,13 +78,15 @@ export struct RmhTitle { | ||
| 76 | } | 78 | } |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 79 | - aboutToAppear(): void { | 81 | + async aboutToAppear(): Promise<void> { |
| 80 | this.getBatchAttentionStatus() | 82 | this.getBatchAttentionStatus() |
| 81 | 83 | ||
| 82 | let page = router.getState(); | 84 | let page = router.getState(); |
| 83 | if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { | 85 | if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { |
| 84 | this.hideTime = true; | 86 | this.hideTime = true; |
| 85 | } | 87 | } |
| 88 | + | ||
| 89 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | getDaysBetweenDates(date: number) { | 92 | getDaysBetweenDates(date: number) { |
| @@ -96,7 +100,7 @@ export struct RmhTitle { | @@ -96,7 +100,7 @@ export struct RmhTitle { | ||
| 96 | build() { | 100 | build() { |
| 97 | Flex() { | 101 | Flex() { |
| 98 | Stack() { | 102 | Stack() { |
| 99 | - Image(this.rmhInfo?.rmhHeadUrl) | 103 | + Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) |
| 100 | .width(36) | 104 | .width(36) |
| 101 | .height(36).borderRadius(50) | 105 | .height(36).borderRadius(50) |
| 102 | Image(this.rmhInfo?.authIcon) | 106 | Image(this.rmhInfo?.authIcon) |
| @@ -7,8 +7,6 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | @@ -7,8 +7,6 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | ||
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | // import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 9 | // import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 10 | -import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare' | ||
| 11 | -import { common } from '@kit.AbilityKit'; | ||
| 12 | const TAG: string = 'Card2Component'; | 10 | const TAG: string = 'Card2Component'; |
| 13 | 11 | ||
| 14 | /** | 12 | /** |
| @@ -111,11 +109,6 @@ export struct Card2Component { | @@ -111,11 +109,6 @@ export struct Card2Component { | ||
| 111 | this.clicked = true; | 109 | this.clicked = true; |
| 112 | // persistentStorage(this.contentDTO.objectId); | 110 | // persistentStorage(this.contentDTO.objectId); |
| 113 | ProcessUtils.processPage(this.contentDTO) | 111 | ProcessUtils.processPage(this.contentDTO) |
| 114 | - | ||
| 115 | - if (this.contentDTO?.channelId === '2001' || this.contentDTO?.channelId === '2002') { | ||
| 116 | - let context = getContext(this) as common.UIAbilityContext; | ||
| 117 | - viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED) | ||
| 118 | - } | ||
| 119 | }) | 112 | }) |
| 120 | } | 113 | } |
| 121 | } | 114 | } |
| @@ -50,6 +50,7 @@ export struct Card3Component { | @@ -50,6 +50,7 @@ export struct Card3Component { | ||
| 50 | Span(this.contentDTO.newsTitle) | 50 | Span(this.contentDTO.newsTitle) |
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | + .lineHeight(27) | ||
| 53 | .fontSize($r("app.float.font_size_18")) | 54 | .fontSize($r("app.float.font_size_18")) |
| 54 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) | 55 | .fontColor(this.clicked ? 0x848484 : $r("app.color.color_222222")) |
| 55 | .width(CommonConstants.FULL_WIDTH) | 56 | .width(CommonConstants.FULL_WIDTH) |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | +import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare' | ||
| 7 | +import { common } from '@kit.AbilityKit'; | ||
| 6 | 8 | ||
| 7 | const TAG: string = 'Card5Component'; | 9 | const TAG: string = 'Card5Component'; |
| 8 | 10 | ||
| @@ -13,6 +15,7 @@ const TAG: string = 'Card5Component'; | @@ -13,6 +15,7 @@ const TAG: string = 'Card5Component'; | ||
| 13 | export struct Card5Component { | 15 | export struct Card5Component { |
| 14 | @State contentDTO: ContentDTO = new ContentDTO(); | 16 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 15 | @Prop titleShowPolicy: number | string | 17 | @Prop titleShowPolicy: number | string |
| 18 | + @Prop compDTO: CompDTO = {} as CompDTO | ||
| 16 | @State loadImg: boolean = false; | 19 | @State loadImg: boolean = false; |
| 17 | @State clicked: boolean = false; | 20 | @State clicked: boolean = false; |
| 18 | @State titleMarked: boolean = false; | 21 | @State titleMarked: boolean = false; |
| @@ -97,6 +100,8 @@ export struct Card5Component { | @@ -97,6 +100,8 @@ export struct Card5Component { | ||
| 97 | .onClick((event: ClickEvent) => { | 100 | .onClick((event: ClickEvent) => { |
| 98 | this.clicked = true; | 101 | this.clicked = true; |
| 99 | ProcessUtils.processPage(this.contentDTO) | 102 | ProcessUtils.processPage(this.contentDTO) |
| 103 | + let context = getContext(this) as common.UIAbilityContext; | ||
| 104 | + viewBlogInsightIntentShare(context, this.contentDTO?.channelId, [this.compDTO], ActionMode.EXECUTED) | ||
| 100 | }) | 105 | }) |
| 101 | 106 | ||
| 102 | } | 107 | } |
| @@ -71,7 +71,7 @@ export struct Card6Component { | @@ -71,7 +71,7 @@ export struct Card6Component { | ||
| 71 | } | 71 | } |
| 72 | .fontColor(this.clicked ? 0x848484 : 0x222222) | 72 | .fontColor(this.clicked ? 0x848484 : 0x222222) |
| 73 | .fontSize(18) | 73 | .fontSize(18) |
| 74 | - .lineHeight(24) | 74 | + .lineHeight(27) |
| 75 | .fontWeight(FontWeight.Normal) | 75 | .fontWeight(FontWeight.Normal) |
| 76 | .maxLines(3) | 76 | .maxLines(3) |
| 77 | .alignSelf(ItemAlign.Start) | 77 | .alignSelf(ItemAlign.Start) |
| @@ -156,7 +156,7 @@ export struct CommentIconComponent { | @@ -156,7 +156,7 @@ export struct CommentIconComponent { | ||
| 156 | // Stack({alignContent:Alignment.Start}) { | 156 | // Stack({alignContent:Alignment.Start}) { |
| 157 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) { | 157 | if (Number.parseInt(this.publishCommentModel.totalCommentNumer) != 0) { |
| 158 | RelativeContainer() { | 158 | RelativeContainer() { |
| 159 | - Image($r('app.media.comment_icon_number_bg')) | 159 | + Image(this.styleType == 1 ? $r('app.media.comment_icon_number_bg'):$r('app.media.ic_like_back_Select')) |
| 160 | .objectFit(ImageFit.Fill) | 160 | .objectFit(ImageFit.Fill) |
| 161 | .resizable({ | 161 | .resizable({ |
| 162 | slice: { | 162 | slice: { |
| @@ -40,7 +40,6 @@ export struct ZhSingleRow03 { | @@ -40,7 +40,6 @@ export struct ZhSingleRow03 { | ||
| 40 | 40 | ||
| 41 | // 请求所有预约状态 | 41 | // 请求所有预约状态 |
| 42 | async getReserveState() { | 42 | async getReserveState() { |
| 43 | - this.reservedIds = [] | ||
| 44 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { | 43 | const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { |
| 45 | const reqItem: reserveReqItem = { | 44 | const reqItem: reserveReqItem = { |
| 46 | liveId: item.objectId.toString(), | 45 | liveId: item.objectId.toString(), |
| @@ -49,6 +48,7 @@ export struct ZhSingleRow03 { | @@ -49,6 +48,7 @@ export struct ZhSingleRow03 { | ||
| 49 | return reqItem; | 48 | return reqItem; |
| 50 | }) | 49 | }) |
| 51 | const res = await LiveModel.getAppointmentStatus(reserveBean); | 50 | const res = await LiveModel.getAppointmentStatus(reserveBean); |
| 51 | + this.reservedIds = [] | ||
| 52 | // this.reserveStatus = res; | 52 | // this.reserveStatus = res; |
| 53 | Logger.debug(TAG, '数据信息:' + `${JSON.stringify(res)}`) | 53 | Logger.debug(TAG, '数据信息:' + `${JSON.stringify(res)}`) |
| 54 | res.map((item: ReserveItemBean) => { | 54 | res.map((item: ReserveItemBean) => { |
| @@ -280,6 +280,8 @@ struct CreatorItem { | @@ -280,6 +280,8 @@ struct CreatorItem { | ||
| 280 | .backgroundColor(0xf5f5f5) | 280 | .backgroundColor(0xf5f5f5) |
| 281 | .width(156) | 281 | .width(156) |
| 282 | .height(208) | 282 | .height(208) |
| 283 | + .border({width: 1}) | ||
| 284 | + .borderRadius(3) | ||
| 283 | Row() | 285 | Row() |
| 284 | .width(156) | 286 | .width(156) |
| 285 | .height(80) | 287 | .height(80) |
| @@ -27,7 +27,7 @@ struct EditUserInfoPage { | @@ -27,7 +27,7 @@ struct EditUserInfoPage { | ||
| 27 | } | 27 | } |
| 28 | }), | 28 | }), |
| 29 | alignment: DialogAlignment.Bottom, | 29 | alignment: DialogAlignment.Bottom, |
| 30 | - offset:{dx:0,dy:-20}, | 30 | + offset:{dx:0,dy:0}, |
| 31 | }) | 31 | }) |
| 32 | 32 | ||
| 33 | aboutToAppear() { | 33 | aboutToAppear() { |
| @@ -104,7 +104,7 @@ struct EditUserInfoPage { | @@ -104,7 +104,7 @@ struct EditUserInfoPage { | ||
| 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) | 104 | .textOverflow({overflow:TextOverflow.Ellipsis}) |
| 105 | .maxLines(1) | 105 | .maxLines(1) |
| 106 | .fontSize(14) | 106 | .fontSize(14) |
| 107 | - .fontColor(r.subTitle === '待完善'?'#999999':'#666666') | 107 | + .fontColor(r.subTitle === '待完善'?'#cccccc':'#666666') |
| 108 | .padding({right:10}) | 108 | .padding({right:10}) |
| 109 | .width('70%') | 109 | .width('70%') |
| 110 | .textAlign(TextAlign.End) | 110 | .textAlign(TextAlign.End) |
| @@ -8,6 +8,7 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI'; | @@ -8,6 +8,7 @@ import { CustomTitleUI } from '../reusable/CustomTitleUI'; | ||
| 8 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; | 8 | import { InteractMComponent } from '../InteractMessage/InteractMComponent'; |
| 9 | import { InteractMessageModel, WDMessageCenterMessageType } from '../../model/InteractMessageModel'; | 9 | import { InteractMessageModel, WDMessageCenterMessageType } from '../../model/InteractMessageModel'; |
| 10 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 10 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 11 | +import { NetworkUtil } from 'wdKit/Index'; | ||
| 11 | 12 | ||
| 12 | @Entry | 13 | @Entry |
| 13 | @Component | 14 | @Component |
| @@ -28,10 +29,9 @@ struct InteractMessagePage { | @@ -28,10 +29,9 @@ struct InteractMessagePage { | ||
| 28 | build() { | 29 | build() { |
| 29 | Column(){ | 30 | Column(){ |
| 30 | CustomTitleUI({titleName:'互动消息'}) | 31 | CustomTitleUI({titleName:'互动消息'}) |
| 31 | - if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 32 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NetworkFailed}) | ||
| 33 | - }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 34 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoMessage}) | 32 | + |
| 33 | + if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 34 | + EmptyComponent({emptyType:this.browSingModel.emptyType}) | ||
| 35 | }else { | 35 | }else { |
| 36 | CustomPullToRefresh({ | 36 | CustomPullToRefresh({ |
| 37 | alldata:this.allDatas, | 37 | alldata:this.allDatas, |
| @@ -114,6 +114,9 @@ struct InteractMessagePage { | @@ -114,6 +114,9 @@ struct InteractMessagePage { | ||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ | 116 | async getData(resolve?: (value: string | PromiseLike<string>) => void){ |
| 117 | + | ||
| 118 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 119 | + if (netStatus) { | ||
| 117 | InteractMessageViewModel.fetchMessageList(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact,this.currentPage).then(InteractMessageMItem => { | 120 | InteractMessageViewModel.fetchMessageList(WDMessageCenterMessageType.WDMessageCenterMessageType_Interact,this.currentPage).then(InteractMessageMItem => { |
| 118 | if(resolve) resolve('刷新成功') | 121 | if(resolve) resolve('刷新成功') |
| 119 | if (InteractMessageMItem && InteractMessageMItem.list && InteractMessageMItem.list.length > 0) { | 122 | if (InteractMessageMItem && InteractMessageMItem.list && InteractMessageMItem.list.length > 0) { |
| @@ -137,9 +140,14 @@ struct InteractMessagePage { | @@ -137,9 +140,14 @@ struct InteractMessagePage { | ||
| 137 | } else { | 140 | } else { |
| 138 | if (this.currentPage === 1) { | 141 | if (this.currentPage === 1) { |
| 139 | this.browSingModel.viewType = ViewType.EMPTY; | 142 | this.browSingModel.viewType = ViewType.EMPTY; |
| 143 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoMessage; | ||
| 140 | } | 144 | } |
| 141 | } | 145 | } |
| 142 | }) | 146 | }) |
| 147 | + }else { | ||
| 148 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 149 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork; | ||
| 150 | + } | ||
| 143 | } | 151 | } |
| 144 | 152 | ||
| 145 | async getMessageLikeCount(){ | 153 | async getMessageLikeCount(){ |
| @@ -12,6 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent'; | @@ -12,6 +12,7 @@ import { BigPicCardComponent } from '../view/BigPicCardComponent'; | ||
| 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; | 12 | import { contentListItemParams } from '../../model/MyCollectionModel'; |
| 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | 13 | import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; |
| 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' | 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' |
| 15 | +import { NetworkUtil } from 'wdKit/Index'; | ||
| 15 | 16 | ||
| 16 | @Entry | 17 | @Entry |
| 17 | @Component | 18 | @Component |
| @@ -26,6 +27,7 @@ struct MyCollectionListPage { | @@ -26,6 +27,7 @@ struct MyCollectionListPage { | ||
| 26 | 27 | ||
| 27 | @State currentPage: number = 1; | 28 | @State currentPage: number = 1; |
| 28 | private scroller: Scroller = new Scroller(); | 29 | private scroller: Scroller = new Scroller(); |
| 30 | + emptyType: WDViewDefaultType = WDViewDefaultType.WDViewDefaultType_Default | ||
| 29 | 31 | ||
| 30 | dialogController: CustomDialogController = new CustomDialogController({ | 32 | dialogController: CustomDialogController = new CustomDialogController({ |
| 31 | builder: MyCustomDialog({ | 33 | builder: MyCustomDialog({ |
| @@ -53,10 +55,8 @@ struct MyCollectionListPage { | @@ -53,10 +55,8 @@ struct MyCollectionListPage { | ||
| 53 | this.deleteNum = 0 | 55 | this.deleteNum = 0 |
| 54 | }}) | 56 | }}) |
| 55 | 57 | ||
| 56 | - if(this.browSingModel.viewType == ViewType.ERROR){ | ||
| 57 | - ErrorComponent() | ||
| 58 | - }else if(this.browSingModel.viewType == ViewType.EMPTY){ | ||
| 59 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoCollection}) | 58 | + if(this.browSingModel.viewType == ViewType.EMPTY){ |
| 59 | + EmptyComponent({emptyType:this.browSingModel.emptyType}) | ||
| 60 | }else { | 60 | }else { |
| 61 | CustomPullToRefresh({ | 61 | CustomPullToRefresh({ |
| 62 | alldata:this.allDatas, | 62 | alldata:this.allDatas, |
| @@ -137,7 +137,10 @@ struct MyCollectionListPage { | @@ -137,7 +137,10 @@ struct MyCollectionListPage { | ||
| 137 | } | 137 | } |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | + | ||
| 140 | async getData(resolve?: (value: string | PromiseLike<string>) => void) { | 141 | async getData(resolve?: (value: string | PromiseLike<string>) => void) { |
| 142 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 143 | + if (netStatus) { | ||
| 141 | MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => { | 144 | MyCollectionViewModel.fetchMyCollectList(1,'1',this.currentPage,getContext(this)).then(collectionItem => { |
| 142 | if(resolve) resolve('刷新成功') | 145 | if(resolve) resolve('刷新成功') |
| 143 | if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { | 146 | if (collectionItem && collectionItem.list && collectionItem.list.length > 0) { |
| @@ -159,9 +162,14 @@ struct MyCollectionListPage { | @@ -159,9 +162,14 @@ struct MyCollectionListPage { | ||
| 159 | } else { | 162 | } else { |
| 160 | if (this.currentPage === 1) { | 163 | if (this.currentPage === 1) { |
| 161 | this.browSingModel.viewType = ViewType.EMPTY; | 164 | this.browSingModel.viewType = ViewType.EMPTY; |
| 165 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoCollection | ||
| 162 | } | 166 | } |
| 163 | } | 167 | } |
| 164 | }) | 168 | }) |
| 169 | + } else { | ||
| 170 | + this.browSingModel.viewType = ViewType.EMPTY; | ||
| 171 | + this.browSingModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoNetwork; | ||
| 172 | + } | ||
| 165 | } | 173 | } |
| 166 | 174 | ||
| 167 | //数据处理 | 175 | //数据处理 |
| 1 | -import { Logger, NumberFormatterUtils } from 'wdKit/Index' | 1 | +import { DisplayUtils,Logger, NumberFormatterUtils } from 'wdKit/Index' |
| 2 | import { LikeViewModel } from '../../viewmodel/LikeViewModel' | 2 | import { LikeViewModel } from '../../viewmodel/LikeViewModel' |
| 3 | import { SPHelper } from 'wdKit'; | 3 | import { SPHelper } from 'wdKit'; |
| 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 4 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | import { ContentDetailDTO } from 'wdBean/Index'; | 6 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 7 | - | 7 | +import measure from '@ohos.measure' |
| 8 | 8 | ||
| 9 | const TAG = 'LikeComponent'; | 9 | const TAG = 'LikeComponent'; |
| 10 | 10 | ||
| @@ -168,30 +168,74 @@ export struct LikeComponent { | @@ -168,30 +168,74 @@ export struct LikeComponent { | ||
| 168 | likeCompStyle5() { | 168 | likeCompStyle5() { |
| 169 | //1: 底部栏目样式 默认样式 | 169 | //1: 底部栏目样式 默认样式 |
| 170 | Stack({ alignContent: Alignment.Bottom }) { | 170 | Stack({ alignContent: Alignment.Bottom }) { |
| 171 | - Column() { | ||
| 172 | - // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) | ||
| 173 | Image(this.transLikeStyle().url) | 171 | Image(this.transLikeStyle().url) |
| 174 | .width(24) | 172 | .width(24) |
| 175 | .height(24) | 173 | .height(24) |
| 176 | - .onClick(() => { | ||
| 177 | - this.clickButtonEvent() | ||
| 178 | - }) | 174 | + if (this.likeCount > 0){ |
| 175 | + RelativeContainer() { | ||
| 176 | + Image(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 177 | + .objectFit(ImageFit.Fill) | ||
| 178 | + .resizable({ | ||
| 179 | + slice: { | ||
| 180 | + top: 1, | ||
| 181 | + left: 20, | ||
| 182 | + right: 1, | ||
| 183 | + bottom: 1 | ||
| 179 | } | 184 | } |
| 185 | + }) | ||
| 186 | + .alignRules({ | ||
| 187 | + top: { anchor: "Text", align: VerticalAlign.Top }, | ||
| 188 | + left: { anchor: "Text", align: HorizontalAlign.Start }, | ||
| 189 | + right: { anchor: "Text", align: HorizontalAlign.End }, | ||
| 190 | + bottom: { anchor: "Text", align: VerticalAlign.Bottom }, | ||
| 191 | + }) | ||
| 192 | + .id("Image") | ||
| 180 | 193 | ||
| 181 | - Row() { | ||
| 182 | - Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | 194 | + Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || ''))// Text("44444444") |
| 183 | .fontSize(8) | 195 | .fontSize(8) |
| 184 | - .fontColor(Color.White) | ||
| 185 | - .padding({ left: 4, right: 2 }) | ||
| 186 | - } | 196 | + .fontColor('#ffffff')// .backgroundColor('#ED2800') |
| 187 | .height(12) | 197 | .height(12) |
| 188 | - .alignItems(VerticalAlign.Center) | ||
| 189 | - .position({ x: '100%', }) | ||
| 190 | - .markAnchor({ x: '100%' }) | ||
| 191 | - .backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 192 | - .backgroundImageSize(ImageSize.Auto) | 198 | + .textAlign(TextAlign.Center) |
| 199 | + .alignRules({ | ||
| 200 | + top: { anchor: "__container__", align: VerticalAlign.Top }, | ||
| 201 | + left: { anchor: "__container__", align: HorizontalAlign.Start } | ||
| 202 | + })/*动态计算文字宽度*/ | ||
| 203 | + .width(this.getMeasureText(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) + | ||
| 204 | + 12)// .backgroundColor(Color.Green) | ||
| 205 | + .id("Text") | ||
| 193 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | 206 | .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) |
| 194 | - }.width(24).height(24) | 207 | + } |
| 208 | + .offset({ | ||
| 209 | + x: 12 | ||
| 210 | + }) | ||
| 211 | + } | ||
| 212 | + | ||
| 213 | + // Column() { | ||
| 214 | + // // Image(this.likeStatus ? $r('app.media.icon_like_select') : $r('app.media.icon_like_default')) | ||
| 215 | + // Image(this.transLikeStyle().url) | ||
| 216 | + // .width(24) | ||
| 217 | + // .height(24) | ||
| 218 | + // .onClick(() => { | ||
| 219 | + // this.clickButtonEvent() | ||
| 220 | + // }) | ||
| 221 | + // } | ||
| 222 | + // | ||
| 223 | + // Row() { | ||
| 224 | + // Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | ||
| 225 | + // .fontSize(8) | ||
| 226 | + // .fontColor(Color.White) | ||
| 227 | + // .padding({ left: 4, right: 2 }) | ||
| 228 | + // } | ||
| 229 | + // .height(12) | ||
| 230 | + // .alignItems(VerticalAlign.Center) | ||
| 231 | + // .position({ x: '100%', }) | ||
| 232 | + // .markAnchor({ x: '100%' }) | ||
| 233 | + // .backgroundImage(this.likeStatus ? $r('app.media.ic_like_back_Select') : $r('app.media.ic_like_back')) | ||
| 234 | + // .backgroundImageSize(ImageSize.Auto) | ||
| 235 | + // .visibility(this.likeCount > 0 ? Visibility.Visible : Visibility.Hidden) | ||
| 236 | + }.width(24).height(24).onClick(() => { | ||
| 237 | + this.clickButtonEvent() | ||
| 238 | + }) | ||
| 195 | } | 239 | } |
| 196 | 240 | ||
| 197 | @Builder | 241 | @Builder |
| @@ -210,8 +254,6 @@ export struct LikeComponent { | @@ -210,8 +254,6 @@ export struct LikeComponent { | ||
| 210 | .height(36) | 254 | .height(36) |
| 211 | .borderRadius(18) | 255 | .borderRadius(18) |
| 212 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5') | 256 | .backgroundColor((this.pageComponentType === 4 || this.pageComponentType === 2) ? '#4D000000' : '#FFF5F5F5') |
| 213 | - | ||
| 214 | - | ||
| 215 | Row() { | 257 | Row() { |
| 216 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) | 258 | Text(NumberFormatterUtils.formatNumberWithWan(this.likeCount || '')) |
| 217 | .fontSize(8) | 259 | .fontSize(8) |
| @@ -306,4 +348,14 @@ export struct LikeComponent { | @@ -306,4 +348,14 @@ export struct LikeComponent { | ||
| 306 | this.likeCount = 0 | 348 | this.likeCount = 0 |
| 307 | }) | 349 | }) |
| 308 | } | 350 | } |
| 351 | + private getMeasureText(text: string) { | ||
| 352 | + let width = measure.measureText({ | ||
| 353 | + textContent: text, | ||
| 354 | + fontSize: 8, | ||
| 355 | + lineHeight: 12, | ||
| 356 | + constraintWidth: DisplayUtils.getDeviceWidth(), | ||
| 357 | + }) | ||
| 358 | + width = px2vp(width) | ||
| 359 | + return width | ||
| 360 | + } | ||
| 309 | } | 361 | } |
| @@ -135,7 +135,8 @@ export struct OperRowListView { | @@ -135,7 +135,8 @@ export struct OperRowListView { | ||
| 135 | Column() { | 135 | Column() { |
| 136 | Image($r('app.media.ic_news_detail_division')) | 136 | Image($r('app.media.ic_news_detail_division')) |
| 137 | .width('100%') | 137 | .width('100%') |
| 138 | - .height($r('app.float.margin_4')) | 138 | + .height($r('app.float.margin_1')) |
| 139 | + .margin({bottom: -2}) | ||
| 139 | 140 | ||
| 140 | Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { | 141 | Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) { |
| 141 | // AudioDialog() | 142 | // AudioDialog() |
| 1 | import { common } from '@kit.AbilityKit'; | 1 | import { common } from '@kit.AbilityKit'; |
| 2 | import { insightIntent } from '@kit.IntentsKit'; | 2 | import { insightIntent } from '@kit.IntentsKit'; |
| 3 | +import { BusinessError } from '@kit.BasicServicesKit'; | ||
| 3 | import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean'; | 4 | import { CompDTO, CompList, ContentDTO, PageInfoBean } from 'wdBean'; |
| 4 | 5 | ||
| 5 | -function generateUniqueId() { | ||
| 6 | - // 生成当前时间戳 | ||
| 7 | - let timestamp = new Date().getTime(); | ||
| 8 | - | ||
| 9 | - // 将时间戳转换成16进制字符串 | ||
| 10 | - let hexString = timestamp.toString(16); | ||
| 11 | - | ||
| 12 | - // 确保字符串长度为16位,不足的话在前面补0 | ||
| 13 | - while (hexString.length < 16) { | ||
| 14 | - hexString = '0' + hexString; | ||
| 15 | - } | ||
| 16 | - | ||
| 17 | - // 格式化为UUID样式 | ||
| 18 | - let uuid = hexString.substring(0, 8) + '-' + | ||
| 19 | - hexString.substring(8, 12) + '-' + | ||
| 20 | - hexString.substring(12, 16) + '-' + | ||
| 21 | - hexString.substring(16, 20) + '-' + | ||
| 22 | - hexString.substring(20); | ||
| 23 | - | 6 | +function generateUUID() { |
| 7 | + let dt = new Date().getTime(); // 获取当前时间的时间戳(毫秒) | ||
| 8 | + let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { | ||
| 9 | + let r = (dt + Math.random() * 16) % 16 | 0; | ||
| 10 | + dt = Math.floor(dt / 16); | ||
| 11 | + return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16); | ||
| 12 | + }); | ||
| 24 | return uuid; | 13 | return uuid; |
| 25 | } | 14 | } |
| 26 | 15 | ||
| @@ -34,15 +23,16 @@ export const enum ActionMode { | @@ -34,15 +23,16 @@ export const enum ActionMode { | ||
| 34 | //ViewBlog意图共享-频道列表 | 23 | //ViewBlog意图共享-频道列表 |
| 35 | export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string, | 24 | export function viewBlogInsightIntentShare(context: common.UIAbilityContext, entityGroupId: string, |
| 36 | compList: CompDTO[] | CompList[], actionMode: ActionMode) { | 25 | compList: CompDTO[] | CompList[], actionMode: ActionMode) { |
| 37 | - console.log('viewBlogInsightIntentShare',actionMode) | 26 | + console.log('viewBlogInsightIntentShare', actionMode) |
| 38 | let insightIntentArray: insightIntent.InsightIntent [] = [] | 27 | let insightIntentArray: insightIntent.InsightIntent [] = [] |
| 28 | + let identifier = generateUUID() | ||
| 39 | if (compList?.length > 0) { | 29 | if (compList?.length > 0) { |
| 40 | compList?.forEach((item: CompDTO | CompList) => { | 30 | compList?.forEach((item: CompDTO | CompList) => { |
| 41 | item.operDataList.forEach((_item: ContentDTO) => { | 31 | item.operDataList.forEach((_item: ContentDTO) => { |
| 42 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | 32 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { |
| 43 | intentName: 'ViewBlog', | 33 | intentName: 'ViewBlog', |
| 44 | intentVersion: '1.0.1', | 34 | intentVersion: '1.0.1', |
| 45 | - identifier: generateUniqueId(), | 35 | + identifier, |
| 46 | intentActionInfo: { | 36 | intentActionInfo: { |
| 47 | actionMode, | 37 | actionMode, |
| 48 | currentPercentage: 50, | 38 | currentPercentage: 50, |
| @@ -67,7 +57,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -67,7 +57,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 67 | _item?.newsSummary.substring(0, 20) : _item?.newsSummary, | 57 | _item?.newsSummary.substring(0, 20) : _item?.newsSummary, |
| 68 | blogAuthor: _item?.source, | 58 | blogAuthor: _item?.source, |
| 69 | blogPublishTime: _item?.publishTimestamp, | 59 | blogPublishTime: _item?.publishTimestamp, |
| 70 | - tag: _item?.newTags, | 60 | + tag: _item?.newTags.split(','), |
| 71 | likeCount: _item?.interactData?.likeNum || 0, | 61 | likeCount: _item?.interactData?.likeNum || 0, |
| 72 | forwardCount: _item?.interactData?.shareNum || 0, | 62 | forwardCount: _item?.interactData?.shareNum || 0, |
| 73 | commentCount: _item?.interactData?.commentNum || 0, | 63 | commentCount: _item?.interactData?.commentNum || 0, |
| @@ -82,21 +72,13 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -82,21 +72,13 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 82 | 72 | ||
| 83 | }) | 73 | }) |
| 84 | console.log('yzl', JSON.stringify(insightIntentArray[0])) | 74 | console.log('yzl', JSON.stringify(insightIntentArray[0])) |
| 85 | - try { | ||
| 86 | // 共享数据 | 75 | // 共享数据 |
| 87 | - insightIntent.shareIntent(context, insightIntentArray, (error) => { | ||
| 88 | - if (error?.code) { | ||
| 89 | - // 处理业务逻辑错误 | ||
| 90 | - console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 91 | - return; | ||
| 92 | - } | ||
| 93 | - // 执行正常业务 | ||
| 94 | - console.log('shareIntent succeed'); | 76 | + insightIntent.shareIntent(context, insightIntentArray).then(() => { |
| 77 | + console.log('yzl shareIntent success'); | ||
| 78 | + }).catch((err: BusinessError) => { | ||
| 79 | + console.error(`yzl failed because ${err?.message}`); | ||
| 95 | }); | 80 | }); |
| 96 | - } catch (error) { | ||
| 97 | - // 处理异常 | ||
| 98 | - console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 99 | - } | 81 | + |
| 100 | } | 82 | } |
| 101 | } | 83 | } |
| 102 | 84 | ||
| @@ -108,7 +90,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | @@ -108,7 +90,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | ||
| 108 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { | 90 | let viewBlogInsightIntentItem: insightIntent.InsightIntent = { |
| 109 | intentName: 'ViewColumn', | 91 | intentName: 'ViewColumn', |
| 110 | intentVersion: '1.0.1', | 92 | intentVersion: '1.0.1', |
| 111 | - identifier: generateUniqueId(), | 93 | + identifier: generateUUID(), |
| 112 | intentActionInfo: { | 94 | intentActionInfo: { |
| 113 | actionMode: ActionMode.EXECUTED, | 95 | actionMode: ActionMode.EXECUTED, |
| 114 | currentPercentage: 50, | 96 | currentPercentage: 50, |
| @@ -116,30 +98,22 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | @@ -116,30 +98,22 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | ||
| 116 | intentEntityInfo: { | 98 | intentEntityInfo: { |
| 117 | entityName: 'Column', | 99 | entityName: 'Column', |
| 118 | entityId, | 100 | entityId, |
| 119 | - displayName:pageInfoBean?.topicInfo?.title, | 101 | + displayName: pageInfoBean?.topicInfo?.title, |
| 120 | description: pageInfoBean?.shareSummary, | 102 | description: pageInfoBean?.shareSummary, |
| 121 | - logoURL:pageInfoBean?.shareCoverUrl, | ||
| 122 | - activityType:['RecentViews'], | 103 | + logoURL: pageInfoBean?.shareCoverUrl, |
| 104 | + activityType: ['RecentViews'], | ||
| 123 | columnTitle: pageInfoBean?.topicInfo?.title, | 105 | columnTitle: pageInfoBean?.topicInfo?.title, |
| 124 | columnSubTitle: pageInfoBean?.shareSummary, | 106 | columnSubTitle: pageInfoBean?.shareSummary, |
| 125 | rankingHint: 99, | 107 | rankingHint: 99, |
| 126 | isPublicData: true | 108 | isPublicData: true |
| 127 | } | 109 | } |
| 128 | } | 110 | } |
| 111 | + console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewBlogInsightIntentItem)) | ||
| 129 | 112 | ||
| 130 | - try { | ||
| 131 | // 共享数据 | 113 | // 共享数据 |
| 132 | - insightIntent.shareIntent(context, [viewBlogInsightIntentItem], (error) => { | ||
| 133 | - if (error?.code) { | ||
| 134 | - // 处理业务逻辑错误 | ||
| 135 | - console.error(`shareIntent failed, error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 136 | - return; | ||
| 137 | - } | ||
| 138 | - // 执行正常业务 | ||
| 139 | - console.log('shareIntent succeed'); | 114 | + insightIntent.shareIntent(context, [viewBlogInsightIntentItem]).then(() => { |
| 115 | + console.log('yzl shareIntent success'); | ||
| 116 | + }).catch((err: BusinessError) => { | ||
| 117 | + console.error(`yzl failed because ${err?.message}`); | ||
| 140 | }); | 118 | }); |
| 141 | - } catch (error) { | ||
| 142 | - // 处理异常 | ||
| 143 | - console.error(`error.code: ${error?.code}, error.message: ${error?.message}`); | ||
| 144 | - } | ||
| 145 | } | 119 | } |
| @@ -52,11 +52,11 @@ class EditInfoViewModel { | @@ -52,11 +52,11 @@ class EditInfoViewModel { | ||
| 52 | if (editDTO.code == 0) { | 52 | if (editDTO.code == 0) { |
| 53 | success(editDTO.data) | 53 | success(editDTO.data) |
| 54 | }else { | 54 | }else { |
| 55 | - success(this.GetqueryAccountOwnerLocal(context)) | 55 | + // success(this.GetqueryAccountOwnerLocal(context)) |
| 56 | } | 56 | } |
| 57 | }).catch((error: Error) => { | 57 | }).catch((error: Error) => { |
| 58 | Logger.info(TAG,'queryAccountOwnerInfo','EditInfoViewModel') | 58 | Logger.info(TAG,'queryAccountOwnerInfo','EditInfoViewModel') |
| 59 | - success(this.GetqueryAccountOwnerLocal(context)) | 59 | + // success(this.GetqueryAccountOwnerLocal(context)) |
| 60 | }) | 60 | }) |
| 61 | })) | 61 | })) |
| 62 | } | 62 | } |
496 Bytes
| @@ -9,11 +9,12 @@ const TAG = 'SpacialTopicPage'; | @@ -9,11 +9,12 @@ const TAG = 'SpacialTopicPage'; | ||
| 9 | @Entry | 9 | @Entry |
| 10 | @Component | 10 | @Component |
| 11 | struct SpacialTopicPage { | 11 | struct SpacialTopicPage { |
| 12 | - action: Action = {} as Action | ||
| 13 | - | 12 | + @State action: Action = {} as Action |
| 13 | + @State reload: number = 0 | ||
| 14 | + @State count: number = 0 | ||
| 14 | build() { | 15 | build() { |
| 15 | Column() { | 16 | Column() { |
| 16 | - SpacialTopicPageComponent({ action: this.action }) | 17 | + SpacialTopicPageComponent({ action: this.action ,reload:this.reload }) |
| 17 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 18 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 18 | } | 19 | } |
| 19 | 20 | ||
| @@ -30,8 +31,12 @@ struct SpacialTopicPage { | @@ -30,8 +31,12 @@ struct SpacialTopicPage { | ||
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | aboutToAppear() { | 33 | aboutToAppear() { |
| 33 | - Logger.info(TAG, 'aboutToAppear'); | 34 | + Logger.info(TAG, `aboutToAppearcount:${this.reload}`); |
| 34 | let action: Action = router.getParams() as Action | 35 | let action: Action = router.getParams() as Action |
| 35 | this.action = action | 36 | this.action = action |
| 36 | } | 37 | } |
| 38 | + onPageShow() { | ||
| 39 | + this.reload = this.reload + 1 | ||
| 40 | + Logger.info(TAG, `onPageShowcount:${this.reload}`); | ||
| 41 | + } | ||
| 37 | } | 42 | } |
-
Please register or login to post a comment