Showing
6 changed files
with
77 additions
and
56 deletions
| @@ -47,6 +47,9 @@ export class SpConstants{ | @@ -47,6 +47,9 @@ export class SpConstants{ | ||
| 47 | //国殇模式数据存储key | 47 | //国殇模式数据存储key |
| 48 | static APP_MOURNS_INFO_DATA_MODEL = 'app_mourns_info_model' | 48 | static APP_MOURNS_INFO_DATA_MODEL = 'app_mourns_info_model' |
| 49 | 49 | ||
| 50 | + //稿件详情音频播放跳转存储key | ||
| 51 | + static APP_NEWS_INFO_DATA_MODEL = 'app_news_info_model' | ||
| 52 | + | ||
| 50 | //频道信息流页面左右挂角 | 53 | //频道信息流页面左右挂角 |
| 51 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' | 54 | static APP_PAGE_CORNER_ADV = 'app_page_corner_adv_' |
| 52 | 55 |
| @@ -28,12 +28,10 @@ export class WDRouterRule { | @@ -28,12 +28,10 @@ export class WDRouterRule { | ||
| 28 | } | 28 | } |
| 29 | if (params) { | 29 | if (params) { |
| 30 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) | 30 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) |
| 31 | - console.log('page.url()==',page.url(),JSON.stringify(params)) | 31 | + // console.log('page.url()==',page.url(),JSON.stringify(params)) |
| 32 | router.pushUrl({ url: page.url(), params: params }) | 32 | router.pushUrl({ url: page.url(), params: params }) |
| 33 | } else { | 33 | } else { |
| 34 | - router.pushUrl({ url: page.url() }, mode).catch((error: Error) => { | ||
| 35 | - console.log("err", JSON.stringify(error)) //100002 uri is not exist | ||
| 36 | - }) | 34 | + router.pushUrl({ url: page.url() }, mode) |
| 37 | } | 35 | } |
| 38 | } else { | 36 | } else { |
| 39 | ToastUtils.showToast("功能开发中", 1000); | 37 | ToastUtils.showToast("功能开发中", 1000); |
| @@ -50,9 +48,7 @@ export class WDRouterRule { | @@ -50,9 +48,7 @@ export class WDRouterRule { | ||
| 50 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) | 48 | // router.pushUrl({ url: 'pages/routerpage2', , params: params }) |
| 51 | router.replaceUrl({ url: page.url(), params: params }) | 49 | router.replaceUrl({ url: page.url(), params: params }) |
| 52 | } else { | 50 | } else { |
| 53 | - router.replaceUrl({ url: page.url() }).catch((error:Error)=>{ | ||
| 54 | - console.log("err",JSON.stringify(error))//100002 uri is not exist | ||
| 55 | - }) | 51 | + router.replaceUrl({ url: page.url() }) |
| 56 | } | 52 | } |
| 57 | } else { | 53 | } else { |
| 58 | ToastUtils.showToast("功能开发中", 1000); | 54 | ToastUtils.showToast("功能开发中", 1000); |
| @@ -170,11 +170,11 @@ export class ProcessUtils { | @@ -170,11 +170,11 @@ export class ProcessUtils { | ||
| 170 | */ | 170 | */ |
| 171 | static processPage(content: ContentDTO) { | 171 | static processPage(content: ContentDTO) { |
| 172 | if (content == null) { | 172 | if (content == null) { |
| 173 | - Logger.error(TAG, "processPage, content is null"); | 173 | + // Logger.error(TAG, "processPage, content is null"); |
| 174 | return; | 174 | return; |
| 175 | } | 175 | } |
| 176 | if (StringUtils.isEmpty(content.objectType)) { | 176 | if (StringUtils.isEmpty(content.objectType)) { |
| 177 | - Logger.error(TAG, "processPage, objectType is empty"); | 177 | + // Logger.error(TAG, "processPage, objectType is empty"); |
| 178 | return; | 178 | return; |
| 179 | } | 179 | } |
| 180 | // 网络出小差了,请检查网络后重试 | 180 | // 网络出小差了,请检查网络后重试 |
| @@ -189,13 +189,13 @@ export class ProcessUtils { | @@ -189,13 +189,13 @@ export class ProcessUtils { | ||
| 189 | if (typeof type == "number") { | 189 | if (typeof type == "number") { |
| 190 | type = `${type}` | 190 | type = `${type}` |
| 191 | } | 191 | } |
| 192 | - console.log(TAG, 'objectType', `${JSON.stringify(content)}`); | 192 | + // console.log(TAG, 'objectType', `${JSON.stringify(content)}`); |
| 193 | switch (type) { | 193 | switch (type) { |
| 194 | case ContentConstants.TYPE_NONE: | 194 | case ContentConstants.TYPE_NONE: |
| 195 | - Logger.debug(TAG, "processPage, do nothing"); | 195 | + // Logger.debug(TAG, "processPage, do nothing"); |
| 196 | break; | 196 | break; |
| 197 | case ContentConstants.TYPE_VOD: | 197 | case ContentConstants.TYPE_VOD: |
| 198 | - Logger.debug(TAG, "processPage, nonsupport!!!"); | 198 | + // Logger.debug(TAG, "processPage, nonsupport!!!"); |
| 199 | ProcessUtils.gotoVod(content) | 199 | ProcessUtils.gotoVod(content) |
| 200 | break; | 200 | break; |
| 201 | case ContentConstants.TYPE_LIVE: | 201 | case ContentConstants.TYPE_LIVE: |
| @@ -432,7 +432,7 @@ export class ProcessUtils { | @@ -432,7 +432,7 @@ export class ProcessUtils { | ||
| 432 | } as Params, | 432 | } as Params, |
| 433 | }; | 433 | }; |
| 434 | WDRouterRule.jumpWithAction(taskAction) | 434 | WDRouterRule.jumpWithAction(taskAction) |
| 435 | - Logger.debug(TAG, `gotoH5NewsWeb, ${content.objectId}`); | 435 | + // Logger.debug(TAG, `gotoH5NewsWeb, ${content.objectId}`); |
| 436 | } | 436 | } |
| 437 | 437 | ||
| 438 | public static gotoWeb(content: ContentDTO) { | 438 | public static gotoWeb(content: ContentDTO) { |
| @@ -454,7 +454,7 @@ export class ProcessUtils { | @@ -454,7 +454,7 @@ export class ProcessUtils { | ||
| 454 | } as Params, | 454 | } as Params, |
| 455 | }; | 455 | }; |
| 456 | WDRouterRule.jumpWithAction(taskAction) | 456 | WDRouterRule.jumpWithAction(taskAction) |
| 457 | - Logger.debug(TAG, `gotoWeb, ${content.objectId}`); | 457 | + // Logger.debug(TAG, `gotoWeb, ${content.objectId}`); |
| 458 | } | 458 | } |
| 459 | 459 | ||
| 460 | public static gotoVod(content: ContentDTO) { | 460 | public static gotoVod(content: ContentDTO) { |
| @@ -473,7 +473,7 @@ export class ProcessUtils { | @@ -473,7 +473,7 @@ export class ProcessUtils { | ||
| 473 | } as Params, | 473 | } as Params, |
| 474 | }; | 474 | }; |
| 475 | WDRouterRule.jumpWithAction(taskAction) | 475 | WDRouterRule.jumpWithAction(taskAction) |
| 476 | - Logger.debug(TAG, `gotoVod, ${content.objectId}`); | 476 | + // Logger.debug(TAG, `gotoVod, ${content.objectId}`); |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | /** | 479 | /** |
| @@ -495,7 +495,7 @@ export class ProcessUtils { | @@ -495,7 +495,7 @@ export class ProcessUtils { | ||
| 495 | } as Params, | 495 | } as Params, |
| 496 | }; | 496 | }; |
| 497 | WDRouterRule.jumpWithAction(taskAction) | 497 | WDRouterRule.jumpWithAction(taskAction) |
| 498 | - Logger.debug(TAG, `gotoLive, ${content.objectId}`); | 498 | + // Logger.debug(TAG, `gotoLive, ${content.objectId}`); |
| 499 | } | 499 | } |
| 500 | 500 | ||
| 501 | //音频详情页 | 501 | //音频详情页 |
| @@ -514,7 +514,7 @@ export class ProcessUtils { | @@ -514,7 +514,7 @@ export class ProcessUtils { | ||
| 514 | // } as Params, | 514 | // } as Params, |
| 515 | // }; | 515 | // }; |
| 516 | // WDRouterRule.jumpWithAction(taskAction) | 516 | // WDRouterRule.jumpWithAction(taskAction) |
| 517 | - Logger.debug(TAG, `gotoAudio, ${content.objectId}`); | 517 | + // Logger.debug(TAG, `gotoAudio, ${content.objectId}`); |
| 518 | } | 518 | } |
| 519 | 519 | ||
| 520 | /** | 520 | /** |
| @@ -538,7 +538,7 @@ export class ProcessUtils { | @@ -538,7 +538,7 @@ export class ProcessUtils { | ||
| 538 | } as Params, | 538 | } as Params, |
| 539 | }; | 539 | }; |
| 540 | WDRouterRule.jumpWithAction(taskAction) | 540 | WDRouterRule.jumpWithAction(taskAction) |
| 541 | - Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); | 541 | + // Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); |
| 542 | } | 542 | } |
| 543 | 543 | ||
| 544 | /** | 544 | /** |
| @@ -561,7 +561,7 @@ export class ProcessUtils { | @@ -561,7 +561,7 @@ export class ProcessUtils { | ||
| 561 | } as Params, | 561 | } as Params, |
| 562 | }; | 562 | }; |
| 563 | WDRouterRule.jumpWithAction(taskAction) | 563 | WDRouterRule.jumpWithAction(taskAction) |
| 564 | - Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); | 564 | + // Logger.debug(TAG, `gotoAtlasDetailPage, ${content.objectId}`); |
| 565 | } | 565 | } |
| 566 | 566 | ||
| 567 | /** | 567 | /** |
| @@ -575,11 +575,12 @@ export class ProcessUtils { | @@ -575,11 +575,12 @@ export class ProcessUtils { | ||
| 575 | entities: ['entity.system.browsable'], | 575 | entities: ['entity.system.browsable'], |
| 576 | uri: url | 576 | uri: url |
| 577 | } | 577 | } |
| 578 | - context.startAbility(wantInfo).then(() => { | ||
| 579 | - Logger.debug(TAG, 'jumpExternalWebPage success') | ||
| 580 | - }).catch((err: BusinessError) => { | ||
| 581 | - Logger.error(TAG, 'jumpExternalWebPage success, error: ' + JSON.stringify(err)) | ||
| 582 | - }) | 578 | + context.startAbility(wantInfo) |
| 579 | + // .then(() => { | ||
| 580 | + // Logger.debug(TAG, 'jumpExternalWebPage success') | ||
| 581 | + // }).catch((err: BusinessError) => { | ||
| 582 | + // Logger.error(TAG, 'jumpExternalWebPage success, error: ' + JSON.stringify(err)) | ||
| 583 | + // }) | ||
| 583 | } | 584 | } |
| 584 | 585 | ||
| 585 | /** | 586 | /** |
| @@ -79,7 +79,7 @@ export struct ENewspaperItemComponent { | @@ -79,7 +79,7 @@ export struct ENewspaperItemComponent { | ||
| 79 | this.startX = x; | 79 | this.startX = x; |
| 80 | this.startY = y; | 80 | this.startY = y; |
| 81 | let points: number[][] = this.getArea(x, y, this.newspaperListItemBean.items); | 81 | let points: number[][] = this.getArea(x, y, this.newspaperListItemBean.items); |
| 82 | - console.log("event.points", JSON.stringify(points)) | 82 | + // console.log("event.points", JSON.stringify(points)) |
| 83 | if (points && points.length > 2) { | 83 | if (points && points.length > 2) { |
| 84 | let path = new Path2D(); | 84 | let path = new Path2D(); |
| 85 | path.moveTo(px2vp(points[0][0]), px2vp(points[0][1])); | 85 | path.moveTo(px2vp(points[0][0]), px2vp(points[0][1])); |
| @@ -27,6 +27,7 @@ import { common } from '@kit.AbilityKit'; | @@ -27,6 +27,7 @@ import { common } from '@kit.AbilityKit'; | ||
| 27 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; | 27 | import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; |
| 28 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | 28 | import { EmitterEventId, EmitterUtils } from 'wdKit/Index' |
| 29 | import { ColorUtils } from '../../utils/ColorUtils'; | 29 | import { ColorUtils } from '../../utils/ColorUtils'; |
| 30 | +import { SpConstants } from 'wdConstant'; | ||
| 30 | 31 | ||
| 31 | 32 | ||
| 32 | const TAG = 'MorningEveningPaperComponent'; | 33 | const TAG = 'MorningEveningPaperComponent'; |
| @@ -35,7 +36,7 @@ const TAG = 'MorningEveningPaperComponent'; | @@ -35,7 +36,7 @@ const TAG = 'MorningEveningPaperComponent'; | ||
| 35 | @Component | 36 | @Component |
| 36 | export struct MorningEveningPaperComponent { | 37 | export struct MorningEveningPaperComponent { |
| 37 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean | 38 | @State pageInfoBean: PageInfoBean = {} as PageInfoBean |
| 38 | - // @State compInfoBean: CompInfoBean = {} as CompInfoBean | 39 | + @State compInfoBean: CompInfoBean = {} as CompInfoBean |
| 39 | @State compListItem: CompList = {} as CompList | 40 | @State compListItem: CompList = {} as CompList |
| 40 | @Provide commentList: InteractDataDTO[] = [] | 41 | @Provide commentList: InteractDataDTO[] = [] |
| 41 | @State audioPlayUrl: string = "" | 42 | @State audioPlayUrl: string = "" |
| @@ -96,14 +97,14 @@ export struct MorningEveningPaperComponent { | @@ -96,14 +97,14 @@ export struct MorningEveningPaperComponent { | ||
| 96 | private AudioSuspension = new AudioSuspensionModel() | 97 | private AudioSuspension = new AudioSuspensionModel() |
| 97 | 98 | ||
| 98 | onCancel() { | 99 | onCancel() { |
| 99 | - console.log(TAG, "cj2024 onCancel = ") | 100 | + // console.log(TAG, "cj2024 onCancel = ") |
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | /** | 103 | /** |
| 103 | * 回调无用 | 104 | * 回调无用 |
| 104 | **/ | 105 | **/ |
| 105 | onConfirm() { | 106 | onConfirm() { |
| 106 | - console.log(TAG, "cj2024 onConfirm = ") | 107 | + // console.log(TAG, "cj2024 onConfirm = ") |
| 107 | // if (this.playerController != undefined) { | 108 | // if (this.playerController != undefined) { |
| 108 | // | 109 | // |
| 109 | // } | 110 | // } |
| @@ -113,10 +114,10 @@ export struct MorningEveningPaperComponent { | @@ -113,10 +114,10 @@ export struct MorningEveningPaperComponent { | ||
| 113 | 114 | ||
| 114 | // 续播判断 | 115 | // 续播判断 |
| 115 | changeContinue() { | 116 | changeContinue() { |
| 116 | - console.log(TAG, "cj2024 changeContinue = 1") | 117 | + // console.log(TAG, "cj2024 changeContinue = 1") |
| 117 | // if (this.nextContId) { | 118 | // if (this.nextContId) { |
| 118 | this.playerController.continue = () => { | 119 | this.playerController.continue = () => { |
| 119 | - console.log(TAG, "cj2024 changeContinue = 2") | 120 | + // console.log(TAG, "cj2024 changeContinue = 2") |
| 120 | this.playerController?.stop(); | 121 | this.playerController?.stop(); |
| 121 | // this.playVM.playWithContentId(this.nextContId ?? ''); | 122 | // this.playVM.playWithContentId(this.nextContId ?? ''); |
| 122 | } | 123 | } |
| @@ -128,10 +129,10 @@ export struct MorningEveningPaperComponent { | @@ -128,10 +129,10 @@ export struct MorningEveningPaperComponent { | ||
| 128 | async aboutToAppear() { | 129 | async aboutToAppear() { |
| 129 | this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string | 130 | this.dailyPaperTopicPageId = await SPHelper.default.getSync('dailyPaperTopicPageId', "") as string |
| 130 | 131 | ||
| 131 | - console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId) | 132 | + // console.info(TAG, `aboutToAppear = ` + this.dailyPaperTopicPageId) |
| 132 | const currentTime = new Date().getTime() | 133 | const currentTime = new Date().getTime() |
| 133 | - console.log(TAG, "currentTime = " + currentTime) | ||
| 134 | - console.log(TAG, `currentTime = ${currentTime}`) | 134 | + // console.log(TAG, "currentTime = " + currentTime) |
| 135 | + // console.log(TAG, `currentTime = ${currentTime}`) | ||
| 135 | try { | 136 | try { |
| 136 | 137 | ||
| 137 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) | 138 | // let pageInfoBean = await MorningEveningViewModel.getMorningEveningPageInfo("" + this.dailyPaperTopicPageId) |
| @@ -144,46 +145,44 @@ export struct MorningEveningPaperComponent { | @@ -144,46 +145,44 @@ export struct MorningEveningPaperComponent { | ||
| 144 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) | 145 | let dateTime = DateTimeUtils.parseDate(this.pageInfoBean?.topicInfo?.topicDate ?? '', DateTimeUtils.PATTERN_DATE_HYPHEN) |
| 145 | const dateShow = new Date(dateTime) | 146 | const dateShow = new Date(dateTime) |
| 146 | this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` | 147 | this.subTitle = `${dateShow.getFullYear()}年\n${(dateShow.getMonth() + 1)}月${dateShow.getDate()}日` |
| 147 | - console.log(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) | ||
| 148 | - console.log(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) | ||
| 149 | - | ||
| 150 | - console.log(TAG, "pageInfoBean dateTime = " + dateTime) | ||
| 151 | - console.log(TAG, "pageInfoBean subTitle = " + this.subTitle) | ||
| 152 | - | ||
| 153 | - console.log(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean)) | 148 | + // console.log(TAG, "pageInfoBean topicDate = " + this.pageInfoBean?.topicInfo?.topicDate) |
| 149 | + // console.log(TAG, "pageInfoBean title = " + this.pageInfoBean?.topicInfo?.title) | ||
| 150 | + // | ||
| 151 | + // console.log(TAG, "pageInfoBean dateTime = " + dateTime) | ||
| 152 | + // console.log(TAG, "pageInfoBean subTitle = " + this.subTitle) | ||
| 153 | + // | ||
| 154 | + // console.log(TAG, "this.pageInfoBean = " + JSON.stringify(this.pageInfoBean)) | ||
| 154 | 155 | ||
| 155 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false | 156 | this.isHasTopView = this.pageInfoBean?.topicInfo?.frontLinkObject?true:false |
| 156 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' | 157 | let coverUrl = this.isHasTopView?this.pageInfoBean?.topicInfo?.frontLinkObject?.coverUrl as string :'' |
| 157 | this.setComponentBgColor(coverUrl) | 158 | this.setComponentBgColor(coverUrl) |
| 158 | 159 | ||
| 159 | - // this.compInfoBean = compInfoBean | ||
| 160 | //信息流缓存 | 160 | //信息流缓存 |
| 161 | let BeanString = SPHelper.default.getSync('MorningEveningComp'+this.dailyPaperTopicPageId,'') as string | 161 | let BeanString = SPHelper.default.getSync('MorningEveningComp'+this.dailyPaperTopicPageId,'') as string |
| 162 | let compInfoBean = {} as CompInfoBean | 162 | let compInfoBean = {} as CompInfoBean |
| 163 | if (BeanString.length > 0) { | 163 | if (BeanString.length > 0) { |
| 164 | compInfoBean = JSON.parse(BeanString) | 164 | compInfoBean = JSON.parse(BeanString) |
| 165 | - }else { | 165 | + } else { |
| 166 | SPHelper.default.delete('MorningEveningComp'+this.dailyPaperTopicPageId) | 166 | SPHelper.default.delete('MorningEveningComp'+this.dailyPaperTopicPageId) |
| 167 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 167 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 168 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) | 168 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | - console.log(TAG, "compInfoBean = " + JSON.stringify(compInfoBean)) | ||
| 172 | if (compInfoBean?.compList[0]) { | 171 | if (compInfoBean?.compList[0]) { |
| 173 | this.compListItem = compInfoBean?.compList[0] | 172 | this.compListItem = compInfoBean?.compList[0] |
| 174 | - console.log(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) | 173 | + // console.log(TAG, '获取评论数据' + `${this.compListItem.operDataList.length}`) |
| 175 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { | 174 | if (this.compListItem.operDataList && this.compListItem.operDataList.length > 0) { |
| 176 | this.getAllContentInteractData(this.compListItem.operDataList) | 175 | this.getAllContentInteractData(this.compListItem.operDataList) |
| 177 | } | 176 | } |
| 178 | - console.log(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) | 177 | + // console.log(TAG, 'compInfoBean?.compList[0].audioDataList', JSON.stringify(compInfoBean?.compList[0].audioDataList)) |
| 179 | if (compInfoBean?.compList[0].audioDataList.length > 0) { | 178 | if (compInfoBean?.compList[0].audioDataList.length > 0) { |
| 180 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0]?.audioUrl | 179 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0]?.audioUrl |
| 181 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0]?.title | 180 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0]?.title |
| 182 | - console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl) | 181 | + // console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl) |
| 183 | } | 182 | } |
| 184 | } | 183 | } |
| 185 | 184 | ||
| 186 | - console.log(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) | 185 | + // console.log(TAG, "compInfoBean compStyle = " + compInfoBean.compList[0].compStyle) |
| 187 | this.playerController.onTimeUpdate = (position, duration) => { | 186 | this.playerController.onTimeUpdate = (position, duration) => { |
| 188 | this.currentTime = DateFormatUtil.secondToTime(position); | 187 | this.currentTime = DateFormatUtil.secondToTime(position); |
| 189 | this.totalTime = DateFormatUtil.secondToTime(duration); | 188 | this.totalTime = DateFormatUtil.secondToTime(duration); |
| @@ -195,6 +194,11 @@ export struct MorningEveningPaperComponent { | @@ -195,6 +194,11 @@ export struct MorningEveningPaperComponent { | ||
| 195 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) | 194 | compInfoBean = await MorningEveningViewModel.getMorningEveningCompInfo(pageInfoBean?.id, pageInfoBean?.groups[0]?.id, currentTime + "", pageInfoBean?.topicInfo?.topicId) |
| 196 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) | 195 | SPHelper.default.saveSync('MorningEveningComp'+this.dailyPaperTopicPageId,JSON.stringify(compInfoBean)) |
| 197 | } | 196 | } |
| 197 | + // 音频悬浮窗跳转数据 | ||
| 198 | + this.compInfoBean = compInfoBean | ||
| 199 | + | ||
| 200 | + // console.log('AudioSuspensionModel', "compInfoBean = " + JSON.stringify(compInfoBean)) | ||
| 201 | + // console.log('AudioSuspensionModel', "compInfoBean11 = " + JSON.stringify(this.compInfoBean)) | ||
| 198 | } catch (exception) { | 202 | } catch (exception) { |
| 199 | this.isContentFailed = true | 203 | this.isContentFailed = true |
| 200 | 204 | ||
| @@ -219,10 +223,10 @@ export struct MorningEveningPaperComponent { | @@ -219,10 +223,10 @@ export struct MorningEveningPaperComponent { | ||
| 219 | contentType: Number(item.objectType ?? '1') | 223 | contentType: Number(item.objectType ?? '1') |
| 220 | }) | 224 | }) |
| 221 | }) | 225 | }) |
| 222 | - console.log(TAG, '获取评论数据' + `${JSON.stringify(params)}`) | 226 | + // console.log(TAG, '获取评论数据' + `${JSON.stringify(params)}`) |
| 223 | 227 | ||
| 224 | this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params) | 228 | this.commentList = await PeopleShipMainViewModel.getContentInteractInfo(params) |
| 225 | - console.log(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`) | 229 | + // console.log(TAG, '获取评论数据' + `${JSON.stringify(this.commentList)}`) |
| 226 | 230 | ||
| 227 | } catch (exception) { | 231 | } catch (exception) { |
| 228 | 232 | ||
| @@ -232,7 +236,7 @@ export struct MorningEveningPaperComponent { | @@ -232,7 +236,7 @@ export struct MorningEveningPaperComponent { | ||
| 232 | async setComponentBgColor(imageUrl: string) { | 236 | async setComponentBgColor(imageUrl: string) { |
| 233 | // 图片转换为PixelMap对象 | 237 | // 图片转换为PixelMap对象 |
| 234 | // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); | 238 | // const pixelMap: image.PixelMap = await image2PixelMap(item.icon); |
| 235 | - console.log(TAG, "compInfoBean compStyle = " + imageUrl) | 239 | + // console.log(TAG, "compInfoBean compStyle = " + imageUrl) |
| 236 | 240 | ||
| 237 | if (this.pageInfoBean.backgroundColor.length > 0){ | 241 | if (this.pageInfoBean.backgroundColor.length > 0){ |
| 238 | let colorDatas = ColorUtils.hexColorValueToRGB(this.pageInfoBean.backgroundColor) | 242 | let colorDatas = ColorUtils.hexColorValueToRGB(this.pageInfoBean.backgroundColor) |
| @@ -270,11 +274,11 @@ export struct MorningEveningPaperComponent { | @@ -270,11 +274,11 @@ export struct MorningEveningPaperComponent { | ||
| 270 | const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); | 274 | const pixelMap: image.PixelMap = await imageNet2PixelMap(imageSource); |
| 271 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { | 275 | effectKit.createColorPicker(pixelMap, (err, colorPicker) => { |
| 272 | let color = colorPicker.getLargestProportionColor(); | 276 | let color = colorPicker.getLargestProportionColor(); |
| 273 | - console.log(TAG, "compInfoBean compStyle = " + color) | 277 | + // console.log(TAG, "compInfoBean compStyle = " + color) |
| 274 | color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) | 278 | color = ColorUtils.getMorningEveningPaperRgb({red:color.red,green:color.green,blue:color.blue,alpha:color.alpha}) |
| 275 | // 将取色器选取的color示例转换为十六进制颜色代码 | 279 | // 将取色器选取的color示例转换为十六进制颜色代码 |
| 276 | this.mixedBgColor = "#ff" + color.alpha.toString(16) + color.red.toString(16).padStart(2,'0') + color.green.toString(16).padStart(2,'0') + color.blue.toString(16).padStart(2,'0'); | 280 | this.mixedBgColor = "#ff" + color.alpha.toString(16) + color.red.toString(16).padStart(2,'0') + color.green.toString(16).padStart(2,'0') + color.blue.toString(16).padStart(2,'0'); |
| 277 | - console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor) | 281 | + // console.log(TAG, "compInfoBean compStyle = " + this.mixedBgColor) |
| 278 | }); | 282 | }); |
| 279 | } | 283 | } |
| 280 | } | 284 | } |
| @@ -398,12 +402,13 @@ export struct MorningEveningPaperComponent { | @@ -398,12 +402,13 @@ export struct MorningEveningPaperComponent { | ||
| 398 | .margin({ left: this.currentStatus === PlayerConstants.STATUS_START ?6:9 })// .alignSelf(ItemAlign.Center) | 402 | .margin({ left: this.currentStatus === PlayerConstants.STATUS_START ?6:9 })// .alignSelf(ItemAlign.Center) |
| 399 | .objectFit(ImageFit.Contain) | 403 | .objectFit(ImageFit.Contain) |
| 400 | .onClick(() => { | 404 | .onClick(() => { |
| 401 | - console.log("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) | 405 | + // console.log("TAG", "cj compInfoBean onClick1 = " + this.isAudioPlaying) |
| 402 | // dialog.open() | 406 | // dialog.open() |
| 403 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) | 407 | // this.playerController.firstPlay(this.audioPlayUrl, this.audioTitle) |
| 408 | + // SPHelper.default.save(SpConstants.APP_NEWS_INFO_DATA_MODEL, JSON.stringify(this.compInfoBean)) | ||
| 404 | this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) | 409 | this.AudioSuspension.setPlayerUrl(this.audioPlayUrl, this.audioTitle) |
| 405 | - console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) | ||
| 406 | - console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) | 410 | + // console.log(TAG, "this.audioPlayUrl = " + this.audioPlayUrl) |
| 411 | + // console.log("TAG", "cj compInfoBean onClick2 = " + this.isAudioPlaying) | ||
| 407 | }) | 412 | }) |
| 408 | } | 413 | } |
| 409 | .height('100%') | 414 | .height('100%') |
| 1 | import { AudioSuspensionModel } from 'wdComponent' | 1 | import { AudioSuspensionModel } from 'wdComponent' |
| 2 | import { PlayerConstants, DateFormatUtil } from 'wdPlayer' | 2 | import { PlayerConstants, DateFormatUtil } from 'wdPlayer' |
| 3 | -import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | 3 | +import { EmitterEventId, EmitterUtils, SPHelper } from 'wdKit/Index' |
| 4 | import window from '@ohos.window'; | 4 | import window from '@ohos.window'; |
| 5 | import lottie from '@ohos/lottie'; | 5 | import lottie from '@ohos/lottie'; |
| 6 | import { LottieView } from 'wdComponent/Index' | 6 | import { LottieView } from 'wdComponent/Index' |
| 7 | +// import { ProcessUtils } from 'wdRouter'; | ||
| 8 | +// import { CompInfoBean, ContentDTO } from 'wdBean'; | ||
| 9 | +// import { SpConstants } from 'wdConstant'; | ||
| 7 | 10 | ||
| 8 | const TAG = 'AudioSuspensionModel' | 11 | const TAG = 'AudioSuspensionModel' |
| 9 | 12 | ||
| @@ -153,6 +156,19 @@ struct Index { | @@ -153,6 +156,19 @@ struct Index { | ||
| 153 | .width(243) | 156 | .width(243) |
| 154 | .height(60) | 157 | .height(60) |
| 155 | .justifyContent(FlexAlign.Start) | 158 | .justifyContent(FlexAlign.Start) |
| 159 | + .onClick(() => { | ||
| 160 | + // let dataModelStr : string = SPHelper.default.getSync(SpConstants.APP_NEWS_INFO_DATA_MODEL,'') as string | ||
| 161 | + // console.log(TAG, dataModelStr) | ||
| 162 | + // let dataModel : CompInfoBean = JSON.parse(dataModelStr) | ||
| 163 | + // // //公共跳转 | ||
| 164 | + // let content: ContentDTO = { | ||
| 165 | + // objectId: this.itemBeanClicked.newsId + '', | ||
| 166 | + // objectType: this.itemBeanClicked.newsType + '', | ||
| 167 | + // relId: this.itemBeanClicked.relId + '', | ||
| 168 | + // relType: this.itemBeanClicked.relType ?? '0' | ||
| 169 | + // } as ContentDTO | ||
| 170 | + // ProcessUtils.processPage(content) | ||
| 171 | + }) | ||
| 156 | 172 | ||
| 157 | Row() { | 173 | Row() { |
| 158 | Image(this.currentStatus === PlayerConstants.STATUS_START ? $r("app.media.icon_audio_pause_svg") : $r("app.media.icon_audio_playing_svg")) | 174 | Image(this.currentStatus === PlayerConstants.STATUS_START ? $r("app.media.icon_audio_pause_svg") : $r("app.media.icon_audio_playing_svg")) |
-
Please register or login to post a comment