Showing
27 changed files
with
241 additions
and
75 deletions
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | "app": { | 2 | "app": { |
| 3 | "bundleName": "com.peopledailychina.hosactivity", | 3 | "bundleName": "com.peopledailychina.hosactivity", |
| 4 | "vendor": "$string:app_vendor", | 4 | "vendor": "$string:app_vendor", |
| 5 | - "versionCode": 7398, | ||
| 6 | - "versionName": "7.3.9.8", | 5 | + "versionCode": 7399, |
| 6 | + "versionName": "7.3.9.9", | ||
| 7 | "icon": "$media:app_icon", | 7 | "icon": "$media:app_icon", |
| 8 | "label": "$string:app_name" | 8 | "label": "$string:app_name" |
| 9 | } | 9 | } |
| @@ -4,13 +4,14 @@ import { common } from '@kit.AbilityKit'; | @@ -4,13 +4,14 @@ import { common } from '@kit.AbilityKit'; | ||
| 4 | import { AccountManagerUtils } from '../utils/AccountManagerUtils'; | 4 | import { AccountManagerUtils } from '../utils/AccountManagerUtils'; |
| 5 | import { UserDataLocal } from '../utils/UserDataLocal'; | 5 | import { UserDataLocal } from '../utils/UserDataLocal'; |
| 6 | import { EmitterUtils } from '../utils/EmitterUtils'; | 6 | import { EmitterUtils } from '../utils/EmitterUtils'; |
| 7 | +import { EmitterEventId } from '../utils/EmitterEventId'; | ||
| 7 | 8 | ||
| 8 | export class UmengStats { | 9 | export class UmengStats { |
| 9 | 10 | ||
| 10 | private static _inited = false | 11 | private static _inited = false |
| 11 | 12 | ||
| 12 | // 启动时调用 | 13 | // 启动时调用 |
| 13 | - static preInit(context: common.UIAbilityContext) { | 14 | + static preInit(context: common.AbilityStageContext) { |
| 14 | 15 | ||
| 15 | // 需在 AppScope/resources/rawfile/umconfig.json 配置key和channel | 16 | // 需在 AppScope/resources/rawfile/umconfig.json 配置key和channel |
| 16 | preInit({ | 17 | preInit({ |
| @@ -23,14 +24,23 @@ export class UmengStats { | @@ -23,14 +24,23 @@ export class UmengStats { | ||
| 23 | 24 | ||
| 24 | // 在用户同意隐私政策后再调用此方法 | 25 | // 在用户同意隐私政策后再调用此方法 |
| 25 | static initAfterAgreeProtocol() { | 26 | static initAfterAgreeProtocol() { |
| 27 | + if (UmengStats._inited) { | ||
| 28 | + return | ||
| 29 | + } | ||
| 26 | init(); | 30 | init(); |
| 27 | UmengStats._inited = true | 31 | UmengStats._inited = true |
| 28 | 32 | ||
| 29 | UmengStats.onLogin() | 33 | UmengStats.onLogin() |
| 30 | - UmengStats.event("testHarmony", {"key1": "value1"}) | 34 | + // UmengStats.event("testHarmony", {"key1": "value1"}) |
| 35 | + | ||
| 36 | + EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => { | ||
| 37 | + UmengStats.onLogin() | ||
| 38 | + }) | ||
| 39 | + EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { | ||
| 40 | + UmengStats.onLogout() | ||
| 41 | + }) | ||
| 31 | } | 42 | } |
| 32 | 43 | ||
| 33 | - // TODO: 登录成功调用 | ||
| 34 | static onLogin() { | 44 | static onLogin() { |
| 35 | AccountManagerUtils.isLogin().then((login) => { | 45 | AccountManagerUtils.isLogin().then((login) => { |
| 36 | if (!login) { return } | 46 | if (!login) { return } |
| @@ -41,7 +51,7 @@ export class UmengStats { | @@ -41,7 +51,7 @@ export class UmengStats { | ||
| 41 | } | 51 | } |
| 42 | }) | 52 | }) |
| 43 | } | 53 | } |
| 44 | - // TODO: 退出登录调用 | 54 | + |
| 45 | static onLogout() { | 55 | static onLogout() { |
| 46 | onProfileSignOff() | 56 | onProfileSignOff() |
| 47 | } | 57 | } |
| @@ -74,6 +74,16 @@ export struct WdWebLocalComponent { | @@ -74,6 +74,16 @@ export struct WdWebLocalComponent { | ||
| 74 | 74 | ||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | + aboutToAppear(): void { | ||
| 78 | + EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (status) => { | ||
| 79 | + Logger.debug(TAG, "接收音频播放状态 = " + status); | ||
| 80 | + if (!this.isPause) { | ||
| 81 | + this.controller.pause() | ||
| 82 | + this.cancelProgressTimer() | ||
| 83 | + } | ||
| 84 | + }) | ||
| 85 | + } | ||
| 86 | + | ||
| 77 | build() { | 87 | build() { |
| 78 | Column() { | 88 | Column() { |
| 79 | Row() { | 89 | Row() { |
| @@ -88,6 +88,7 @@ export struct CardParser { | @@ -88,6 +88,7 @@ export struct CardParser { | ||
| 88 | pageId: this.pageId, | 88 | pageId: this.pageId, |
| 89 | pageName: this.pageName | 89 | pageName: this.pageName |
| 90 | }) | 90 | }) |
| 91 | + this.getBehindDivider() | ||
| 91 | } else { | 92 | } else { |
| 92 | if (contentDTO.appStyle === CompStyle.Card_02) { | 93 | if (contentDTO.appStyle === CompStyle.Card_02) { |
| 93 | Card2Component({ | 94 | Card2Component({ |
| @@ -185,6 +185,12 @@ export struct ImageAndTextPageComponent { | @@ -185,6 +185,12 @@ export struct ImageAndTextPageComponent { | ||
| 185 | .padding({ top: 14, bottom: 24 }) | 185 | .padding({ top: 14, bottom: 24 }) |
| 186 | .justifyContent(FlexAlign.Center) | 186 | .justifyContent(FlexAlign.Center) |
| 187 | } | 187 | } |
| 188 | + | ||
| 189 | + // 没有推荐 && 没有评论,高度需要增加,否则被外层padding了 显示不下 | ||
| 190 | + if (this.recommendList.length == 0 && !this.contentDetailData?.openComment) { | ||
| 191 | + Column() { | ||
| 192 | + }.height(44 + 24) | ||
| 193 | + } | ||
| 188 | if (this.recommendList.length > 0) { | 194 | if (this.recommendList.length > 0) { |
| 189 | Column(){ | 195 | Column(){ |
| 190 | Divider().strokeWidth(8).color('#f5f5f5') | 196 | Divider().strokeWidth(8).color('#f5f5f5') |
| @@ -31,6 +31,11 @@ import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; | @@ -31,6 +31,11 @@ import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; | ||
| 31 | 31 | ||
| 32 | const TAG = 'MorningEveningPaperComponent'; | 32 | const TAG = 'MorningEveningPaperComponent'; |
| 33 | 33 | ||
| 34 | +interface newsInfo { | ||
| 35 | + currentStatus: number | string | undefined, | ||
| 36 | + url: string | ||
| 37 | +} | ||
| 38 | + | ||
| 34 | @Entry | 39 | @Entry |
| 35 | @Component | 40 | @Component |
| 36 | export struct MorningEveningPaperComponent { | 41 | export struct MorningEveningPaperComponent { |
| @@ -138,6 +143,10 @@ export struct MorningEveningPaperComponent { | @@ -138,6 +143,10 @@ export struct MorningEveningPaperComponent { | ||
| 138 | this.fetchData() | 143 | this.fetchData() |
| 139 | } | 144 | } |
| 140 | } | 145 | } |
| 146 | + EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { | ||
| 147 | + // console.log(TAG, 'this.currentStatus', val) | ||
| 148 | + this.currentStatus = val | ||
| 149 | + }) | ||
| 141 | } | 150 | } |
| 142 | 151 | ||
| 143 | async fetchData() { | 152 | async fetchData() { |
| @@ -191,6 +200,25 @@ export struct MorningEveningPaperComponent { | @@ -191,6 +200,25 @@ export struct MorningEveningPaperComponent { | ||
| 191 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0]?.audioUrl | 200 | this.audioPlayUrl = compInfoBean?.compList[0].audioDataList[0]?.audioUrl |
| 192 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0]?.title | 201 | this.audioTitle = compInfoBean?.compList[0].audioDataList[0]?.title |
| 193 | // console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl) | 202 | // console.log(TAG, 'this.audioPlayUrl', this.audioPlayUrl) |
| 203 | + const newsInfo = this.AudioSuspension.newsInfo(); | ||
| 204 | + // console.log(TAG, 'newsInfo', newsInfo) | ||
| 205 | + if (newsInfo) { | ||
| 206 | + try { | ||
| 207 | + const parsedInfo: newsInfo = JSON.parse(newsInfo); | ||
| 208 | + const url = parsedInfo.url; | ||
| 209 | + | ||
| 210 | + // console.log(TAG, 'url', url) | ||
| 211 | + // console.log(TAG, 'this.audioUrl', this.audioUrl) | ||
| 212 | + | ||
| 213 | + if (url == this.audioPlayUrl) { | ||
| 214 | + this.currentStatus = parsedInfo.currentStatus | ||
| 215 | + } | ||
| 216 | + } catch (error) { | ||
| 217 | + console.error(`${TAG} Error parsing newsInfo:`, error); | ||
| 218 | + } | ||
| 219 | + } else { | ||
| 220 | + console.log(`${TAG} No newsInfo available`); | ||
| 221 | + } | ||
| 194 | } | 222 | } |
| 195 | } | 223 | } |
| 196 | 224 |
| @@ -134,6 +134,10 @@ export struct RmhTitle { | @@ -134,6 +134,10 @@ export struct RmhTitle { | ||
| 134 | return this.rmhInfo?.cnIsAttention && this.rmhInfo?.userType != "5" | 134 | return this.rmhInfo?.cnIsAttention && this.rmhInfo?.userType != "5" |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | + getFollowText() { | ||
| 138 | + return Number(this.followStatus) === 0 ? '关注' : '已关注' | ||
| 139 | + } | ||
| 140 | + | ||
| 137 | build() { | 141 | build() { |
| 138 | Flex() { | 142 | Flex() { |
| 139 | if (this.rmhInfo.userType != '5') { | 143 | if (this.rmhInfo.userType != '5') { |
| @@ -201,8 +205,17 @@ export struct RmhTitle { | @@ -201,8 +205,17 @@ export struct RmhTitle { | ||
| 201 | .textAlign(TextAlign.Start) | 205 | .textAlign(TextAlign.Start) |
| 202 | .height(14) | 206 | .height(14) |
| 203 | .lineHeight(14) | 207 | .lineHeight(14) |
| 204 | - .width('calc(100% - 65vp)') | ||
| 205 | - // .constraintSize({maxWidth:(DisplayUtils.getDeviceWidth() - 32 - 36 - 18 - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime))))}) | 208 | + // .width('calc(100% - 65vp)') |
| 209 | + .constraintSize({ | ||
| 210 | + maxWidth:( | ||
| 211 | + DisplayUtils.getDeviceWidth() | ||
| 212 | + - 32 | ||
| 213 | + - 8 - 12 | ||
| 214 | + - 36 | ||
| 215 | + - (this.hasRightFollow() ? (19 + 6 + this.getTextWidth(this.getFollowText(), $r('app.float.font_size_13'))) : 0) | ||
| 216 | + - this.getTextWidth(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)), $r("app.float.font_size_12")) | ||
| 217 | + ) | ||
| 218 | + }) | ||
| 206 | } | 219 | } |
| 207 | 220 | ||
| 208 | } | 221 | } |
| @@ -223,13 +236,15 @@ export struct RmhTitle { | @@ -223,13 +236,15 @@ export struct RmhTitle { | ||
| 223 | Image($r('app.media.rmh_follow')) | 236 | Image($r('app.media.rmh_follow')) |
| 224 | .width(16) | 237 | .width(16) |
| 225 | .height(16) | 238 | .height(16) |
| 239 | + .margin({right: 3}) | ||
| 226 | } | 240 | } |
| 227 | 241 | ||
| 228 | - Text(Number(this.followStatus) === 0 ? '关注' : '已关注') | 242 | + Text(this.getFollowText()) |
| 229 | .fontSize($r('app.float.font_size_13')) | 243 | .fontSize($r('app.float.font_size_13')) |
| 244 | + .fontWeight(600) | ||
| 230 | .fontColor(Number(this.followStatus) === 0 ? $r('app.color.color_ED2800') : 0xc6c6c6) | 245 | .fontColor(Number(this.followStatus) === 0 ? $r('app.color.color_ED2800') : 0xc6c6c6) |
| 231 | } | 246 | } |
| 232 | - .margin({top:4}) | 247 | + // .margin({top:4}) |
| 233 | .height(36) | 248 | .height(36) |
| 234 | } | 249 | } |
| 235 | .flexShrink(0) | 250 | .flexShrink(0) |
| @@ -270,10 +285,10 @@ export struct RmhTitle { | @@ -270,10 +285,10 @@ export struct RmhTitle { | ||
| 270 | } | 285 | } |
| 271 | 286 | ||
| 272 | // 获取文本宽度 | 287 | // 获取文本宽度 |
| 273 | - private getTextWidth(text: string) { | 288 | + private getTextWidth(text: string, fontSize: Resource) { |
| 274 | let size = measure.measureTextSize({ | 289 | let size = measure.measureTextSize({ |
| 275 | textContent: text, | 290 | textContent: text, |
| 276 | - fontSize: $r("app.float.font_size_12") | 291 | + fontSize: fontSize |
| 277 | }) | 292 | }) |
| 278 | return px2vp(Number(size.width)) | 293 | return px2vp(Number(size.width)) |
| 279 | } | 294 | } |
| @@ -27,14 +27,17 @@ export struct MoreComponent { | @@ -27,14 +27,17 @@ export struct MoreComponent { | ||
| 27 | if (item.appStyle !== "9") { | 27 | if (item.appStyle !== "9") { |
| 28 | CardParser({compDTO:new CompDTO, contentDTO: item }) | 28 | CardParser({compDTO:new CompDTO, contentDTO: item }) |
| 29 | } else { | 29 | } else { |
| 30 | - Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" }) | 30 | + Column(){ |
| 31 | + Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" }) | ||
| 32 | + | ||
| 33 | + Divider() | ||
| 34 | + .width('100%') | ||
| 35 | + .color($r('app.color.color_F5F5F5')) | ||
| 36 | + .strokeWidth(4) | ||
| 37 | + } | ||
| 31 | } | 38 | } |
| 32 | }) | 39 | }) |
| 33 | 40 | ||
| 34 | - Divider() | ||
| 35 | - .width('100%') | ||
| 36 | - .color($r('app.color.color_F5F5F5')) | ||
| 37 | - .strokeWidth(4) | ||
| 38 | 41 | ||
| 39 | } else { | 42 | } else { |
| 40 | Column() { | 43 | Column() { |
| @@ -233,7 +233,7 @@ export struct ZhSingleColumn09 { | @@ -233,7 +233,7 @@ export struct ZhSingleColumn09 { | ||
| 233 | .fontSize(14) | 233 | .fontSize(14) |
| 234 | .fontColor(this.compDTO?.operDataList.length > 8 && !this.fullyTraversed ? 0xed2800 : 0xB0B0B0) | 234 | .fontColor(this.compDTO?.operDataList.length > 8 && !this.fullyTraversed ? 0xed2800 : 0xB0B0B0) |
| 235 | .margin({ right: 4 }) | 235 | .margin({ right: 4 }) |
| 236 | - Image(this.compDTO?.operDataList.length > 8 ? $r('app.media.icon_refresh') : $r('app.media.ic_refresh')) | 236 | + Image(this.compDTO?.operDataList.length > 8 && !this.fullyTraversed ? $r('app.media.icon_refresh') : $r('app.media.ic_refresh')) |
| 237 | .width(14) | 237 | .width(14) |
| 238 | .height(14) | 238 | .height(14) |
| 239 | } | 239 | } |
| @@ -437,6 +437,9 @@ export struct ZhSingleRow03 { | @@ -437,6 +437,9 @@ export struct ZhSingleRow03 { | ||
| 437 | .fontSize(12) | 437 | .fontSize(12) |
| 438 | .textAlign(TextAlign.Center) | 438 | .textAlign(TextAlign.Center) |
| 439 | .borderRadius(3) | 439 | .borderRadius(3) |
| 440 | + .borderStyle(BorderStyle.Solid) | ||
| 441 | + .borderWidth(this.isReserved(Number(item.objectId)) ? 1 : 0) | ||
| 442 | + .borderColor('#e5e5e5') | ||
| 440 | .onClick(() => { | 443 | .onClick(() => { |
| 441 | this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | 444 | this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) |
| 442 | }) | 445 | }) |
| @@ -447,7 +447,7 @@ export struct PaperSingleColumn999CardView { | @@ -447,7 +447,7 @@ export struct PaperSingleColumn999CardView { | ||
| 447 | .borderRadius(5) | 447 | .borderRadius(5) |
| 448 | .objectFit(ImageFit.Fill) | 448 | .objectFit(ImageFit.Fill) |
| 449 | // .aspectRatio(319 / 179) ///图片设计比例 | 449 | // .aspectRatio(319 / 179) ///图片设计比例 |
| 450 | - .padding({ top: 10 }) | 450 | + .margin({ top: 10 }) |
| 451 | .backgroundColor('#f5f5f5') | 451 | .backgroundColor('#f5f5f5') |
| 452 | .width('100%') | 452 | .width('100%') |
| 453 | .height((DisplayUtils.getDeviceWidth() - 66)*(179 / 319)) | 453 | .height((DisplayUtils.getDeviceWidth() - 66)*(179 / 319)) |
| @@ -585,7 +585,7 @@ export struct PaperSingleColumn999CardView { | @@ -585,7 +585,7 @@ export struct PaperSingleColumn999CardView { | ||
| 585 | Text(this.getPublishTime()) | 585 | Text(this.getPublishTime()) |
| 586 | .fontSize(12) | 586 | .fontSize(12) |
| 587 | .fontColor('#B0B0B0') | 587 | .fontColor('#B0B0B0') |
| 588 | - .margin({ left: this.item?.source.length > 0?0:16 }) | 588 | + .margin({ left: this.buildSourceString().length > 0?0:16 }) |
| 589 | if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) { | 589 | if (this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) { |
| 590 | Text(this.handlerNum(this.interactData.commentNum.toString()) + "评") | 590 | Text(this.handlerNum(this.interactData.commentNum.toString()) + "评") |
| 591 | .fontSize(12) | 591 | .fontSize(12) |
| @@ -679,7 +679,7 @@ export struct PaperSingleColumn999CardView { | @@ -679,7 +679,7 @@ export struct PaperSingleColumn999CardView { | ||
| 679 | buildSourceString(): string { | 679 | buildSourceString(): string { |
| 680 | let contentString: string = '' | 680 | let contentString: string = '' |
| 681 | if (this.item?.rmhInfo?.rmhName.length > 0) { | 681 | if (this.item?.rmhInfo?.rmhName.length > 0) { |
| 682 | - // contentString = this.item?.rmhInfo?.rmhName | 682 | + contentString = this.item?.rmhInfo?.rmhName |
| 683 | }else if(this.item?.source.length > 0){ | 683 | }else if(this.item?.source.length > 0){ |
| 684 | contentString = this.item?.source | 684 | contentString = this.item?.source |
| 685 | } | 685 | } |
| @@ -17,6 +17,8 @@ import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | @@ -17,6 +17,8 @@ import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | ||
| 17 | import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; | 17 | import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; |
| 18 | 18 | ||
| 19 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; | 19 | import { PeopleShipMainViewModel } from '../../viewmodel/PeopleShipMainViewModel'; |
| 20 | +import { router } from '@kit.ArkUI'; | ||
| 21 | + | ||
| 20 | @Entry | 22 | @Entry |
| 21 | @Component | 23 | @Component |
| 22 | struct MyCollectionListPage { | 24 | struct MyCollectionListPage { |
| @@ -151,7 +153,10 @@ struct MyCollectionListPage { | @@ -151,7 +153,10 @@ struct MyCollectionListPage { | ||
| 151 | .scrollBar(BarState.Off) | 153 | .scrollBar(BarState.Off) |
| 152 | .height(CommonConstants.FULL_PARENT) | 154 | .height(CommonConstants.FULL_PARENT) |
| 153 | .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 | 155 | .edgeEffect(EdgeEffect.None) // 必须设置列表为滑动到边缘无效果 |
| 154 | - .margin({ | 156 | + .margin(router.getState().name === 'MyCollectionListPage' ? { |
| 157 | + left: 6, | ||
| 158 | + right: 6 | ||
| 159 | + } : { | ||
| 155 | left: 16, | 160 | left: 16, |
| 156 | right: 16 | 161 | right: 16 |
| 157 | }) | 162 | }) |
| 1 | import { CommonConstants, ViewType } from 'wdConstant'; | 1 | import { CommonConstants, ViewType } from 'wdConstant'; |
| 2 | -import { Logger, NetworkUtil } from 'wdKit'; | 2 | +import { EmitterEventId, EmitterUtils, Logger, NetworkUtil } from 'wdKit'; |
| 3 | import { EmptyComponent } from '../view/EmptyComponent'; | 3 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 4 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh'; | 5 | import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh'; |
| @@ -43,6 +43,7 @@ export struct PageComponent { | @@ -43,6 +43,7 @@ export struct PageComponent { | ||
| 43 | // 国殇灰度管理 | 43 | // 国殇灰度管理 |
| 44 | GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') | 44 | GrayManage: SubscribedAbstractProperty<GrayManageModel> = AppStorage.link<GrayManageModel>('GrayManage') |
| 45 | @State netStatus: number | undefined = undefined // 存储网络状态 | 45 | @State netStatus: number | undefined = undefined // 存储网络状态 |
| 46 | + isRMH:boolean = false | ||
| 46 | 47 | ||
| 47 | build() { | 48 | build() { |
| 48 | Column() { | 49 | Column() { |
| @@ -282,6 +283,16 @@ export struct PageComponent { | @@ -282,6 +283,16 @@ export struct PageComponent { | ||
| 282 | this.needload = false; | 283 | this.needload = false; |
| 283 | // console.log(TAG, 'aboutToAppear onAutoRefresh111 ' + this.needload) | 284 | // console.log(TAG, 'aboutToAppear onAutoRefresh111 ' + this.needload) |
| 284 | } | 285 | } |
| 286 | + | ||
| 287 | + //人民号推荐 监听登录事件(刷新页面) | ||
| 288 | + EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => { | ||
| 289 | + if(this.navIndex === this.currentTopNavSelectedIndex && this.isRMH){ | ||
| 290 | + this.listScroller.scrollEdge(Edge.Top) | ||
| 291 | + this.pageModel.viewType = ViewType.LOADING; | ||
| 292 | + this.getData() | ||
| 293 | + } | ||
| 294 | + }) | ||
| 295 | + | ||
| 285 | } | 296 | } |
| 286 | 297 | ||
| 287 | onChange() { | 298 | onChange() { |
| @@ -97,10 +97,10 @@ export struct TopNavigationComponentNew { | @@ -97,10 +97,10 @@ export struct TopNavigationComponentNew { | ||
| 97 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { | 97 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { |
| 98 | if (CompUtils.isNews(this.navItem)) { | 98 | if (CompUtils.isNews(this.navItem)) { |
| 99 | this.createPageComponent(navItem, index, | 99 | this.createPageComponent(navItem, index, |
| 100 | - (channelId) => this.GrayManage.get().isNewsMourning(channelId)); | 100 | + (channelId) => this.GrayManage.get().isNewsMourning(channelId),false); |
| 101 | } else if (CompUtils.isRMH(this.navItem)) { | 101 | } else if (CompUtils.isRMH(this.navItem)) { |
| 102 | this.createPageComponent(navItem, index, | 102 | this.createPageComponent(navItem, index, |
| 103 | - (channelId) => this.GrayManage.get().isRmhMourning(channelId)); | 103 | + (channelId) => this.GrayManage.get().isRmhMourning(channelId),true); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | } else { | 106 | } else { |
| @@ -165,7 +165,7 @@ export struct TopNavigationComponentNew { | @@ -165,7 +165,7 @@ export struct TopNavigationComponentNew { | ||
| 165 | 165 | ||
| 166 | } | 166 | } |
| 167 | @Builder | 167 | @Builder |
| 168 | - createPageComponent(navItem: TopNavDTO, index: number, mourningCheckFn: (channelId: string) => boolean) { | 168 | + createPageComponent(navItem: TopNavDTO, index: number, mourningCheckFn: (channelId: string) => boolean,isRMH:boolean = false) { |
| 169 | PageComponent({ | 169 | PageComponent({ |
| 170 | currentTopNavSelectedIndex: this.currentTopNavSelectedIndex, | 170 | currentTopNavSelectedIndex: this.currentTopNavSelectedIndex, |
| 171 | navIndex: index, | 171 | navIndex: index, |
| @@ -173,6 +173,7 @@ export struct TopNavigationComponentNew { | @@ -173,6 +173,7 @@ export struct TopNavigationComponentNew { | ||
| 173 | channelId: navItem?.channelId + '', | 173 | channelId: navItem?.channelId + '', |
| 174 | autoRefresh: this.autoRefresh2Page, | 174 | autoRefresh: this.autoRefresh2Page, |
| 175 | isMourning: mourningCheckFn(`${navItem.channelId}`), | 175 | isMourning: mourningCheckFn(`${navItem.channelId}`), |
| 176 | + isRMH:isRMH | ||
| 176 | }) | 177 | }) |
| 177 | // .margin({ | 178 | // .margin({ |
| 178 | // left: 6, | 179 | // left: 6, |
| @@ -266,6 +266,9 @@ export struct PeopleShipMainComponent { | @@ -266,6 +266,9 @@ export struct PeopleShipMainComponent { | ||
| 266 | ListItem() { | 266 | ListItem() { |
| 267 | Column(){ | 267 | Column(){ |
| 268 | CardParser({ compDTO: new CompDTO, contentDTO: item }) | 268 | CardParser({ compDTO: new CompDTO, contentDTO: item }) |
| 269 | + .margin({ | ||
| 270 | + left: 6, right: 6 | ||
| 271 | + }) | ||
| 269 | // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 272 | // Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 270 | }.width('100%') | 273 | }.width('100%') |
| 271 | 274 | ||
| @@ -566,10 +569,10 @@ export struct PeopleShipMainComponent { | @@ -566,10 +569,10 @@ export struct PeopleShipMainComponent { | ||
| 566 | } | 569 | } |
| 567 | 570 | ||
| 568 | //退出登录的时候 刷新界面 | 571 | //退出登录的时候 刷新界面 |
| 569 | - let userID = UserDataLocal.getUserId() | ||
| 570 | - if (!StringUtils.isNotEmpty(userID)) { | ||
| 571 | - this.getData() | ||
| 572 | - } | 572 | + // let userID = UserDataLocal.getUserId() |
| 573 | + // if (!StringUtils.isNotEmpty(userID)) { | ||
| 574 | + // this.getData() | ||
| 575 | + // } | ||
| 573 | } | 576 | } |
| 574 | 577 | ||
| 575 | onAutoRefresh(changedPropertyName: string) { | 578 | onAutoRefresh(changedPropertyName: string) { |
| @@ -115,13 +115,6 @@ export struct SearchResultComponent { | @@ -115,13 +115,6 @@ export struct SearchResultComponent { | ||
| 115 | ListItem() { | 115 | ListItem() { |
| 116 | Column() { | 116 | Column() { |
| 117 | CardParser({compDTO:new CompDTO,contentDTO:item}) | 117 | CardParser({compDTO:new CompDTO,contentDTO:item}) |
| 118 | - if (index != this.data.totalCount() - 1) { | ||
| 119 | - Divider() | ||
| 120 | - .width('100%') | ||
| 121 | - .height(`${this.calcHeight(1)}lpx`) | ||
| 122 | - .color($r('app.color.color_F5F5F5')) | ||
| 123 | - .strokeWidth(`${this.calcHeight(1)}lpx`) | ||
| 124 | - } | ||
| 125 | } | 118 | } |
| 126 | } | 119 | } |
| 127 | }) | 120 | }) |
| @@ -310,18 +310,8 @@ export struct SearchResultContentComponent { | @@ -310,18 +310,8 @@ export struct SearchResultContentComponent { | ||
| 310 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 310 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 311 | } | 311 | } |
| 312 | } else { | 312 | } else { |
| 313 | - if (this.data?.get(index + 1)?.sameContentListSize > 0 && index !== 0) { | ||
| 314 | - Divider() | ||
| 315 | - .width('100%') | ||
| 316 | - .color($r('app.color.color_F5F5F5')) | ||
| 317 | - .strokeWidth(4) | ||
| 318 | - } | ||
| 319 | CardParser({ compDTO: new CompDTO, contentDTO: item }) | 313 | CardParser({ compDTO: new CompDTO, contentDTO: item }) |
| 320 | } | 314 | } |
| 321 | - if (index != this.data.totalCount() - 1) { | ||
| 322 | - Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | ||
| 323 | - | ||
| 324 | - } | ||
| 325 | } | 315 | } |
| 326 | } | 316 | } |
| 327 | }, (item: ContentDTO, index: number) => index.toString()) | 317 | }, (item: ContentDTO, index: number) => index.toString()) |
| @@ -41,6 +41,11 @@ const TAG = 'OperRowListView'; | @@ -41,6 +41,11 @@ const TAG = 'OperRowListView'; | ||
| 41 | }) | 41 | }) |
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | +interface newsInfo { | ||
| 45 | + currentStatus: number | string | undefined, | ||
| 46 | + url: string | ||
| 47 | +} | ||
| 48 | + | ||
| 44 | @Preview | 49 | @Preview |
| 45 | @Component | 50 | @Component |
| 46 | export struct OperRowListView { | 51 | export struct OperRowListView { |
| @@ -103,6 +108,7 @@ export struct OperRowListView { | @@ -103,6 +108,7 @@ export struct OperRowListView { | ||
| 103 | // console.info(TAG, 'this.needLike', this.needLike) | 108 | // console.info(TAG, 'this.needLike', this.needLike) |
| 104 | this.handleStyle() | 109 | this.handleStyle() |
| 105 | this.onDetailUpdated() | 110 | this.onDetailUpdated() |
| 111 | + | ||
| 106 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { | 112 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { |
| 107 | // console.log(TAG, 'this.currentStatus', val) | 113 | // console.log(TAG, 'this.currentStatus', val) |
| 108 | this.currentStatus = val | 114 | this.currentStatus = val |
| @@ -187,6 +193,25 @@ export struct OperRowListView { | @@ -187,6 +193,25 @@ export struct OperRowListView { | ||
| 187 | this.audioTitle = this.contentDetailData.newsTitle || '' | 193 | this.audioTitle = this.contentDetailData.newsTitle || '' |
| 188 | // console.log(TAG, 'this.audioUrl+++', this.audioUrl) | 194 | // console.log(TAG, 'this.audioUrl+++', this.audioUrl) |
| 189 | // console.log(TAG, 'this.audioTitle+++', this.audioTitle) | 195 | // console.log(TAG, 'this.audioTitle+++', this.audioTitle) |
| 196 | + const newsInfo = this.AudioSuspension.newsInfo(); | ||
| 197 | + // console.log(TAG, 'newsInfo', newsInfo) | ||
| 198 | + if (newsInfo) { | ||
| 199 | + try { | ||
| 200 | + const parsedInfo: newsInfo = JSON.parse(newsInfo); | ||
| 201 | + const url = parsedInfo.url; | ||
| 202 | + | ||
| 203 | + // console.log(TAG, 'url', url) | ||
| 204 | + // console.log(TAG, 'this.audioUrl', this.audioUrl) | ||
| 205 | + | ||
| 206 | + if (url == this.audioUrl) { | ||
| 207 | + this.currentStatus = parsedInfo.currentStatus | ||
| 208 | + } | ||
| 209 | + } catch (error) { | ||
| 210 | + console.error(`${TAG} Error parsing newsInfo:`, error); | ||
| 211 | + } | ||
| 212 | + } else { | ||
| 213 | + console.log(`${TAG} No newsInfo available`); | ||
| 214 | + } | ||
| 190 | } | 215 | } |
| 191 | // 2:竖屏直播页 3:图集 4:横屏直播页 | 216 | // 2:竖屏直播页 3:图集 4:横屏直播页 |
| 192 | if(this.pageComponentType == 2 || this.pageComponentType == 4) { | 217 | if(this.pageComponentType == 2 || this.pageComponentType == 4) { |
| @@ -475,10 +500,10 @@ export struct OperRowListView { | @@ -475,10 +500,10 @@ export struct OperRowListView { | ||
| 475 | } | 500 | } |
| 476 | ] | 501 | ] |
| 477 | } | 502 | } |
| 478 | - console.info(TAG, '查询用户对作品收藏1', JSON.stringify(params)) | 503 | + // console.info(TAG, '查询用户对作品收藏1', JSON.stringify(params)) |
| 479 | // console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params)) | 504 | // console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params)) |
| 480 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) | 505 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) |
| 481 | - console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data)) | 506 | + // console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data)) |
| 482 | this.newsStatusOfUser = data[0]; | 507 | this.newsStatusOfUser = data[0]; |
| 483 | } catch (exception) { | 508 | } catch (exception) { |
| 484 | // console.error(TAG, JSON.stringify(exception)) | 509 | // console.error(TAG, JSON.stringify(exception)) |
| @@ -491,9 +516,9 @@ export struct OperRowListView { | @@ -491,9 +516,9 @@ export struct OperRowListView { | ||
| 491 | async toggleCollectStatus() { | 516 | async toggleCollectStatus() { |
| 492 | // 未登录,跳转登录 | 517 | // 未登录,跳转登录 |
| 493 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | 518 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 494 | - console.log(TAG, '收藏点击,登录', user_id) | 519 | + // console.log(TAG, '收藏点击,登录', user_id) |
| 495 | if (!user_id) { | 520 | if (!user_id) { |
| 496 | - console.log(TAG, '收藏点击,用户未登录') | 521 | + // console.log(TAG, '收藏点击,用户未登录') |
| 497 | if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() } | 522 | if (this.dialogBeforeJumpOtherPageAction) { this.dialogBeforeJumpOtherPageAction() } |
| 498 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 523 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 499 | return | 524 | return |
| @@ -524,7 +549,7 @@ export struct OperRowListView { | @@ -524,7 +549,7 @@ export struct OperRowListView { | ||
| 524 | } | 549 | } |
| 525 | } | 550 | } |
| 526 | 551 | ||
| 527 | - console.log(TAG, '收藏点击', JSON.stringify(params)) | 552 | + // console.log(TAG, '收藏点击', JSON.stringify(params)) |
| 528 | PageRepository.postExecuteCollectRecord(params).then(res => { | 553 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 529 | if (this.newsStatusOfUser && res.code == 0) { | 554 | if (this.newsStatusOfUser && res.code == 0) { |
| 530 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 555 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| @@ -536,7 +561,7 @@ export struct OperRowListView { | @@ -536,7 +561,7 @@ export struct OperRowListView { | ||
| 536 | } | 561 | } |
| 537 | this.queryContentInteractCount() | 562 | this.queryContentInteractCount() |
| 538 | } | 563 | } |
| 539 | - console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | 564 | + // console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 540 | }).catch((error:Error) =>{ | 565 | }).catch((error:Error) =>{ |
| 541 | ToastUtils.showToast(error.message, 1000); | 566 | ToastUtils.showToast(error.message, 1000); |
| 542 | }) | 567 | }) |
| @@ -553,9 +578,9 @@ export struct OperRowListView { | @@ -553,9 +578,9 @@ export struct OperRowListView { | ||
| 553 | contentType: this.contentDetailData?.newsType, | 578 | contentType: this.contentDetailData?.newsType, |
| 554 | }] | 579 | }] |
| 555 | } | 580 | } |
| 556 | - console.log(TAG, '查询点赞、收藏数量', JSON.stringify(params)) | 581 | + // console.log(TAG, '查询点赞、收藏数量', JSON.stringify(params)) |
| 557 | PageRepository.getContentInteract(params).then(res => { | 582 | PageRepository.getContentInteract(params).then(res => { |
| 558 | - console.log(TAG, '查询点赞、收藏数量 res', JSON.stringify(res)) | 583 | + // console.log(TAG, '查询点赞、收藏数量 res', JSON.stringify(res)) |
| 559 | if (res.data) { | 584 | if (res.data) { |
| 560 | this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) | 585 | this.interactData.likeNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.likeNum) |
| 561 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | 586 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) |
| @@ -13,7 +13,6 @@ export class AudioSuspensionModel { | @@ -13,7 +13,6 @@ export class AudioSuspensionModel { | ||
| 13 | public playerController: SubscribedAbstractProperty<WDPlayerController> = AppStorage.link<WDPlayerController>('playerController') | 13 | public playerController: SubscribedAbstractProperty<WDPlayerController> = AppStorage.link<WDPlayerController>('playerController') |
| 14 | public floatWindowClass: SubscribedAbstractProperty<window.Window> = AppStorage.link<window.Window>('floatWindowClass') | 14 | public floatWindowClass: SubscribedAbstractProperty<window.Window> = AppStorage.link<window.Window>('floatWindowClass') |
| 15 | public srcTitle: string = '' | 15 | public srcTitle: string = '' |
| 16 | - private url: string = '' | ||
| 17 | // 窗口是否最小化 | 16 | // 窗口是否最小化 |
| 18 | private isMinimize: SubscribedAbstractProperty<boolean> = AppStorage.link<boolean>('isMinimize') | 17 | private isMinimize: SubscribedAbstractProperty<boolean> = AppStorage.link<boolean>('isMinimize') |
| 19 | constructor() { | 18 | constructor() { |
| @@ -40,8 +39,7 @@ export class AudioSuspensionModel { | @@ -40,8 +39,7 @@ export class AudioSuspensionModel { | ||
| 40 | * 配置音频地址 | 39 | * 配置音频地址 |
| 41 | */ | 40 | */ |
| 42 | public async setPlayerUrl(url: string, srcTitle: string, srcContentId?: string, srcSource?: string) { | 41 | public async setPlayerUrl(url: string, srcTitle: string, srcContentId?: string, srcSource?: string) { |
| 43 | - /*console.log(TAG,'this.url', this.url) | ||
| 44 | - console.log(TAG,'url', url)*/ | 42 | + // console.log(TAG,'url', url) |
| 45 | this.playerController.get().keepOnBackground = true | 43 | this.playerController.get().keepOnBackground = true |
| 46 | BackgroundAudioController.sharedController().avplayerController = this.playerController.get() | 44 | BackgroundAudioController.sharedController().avplayerController = this.playerController.get() |
| 47 | await BackgroundAudioController.sharedController().createSession() | 45 | await BackgroundAudioController.sharedController().createSession() |
| @@ -50,7 +48,7 @@ export class AudioSuspensionModel { | @@ -50,7 +48,7 @@ export class AudioSuspensionModel { | ||
| 50 | await BackgroundAudioController.sharedController().setSessionMetaData(srcContentId ?? "", srcTitle, $r("app.media.system_audio_icon_bk_center"), srcSource ?? "") | 48 | await BackgroundAudioController.sharedController().setSessionMetaData(srcContentId ?? "", srcTitle, $r("app.media.system_audio_icon_bk_center"), srcSource ?? "") |
| 51 | BackgroundAudioController.sharedController().stopUseFeatures() | 49 | BackgroundAudioController.sharedController().stopUseFeatures() |
| 52 | 50 | ||
| 53 | - if (this.url === url) { | 51 | + if (this.playerController.get().getUrl() === url) { |
| 54 | this.isMinimize = AppStorage.link<boolean>('isMinimize') | 52 | this.isMinimize = AppStorage.link<boolean>('isMinimize') |
| 55 | // console.log(TAG, 'this.isMinimize', this.isMinimize?.get()) | 53 | // console.log(TAG, 'this.isMinimize', this.isMinimize?.get()) |
| 56 | if (this.isMinimize?.get()) { | 54 | if (this.isMinimize?.get()) { |
| @@ -61,7 +59,6 @@ export class AudioSuspensionModel { | @@ -61,7 +59,6 @@ export class AudioSuspensionModel { | ||
| 61 | this.playerController.get().switchPlayOrPause() | 59 | this.playerController.get().switchPlayOrPause() |
| 62 | } | 60 | } |
| 63 | } else { | 61 | } else { |
| 64 | - this.url = url | ||
| 65 | this.playerController.get().firstPlay(url) | 62 | this.playerController.get().firstPlay(url) |
| 66 | this.playerController.get().onCanplay = () => { | 63 | this.playerController.get().onCanplay = () => { |
| 67 | this.playerController.get().play() | 64 | this.playerController.get().play() |
| @@ -120,6 +117,16 @@ export class AudioSuspensionModel { | @@ -120,6 +117,16 @@ export class AudioSuspensionModel { | ||
| 120 | // console.info(TAG, 'Succeeded in minimizing the window.'); | 117 | // console.info(TAG, 'Succeeded in minimizing the window.'); |
| 121 | }); | 118 | }); |
| 122 | } | 119 | } |
| 120 | + // 获取当前播放状态 newsId作为参数 | ||
| 121 | + public newsInfo() { | ||
| 122 | + const currentStatus = this.playerController.get().getStatus() | ||
| 123 | + const url = this.playerController.get().getUrl() | ||
| 124 | + return JSON.stringify({ currentStatus, url }) | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + public switchPlayOrPause() { | ||
| 128 | + this.playerController.get().switchPlayOrPause() | ||
| 129 | + } | ||
| 123 | 130 | ||
| 124 | 131 | ||
| 125 | 132 |
| @@ -89,7 +89,7 @@ export class PageHelper { | @@ -89,7 +89,7 @@ export class PageHelper { | ||
| 89 | pageModel.displayPageInfoMd5 = pageInfo.md5 | 89 | pageModel.displayPageInfoMd5 = pageInfo.md5 |
| 90 | //解析页面挂角广告资源 | 90 | //解析页面挂角广告资源 |
| 91 | pageAdvModel.analysisAdvSource(pageInfo); | 91 | pageAdvModel.analysisAdvSource(pageInfo); |
| 92 | - this.parseGroup(pageModel, true) | 92 | + this.parseGroup(pageModel, true, true) |
| 93 | }) | 93 | }) |
| 94 | } | 94 | } |
| 95 | 95 | ||
| @@ -110,7 +110,7 @@ export class PageHelper { | @@ -110,7 +110,7 @@ export class PageHelper { | ||
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | async getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { | 112 | async getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { |
| 113 | - let cacheIsSame = false; | 113 | + let adHasChanged = false; |
| 114 | pageModel.currentPage = 1; | 114 | pageModel.currentPage = 1; |
| 115 | pageModel.loadImg = await onlyWifiLoadImg(); | 115 | pageModel.loadImg = await onlyWifiLoadImg(); |
| 116 | if (pageModel.pageType == 1) { | 116 | if (pageModel.pageType == 1) { |
| @@ -142,7 +142,7 @@ export class PageHelper { | @@ -142,7 +142,7 @@ export class PageHelper { | ||
| 142 | if (pageInfo.md5 == pageModel.displayPageInfoMd5) { | 142 | if (pageInfo.md5 == pageModel.displayPageInfoMd5) { |
| 143 | // 缓存一致,不解析 | 143 | // 缓存一致,不解析 |
| 144 | // Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。') | 144 | // Logger.debug(TAG, 'getPageInfo 与缓存一致,不解析广告。。。') |
| 145 | - cacheIsSame = true; | 145 | + adHasChanged = true; |
| 146 | } else { | 146 | } else { |
| 147 | // Logger.debug(TAG, 'getPageInfo 要解析广告') | 147 | // Logger.debug(TAG, 'getPageInfo 要解析广告') |
| 148 | if (pageModel.currentPage == 1) { | 148 | if (pageModel.currentPage == 1) { |
| @@ -152,10 +152,10 @@ export class PageHelper { | @@ -152,10 +152,10 @@ export class PageHelper { | ||
| 152 | pageModel.displayPageInfoMd5 = pageInfo.md5 | 152 | pageModel.displayPageInfoMd5 = pageInfo.md5 |
| 153 | //解析页面挂角广告资源 | 153 | //解析页面挂角广告资源 |
| 154 | pageAdvModel.analysisAdvSource(pageInfo); | 154 | pageAdvModel.analysisAdvSource(pageInfo); |
| 155 | - cacheIsSame = false; | 155 | + adHasChanged = false; |
| 156 | } | 156 | } |
| 157 | // Logger.debug(TAG, 'getPageInfo go on') | 157 | // Logger.debug(TAG, 'getPageInfo go on') |
| 158 | - this.parseGroup(pageModel, cacheIsSame) | 158 | + this.parseGroup(pageModel, false, adHasChanged) |
| 159 | }).catch((err:Error) => { | 159 | }).catch((err:Error) => { |
| 160 | this.refreshUIEnd(pageModel, false) | 160 | this.refreshUIEnd(pageModel, false) |
| 161 | if (this.isPageLoaded(pageModel)) { | 161 | if (this.isPageLoaded(pageModel)) { |
| @@ -178,7 +178,7 @@ export class PageHelper { | @@ -178,7 +178,7 @@ export class PageHelper { | ||
| 178 | * 解析信息流页面楼层数据 | 178 | * 解析信息流页面楼层数据 |
| 179 | * @param pageModel | 179 | * @param pageModel |
| 180 | */ | 180 | */ |
| 181 | - async parseGroup(pageModel: PageModel, isCache: boolean) { | 181 | + async parseGroup(pageModel: PageModel, isCache: boolean, adHasChagned: boolean) { |
| 182 | let pageInfo: PageInfoDTO = pageModel.pageInfo | 182 | let pageInfo: PageInfoDTO = pageModel.pageInfo |
| 183 | pageModel.groupList = [] | 183 | pageModel.groupList = [] |
| 184 | pageInfo.pageAdList = [] | 184 | pageInfo.pageAdList = [] |
| @@ -200,7 +200,7 @@ export class PageHelper { | @@ -200,7 +200,7 @@ export class PageHelper { | ||
| 200 | if (isCache) { | 200 | if (isCache) { |
| 201 | pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO | 201 | pageDto = await PageViewModel.getPageGroupCacheData(pageModel.bizCopy()) as PageDTO |
| 202 | pageModel.displayGroupInfoMd5 = pageDto.md5 | 202 | pageModel.displayGroupInfoMd5 = pageDto.md5 |
| 203 | - pageModel.currentPage = 2 | 203 | + // pageModel.currentPage = 2 |
| 204 | } else { | 204 | } else { |
| 205 | pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO | 205 | pageDto = await PageViewModel.getPageGroupCompData(pageModel.bizCopy()) as PageDTO |
| 206 | //增加楼层数据异常判断条件 | 206 | //增加楼层数据异常判断条件 |
| @@ -141,9 +141,9 @@ export struct TopPlayComponent { | @@ -141,9 +141,9 @@ export struct TopPlayComponent { | ||
| 141 | this.isHideLoading = false | 141 | this.isHideLoading = false |
| 142 | } else { | 142 | } else { |
| 143 | this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait' | 143 | this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait' |
| 144 | - if (this.isWait) { | ||
| 145 | - this.isHideLoading = true | ||
| 146 | - } | 144 | + // if (this.isWait) { |
| 145 | + // this.isHideLoading = true | ||
| 146 | + // } | ||
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && | 149 | this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && |
| @@ -269,6 +269,14 @@ export struct TopPlayComponent { | @@ -269,6 +269,14 @@ export struct TopPlayComponent { | ||
| 269 | Visibility.None)// .contrast(this.isEnd ? 0.4 : 1) | 269 | Visibility.None)// .contrast(this.isEnd ? 0.4 : 1) |
| 270 | .blur(this.isEnd ? 20 : 0) | 270 | .blur(this.isEnd ? 20 : 0) |
| 271 | .width('100%') | 271 | .width('100%') |
| 272 | + .onComplete(event=>{ | ||
| 273 | + if (event?.loadingStatus == 1) { | ||
| 274 | + this.isHideLoading = true | ||
| 275 | + } | ||
| 276 | + }) | ||
| 277 | + .onError(()=>{ | ||
| 278 | + this.isHideLoading = true | ||
| 279 | + }) | ||
| 272 | 280 | ||
| 273 | 281 | ||
| 274 | if (this.liveDetailPageLogic.showPad) { | 282 | if (this.liveDetailPageLogic.showPad) { |
| @@ -243,8 +243,10 @@ export struct PlayerTitleView { | @@ -243,8 +243,10 @@ export struct PlayerTitleView { | ||
| 243 | .fontWeight(400) | 243 | .fontWeight(400) |
| 244 | .fontFamily('PingFang SC-Regular') | 244 | .fontFamily('PingFang SC-Regular') |
| 245 | .onClick(() => { | 245 | .onClick(() => { |
| 246 | - this.isOpenDetail = true | ||
| 247 | - this.dialogController?.open() | 246 | + if (this.isOverLines) { |
| 247 | + this.isOpenDetail = true | ||
| 248 | + this.dialogController?.open() | ||
| 249 | + } | ||
| 248 | }) | 250 | }) |
| 249 | if (this.isOverLines) { | 251 | if (this.isOverLines) { |
| 250 | Span('... 全文') | 252 | Span('... 全文') |
| @@ -430,6 +430,10 @@ export class WDPlayerController { | @@ -430,6 +430,10 @@ export class WDPlayerController { | ||
| 430 | return this.status; | 430 | return this.status; |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | + getUrl() { | ||
| 434 | + return this.url | ||
| 435 | + } | ||
| 436 | + | ||
| 433 | getPlayer() { | 437 | getPlayer() { |
| 434 | return this.avPlayer; | 438 | return this.avPlayer; |
| 435 | } | 439 | } |
| 1 | +import AbilityStage from '@ohos.app.ability.AbilityStage'; | ||
| 2 | +import AbilityConstant from '@ohos.app.ability.AbilityConstant'; | ||
| 3 | +import Want from '@ohos.app.ability.Want'; | ||
| 4 | +import { Configuration } from '@ohos.app.ability.Configuration'; | ||
| 5 | +import { SPHelper, UmengStats } from 'wdKit'; | ||
| 6 | + | ||
| 7 | +export default class MyAbilityStage extends AbilityStage { | ||
| 8 | + | ||
| 9 | + onCreate() { | ||
| 10 | + | ||
| 11 | + UmengStats.preInit(this.context) | ||
| 12 | + | ||
| 13 | + // KV存储 | ||
| 14 | + SPHelper.init(this.context); | ||
| 15 | + | ||
| 16 | + if (SPHelper.default.getSync('isPrivacy', true)) { | ||
| 17 | + // 同意隐私协议,这里直接初始化。TODO 耗时梳理 | ||
| 18 | + UmengStats.initAfterAgreeProtocol() | ||
| 19 | + } | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + onAcceptWant(want: Want): string { | ||
| 23 | + return "" | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + onConfigurationUpdate(newConfig: Configuration): void { | ||
| 27 | + | ||
| 28 | + } | ||
| 29 | + onMemoryLevel(level: AbilityConstant.MemoryLevel): void { | ||
| 30 | + | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + onDestroy(): void { | ||
| 34 | + | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | +} |
| @@ -87,8 +87,11 @@ export struct VideoChannelPage { | @@ -87,8 +87,11 @@ export struct VideoChannelPage { | ||
| 87 | if (item.channelStyle === 1) { | 87 | if (item.channelStyle === 1) { |
| 88 | return this.currentTopNavSelectedIndex === index ? Color.White : this.tabSelectedColor(false) | 88 | return this.currentTopNavSelectedIndex === index ? Color.White : this.tabSelectedColor(false) |
| 89 | } else { | 89 | } else { |
| 90 | - return this.tabSelectedColor(this.currentTopNavSelectedIndex === | ||
| 91 | - index) | 90 | + // 如果当前时沉浸式,其他TAB全部设置 白色50% |
| 91 | + if (this.isImmerseChannel() && this.currentTopNavSelectedIndex != index) { | ||
| 92 | + return "#50FFFFFF" | ||
| 93 | + } | ||
| 94 | + return this.tabSelectedColor(this.currentTopNavSelectedIndex === index) | ||
| 92 | } | 95 | } |
| 93 | } | 96 | } |
| 94 | 97 |
| @@ -193,7 +193,7 @@ export class StartupManager { | @@ -193,7 +193,7 @@ export class StartupManager { | ||
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | private preInitUmentStat() { | 195 | private preInitUmentStat() { |
| 196 | - UmengStats.preInit(this.context!) | 196 | + // UmengStats.preInit(this.context!) |
| 197 | } | 197 | } |
| 198 | private initUmengStat() { | 198 | private initUmengStat() { |
| 199 | Logger.debug(TAG, "App 友盟统计 初始化") | 199 | Logger.debug(TAG, "App 友盟统计 初始化") |
| @@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
| 4 | "type": "entry", | 4 | "type": "entry", |
| 5 | "description": "$string:module_desc", | 5 | "description": "$string:module_desc", |
| 6 | "mainElement": "EntryAbility", | 6 | "mainElement": "EntryAbility", |
| 7 | + "srcEntry": "./ets/entryability/EntryAbilityStage.ets", | ||
| 7 | "deviceTypes": [ | 8 | "deviceTypes": [ |
| 8 | "phone", | 9 | "phone", |
| 9 | // "tablet", | 10 | // "tablet", |
-
Please register or login to post a comment