Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
52 changed files
with
280 additions
and
135 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": 7399, | ||
| 6 | - "versionName": "7.3.9.9", | 5 | + "versionCode": 7401, |
| 6 | + "versionName": "7.4.0.1", | ||
| 7 | "icon": "$media:app_icon", | 7 | "icon": "$media:app_icon", |
| 8 | "label": "$string:app_name" | 8 | "label": "$string:app_name" |
| 9 | } | 9 | } |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdconstant", | 5 | + "name": "wdConstant", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdjsbridge", | 5 | + "name": "wdJsBridge", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdkit", | 5 | + "name": "wdKit", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdnetwork", | 5 | + "name": "wdNetwork", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdrouter", | 5 | + "name": "wdRouter", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -3,7 +3,7 @@ import { RetryHolderManager } from '@ohos/imageknife/src/main/ets/components/ima | @@ -3,7 +3,7 @@ import { RetryHolderManager } from '@ohos/imageknife/src/main/ets/components/ima | ||
| 3 | import App from '@system.app' | 3 | import App from '@system.app' |
| 4 | import { Action, Params } from 'wdBean/Index' | 4 | import { Action, Params } from 'wdBean/Index' |
| 5 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 5 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 6 | -import { Logger } from 'wdKit/Index' | 6 | +import { Logger, SPHelper } from 'wdKit/Index' |
| 7 | import { ContentType } from '../common/ContentType' | 7 | import { ContentType } from '../common/ContentType' |
| 8 | import { WDRouterRule } from '../router/WDRouterRule' | 8 | import { WDRouterRule } from '../router/WDRouterRule' |
| 9 | import HomeChannelUtils from './HomeChannelUtils' | 9 | import HomeChannelUtils from './HomeChannelUtils' |
| @@ -127,6 +127,8 @@ export class AppInnerLink { | @@ -127,6 +127,8 @@ export class AppInnerLink { | ||
| 127 | if (params.type == "topic" && params.subType == "audio_news") { | 127 | if (params.type == "topic" && params.subType == "audio_news") { |
| 128 | } | 128 | } |
| 129 | if (params.type == "topic" && params.subType == "moring_evening_news") { | 129 | if (params.type == "topic" && params.subType == "moring_evening_news") { |
| 130 | + ///解决早晚报切换不更新问题,内部更新id | ||
| 131 | + SPHelper.default.deleteSync('dailyPaperTopicPageId'); | ||
| 130 | ProcessUtils.gotoMorningEveningPaper() | 132 | ProcessUtils.gotoMorningEveningPaper() |
| 131 | } | 133 | } |
| 132 | 134 |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdwebcomponent", | 5 | + "name": "wdWebComponent", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -197,6 +197,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) { | @@ -197,6 +197,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) { | ||
| 197 | ProcessUtils.processPage(content) | 197 | ProcessUtils.processPage(content) |
| 198 | } | 198 | } |
| 199 | if (urlParams.get('subType') === 'moring_evening_news') { | 199 | if (urlParams.get('subType') === 'moring_evening_news') { |
| 200 | + ///解决早晚报切换不更新问题,内部更新id | ||
| 201 | + SPHelper.default.deleteSync('dailyPaperTopicPageId'); | ||
| 200 | ProcessUtils.gotoMorningEveningPaper() | 202 | ProcessUtils.gotoMorningEveningPaper() |
| 201 | } | 203 | } |
| 202 | if (urlParams.get('subType') === 'electronic_newspapers') { | 204 | if (urlParams.get('subType') === 'electronic_newspapers') { |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdbean", | 5 | + "name": "wdBean", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -22,6 +22,8 @@ export class ContentShareInfoDTO { | @@ -22,6 +22,8 @@ export class ContentShareInfoDTO { | ||
| 22 | 22 | ||
| 23 | @Observed | 23 | @Observed |
| 24 | export class ContentDTO implements BaseDTO { | 24 | export class ContentDTO implements BaseDTO { |
| 25 | + introduction: string = ''; | ||
| 26 | + zhDescription: string = ''; | ||
| 25 | seoTags: string = ''; | 27 | seoTags: string = ''; |
| 26 | cornerMark:string = ''; | 28 | cornerMark:string = ''; |
| 27 | liveType?: string; // 直播新闻-直播状态 | 29 | liveType?: string; // 直播新闻-直播状态 |
| @@ -153,6 +155,7 @@ export class ContentDTO implements BaseDTO { | @@ -153,6 +155,7 @@ export class ContentDTO implements BaseDTO { | ||
| 153 | 155 | ||
| 154 | static clone(old: ContentDTO): ContentDTO { | 156 | static clone(old: ContentDTO): ContentDTO { |
| 155 | let content = new ContentDTO(); | 157 | let content = new ContentDTO(); |
| 158 | + content.zhDescription = old.zhDescription; | ||
| 156 | content.liveType = old.liveType; | 159 | content.liveType = old.liveType; |
| 157 | content.seoTags = old.seoTags; | 160 | content.seoTags = old.seoTags; |
| 158 | content.appStyle = old.appStyle; | 161 | content.appStyle = old.appStyle; |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdcomponent", | 5 | + "name": "wdComponent", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -81,7 +81,7 @@ export struct CardParser { | @@ -81,7 +81,7 @@ export struct CardParser { | ||
| 81 | @Builder | 81 | @Builder |
| 82 | contentBuilder(contentDTO: ContentDTO) { | 82 | contentBuilder(contentDTO: ContentDTO) { |
| 83 | // Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 83 | // Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 84 | - if (!!contentDTO.contentText) { | 84 | + if (!!contentDTO.contentText || !!contentDTO.zhDescription || !!contentDTO.introduction) { |
| 85 | SearchContentComponent({ | 85 | SearchContentComponent({ |
| 86 | contentDTO, | 86 | contentDTO, |
| 87 | compDTO: this.compDTO, | 87 | compDTO: this.compDTO, |
| @@ -30,7 +30,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -30,7 +30,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 30 | import { PageRepository } from '../repository/PageRepository'; | 30 | import { PageRepository } from '../repository/PageRepository'; |
| 31 | import { OperRowListView } from './view/OperRowListView'; | 31 | import { OperRowListView } from './view/OperRowListView'; |
| 32 | import { CommentDialogView } from './CommentDialogView'; | 32 | import { CommentDialogView } from './CommentDialogView'; |
| 33 | -import { CustomTitleUI } from 'wdcomponent/ets/components/reusable/CustomTitleUI'; | 33 | +import { CustomTitleUI } from './reusable/CustomTitleUI'; |
| 34 | 34 | ||
| 35 | const TAG = 'H5NewsWebPageComponent' | 35 | const TAG = 'H5NewsWebPageComponent' |
| 36 | 36 |
| @@ -452,7 +452,7 @@ export struct MorningEveningPaperComponent { | @@ -452,7 +452,7 @@ export struct MorningEveningPaperComponent { | ||
| 452 | }) | 452 | }) |
| 453 | } | 453 | } |
| 454 | .height('100%') | 454 | .height('100%') |
| 455 | - .width('20%') | 455 | + .width(63) |
| 456 | .onClick(() => { | 456 | .onClick(() => { |
| 457 | }) | 457 | }) |
| 458 | } | 458 | } |
| @@ -33,7 +33,7 @@ export struct Card11Component { | @@ -33,7 +33,7 @@ export struct Card11Component { | ||
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | titleInit() { | 35 | titleInit() { |
| 36 | - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 36 | + const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title || this.contentDTO.newsTitle); |
| 37 | this.titleMarked = titleInitRes.titleMarked; | 37 | this.titleMarked = titleInitRes.titleMarked; |
| 38 | this.textArr = titleInitRes.textArr; | 38 | this.textArr = titleInitRes.textArr; |
| 39 | } | 39 | } |
| @@ -241,7 +241,7 @@ struct createImg { | @@ -241,7 +241,7 @@ struct createImg { | ||
| 241 | Image(this.loadImg ? item.url || item.fullUrl : '') | 241 | Image(this.loadImg ? item.url || item.fullUrl : '') |
| 242 | .backgroundColor(0xf5f5f5) | 242 | .backgroundColor(0xf5f5f5) |
| 243 | .width('100%') | 243 | .width('100%') |
| 244 | - .height(198) | 244 | + .aspectRatio(16 / 9) |
| 245 | .autoResize(true) | 245 | .autoResize(true) |
| 246 | .borderRadius(this.caclImageRadius(index)) | 246 | .borderRadius(this.caclImageRadius(index)) |
| 247 | .borderStyle(BorderStyle.Solid) | 247 | .borderStyle(BorderStyle.Solid) |
| @@ -36,7 +36,7 @@ export struct Card20Component { | @@ -36,7 +36,7 @@ export struct Card20Component { | ||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | titleInit() { | 38 | titleInit() { |
| 39 | - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 39 | + const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title || this.contentDTO.newsTitle); |
| 40 | this.titleMarked = titleInitRes.titleMarked; | 40 | this.titleMarked = titleInitRes.titleMarked; |
| 41 | this.textArr = titleInitRes.textArr; | 41 | this.textArr = titleInitRes.textArr; |
| 42 | } | 42 | } |
| @@ -55,7 +55,7 @@ export struct Card20Component { | @@ -55,7 +55,7 @@ export struct Card20Component { | ||
| 55 | isPeopleShipHome:this.isPeopleShipHome, loadImg: this.loadImg | 55 | isPeopleShipHome:this.isPeopleShipHome, loadImg: this.loadImg |
| 56 | } | 56 | } |
| 57 | ) // 标题 | 57 | ) // 标题 |
| 58 | - if (this.contentDTO.newsTitle) { | 58 | + if (this.contentDTO.title || this.contentDTO.newsTitle) { |
| 59 | Stack() { | 59 | Stack() { |
| 60 | if(this.contentDTO.objectType == '5'){ | 60 | if(this.contentDTO.objectType == '5'){ |
| 61 | Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center) | 61 | Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(29).align(Alignment.Center) |
| @@ -36,7 +36,7 @@ export struct Card6Component { | @@ -36,7 +36,7 @@ export struct Card6Component { | ||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | titleInit() { | 38 | titleInit() { |
| 39 | - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 39 | + const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title || this.contentDTO.newsTitle); |
| 40 | this.titleMarked = titleInitRes.titleMarked; | 40 | this.titleMarked = titleInitRes.titleMarked; |
| 41 | this.textArr = titleInitRes.textArr; | 41 | this.textArr = titleInitRes.textArr; |
| 42 | } | 42 | } |
| @@ -80,7 +80,7 @@ export struct Card6Component { | @@ -80,7 +80,7 @@ export struct Card6Component { | ||
| 80 | } | 80 | } |
| 81 | }) | 81 | }) |
| 82 | } else { | 82 | } else { |
| 83 | - Span(this.contentDTO.newsTitle) | 83 | + Span(this.contentDTO.newsTitle || this.contentDTO.title) |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | .fontColor(this.clicked ? 0x848484 : 0x222222) | 86 | .fontColor(this.clicked ? 0x848484 : 0x222222) |
| @@ -34,7 +34,7 @@ export struct SearchContentComponent { | @@ -34,7 +34,7 @@ export struct SearchContentComponent { | ||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | titleInit() { | 36 | titleInit() { |
| 37 | - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.contentText || ''); | 37 | + const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.contentText || this.contentDTO.zhDescription || this.contentDTO.introduction); |
| 38 | // this.titleMarked = titleInitRes.titleMarked; | 38 | // this.titleMarked = titleInitRes.titleMarked; |
| 39 | this.textArr = titleInitRes.textArr; | 39 | this.textArr = titleInitRes.textArr; |
| 40 | } | 40 | } |
| @@ -44,7 +44,7 @@ export struct SearchContentComponent { | @@ -44,7 +44,7 @@ export struct SearchContentComponent { | ||
| 44 | //body | 44 | //body |
| 45 | Column() { | 45 | Column() { |
| 46 | //新闻标题 | 46 | //新闻标题 |
| 47 | - Text(this.contentDTO.newsTitle) | 47 | + Text(this.contentDTO.newsTitle || this.contentDTO.title) |
| 48 | .fontSize($r('app.float.font_size_18')) | 48 | .fontSize($r('app.float.font_size_18')) |
| 49 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) | 49 | .fontColor(this.clicked ? 0x848484 : $r('app.color.color_222222')) |
| 50 | .maxLines(3) | 50 | .maxLines(3) |
| 1 | import { ContentDTO } from 'wdBean/Index' | 1 | import { ContentDTO } from 'wdBean/Index' |
| 2 | -import { DateTimeUtils, StringUtils, UserDataLocal } from 'wdKit/Index' | 2 | +import { DateTimeUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit/Index' |
| 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' | 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' |
| 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' | 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' |
| 6 | import measure from '@ohos.measure' | 6 | import measure from '@ohos.measure' |
| 7 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' | 7 | import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' |
| 8 | -import { ProcessUtils } from 'wdRouter/Index' | 8 | +import { ProcessUtils, WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 9 | +import { SpConstants } from 'wdConstant' | ||
| 9 | 10 | ||
| 10 | @Component | 11 | @Component |
| 11 | export struct ChildCommentComponent { | 12 | export struct ChildCommentComponent { |
| @@ -221,6 +222,11 @@ export struct ChildCommentComponent { | @@ -221,6 +222,11 @@ export struct ChildCommentComponent { | ||
| 221 | } | 222 | } |
| 222 | 223 | ||
| 223 | commentLikeOperation() { | 224 | commentLikeOperation() { |
| 225 | + let userid = SPHelper.default.getSync(SpConstants.USER_ID,"") as string | ||
| 226 | + if (!userid) { | ||
| 227 | + WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | ||
| 228 | + return | ||
| 229 | + } | ||
| 224 | let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0) | 230 | let item = new CommentLikeOperationRequestItem(this.data.targetId, this.data.id + "", this.data.targetType + "", UserDataLocal.getUserName(), UserDataLocal.getUserHeaderUrl(), this.data.like_status === 0 ? 1 : 0) |
| 225 | MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => { | 231 | MinePageDatasModel.getCommentLikeOperation(item, getContext(this)).then((value) => { |
| 226 | if (value != null) { | 232 | if (value != null) { |
| @@ -82,7 +82,7 @@ export struct MessageListItemUI { | @@ -82,7 +82,7 @@ export struct MessageListItemUI { | ||
| 82 | Text().backgroundColor($r('app.color.color_EDEDED')) | 82 | Text().backgroundColor($r('app.color.color_EDEDED')) |
| 83 | .width('100%') | 83 | .width('100%') |
| 84 | .height(1) | 84 | .height(1) |
| 85 | - .visibility(this.index != 3 ?Visibility.Visible:Visibility.None) | 85 | + // .visibility(this.index != 3 ?Visibility.Visible:Visibility.None) |
| 86 | } | 86 | } |
| 87 | } | 87 | } |
| 88 | 88 |
| 1 | -import { CommonConstants, ViewType } from 'wdConstant'; | 1 | +import { BottomNavi, CommonConstants, ViewType } from 'wdConstant'; |
| 2 | import { EmitterEventId, EmitterUtils, 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'; |
| @@ -43,7 +43,7 @@ export struct PageComponent { | @@ -43,7 +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 | + bottomNavi:BottomNavi = BottomNavi.NEWS |
| 47 | 47 | ||
| 48 | build() { | 48 | build() { |
| 49 | Column() { | 49 | Column() { |
| @@ -286,7 +286,7 @@ export struct PageComponent { | @@ -286,7 +286,7 @@ export struct PageComponent { | ||
| 286 | 286 | ||
| 287 | //人民号推荐 监听登录事件(刷新页面) | 287 | //人民号推荐 监听登录事件(刷新页面) |
| 288 | EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => { | 288 | EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => { |
| 289 | - if(this.navIndex === this.currentTopNavSelectedIndex && this.isRMH){ | 289 | + if(this.navIndex === this.currentTopNavSelectedIndex && this.bottomNavi == BottomNavi.PEOPLE){ |
| 290 | this.listScroller.scrollEdge(Edge.Top) | 290 | this.listScroller.scrollEdge(Edge.Top) |
| 291 | this.pageModel.viewType = ViewType.LOADING; | 291 | this.pageModel.viewType = ViewType.LOADING; |
| 292 | this.getData() | 292 | this.getData() |
| @@ -298,9 +298,21 @@ export struct PageComponent { | @@ -298,9 +298,21 @@ export struct PageComponent { | ||
| 298 | onChange() { | 298 | onChange() { |
| 299 | // console.log(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`); | 299 | // console.log(TAG, `onChangezz id: ${this.pageId} , ${this.channelId} , ${this.navIndex} , navIndex: ${this.currentTopNavSelectedIndex}`); |
| 300 | // 注册监听网络连接 | 300 | // 注册监听网络连接 |
| 301 | - this.netStatus = undefined | ||
| 302 | - let netStatus = NetworkUtil.isNetConnected() | ||
| 303 | - if (netStatus) { | 301 | + if(this.bottomNavi == BottomNavi.VIDEO){ |
| 302 | + this.netStatus = undefined | ||
| 303 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 304 | + if (netStatus) { | ||
| 305 | + if (this.navIndex === this.currentTopNavSelectedIndex) { | ||
| 306 | + // console.log(TAG, 'page onAutoRefresh111 ' + this.needload) | ||
| 307 | + if (this.needload) { | ||
| 308 | + this.getData(); | ||
| 309 | + } | ||
| 310 | + this.needload = false; | ||
| 311 | + } | ||
| 312 | + } else { | ||
| 313 | + this.pageModel.viewType = ViewType.NoNetwork; | ||
| 314 | + } | ||
| 315 | + }else{ | ||
| 304 | if (this.navIndex === this.currentTopNavSelectedIndex) { | 316 | if (this.navIndex === this.currentTopNavSelectedIndex) { |
| 305 | // console.log(TAG, 'page onAutoRefresh111 ' + this.needload) | 317 | // console.log(TAG, 'page onAutoRefresh111 ' + this.needload) |
| 306 | if (this.needload) { | 318 | if (this.needload) { |
| @@ -308,9 +320,8 @@ export struct PageComponent { | @@ -308,9 +320,8 @@ export struct PageComponent { | ||
| 308 | } | 320 | } |
| 309 | this.needload = false; | 321 | this.needload = false; |
| 310 | } | 322 | } |
| 311 | - } else { | ||
| 312 | - this.pageModel.viewType = ViewType.NoNetwork; | ||
| 313 | } | 323 | } |
| 324 | + | ||
| 314 | } | 325 | } |
| 315 | 326 | ||
| 316 | async onAutoRefresh() { | 327 | async onAutoRefresh() { |
| @@ -7,7 +7,7 @@ import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/I | @@ -7,7 +7,7 @@ import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/I | ||
| 7 | import { TitleBackComponent } from '../setting/TitleBackComponent'; | 7 | import { TitleBackComponent } from '../setting/TitleBackComponent'; |
| 8 | 8 | ||
| 9 | const TAG = 'PrivacySettingPage'; | 9 | const TAG = 'PrivacySettingPage'; |
| 10 | -const DiyString = '开启个性化推荐' | 10 | +const DiyString = '开启个性推荐' |
| 11 | const DiyCloseTipsString = '关闭后,将不会使用你的偏好进行内容推荐' | 11 | const DiyCloseTipsString = '关闭后,将不会使用你的偏好进行内容推荐' |
| 12 | 12 | ||
| 13 | @Entry | 13 | @Entry |
| @@ -15,6 +15,7 @@ import { GrayManageModel } from '../../viewmodel/GrayManageModel'; | @@ -15,6 +15,7 @@ import { GrayManageModel } from '../../viewmodel/GrayManageModel'; | ||
| 15 | import { ColorUtils } from '../../utils/ColorUtils'; | 15 | import { ColorUtils } from '../../utils/ColorUtils'; |
| 16 | import { ImageKnifeComponent } from '@ohos/imageknife'; | 16 | import { ImageKnifeComponent } from '@ohos/imageknife'; |
| 17 | import { CommonUtils } from '../../utils/CommonUtils'; | 17 | import { CommonUtils } from '../../utils/CommonUtils'; |
| 18 | +import { BottomNavi } from 'wdConstant'; | ||
| 18 | 19 | ||
| 19 | const TAG = 'TopNavigationComponent'; | 20 | const TAG = 'TopNavigationComponent'; |
| 20 | 21 | ||
| @@ -97,10 +98,10 @@ export struct TopNavigationComponentNew { | @@ -97,10 +98,10 @@ export struct TopNavigationComponentNew { | ||
| 97 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { | 98 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { |
| 98 | if (CompUtils.isNews(this.navItem)) { | 99 | if (CompUtils.isNews(this.navItem)) { |
| 99 | this.createPageComponent(navItem, index, | 100 | this.createPageComponent(navItem, index, |
| 100 | - (channelId) => this.GrayManage.get().isNewsMourning(channelId),false); | 101 | + (channelId) => this.GrayManage.get().isNewsMourning(channelId),BottomNavi.NEWS); |
| 101 | } else if (CompUtils.isRMH(this.navItem)) { | 102 | } else if (CompUtils.isRMH(this.navItem)) { |
| 102 | this.createPageComponent(navItem, index, | 103 | this.createPageComponent(navItem, index, |
| 103 | - (channelId) => this.GrayManage.get().isRmhMourning(channelId),true); | 104 | + (channelId) => this.GrayManage.get().isRmhMourning(channelId),BottomNavi.PEOPLE); |
| 104 | } | 105 | } |
| 105 | 106 | ||
| 106 | } else { | 107 | } else { |
| @@ -165,7 +166,7 @@ export struct TopNavigationComponentNew { | @@ -165,7 +166,7 @@ export struct TopNavigationComponentNew { | ||
| 165 | 166 | ||
| 166 | } | 167 | } |
| 167 | @Builder | 168 | @Builder |
| 168 | - createPageComponent(navItem: TopNavDTO, index: number, mourningCheckFn: (channelId: string) => boolean,isRMH:boolean = false) { | 169 | + createPageComponent(navItem: TopNavDTO, index: number, mourningCheckFn: (channelId: string) => boolean,bottomNavi:BottomNavi = BottomNavi.NEWS) { |
| 169 | PageComponent({ | 170 | PageComponent({ |
| 170 | currentTopNavSelectedIndex: this.currentTopNavSelectedIndex, | 171 | currentTopNavSelectedIndex: this.currentTopNavSelectedIndex, |
| 171 | navIndex: index, | 172 | navIndex: index, |
| @@ -173,7 +174,7 @@ export struct TopNavigationComponentNew { | @@ -173,7 +174,7 @@ export struct TopNavigationComponentNew { | ||
| 173 | channelId: navItem?.channelId + '', | 174 | channelId: navItem?.channelId + '', |
| 174 | autoRefresh: this.autoRefresh2Page, | 175 | autoRefresh: this.autoRefresh2Page, |
| 175 | isMourning: mourningCheckFn(`${navItem.channelId}`), | 176 | isMourning: mourningCheckFn(`${navItem.channelId}`), |
| 176 | - isRMH:isRMH | 177 | + bottomNavi:bottomNavi |
| 177 | }) | 178 | }) |
| 178 | // .margin({ | 179 | // .margin({ |
| 179 | // left: 6, | 180 | // left: 6, |
| @@ -457,6 +457,8 @@ export struct SearchResultContentComponent { | @@ -457,6 +457,8 @@ export struct SearchResultContentComponent { | ||
| 457 | let seoTags = value.data?.seoTags | 457 | let seoTags = value.data?.seoTags |
| 458 | let cornerMark = value.data?.cornerMark | 458 | let cornerMark = value.data?.cornerMark |
| 459 | let contentDTO = new ContentDTO(); | 459 | let contentDTO = new ContentDTO(); |
| 460 | + contentDTO.introduction = value.data.introduction | ||
| 461 | + contentDTO.zhDescription = value.data.zhDescription | ||
| 460 | contentDTO.liveType = liveType ? liveType : "" | 462 | contentDTO.liveType = liveType ? liveType : "" |
| 461 | contentDTO.seoTags = seoTags ? seoTags : "" | 463 | contentDTO.seoTags = seoTags ? seoTags : "" |
| 462 | contentDTO.cornerMark = cornerMark ? cornerMark : "" | 464 | contentDTO.cornerMark = cornerMark ? cornerMark : "" |
| @@ -363,14 +363,6 @@ export struct AccountAndSecurityLayout { | @@ -363,14 +363,6 @@ export struct AccountAndSecurityLayout { | ||
| 363 | .padding({ top: 32, left: "31lpx", right: "31lpx" }) | 363 | .padding({ top: 32, left: "31lpx", right: "31lpx" }) |
| 364 | .width('100%') | 364 | .width('100%') |
| 365 | } | 365 | } |
| 366 | - Text('请注意:注销后7天内不能再次注册人民日报客户端,需要等到账号冷静期结束才能再次登录注册') | ||
| 367 | - .fontColor('#ED2800') | ||
| 368 | - .fontSize(14) | ||
| 369 | - .fontWeight(400) | ||
| 370 | - .lineHeight(20) | ||
| 371 | - .padding({ top: 32, left: 16, right: 16 }) | ||
| 372 | - .width('100%') | ||
| 373 | - | ||
| 374 | }.alignRules({ | 366 | }.alignRules({ |
| 375 | top: { anchor: "__container__", align: VerticalAlign.Top }, | 367 | top: { anchor: "__container__", align: VerticalAlign.Top }, |
| 376 | left: { anchor: "__container__", align: HorizontalAlign.Start }, | 368 | left: { anchor: "__container__", align: HorizontalAlign.Start }, |
| @@ -96,7 +96,7 @@ export struct MineSettingComponent { | @@ -96,7 +96,7 @@ export struct MineSettingComponent { | ||
| 96 | Column(){ | 96 | Column(){ |
| 97 | TitleBackComponent({title:"设置"}) | 97 | TitleBackComponent({title:"设置"}) |
| 98 | this.settingList() | 98 | this.settingList() |
| 99 | - } | 99 | + }.height('100%').backgroundColor(Color.White) |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | // 页面布局 | 102 | // 页面布局 |
| @@ -122,7 +122,7 @@ export struct MineSettingComponent { | @@ -122,7 +122,7 @@ export struct MineSettingComponent { | ||
| 122 | Divider() | 122 | Divider() |
| 123 | .color('#f0f0f0') | 123 | .color('#f0f0f0') |
| 124 | .strokeWidth(5) | 124 | .strokeWidth(5) |
| 125 | - } else if(index !== this.listData.length - 1) { | 125 | + } else { |
| 126 | Divider() | 126 | Divider() |
| 127 | .color('#f0f0f0') | 127 | .color('#f0f0f0') |
| 128 | .strokeWidth(1) | 128 | .strokeWidth(1) |
| 1 | +import { GradeSpan } from './span/GradeSpan'; | ||
| 2 | +import { image } from '@kit.ImageKit'; | ||
| 3 | +import { LengthMetrics } from '@kit.ArkUI'; | ||
| 4 | +import { StringUtils } from 'wdKit'; | ||
| 5 | + | ||
| 6 | +@Component | ||
| 7 | +export struct UserGradeTextSpan{ | ||
| 8 | + @Watch('contentChange') @Prop nameContent:string = "" | ||
| 9 | + @Watch('contentChange') @Prop gradeContent:string = "" | ||
| 10 | + @Watch('contentChange') @Prop gradeWidth:number = 50 | ||
| 11 | + | ||
| 12 | + taskId:number = -1 | ||
| 13 | + | ||
| 14 | + customSpan3: GradeSpan | undefined = undefined; | ||
| 15 | + style1: MutableStyledString | undefined = undefined; | ||
| 16 | + | ||
| 17 | + imagePixelMap: image.PixelMap | undefined = undefined; | ||
| 18 | + | ||
| 19 | + textController: TextController = new TextController(); | ||
| 20 | + | ||
| 21 | + private async getPixmapFromMedia(resource: Resource) { | ||
| 22 | + let unit8Array = await getContext(this)?.resourceManager?.getMediaContent({ | ||
| 23 | + bundleName: resource.bundleName, | ||
| 24 | + moduleName: resource.moduleName, | ||
| 25 | + id: resource.id | ||
| 26 | + }); | ||
| 27 | + let imageSource = image.createImageSource(unit8Array.buffer.slice(0, unit8Array.buffer.byteLength)); | ||
| 28 | + let createPixelMap: image.PixelMap = await imageSource.createPixelMap({ | ||
| 29 | + desiredPixelFormat: image.PixelMapFormat.RGBA_8888, | ||
| 30 | + desiredSize: { width: vp2px(this.gradeWidth), height: vp2px(18) } | ||
| 31 | + }); | ||
| 32 | + await imageSource.release(); | ||
| 33 | + return createPixelMap; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + contentChange(){ | ||
| 37 | + if(this.taskId != -1){ | ||
| 38 | + clearTimeout(this.taskId) | ||
| 39 | + } | ||
| 40 | + this.taskId = setTimeout(() => { | ||
| 41 | + this.createSpan() | ||
| 42 | + }, 100); | ||
| 43 | + | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + async createSpan(){ | ||
| 47 | + if(StringUtils.isEmpty(this.nameContent)){ | ||
| 48 | + return | ||
| 49 | + } | ||
| 50 | + this.imagePixelMap = await this.getPixmapFromMedia($r('app.media.my_grade_bg')) | ||
| 51 | + this.customSpan3 = new GradeSpan(this.gradeContent, this.gradeWidth, 18,this.imagePixelMap); | ||
| 52 | + this.style1 = new MutableStyledString(this.customSpan3); | ||
| 53 | + | ||
| 54 | + let name:MutableStyledString = new MutableStyledString(this.nameContent, [ | ||
| 55 | + { | ||
| 56 | + start: 0, | ||
| 57 | + length: 100, | ||
| 58 | + styledKey: StyledStringKey.FONT, | ||
| 59 | + styledValue: new TextStyle({ fontColor: Color.White,fontWeight: 500,fontSize: LengthMetrics.px(vp2px(20)) }) | ||
| 60 | + }]) | ||
| 61 | + | ||
| 62 | + name.appendStyledString(new StyledString(this.customSpan3)) | ||
| 63 | + this.textController.setStyledString(name) | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + | ||
| 67 | + aboutToAppear() { | ||
| 68 | + this.createSpan() | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + build() { | ||
| 72 | + Text(undefined, { controller: this.textController }) | ||
| 73 | + .copyOption(CopyOptions.InApp) | ||
| 74 | + .maxLines(2) | ||
| 75 | + } | ||
| 76 | +} |
| 1 | +import { drawing } from '@kit.ArkGraphics2D'; | ||
| 2 | +import { image } from '@kit.ImageKit'; | ||
| 3 | + | ||
| 4 | +export class GradeSpan extends CustomSpan { | ||
| 5 | + width: number = 160; | ||
| 6 | + word: string = ""; | ||
| 7 | + height: number = 10; | ||
| 8 | + imagePixelMap: image.PixelMap | undefined = undefined; | ||
| 9 | + | ||
| 10 | + | ||
| 11 | + constructor(word: string, width: number, height: number,imagePixelMap: image.PixelMap) { | ||
| 12 | + super(); | ||
| 13 | + this.word = word; | ||
| 14 | + this.width = width; | ||
| 15 | + this.height = height; | ||
| 16 | + this.imagePixelMap = imagePixelMap; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + onMeasure(measureInfo: CustomSpanMeasureInfo): CustomSpanMetrics { | ||
| 20 | + return { width: this.width, height: this.height }; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + onDraw(context: DrawContext, options: CustomSpanDrawInfo) { | ||
| 24 | + let canvas = context.canvas; | ||
| 25 | + | ||
| 26 | + const brush = new drawing.Brush(); | ||
| 27 | + | ||
| 28 | + canvas.attachBrush(brush); | ||
| 29 | + let options2 = new drawing.SamplingOptions(drawing.FilterMode.FILTER_MODE_NEAREST); | ||
| 30 | + if (this.imagePixelMap) { | ||
| 31 | + canvas.drawImage(this.imagePixelMap, options.x , options.lineBottom - vp2px(this.height) - 10, options2); | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + brush.setColor({ alpha: 255, red: 237, green: 40, blue: 0 }); | ||
| 35 | + canvas.attachBrush(brush); | ||
| 36 | + | ||
| 37 | + const font = new drawing.Font(); | ||
| 38 | + font.setSize(vp2px(12)); | ||
| 39 | + const textBlob = drawing.TextBlob.makeFromString(this.word, font, drawing.TextEncoding.TEXT_ENCODING_UTF8); | ||
| 40 | + // canvas.drawTextBlob(textBlob, options.x + 20, options.lineBottom - 15); | ||
| 41 | + canvas.drawTextBlob(textBlob, options.x + vp2px(9), options.lineBottom - vp2px(7.5)); | ||
| 42 | + | ||
| 43 | + canvas.detachBrush(); | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + setWord(word: string) { | ||
| 47 | + this.word = word; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | +} |
| @@ -8,6 +8,7 @@ import MinePageDatasModel from '../model/MinePageDatasModel'; | @@ -8,6 +8,7 @@ import MinePageDatasModel from '../model/MinePageDatasModel'; | ||
| 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; | 8 | import { EmptyComponent } from '../components/view/EmptyComponent'; |
| 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; | 9 | import { CustomTitleUI } from '../components/reusable/CustomTitleUI'; |
| 10 | import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index'; | 10 | import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index'; |
| 11 | +import { UserGradeTextSpan } from '../components/view/UserGradeTextSpan'; | ||
| 11 | 12 | ||
| 12 | const TAG = "MineHomePage" | 13 | const TAG = "MineHomePage" |
| 13 | 14 | ||
| @@ -121,37 +122,17 @@ struct MineHomePage { | @@ -121,37 +122,17 @@ struct MineHomePage { | ||
| 121 | 122 | ||
| 122 | Column() { | 123 | Column() { |
| 123 | Row() { | 124 | Row() { |
| 124 | - Text(`${this.userName}`) | ||
| 125 | - .fontColor($r('app.color.white')) | ||
| 126 | - .maxLines(2) | ||
| 127 | - .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 128 | - .fontSize(20) | ||
| 129 | - .lineHeight(26) | ||
| 130 | - .fontWeight(500) | ||
| 131 | - .constraintSize({maxWidth:180}) | ||
| 132 | - .onClick(()=>{ | ||
| 133 | - let params: editModelParams = { | ||
| 134 | - editContent: this.userName | ||
| 135 | - } | ||
| 136 | - WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage,params) | ||
| 137 | - }) | ||
| 138 | - | ||
| 139 | - if(this.levelId>0){ | ||
| 140 | - Text(`等级${this.levelId}`) | ||
| 141 | - .fontColor($r('app.color.color_ED2800')) | ||
| 142 | - .fontSize(12) | ||
| 143 | - .lineHeight(18) | ||
| 144 | - .fontWeight(500) | ||
| 145 | - .margin({ left: 6 }) | ||
| 146 | - .backgroundImage($r("app.media.my_grade_bg")) | ||
| 147 | - .backgroundImageSize(ImageSize.Cover) | ||
| 148 | - .padding({left: 6,right: 6}) | ||
| 149 | - .height(18) | ||
| 150 | - .borderRadius({topRight:2,bottomRight:2}) | ||
| 151 | - } | ||
| 152 | 125 | ||
| 153 | - Blank() | ||
| 154 | - } | 126 | + UserGradeTextSpan({nameContent:`${this.userName}`,gradeContent:`等级${this.levelId}`,gradeWidth:this.levelId >9 ? 50 : 45}) |
| 127 | + | ||
| 128 | + }.constraintSize({maxWidth:`calc(100% - 16vp - 90vp)`}) | ||
| 129 | + .padding({top:8}) | ||
| 130 | + .onClick(()=>{ | ||
| 131 | + let params: editModelParams = { | ||
| 132 | + editContent: this.userName | ||
| 133 | + } | ||
| 134 | + WDRouterRule.jumpWithPage(WDRouterPage.editUserNikeNamePage,params) | ||
| 135 | + }) | ||
| 155 | 136 | ||
| 156 | Row() { | 137 | Row() { |
| 157 | Row() { | 138 | Row() { |
| @@ -205,9 +205,10 @@ struct OtherNormalUserHomePage { | @@ -205,9 +205,10 @@ struct OtherNormalUserHomePage { | ||
| 205 | .justifyContent(FlexAlign.Center) | 205 | .justifyContent(FlexAlign.Center) |
| 206 | .width('100%') | 206 | .width('100%') |
| 207 | .backgroundColor($r('app.color.white')) | 207 | .backgroundColor($r('app.color.white')) |
| 208 | + | ||
| 209 | + //间隔符 | ||
| 210 | + Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | ||
| 208 | } | 211 | } |
| 209 | - //间隔符 | ||
| 210 | - Divider().width('100%').height('12lpx').color($r('app.color.color_F5F5F5')).strokeWidth('12lpx') | ||
| 211 | 212 | ||
| 212 | //tab 页面 | 213 | //tab 页面 |
| 213 | Stack({ alignContent: Alignment.Top }){ | 214 | Stack({ alignContent: Alignment.Top }){ |
| @@ -367,12 +368,10 @@ struct OtherNormalUserHomePage { | @@ -367,12 +368,10 @@ struct OtherNormalUserHomePage { | ||
| 367 | .lineHeight('38lpx') | 368 | .lineHeight('38lpx') |
| 368 | 369 | ||
| 369 | if(this.currentIndex === index){ | 370 | if(this.currentIndex === index){ |
| 370 | - Divider() | ||
| 371 | - .width('31lpx') | ||
| 372 | - .height('4lpx') | ||
| 373 | - .color('#ED2800') | ||
| 374 | - .strokeWidth('4lpx') | ||
| 375 | - .margin({top:'50lpx'}) | 371 | + Image($r('app.media.icon_channel_active'))//.colorFilter(ColorUtils.getDrawingColorFilter(this.getBothColor(""))) |
| 372 | + .width(16) | ||
| 373 | + .height(2) | ||
| 374 | + .margin({top: 30}) | ||
| 376 | .id("divTag") | 375 | .id("divTag") |
| 377 | } | 376 | } |
| 378 | }.onClick(()=>{ | 377 | }.onClick(()=>{ |
| @@ -46,6 +46,7 @@ export class AudioSuspensionModel { | @@ -46,6 +46,7 @@ export class AudioSuspensionModel { | ||
| 46 | // BackgroundAudioController.sharedController().startContinuousTask() | 46 | // BackgroundAudioController.sharedController().startContinuousTask() |
| 47 | BackgroundAudioController.sharedController().listenPlayEvents() | 47 | BackgroundAudioController.sharedController().listenPlayEvents() |
| 48 | 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 ?? "") |
| 49 | + BackgroundAudioController.sharedController().activateSession() | ||
| 49 | BackgroundAudioController.sharedController().stopUseFeatures() | 50 | BackgroundAudioController.sharedController().stopUseFeatures() |
| 50 | 51 | ||
| 51 | if (this.playerController.get().getUrl() === url) { | 52 | if (this.playerController.get().getUrl() === url) { |
| @@ -6,6 +6,8 @@ export class SearchResultContentItem{ | @@ -6,6 +6,8 @@ export class SearchResultContentItem{ | ||
| 6 | } | 6 | } |
| 7 | 7 | ||
| 8 | export class SearchDescription{ | 8 | export class SearchDescription{ |
| 9 | + introduction: string = '' | ||
| 10 | + zhDescription: string = '' | ||
| 9 | likeEnable: string = "" | 11 | likeEnable: string = "" |
| 10 | previewUri: string = "" | 12 | previewUri: string = "" |
| 11 | firstFrameImageBucket: string = "" | 13 | firstFrameImageBucket: string = "" |
| @@ -151,7 +153,6 @@ export class SearchDescription{ | @@ -151,7 +153,6 @@ export class SearchDescription{ | ||
| 151 | liveEndTime: string = "" | 153 | liveEndTime: string = "" |
| 152 | topicTemplate: string = "" | 154 | topicTemplate: string = "" |
| 153 | barrageEnable: string = "" | 155 | barrageEnable: string = "" |
| 154 | - introduction: string = "" | ||
| 155 | notice: string = "" | 156 | notice: string = "" |
| 156 | shareTitleLiteral: string = "" | 157 | shareTitleLiteral: string = "" |
| 157 | coverHImageUri: string = "" | 158 | coverHImageUri: string = "" |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wddetailplayapi", | 5 | + "name": "wdDetailPlayApi", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wddetailplaylive", | 5 | + "name": "wdDetailPlayLive", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wddetailplayshortvideo", | 5 | + "name": "wdDetailPlayShortVideo", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 1 | { | 1 | { |
| 2 | - "name": "wdhwability", | 2 | + "name": "wdHwAbility", |
| 3 | "version": "1.0.0", | 3 | "version": "1.0.0", |
| 4 | "description": "Please describe the basic information.", | 4 | "description": "Please describe the basic information.", |
| 5 | "main": "Index.ets", | 5 | "main": "Index.ets", |
| @@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
| 7 | "license": "Apache-2.0", | 7 | "license": "Apache-2.0", |
| 8 | "packageType": "InterfaceHar", | 8 | "packageType": "InterfaceHar", |
| 9 | "dependencies": { | 9 | "dependencies": { |
| 10 | - "library": "file:./src/main/ets/getuiPush/GT-HM-1.0.4.har", | 10 | + "GtSDK": "file:./src/main/ets/getuiPush/GT-HM-1.0.4.har", |
| 11 | "neonui":"file:./src/main/ets/voiceRecognizer/neonui.har", | 11 | "neonui":"file:./src/main/ets/voiceRecognizer/neonui.har", |
| 12 | "wdConstant": "file:../../commons/wdConstant", | 12 | "wdConstant": "file:../../commons/wdConstant", |
| 13 | "wdLogin": "file:../../features/wdLogin", | 13 | "wdLogin": "file:../../features/wdLogin", |
| @@ -4,7 +4,7 @@ import PushManager, { | @@ -4,7 +4,7 @@ import PushManager, { | ||
| 4 | GTCmdMessage, GTNotificationMessage, GTTransmitMessage, PushConst, | 4 | GTCmdMessage, GTNotificationMessage, GTTransmitMessage, PushConst, |
| 5 | SetTagCmdMessage, | 5 | SetTagCmdMessage, |
| 6 | Tag, | 6 | Tag, |
| 7 | - UnBindAliasCmdMessage } from 'library'; | 7 | + UnBindAliasCmdMessage } from 'GtSDK'; |
| 8 | import { AppUtils, DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper } from 'wdKit/Index'; | 8 | import { AppUtils, DeviceUtil, EmitterEventId, EmitterUtils, Logger, SPHelper } from 'wdKit/Index'; |
| 9 | import { HostEnum, HostManager, HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; | 9 | import { HostEnum, HostManager, HttpBizUtil, HttpUrlUtils, HttpUtils, ResponseDTO } from 'wdNetwork/Index'; |
| 10 | import { notificationManager } from '@kit.NotificationKit'; | 10 | import { notificationManager } from '@kit.NotificationKit'; |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdlogin", | 5 | + "name": "wdLogin", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| 1 | -import ArrayList from '@ohos.util.ArrayList'; | ||
| 2 | -import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/Index'; | ||
| 3 | -import router from '@ohos.router'; | ||
| 4 | -import { LoginViewModel } from './LoginViewModel'; | ||
| 5 | -import { BreakpointSystem, CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit'; | ||
| 6 | -import { | ||
| 7 | - SpConstants | ||
| 8 | -} from '../../../../../../../commons/wdNetwork/oh_modules/wdConstant/src/main/ets/constants/SpConstants' | ||
| 9 | -import data_preferences from '@ohos.data.preferences'; | ||
| 10 | -import { WDRouterPage, WDRouterRule } from 'wdRouter'; | ||
| 11 | -import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking/Index'; | 1 | +import { Params } from 'wdBean' |
| 2 | +import router from '@ohos.router' | ||
| 3 | +import { LoginViewModel } from './LoginViewModel' | ||
| 4 | +import { BreakpointSystem, CustomToast, DateTimeUtils, Logger, SPHelper, ToastUtils } from 'wdKit' | ||
| 5 | +import { SpConstants } from 'wdConstant' | ||
| 6 | +import { WDRouterPage, WDRouterRule } from 'wdRouter' | ||
| 7 | +import { TrackingPageBrowse, TrackConstants, TrackingButton } from 'wdTracking' | ||
| 12 | 8 | ||
| 13 | const TAG = "SettingPasswordLayout" | 9 | const TAG = "SettingPasswordLayout" |
| 14 | 10 |
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | "license": "Apache-2.0", | 2 | "license": "Apache-2.0", |
| 3 | "devDependencies": {}, | 3 | "devDependencies": {}, |
| 4 | "author": "", | 4 | "author": "", |
| 5 | - "name": "wdplayer", | 5 | + "name": "wdPlayer", |
| 6 | "description": "Please describe the basic information.", | 6 | "description": "Please describe the basic information.", |
| 7 | "main": "Index.ets", | 7 | "main": "Index.ets", |
| 8 | "version": "1.0.0", | 8 | "version": "1.0.0", |
| @@ -53,13 +53,18 @@ export class BackgroundAudioController { | @@ -53,13 +53,18 @@ export class BackgroundAudioController { | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | // 激活接口要在元数据、控制命令注册完成之后再执行 | 55 | // 激活接口要在元数据、控制命令注册完成之后再执行 |
| 56 | - await this.lastSession?.activate(); | 56 | + // await this.lastSession?.activate(); |
| 57 | Logger.debug(TAG, `session create done : sessionId : ${this.lastSession?.sessionId}`); | 57 | Logger.debug(TAG, `session create done : sessionId : ${this.lastSession?.sessionId}`); |
| 58 | 58 | ||
| 59 | this.lastProgress = 0 | 59 | this.lastProgress = 0 |
| 60 | this.hasSetupProgress = false | 60 | this.hasSetupProgress = false |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | + async activateSession() { | ||
| 64 | + await this.lastSession?.activate(); | ||
| 65 | + Logger.debug(TAG, `session activate done : sessionId : ${this.lastSession?.sessionId}`); | ||
| 66 | + } | ||
| 67 | + | ||
| 63 | destorySession() { | 68 | destorySession() { |
| 64 | if (this.lastSession) { | 69 | if (this.lastSession) { |
| 65 | this.lastSession.deactivate(); | 70 | this.lastSession.deactivate(); |
| @@ -74,6 +79,21 @@ export class BackgroundAudioController { | @@ -74,6 +79,21 @@ export class BackgroundAudioController { | ||
| 74 | this.lastItemTitle = title || "" | 79 | this.lastItemTitle = title || "" |
| 75 | this.lastItemMediaImage = mediaImage | 80 | this.lastItemMediaImage = mediaImage |
| 76 | this.lastItemArtist = artist || "" | 81 | this.lastItemArtist = artist || "" |
| 82 | + | ||
| 83 | + let metadata: AVSessionManager.AVMetadata = { | ||
| 84 | + assetId: assetId.length > 0 ? assetId : "fake-asset-id", | ||
| 85 | + title: title.length > 0 ? title : " ", | ||
| 86 | + mediaImage: "https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png" ,//pixelMapImage ?? ("file://" + mediaImage.id), | ||
| 87 | + artist: artist.length > 0 ? artist : "人日日报" | ||
| 88 | + // duration: duration | ||
| 89 | + }; | ||
| 90 | + | ||
| 91 | + try { | ||
| 92 | + await this.lastSession?.setAVMetadata(metadata) | ||
| 93 | + Logger.debug(TAG, `SetAVMetadata successfully`); | ||
| 94 | + } catch (err) { | ||
| 95 | + Logger.error(TAG, `Failed to set AVMetadata. Code: ${err.code}, message: ${err.message}`); | ||
| 96 | + } finally {} | ||
| 77 | } | 97 | } |
| 78 | 98 | ||
| 79 | async setSessionMetaDataWithDuration(assetId: string, title: string, mediaImage: Resource, artist: string, duration: number) { | 99 | async setSessionMetaDataWithDuration(assetId: string, title: string, mediaImage: Resource, artist: string, duration: number) { |
| @@ -20,11 +20,11 @@ export default class DailyNewspaperFormAbility extends FormExtensionAbility { | @@ -20,11 +20,11 @@ export default class DailyNewspaperFormAbility extends FormExtensionAbility { | ||
| 20 | 20 | ||
| 21 | if (want.parameters) { | 21 | if (want.parameters) { |
| 22 | let formId = want.parameters[formInfo.FormParam.IDENTITY_KEY] as string | 22 | let formId = want.parameters[formInfo.FormParam.IDENTITY_KEY] as string |
| 23 | - let isTempCard = want.parameters[formInfo.FormParam.TEMPORARY_KEY] as boolean | ||
| 24 | - if (isTempCard === false) { // 如果为常态卡片,直接进行信息持久化 | 23 | + // let isTempCard = want.parameters[formInfo.FormParam.TEMPORARY_KEY] as boolean |
| 24 | + // if (isTempCard === false) { // 如果为常态卡片,直接进行信息持久化 | ||
| 25 | 25 | ||
| 26 | this.fetchAndRefreshData(formId) | 26 | this.fetchAndRefreshData(formId) |
| 27 | - } | 27 | + // } |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | let obj: FormNewspaperData = {} as FormNewspaperData | 30 | let obj: FormNewspaperData = {} as FormNewspaperData |
| @@ -94,7 +94,8 @@ export struct BottomNavigationComponent { | @@ -94,7 +94,8 @@ export struct BottomNavigationComponent { | ||
| 94 | _currentNavIndex: $currentNavIndex, | 94 | _currentNavIndex: $currentNavIndex, |
| 95 | bottomNavIndex: index, | 95 | bottomNavIndex: index, |
| 96 | autoRefresh: this.autoRefresh, | 96 | autoRefresh: this.autoRefresh, |
| 97 | - navItem: navItem | 97 | + navItem: navItem, |
| 98 | + assignChannel: this.assignChannel | ||
| 98 | }) | 99 | }) |
| 99 | } else { | 100 | } else { |
| 100 | // 其它带顶导的页面,如 新闻、人民号、服务 | 101 | // 其它带顶导的页面,如 新闻、人民号、服务 |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | import { BottomNavDTO, TopNavDTO } from 'wdBean/Index'; | 5 | import { BottomNavDTO, TopNavDTO } from 'wdBean/Index'; |
| 6 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; | 6 | import { VideoChannelDetail } from 'wdDetailPlayShortVideo/Index'; |
| 7 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 7 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 8 | -import { DisplayDirection } from 'wdConstant/Index'; | 8 | +import { DisplayDirection ,BottomNavi} from 'wdConstant/Index'; |
| 9 | import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index'; | 9 | import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index'; |
| 10 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | 10 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; |
| 11 | import { ParamType, Tracking } from 'wdTracking/Index'; | 11 | import { ParamType, Tracking } from 'wdTracking/Index'; |
| @@ -25,6 +25,7 @@ export struct VideoChannelPage { | @@ -25,6 +25,7 @@ export struct VideoChannelPage { | ||
| 25 | private groupId: number = 0 | 25 | private groupId: number = 0 |
| 26 | private swiperController: SwiperController = new SwiperController() | 26 | private swiperController: SwiperController = new SwiperController() |
| 27 | // 自动刷新触发(双击tab自动刷新) | 27 | // 自动刷新触发(双击tab自动刷新) |
| 28 | + @Prop @Watch('setTabbarActive') assignChannel: AssignChannelParam | ||
| 28 | @Prop autoRefresh: number = 0 | 29 | @Prop autoRefresh: number = 0 |
| 29 | @Prop topNavList: TopNavDTO[] | 30 | @Prop topNavList: TopNavDTO[] |
| 30 | @Link _currentNavIndex?: number; | 31 | @Link _currentNavIndex?: number; |
| @@ -59,18 +60,16 @@ export struct VideoChannelPage { | @@ -59,18 +60,16 @@ export struct VideoChannelPage { | ||
| 59 | if (this.currentTopNavSelectedIndex === 0) { | 60 | if (this.currentTopNavSelectedIndex === 0) { |
| 60 | this.handleAudio(this.topNavList[0]) | 61 | this.handleAudio(this.topNavList[0]) |
| 61 | } | 62 | } |
| 63 | + } | ||
| 62 | 64 | ||
| 63 | - EmitterUtils.receiveEvent(EmitterEventId.JUMP_HOME_CHANNEL, (str?: string) => { | ||
| 64 | - // Logger.debug(TAG, 'receiveEvent JUMP_HOME_CHANNEL: ' + str) | ||
| 65 | - if (str) { | ||
| 66 | - // 跳转指定频道场景,传参底导id、频道id | ||
| 67 | - let assignChannel = JSON.parse(str) as AssignChannelParam | ||
| 68 | - let index = this.topNavList.findIndex((item: TopNavDTO, index) => { | ||
| 69 | - return Number(assignChannel.channelId) == item.channelId && Number(assignChannel.pageId) == item.pageId | ||
| 70 | - }) || 0 | ||
| 71 | - this.clickTopNav(index) | ||
| 72 | - } | ||
| 73 | - }) | 65 | + /** |
| 66 | + * 切换顶部导航index | ||
| 67 | + */ | ||
| 68 | + setTabbarActive() { | ||
| 69 | + let index = this.topNavList.findIndex((item: TopNavDTO, index) => { | ||
| 70 | + return Number(this.assignChannel.channelId) == item.channelId && Number(this.assignChannel.pageId) == item.pageId | ||
| 71 | + }) || 0 | ||
| 72 | + this.clickTopNav(index) | ||
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | /** | 75 | /** |
| @@ -336,6 +335,7 @@ export struct VideoChannelPage { | @@ -336,6 +335,7 @@ export struct VideoChannelPage { | ||
| 336 | channelId: item.channelId + '', | 335 | channelId: item.channelId + '', |
| 337 | autoRefresh: this.autoRefresh, | 336 | autoRefresh: this.autoRefresh, |
| 338 | isMourning: this.GrayManage.get().isVideoMourning(`${item.channelId}`), | 337 | isMourning: this.GrayManage.get().isVideoMourning(`${item.channelId}`), |
| 338 | + bottomNavi:BottomNavi.VIDEO | ||
| 339 | }).backgroundColor(Color.White) | 339 | }).backgroundColor(Color.White) |
| 340 | } | 340 | } |
| 341 | 341 |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | -import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'; | 2 | +import { Params } from 'wdBean/Index'; |
| 3 | import { Logger, ToastUtils } from 'wdKit'; | 3 | import { Logger, ToastUtils } from 'wdKit'; |
| 4 | import { CustomTitleUI } from 'wdComponent/src/main/ets/components/reusable/CustomTitleUI'; | 4 | import { CustomTitleUI } from 'wdComponent/src/main/ets/components/reusable/CustomTitleUI'; |
| 5 | import {BusinessError, pasteboard} from '@kit.BasicServicesKit'; | 5 | import {BusinessError, pasteboard} from '@kit.BasicServicesKit'; |
| @@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
| 18 | "abilities": [ | 18 | "abilities": [ |
| 19 | { | 19 | { |
| 20 | "name": "EntryAbility", | 20 | "name": "EntryAbility", |
| 21 | +// "launchType": "singleton", | ||
| 21 | // 这里不能改动,和后台推送有绑定 | 22 | // 这里不能改动,和后台推送有绑定 |
| 22 | "srcEntry": "./ets/entryability/EntryAbility.ets", | 23 | "srcEntry": "./ets/entryability/EntryAbility.ets", |
| 23 | "description": "$string:app_desc", | 24 | "description": "$string:app_desc", |
| @@ -143,11 +144,11 @@ | @@ -143,11 +144,11 @@ | ||
| 143 | }, | 144 | }, |
| 144 | { // 默认的 | 145 | { // 默认的 |
| 145 | "entities": [ | 146 | "entities": [ |
| 146 | - "entity.system.home", | 147 | + "entity.system.home" |
| 147 | ], | 148 | ], |
| 148 | "actions": [ | 149 | "actions": [ |
| 149 | - "action.system.home", | ||
| 150 | - ], | 150 | + "action.system.home" |
| 151 | + ] | ||
| 151 | 152 | ||
| 152 | }, | 153 | }, |
| 153 | { // H5换端 | 154 | { // H5换端 |
| @@ -159,7 +160,7 @@ | @@ -159,7 +160,7 @@ | ||
| 159 | "scheme": "rmrbapp", | 160 | "scheme": "rmrbapp", |
| 160 | "host": "rmrb.app", | 161 | "host": "rmrb.app", |
| 161 | "path": "openwith" | 162 | "path": "openwith" |
| 162 | - }, | 163 | + } |
| 163 | ]}, | 164 | ]}, |
| 164 | { // 推送 | 165 | { // 推送 |
| 165 | "actions": [ | 166 | "actions": [ |
| @@ -173,7 +174,7 @@ | @@ -173,7 +174,7 @@ | ||
| 173 | "path": 'openwith' | 174 | "path": 'openwith' |
| 174 | } | 175 | } |
| 175 | ] | 176 | ] |
| 176 | - }, | 177 | + } |
| 177 | ] | 178 | ] |
| 178 | } | 179 | } |
| 179 | ], | 180 | ], |
| @@ -216,7 +217,7 @@ | @@ -216,7 +217,7 @@ | ||
| 216 | }, | 217 | }, |
| 217 | { | 218 | { |
| 218 | "name": "ohos.permission.INTERNET" | 219 | "name": "ohos.permission.INTERNET" |
| 219 | - }, | 220 | + } |
| 220 | ], | 221 | ], |
| 221 | "extensionAbilities": [ | 222 | "extensionAbilities": [ |
| 222 | { | 223 | { |
| @@ -230,7 +231,7 @@ | @@ -230,7 +231,7 @@ | ||
| 230 | "name": "ohos.extension.form", | 231 | "name": "ohos.extension.form", |
| 231 | "resource": "$profile:form_config" | 232 | "resource": "$profile:form_config" |
| 232 | } | 233 | } |
| 233 | - ], | 234 | + ] |
| 234 | 235 | ||
| 235 | } | 236 | } |
| 236 | ] | 237 | ] |
-
Please register or login to post a comment