Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (25 commits) fix(聚合页):上拉加载更多 fix: 16784 【穿越测试】大图卡稿件,标题超过2行,应省略号展示。 fix: 16784 【穿越测试】大图卡稿件,标题超过2行,应省略号展示。 fix(聚合页):增加下拉刷新功能 fix:点赞数 fix: 16977 功能缺陷--进入人民号-横滑卡少个更多按钮,看图 fix: 16914 UI还原问题-频道中的文章标题,文章正文,字体大小、行距与安卓不一致 fix: 16618 人民号主题卡字体样式鸿蒙与安卓不一致 web组件支持长内容 标题弹框渐变背景,直播评论返回回调 desc:升级API 12 fix:bug[16997] 搜索结果页-稿件发布日期展示错误 fix: 直播预约卡预约功能debug fix: 直播预约卡预约功能debug fix:bug[16993] 搜索页面-没有配置人搜索不该展示热门搜索标识 fix:16696 篇头跳转缺少交互 直播评论接入 底导双击刷新改完单击刷新 fix: 直播预约卡预约功能 fix:bug[16954] 定位权限弹窗未能依次弹出提示 ...
Showing
49 changed files
with
553 additions
and
146 deletions
| @@ -34,8 +34,8 @@ | @@ -34,8 +34,8 @@ | ||
| 34 | { | 34 | { |
| 35 | "name": "default", | 35 | "name": "default", |
| 36 | "signingConfig": "default", | 36 | "signingConfig": "default", |
| 37 | - "compileSdkVersion": "4.1.0(11)", | ||
| 38 | - "compatibleSdkVersion": "4.1.0(11)", | 37 | + "compileSdkVersion": "5.0.0(12)", |
| 38 | + "compatibleSdkVersion": "5.0.0(12)", | ||
| 39 | "runtimeOS": "HarmonyOS", | 39 | "runtimeOS": "HarmonyOS", |
| 40 | } | 40 | } |
| 41 | ], | 41 | ], |
| @@ -155,9 +155,15 @@ function buildErrorMsg(httpStatus: number): string { | @@ -155,9 +155,15 @@ function buildErrorMsg(httpStatus: number): string { | ||
| 155 | case HttpStatusCode.HttpVersionNotSupported: | 155 | case HttpStatusCode.HttpVersionNotSupported: |
| 156 | message = "HTTP版本不受支持(505)"; | 156 | message = "HTTP版本不受支持(505)"; |
| 157 | break; | 157 | break; |
| 158 | - default: | 158 | + default:{ |
| 159 | // 网络连接故障 | 159 | // 网络连接故障 |
| 160 | + if(httpStatus != undefined){ | ||
| 160 | message = `连接出错(${httpStatus})!`; | 161 | message = `连接出错(${httpStatus})!`; |
| 162 | + }else{ | ||
| 163 | + message = `连接出错!`; | ||
| 164 | + } | ||
| 165 | + } | ||
| 166 | + | ||
| 161 | } | 167 | } |
| 162 | return message; | 168 | return message; |
| 163 | } | 169 | } |
| @@ -244,7 +244,6 @@ export class HttpUrlUtils { | @@ -244,7 +244,6 @@ export class HttpUrlUtils { | ||
| 244 | * first_load&refreshTime=1710829610144&pageId=28927&channelStrategy=2&groupId=40621& | 244 | * first_load&refreshTime=1710829610144&pageId=28927&channelStrategy=2&groupId=40621& |
| 245 | * pageSize=20&pageNum=1&topicId=10000009445 | 245 | * pageSize=20&pageNum=1&topicId=10000009445 |
| 246 | * */ | 246 | * */ |
| 247 | - static readonly MORNING_EVENING_PAGE_INFO_PATH: string = "/api/rmrb-bff-display-zh/display/zh/c/pageInfo"; | ||
| 248 | /** | 247 | /** |
| 249 | * 直播回顾 | 248 | * 直播回顾 |
| 250 | * */ | 249 | * */ |
| @@ -38,6 +38,17 @@ class AppLoginAuthInfo { | @@ -38,6 +38,17 @@ class AppLoginAuthInfo { | ||
| 38 | Authorization: string = '' | 38 | Authorization: string = '' |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | +interface IDataJson { | ||
| 42 | + jumpType:number | ||
| 43 | + jumpUrl:string | ||
| 44 | + newsId:string | ||
| 45 | + newsObjectLevel:string | ||
| 46 | + newsObjectType:number | ||
| 47 | + newsRelId:string | ||
| 48 | + newsTitle:string | ||
| 49 | + pageId:string | ||
| 50 | +} | ||
| 51 | + | ||
| 41 | /** | 52 | /** |
| 42 | * h5调用native代码 | 53 | * h5调用native代码 |
| 43 | * @param data | 54 | * @param data |
| @@ -121,6 +132,16 @@ function handleJsCallReceiveH5Data(data: Message) { | @@ -121,6 +132,16 @@ function handleJsCallReceiveH5Data(data: Message) { | ||
| 121 | case '5': | 132 | case '5': |
| 122 | ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}')) | 133 | ProcessUtils.processPage(JSON.parse(data?.data?.dataJson || '{}')) |
| 123 | break; | 134 | break; |
| 135 | + case '6': | ||
| 136 | + let contentJson: IDataJson = JSON.parse(data?.data?.dataJson || '{}') | ||
| 137 | + let content: ContentDTO = { | ||
| 138 | + objectId: contentJson?.newsId, | ||
| 139 | + relId: contentJson?.newsRelId, | ||
| 140 | + pageId: contentJson?.pageId, | ||
| 141 | + objectType: String(contentJson?.newsObjectType) | ||
| 142 | + } as ContentDTO | ||
| 143 | + ProcessUtils.processPage(content) | ||
| 144 | + break; | ||
| 124 | default: | 145 | default: |
| 125 | break; | 146 | break; |
| 126 | } | 147 | } |
| @@ -134,7 +155,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) { | @@ -134,7 +155,8 @@ function handleJsCallAppInnerLinkMethod(data: Message) { | ||
| 134 | relId: urlParams.get('relId') || '', | 155 | relId: urlParams.get('relId') || '', |
| 135 | relType: urlParams.get('relType') || '', | 156 | relType: urlParams.get('relType') || '', |
| 136 | pageId: urlParams.get('pageId') || '', | 157 | pageId: urlParams.get('pageId') || '', |
| 137 | - objectType: '' | 158 | + objectType: '', |
| 159 | + linkUrl: urlParams.get('url') || '' | ||
| 138 | } as ContentDTO | 160 | } as ContentDTO |
| 139 | if (urlParams.get('skipType') === '1') { | 161 | if (urlParams.get('skipType') === '1') { |
| 140 | 162 |
| @@ -48,8 +48,8 @@ export struct WdWebLocalComponent { | @@ -48,8 +48,8 @@ export struct WdWebLocalComponent { | ||
| 48 | 48 | ||
| 49 | Row() { | 49 | Row() { |
| 50 | RelativeContainer() { | 50 | RelativeContainer() { |
| 51 | - // Web({ src: this.webResource, controller: this.webviewControl, renderMode: RenderMode.SYNC_RENDER }) | ||
| 52 | - Web({ src: this.webResource, controller: this.webviewControl}) | 51 | + Web({ src: this.webResource, controller: this.webviewControl, renderMode: RenderMode.SYNC_RENDER }) |
| 52 | + // Web({ src: this.webResource, controller: this.webviewControl}) | ||
| 53 | .domStorageAccess(true) | 53 | .domStorageAccess(true) |
| 54 | .databaseAccess(true) | 54 | .databaseAccess(true) |
| 55 | .javaScriptAccess(true) | 55 | .javaScriptAccess(true) |
| @@ -57,9 +57,9 @@ export struct WdWebLocalComponent { | @@ -57,9 +57,9 @@ export struct WdWebLocalComponent { | ||
| 57 | .mixedMode(MixedMode.All) | 57 | .mixedMode(MixedMode.All) |
| 58 | .onlineImageAccess(true) | 58 | .onlineImageAccess(true) |
| 59 | .enableNativeEmbedMode(true) | 59 | .enableNativeEmbedMode(true) |
| 60 | - // .layoutMode(WebLayoutMode.FIT_CONTENT) | 60 | + .layoutMode(WebLayoutMode.FIT_CONTENT) |
| 61 | // .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST }) | 61 | // .nestedScroll({ scrollForward: NestedScrollMode.SELF_FIRST, scrollBackward: NestedScrollMode.PARENT_FIRST }) |
| 62 | - .height(this.webHeight) | 62 | + // .height(this.webHeight) |
| 63 | .onPageBegin((event) => { | 63 | .onPageBegin((event) => { |
| 64 | this.onPageBegin(event?.url); | 64 | this.onPageBegin(event?.url); |
| 65 | }) | 65 | }) |
| 1 | import { CompAdvMatInfoBean } from '../adv/CompAdvInfoBean'; | 1 | import { CompAdvMatInfoBean } from '../adv/CompAdvInfoBean'; |
| 2 | import { AudioDTO } from '../content/AudioDTO'; | 2 | import { AudioDTO } from '../content/AudioDTO'; |
| 3 | import { ContentDTO } from '../content/ContentDTO'; | 3 | import { ContentDTO } from '../content/ContentDTO'; |
| 4 | +import { BaseDTO } from './BaseDTO'; | ||
| 4 | 5 | ||
| 5 | -export interface CompDTO { | 6 | +export interface CompDTO extends BaseDTO{ |
| 6 | backgroundColor: string; | 7 | backgroundColor: string; |
| 7 | backgroundImgUrl: string; | 8 | backgroundImgUrl: string; |
| 8 | cityCode: string; | 9 | cityCode: string; |
| @@ -6,8 +6,9 @@ import { slideShows } from '../morningevening/slideShows'; | @@ -6,8 +6,9 @@ import { slideShows } from '../morningevening/slideShows'; | ||
| 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; | 6 | import { VoiceInfoDTO } from '../detail/VoiceInfoDTO'; |
| 7 | import { RmhInfoDTO } from '../detail/RmhInfoDTO'; | 7 | import { RmhInfoDTO } from '../detail/RmhInfoDTO'; |
| 8 | import { commentInfo } from './commentInfo'; | 8 | import { commentInfo } from './commentInfo'; |
| 9 | +import { BaseDTO } from '../component/BaseDTO'; | ||
| 9 | 10 | ||
| 10 | -export interface ContentDTO { | 11 | +export interface ContentDTO extends BaseDTO { |
| 11 | appStyle: string; | 12 | appStyle: string; |
| 12 | cityCode: string; | 13 | cityCode: string; |
| 13 | coverSize: string; | 14 | coverSize: string; |
| @@ -18,7 +18,8 @@ | @@ -18,7 +18,8 @@ | ||
| 18 | "wdRouter": "file:../../commons/wdRouter", | 18 | "wdRouter": "file:../../commons/wdRouter", |
| 19 | "wdNetwork": "file:../../commons/wdNetwork", | 19 | "wdNetwork": "file:../../commons/wdNetwork", |
| 20 | "wdJsBridge": "file:../../commons/wdJsBridge", | 20 | "wdJsBridge": "file:../../commons/wdJsBridge", |
| 21 | - "wdDetailPlayApi":"file:../../features/wdDetailPlayApi", | ||
| 22 | - "wdHwAbility": "file:../../features/wdHwAbility" | 21 | + "wdDetailPlayApi": "file:../../features/wdDetailPlayApi", |
| 22 | + "wdHwAbility": "file:../../features/wdHwAbility", | ||
| 23 | + "wdShare": "file:../../features/wdShare" | ||
| 23 | } | 24 | } |
| 24 | } | 25 | } |
| @@ -50,7 +50,7 @@ export struct ImageAndTextPageComponent { | @@ -50,7 +50,7 @@ export struct ImageAndTextPageComponent { | ||
| 50 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] | 50 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] |
| 51 | @State isNetConnected: boolean = true | 51 | @State isNetConnected: boolean = true |
| 52 | @State info: Area | null = null | 52 | @State info: Area | null = null |
| 53 | - | 53 | + @State likeNum: number = 0 |
| 54 | build() { | 54 | build() { |
| 55 | Column() { | 55 | Column() { |
| 56 | // 发布时间 | 56 | // 发布时间 |
| @@ -105,13 +105,13 @@ export struct ImageAndTextPageComponent { | @@ -105,13 +105,13 @@ export struct ImageAndTextPageComponent { | ||
| 105 | $r('app.media.icon_candle'))) | 105 | $r('app.media.icon_candle'))) |
| 106 | .width(24) | 106 | .width(24) |
| 107 | .height(24) | 107 | .height(24) |
| 108 | - .margin({ right: 5 }) | ||
| 109 | } | 108 | } |
| 110 | - if (this.interactData?.likeNum > 0) { | ||
| 111 | - Text(NumberFormatterUtils.formatNumberWithWan(this.interactData?.likeNum)) | 109 | + if (this.likeNum > 0) { |
| 110 | + Text(NumberFormatterUtils.formatNumberWithWan(this.likeNum)) | ||
| 112 | .fontSize(16) | 111 | .fontSize(16) |
| 113 | .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') | 112 | .fontColor(this.newsStatusOfUser?.likeStatus === '1' ? '#ED2800' : '#999999') |
| 114 | .fontWeight(500) | 113 | .fontWeight(500) |
| 114 | + .margin({ left: 5 }) | ||
| 115 | } | 115 | } |
| 116 | } | 116 | } |
| 117 | .width(154) | 117 | .width(154) |
| @@ -303,7 +303,7 @@ export struct ImageAndTextPageComponent { | @@ -303,7 +303,7 @@ export struct ImageAndTextPageComponent { | ||
| 303 | } | 303 | } |
| 304 | PageRepository.getContentInteract(params).then(res => { | 304 | PageRepository.getContentInteract(params).then(res => { |
| 305 | if (res.data) { | 305 | if (res.data) { |
| 306 | - this.interactData =res.data[0] | 306 | + this.likeNum = Number(res.data[0]?.likeNum) || 0 |
| 307 | } | 307 | } |
| 308 | }) | 308 | }) |
| 309 | } | 309 | } |
| @@ -211,12 +211,13 @@ export struct MorningEveningPaperComponent { | @@ -211,12 +211,13 @@ export struct MorningEveningPaperComponent { | ||
| 211 | } | 211 | } |
| 212 | .height('100%') | 212 | .height('100%') |
| 213 | 213 | ||
| 214 | - PaperTitleComponent().margin({ | ||
| 215 | - top: this.topSafeHeight | ||
| 216 | - }) | 214 | + PaperTitleComponent() |
| 217 | } | 215 | } |
| 218 | .width('100%') | 216 | .width('100%') |
| 219 | .height('100%') | 217 | .height('100%') |
| 218 | + .padding({ | ||
| 219 | + top: this.topSafeHeight | ||
| 220 | + }) | ||
| 220 | // .backgroundColor(Color.Black) | 221 | // .backgroundColor(Color.Black) |
| 221 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) | 222 | // .backgroundColor(this.pageInfoBean?.backgroundColor ?? Color.Black) |
| 222 | .backgroundColor(this.mixedBgColor ?? Color.Black) | 223 | .backgroundColor(this.mixedBgColor ?? Color.Black) |
| @@ -47,8 +47,10 @@ export struct MultiPictureDetailPageComponent { | @@ -47,8 +47,10 @@ export struct MultiPictureDetailPageComponent { | ||
| 47 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 47 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 48 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] | 48 | @State operationButtonList: string[] = ['comment', 'like', 'collect', 'share'] |
| 49 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; | 49 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number; |
| 50 | + @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number; | ||
| 50 | @State windowHeight: number = AppStorage.get<number>('windowHeight') as number; | 51 | @State windowHeight: number = AppStorage.get<number>('windowHeight') as number; |
| 51 | @State currentOffset:number = 0 | 52 | @State currentOffset:number = 0 |
| 53 | + @State duration:number = 0 | ||
| 52 | 54 | ||
| 53 | //watch监听页码回调 | 55 | //watch监听页码回调 |
| 54 | onCurrentPageNumUpdated(): void { | 56 | onCurrentPageNumUpdated(): void { |
| @@ -81,6 +83,7 @@ export struct MultiPictureDetailPageComponent { | @@ -81,6 +83,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 81 | } | 83 | } |
| 82 | } | 84 | } |
| 83 | 85 | ||
| 86 | + | ||
| 84 | aboutToDisappear() { | 87 | aboutToDisappear() { |
| 85 | 88 | ||
| 86 | } | 89 | } |
| @@ -98,6 +101,7 @@ export struct MultiPictureDetailPageComponent { | @@ -98,6 +101,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 98 | @Builder | 101 | @Builder |
| 99 | init() { | 102 | init() { |
| 100 | if (this.contentDetailData.rmhPlatform == 1) { | 103 | if (this.contentDetailData.rmhPlatform == 1) { |
| 104 | + if(!this.showDownload) { | ||
| 101 | Row() { | 105 | Row() { |
| 102 | Row({ space: 8 }) { | 106 | Row({ space: 8 }) { |
| 103 | if (this.getImgUrl()){ | 107 | if (this.getImgUrl()){ |
| @@ -221,7 +225,11 @@ export struct MultiPictureDetailPageComponent { | @@ -221,7 +225,11 @@ export struct MultiPictureDetailPageComponent { | ||
| 221 | middle: { anchor: "__container__", align: HorizontalAlign.Center } | 225 | middle: { anchor: "__container__", align: HorizontalAlign.Center } |
| 222 | }) | 226 | }) |
| 223 | .id('e_attention') | 227 | .id('e_attention') |
| 224 | - .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | 228 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| 229 | + TransitionEffect.translate({ x: 0, y: `-${this.topSafeHeight + 12}px` }) | ||
| 230 | + )) | ||
| 231 | + } | ||
| 232 | + | ||
| 225 | } | 233 | } |
| 226 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { | 234 | if (this.contentDetailData?.photoList && this.contentDetailData?.photoList?.length > 0) { |
| 227 | Swiper(this.swiperController) { | 235 | Swiper(this.swiperController) { |
| @@ -241,6 +249,9 @@ export struct MultiPictureDetailPageComponent { | @@ -241,6 +249,9 @@ export struct MultiPictureDetailPageComponent { | ||
| 241 | this.currentOffset = Math.abs(extraInfo.currentOffset) | 249 | this.currentOffset = Math.abs(extraInfo.currentOffset) |
| 242 | }) | 250 | }) |
| 243 | .onTouch((event: TouchEvent) => { | 251 | .onTouch((event: TouchEvent) => { |
| 252 | + if(this.duration === 0) { | ||
| 253 | + this.duration = 500 | ||
| 254 | + } | ||
| 244 | if(event.type === 1) { | 255 | if(event.type === 1) { |
| 245 | // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { | 256 | // if(this.currentOffset > px2vp((this.windowHeight - item.height)/2 - 100)) { |
| 246 | if(this.currentOffset > 160) { | 257 | if(this.currentOffset > 160) { |
| @@ -285,6 +296,7 @@ export struct MultiPictureDetailPageComponent { | @@ -285,6 +296,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 285 | }) | 296 | }) |
| 286 | } | 297 | } |
| 287 | Column(){ | 298 | Column(){ |
| 299 | + if(!this.showDownload) { | ||
| 288 | Column(){ | 300 | Column(){ |
| 289 | Row() { | 301 | Row() { |
| 290 | Scroll(this.scroller) { | 302 | Scroll(this.scroller) { |
| @@ -354,7 +366,11 @@ export struct MultiPictureDetailPageComponent { | @@ -354,7 +366,11 @@ export struct MultiPictureDetailPageComponent { | ||
| 354 | operationButtonList: this.operationButtonList, | 366 | operationButtonList: this.operationButtonList, |
| 355 | }) | 367 | }) |
| 356 | } | 368 | } |
| 357 | - .visibility(!this.showDownload ? Visibility.Visible : Visibility.None) | 369 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| 370 | + TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` }) | ||
| 371 | + )) | ||
| 372 | + } | ||
| 373 | + if(this.showDownload) { | ||
| 358 | Column(){ | 374 | Column(){ |
| 359 | Row() { | 375 | Row() { |
| 360 | Flex({ | 376 | Flex({ |
| @@ -391,7 +407,10 @@ export struct MultiPictureDetailPageComponent { | @@ -391,7 +407,10 @@ export struct MultiPictureDetailPageComponent { | ||
| 391 | } | 407 | } |
| 392 | .width('100%') | 408 | .width('100%') |
| 393 | } | 409 | } |
| 394 | - .visibility(this.showDownload ? Visibility.Visible : Visibility.None) | 410 | + .transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine( |
| 411 | + TransitionEffect.translate({ x: 0, y: `${this.bottomSafeHeight}px` }) | ||
| 412 | + )) | ||
| 413 | + } | ||
| 395 | } | 414 | } |
| 396 | .zIndex(10) | 415 | .zIndex(10) |
| 397 | .id('e_swiper_bottom') | 416 | .id('e_swiper_bottom') |
| @@ -53,7 +53,7 @@ export struct CardAdvBottom { | @@ -53,7 +53,7 @@ export struct CardAdvBottom { | ||
| 53 | let a = this.compDTO; | 53 | let a = this.compDTO; |
| 54 | let currentIndex = -1 | 54 | let currentIndex = -1 |
| 55 | for (let i = 0; i < this.pageModel.compList.size(); i++) { | 55 | for (let i = 0; i < this.pageModel.compList.size(); i++) { |
| 56 | - let b = this.pageModel.compList.getData(i) | 56 | + let b = this.pageModel.compList.getData(i) as CompDTO |
| 57 | if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { | 57 | if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { |
| 58 | currentIndex = i | 58 | currentIndex = i |
| 59 | break; | 59 | break; |
| @@ -65,7 +65,7 @@ export struct CardAdvTop { | @@ -65,7 +65,7 @@ export struct CardAdvTop { | ||
| 65 | let a = this.compDTO; | 65 | let a = this.compDTO; |
| 66 | let currentIndex = -1 | 66 | let currentIndex = -1 |
| 67 | for (let i = 0; i < this.pageModel.compList.size(); i++) { | 67 | for (let i = 0; i < this.pageModel.compList.size(); i++) { |
| 68 | - let b = this.pageModel.compList.getData(i) | 68 | + let b = this.pageModel.compList.getData(i) as CompDTO |
| 69 | if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { | 69 | if (a.compStyle === b.compStyle && a.matInfo === b.matInfo) { |
| 70 | currentIndex = i | 70 | currentIndex = i |
| 71 | break; | 71 | break; |
| @@ -59,6 +59,7 @@ export struct Card20Component { | @@ -59,6 +59,7 @@ export struct Card20Component { | ||
| 59 | .width(CommonConstants.FULL_WIDTH) | 59 | .width(CommonConstants.FULL_WIDTH) |
| 60 | .textOverflowStyle(2) | 60 | .textOverflowStyle(2) |
| 61 | .margin({ bottom: 8 }) | 61 | .margin({ bottom: 8 }) |
| 62 | + .lineHeight(20) | ||
| 62 | } | 63 | } |
| 63 | if (this.contentDTO.fullColumnImgUrls[0]) { | 64 | if (this.contentDTO.fullColumnImgUrls[0]) { |
| 64 | createImg({ contentDTO: this.contentDTO }) | 65 | createImg({ contentDTO: this.contentDTO }) |
| @@ -38,7 +38,7 @@ export struct Card2Component { | @@ -38,7 +38,7 @@ export struct Card2Component { | ||
| 38 | Text(this.contentDTO.newsTitle) | 38 | Text(this.contentDTO.newsTitle) |
| 39 | .fontSize($r('app.float.font_size_17')) | 39 | .fontSize($r('app.float.font_size_17')) |
| 40 | .fontColor($r('app.color.color_222222')) | 40 | .fontColor($r('app.color.color_222222')) |
| 41 | - .maxLines(3) | 41 | + .maxLines(2) |
| 42 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | 42 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 |
| 43 | .align(Alignment.Start) | 43 | .align(Alignment.Start) |
| 44 | //大图 | 44 | //大图 |
| @@ -57,7 +57,7 @@ export struct ZhSingleColumn04 { | @@ -57,7 +57,7 @@ export struct ZhSingleColumn04 { | ||
| 57 | .width(12) | 57 | .width(12) |
| 58 | .margin({ left: 12, right: 8 }) | 58 | .margin({ left: 12, right: 8 }) |
| 59 | Text(item.newsTitle) | 59 | Text(item.newsTitle) |
| 60 | - .fontSizeColorWeight($r('app.float.font_size_12'), $r('app.color.color_222222'), 400) | 60 | + .fontSizeColorWeight($r('app.float.font_size_17'), $r('app.color.color_222222'), 400) |
| 61 | .maxLines(1) | 61 | .maxLines(1) |
| 62 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 62 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 63 | .layoutWeight(1) | 63 | .layoutWeight(1) |
| @@ -67,19 +67,19 @@ export struct ZhSingleColumn04 { | @@ -67,19 +67,19 @@ export struct ZhSingleColumn04 { | ||
| 67 | .borderRadius(4) | 67 | .borderRadius(4) |
| 68 | .fontSizeColorWeight($r('app.float.vp_12'), '#F07E46', 500) | 68 | .fontSizeColorWeight($r('app.float.vp_12'), '#F07E46', 500) |
| 69 | .backgroundColor('rgba(240, 126, 70, 0.2)') | 69 | .backgroundColor('rgba(240, 126, 70, 0.2)') |
| 70 | - .margin({ right: 18 }) | 70 | + .margin({ right: 21 }) |
| 71 | } else if (item.tagWord === 2) { | 71 | } else if (item.tagWord === 2) { |
| 72 | Text('新') | 72 | Text('新') |
| 73 | .padding(3) | 73 | .padding(3) |
| 74 | .borderRadius(4) | 74 | .borderRadius(4) |
| 75 | .fontSizeColorWeight($r('app.float.vp_12'), '#468DF0', 500) | 75 | .fontSizeColorWeight($r('app.float.vp_12'), '#468DF0', 500) |
| 76 | .backgroundColor('rgba(70, 141, 240, 0.2)') | 76 | .backgroundColor('rgba(70, 141, 240, 0.2)') |
| 77 | - .margin({ right: 18 }) | 77 | + .margin({ right: 21 }) |
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | .width(CommonConstants.FULL_WIDTH) | 80 | .width(CommonConstants.FULL_WIDTH) |
| 81 | .height(32) | 81 | .height(32) |
| 82 | - .margin({ bottom: 4 }) | 82 | + .margin({ bottom: 8 }) |
| 83 | .backgroundImage($r('app.media.rmh_theme_bg')) | 83 | .backgroundImage($r('app.media.rmh_theme_bg')) |
| 84 | .backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH }) | 84 | .backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH }) |
| 85 | .onClick(() => { | 85 | .onClick(() => { |
| @@ -5,6 +5,8 @@ import { PageRepository } from '../../repository/PageRepository'; | @@ -5,6 +5,8 @@ import { PageRepository } from '../../repository/PageRepository'; | ||
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import { HttpUtils } from 'wdNetwork/Index'; | 6 | import { HttpUtils } from 'wdNetwork/Index'; |
| 7 | import { DateTimeUtils } from 'wdKit'; | 7 | import { DateTimeUtils } from 'wdKit'; |
| 8 | +import { LiveModel } from '../../viewmodel/LiveModel' | ||
| 9 | +import { Logger, ToastUtils } from 'wdKit'; | ||
| 8 | 10 | ||
| 9 | /** | 11 | /** |
| 10 | * 直播预约卡 | 12 | * 直播预约卡 |
| @@ -12,13 +14,62 @@ import { DateTimeUtils } from 'wdKit'; | @@ -12,13 +14,62 @@ import { DateTimeUtils } from 'wdKit'; | ||
| 12 | */ | 14 | */ |
| 13 | const TAG = 'Zh_Single_Row-03' | 15 | const TAG = 'Zh_Single_Row-03' |
| 14 | 16 | ||
| 17 | +interface reserveItem { | ||
| 18 | + liveId: number, | ||
| 19 | + relationId: string, | ||
| 20 | + subscribe: boolean | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +interface reserveReqItem { | ||
| 24 | + liveId: string, | ||
| 25 | + relationId: string, | ||
| 26 | +} | ||
| 27 | + | ||
| 15 | @Entry | 28 | @Entry |
| 16 | @Component | 29 | @Component |
| 17 | export struct ZhSingleRow03 { | 30 | export struct ZhSingleRow03 { |
| 18 | @State compDTO: CompDTO = {} as CompDTO | 31 | @State compDTO: CompDTO = {} as CompDTO |
| 19 | @State isEndEdge: boolean = false; | 32 | @State isEndEdge: boolean = false; |
| 33 | + // @State reserveStatus: reserveItem[] = [] | ||
| 34 | + @State reservedIds: string[] = []; | ||
| 20 | scroller: Scroller = new Scroller() | 35 | scroller: Scroller = new Scroller() |
| 21 | 36 | ||
| 37 | + aboutToAppear(): void { | ||
| 38 | + this.getReserveState(); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + // 请求所有预约状态 | ||
| 42 | + async getReserveState() { | ||
| 43 | + const reserveBean: reserveReqItem[] = this.compDTO.operDataList.map((item: ContentDTO) => { | ||
| 44 | + const reqItem: reserveReqItem = { | ||
| 45 | + liveId: item.objectId, | ||
| 46 | + relationId: item.relId | ||
| 47 | + } | ||
| 48 | + return reqItem; | ||
| 49 | + }) | ||
| 50 | + const res = await LiveModel.getAppointmentStatus(reserveBean); | ||
| 51 | + // this.reserveStatus = res; | ||
| 52 | + res.map((item: reserveItem) => { | ||
| 53 | + if (item.subscribe) { | ||
| 54 | + this.reservedIds.push(item.liveId.toString()) | ||
| 55 | + } | ||
| 56 | + }) | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + // 判断是否预约 | ||
| 60 | + isReserved(liveId: number) { | ||
| 61 | + return this.reservedIds.includes(liveId.toString()) | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + // 预约/取消预约 | ||
| 65 | + async bookAndCancel(relationId: string, liveId: string, isSubscribe: boolean) { | ||
| 66 | + const res = await LiveModel.liveAppointment(relationId.toString(), liveId.toString(), isSubscribe); | ||
| 67 | + if (res.code == 0) { | ||
| 68 | + ToastUtils.shortToast(isSubscribe ? '预约成功' : '取消预约成功') | ||
| 69 | + this.getReserveState(); | ||
| 70 | + } | ||
| 71 | + } | ||
| 72 | + | ||
| 22 | format(timeNum: number) { | 73 | format(timeNum: number) { |
| 23 | const todayDate = new Date().setHours(0,0,0,0) | 74 | const todayDate = new Date().setHours(0,0,0,0) |
| 24 | const parseDate = new Date(timeNum).setHours(0,0,0,0); | 75 | const parseDate = new Date(timeNum).setHours(0,0,0,0); |
| @@ -44,6 +95,37 @@ export struct ZhSingleRow03 { | @@ -44,6 +95,37 @@ export struct ZhSingleRow03 { | ||
| 44 | Scroll(this.scroller){ | 95 | Scroll(this.scroller){ |
| 45 | Row() { | 96 | Row() { |
| 46 | ForEach(this.compDTO.operDataList, (item: ContentDTO) => { | 97 | ForEach(this.compDTO.operDataList, (item: ContentDTO) => { |
| 98 | + this.ItemCard(item) | ||
| 99 | + }) | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + .scrollable(ScrollDirection.Horizontal) | ||
| 103 | + .scrollBar(BarState.Off) | ||
| 104 | + .onScrollEdge((side: Edge) => { | ||
| 105 | + if (side === Edge.End) { | ||
| 106 | + this.isEndEdge = true; | ||
| 107 | + } | ||
| 108 | + }) | ||
| 109 | + .onScrollStop(() => { | ||
| 110 | + if (this.isEndEdge) { | ||
| 111 | + this.jumpToMore(); | ||
| 112 | + } | ||
| 113 | + }) | ||
| 114 | + .onScroll((xOffset: number, yOffset: number) => { | ||
| 115 | + this.isEndEdge = false; | ||
| 116 | + }) | ||
| 117 | + } | ||
| 118 | + .padding({ | ||
| 119 | + left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 120 | + right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 121 | + top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 122 | + bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 123 | + }) | ||
| 124 | + .backgroundColor($r('app.color.white')) | ||
| 125 | + } | ||
| 126 | + | ||
| 127 | + @Builder | ||
| 128 | + ItemCard(item: ContentDTO) { | ||
| 47 | Column() { | 129 | Column() { |
| 48 | Row() { | 130 | Row() { |
| 49 | Image(item.coverUrl) | 131 | Image(item.coverUrl) |
| @@ -80,14 +162,18 @@ export struct ZhSingleRow03 { | @@ -80,14 +162,18 @@ export struct ZhSingleRow03 { | ||
| 80 | } | 162 | } |
| 81 | 163 | ||
| 82 | Row() { | 164 | Row() { |
| 83 | - Text('预约') | 165 | + Text(this.isReserved(Number(item.objectId)) ? '已预约' : '预约') |
| 84 | .width(48) | 166 | .width(48) |
| 85 | .height(24) | 167 | .height(24) |
| 86 | - .backgroundColor(0xED2800) | ||
| 87 | - .fontColor(0xffffff) | 168 | + .backgroundColor(this.isReserved(Number(item.objectId)) ? 0xffffff : 0xED2800) |
| 169 | + .fontColor(this.isReserved(Number(item.objectId)) ? 0xC8C8C8 : 0xffffff) | ||
| 88 | .fontSize(12) | 170 | .fontSize(12) |
| 89 | .textAlign(TextAlign.Center) | 171 | .textAlign(TextAlign.Center) |
| 90 | .borderRadius(3) | 172 | .borderRadius(3) |
| 173 | + .onClick(() => { | ||
| 174 | + this.bookAndCancel(item.relId, item.objectId, !this.isReserved(Number(item.objectId))) | ||
| 175 | + }) | ||
| 176 | + | ||
| 91 | } | 177 | } |
| 92 | .margin({top: -5}) | 178 | .margin({top: -5}) |
| 93 | } | 179 | } |
| @@ -102,34 +188,9 @@ export struct ZhSingleRow03 { | @@ -102,34 +188,9 @@ export struct ZhSingleRow03 { | ||
| 102 | .onClick(() => { | 188 | .onClick(() => { |
| 103 | ProcessUtils.processPage(item) | 189 | ProcessUtils.processPage(item) |
| 104 | }) | 190 | }) |
| 105 | - }) | ||
| 106 | - } | ||
| 107 | - } | ||
| 108 | - .scrollable(ScrollDirection.Horizontal) | ||
| 109 | - .scrollBar(BarState.Off) | ||
| 110 | - .onScrollEdge((side: Edge) => { | ||
| 111 | - if (side === Edge.End) { | ||
| 112 | - this.isEndEdge = true; | ||
| 113 | - } | ||
| 114 | - }) | ||
| 115 | - .onScrollStop(() => { | ||
| 116 | - if (this.isEndEdge) { | ||
| 117 | - this.jumpToMore(); | ||
| 118 | - } | ||
| 119 | - }) | ||
| 120 | - .onScroll((xOffset: number, yOffset: number) => { | ||
| 121 | - this.isEndEdge = false; | ||
| 122 | - }) | ||
| 123 | - } | ||
| 124 | - .padding({ | ||
| 125 | - left: $r('app.float.card_comp_pagePadding_lf'), | ||
| 126 | - right: $r('app.float.card_comp_pagePadding_lf'), | ||
| 127 | - top: $r('app.float.card_comp_pagePadding_tb'), | ||
| 128 | - bottom: $r('app.float.card_comp_pagePadding_tb') | ||
| 129 | - }) | ||
| 130 | - .backgroundColor($r('app.color.white')) | ||
| 131 | } | 191 | } |
| 132 | 192 | ||
| 193 | + | ||
| 133 | @Builder | 194 | @Builder |
| 134 | CompHeader(item: CompDTO) { | 195 | CompHeader(item: CompDTO) { |
| 135 | Row() { | 196 | Row() { |
| @@ -115,15 +115,6 @@ export struct BottomNavigationComponent { | @@ -115,15 +115,6 @@ export struct BottomNavigationComponent { | ||
| 115 | .height(CommonConstants.FULL_PARENT) | 115 | .height(CommonConstants.FULL_PARENT) |
| 116 | .padding({ bottom: 15, left: 10, right: 10, top: 2 }) | 116 | .padding({ bottom: 15, left: 10, right: 10, top: 2 }) |
| 117 | .aspectRatio(this.ASPECT_RATIO_1_1) | 117 | .aspectRatio(this.ASPECT_RATIO_1_1) |
| 118 | - .gesture( | ||
| 119 | - TapGesture({ count: 2 }) | ||
| 120 | - .onAction((event: GestureEvent) => { | ||
| 121 | - if (this.currentNavIndex === index) { | ||
| 122 | - // 当前tab,双击事件 | ||
| 123 | - this.autoRefresh++ | ||
| 124 | - } | ||
| 125 | - }) | ||
| 126 | - ) | ||
| 127 | 118 | ||
| 128 | Text(navItem.name) | 119 | Text(navItem.name) |
| 129 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) | 120 | .margin({ bottom: $r('app.float.bottom_navigation_margin_bottom') }) |
| @@ -140,8 +131,14 @@ export struct BottomNavigationComponent { | @@ -140,8 +131,14 @@ export struct BottomNavigationComponent { | ||
| 140 | this.barBackgroundColor = Color.White | 131 | this.barBackgroundColor = Color.White |
| 141 | this.currentBottomNavInfo = {} as BottomNavDTO | 132 | this.currentBottomNavInfo = {} as BottomNavDTO |
| 142 | } else { | 133 | } else { |
| 134 | + if (this.currentNavIndex === index) { | ||
| 135 | + // 当前tab,单击事件 | ||
| 136 | + this.autoRefresh++ | ||
| 137 | + } else { | ||
| 138 | + // 切换tab | ||
| 143 | this.currentBottomNavInfo = navItem | 139 | this.currentBottomNavInfo = navItem |
| 144 | } | 140 | } |
| 141 | + } | ||
| 145 | 142 | ||
| 146 | this.currentNavIndex = index; | 143 | this.currentNavIndex = index; |
| 147 | Logger.info(TAG, `onChange, index: ${index}`); | 144 | Logger.info(TAG, `onChange, index: ${index}`); |
| @@ -186,21 +183,4 @@ export struct BottomNavigationComponent { | @@ -186,21 +183,4 @@ export struct BottomNavigationComponent { | ||
| 186 | this.assignChannel.bottomNavId = assignChannel.bottomNavId | 183 | this.assignChannel.bottomNavId = assignChannel.bottomNavId |
| 187 | }, 20) | 184 | }, 20) |
| 188 | } | 185 | } |
| 189 | - | ||
| 190 | - /** | ||
| 191 | - * 双击实现 | ||
| 192 | - */ | ||
| 193 | - // doubleClickTime: number = 0 | ||
| 194 | - | ||
| 195 | - /** | ||
| 196 | - * 双击实现 | ||
| 197 | - */ | ||
| 198 | - // private doubleClick(fun: () => void) { | ||
| 199 | - // let now = DateTimeUtils.getTimeStamp() | ||
| 200 | - // if (now - this.doubleClickTime < 200) { | ||
| 201 | - // fun() | ||
| 202 | - // } else { | ||
| 203 | - // this.doubleClickTime = now | ||
| 204 | - // } | ||
| 205 | - // } | ||
| 206 | } | 186 | } |
| @@ -83,7 +83,7 @@ struct ReserveMorePage { | @@ -83,7 +83,7 @@ struct ReserveMorePage { | ||
| 83 | this.reserveBean = this.transformToLiveDetailsBeans(liveReviewDTO.list) | 83 | this.reserveBean = this.transformToLiveDetailsBeans(liveReviewDTO.list) |
| 84 | 84 | ||
| 85 | const apointMentStatus = await LiveModel.getAppointmentStatus(this.reserveBean) | 85 | const apointMentStatus = await LiveModel.getAppointmentStatus(this.reserveBean) |
| 86 | - console.info(`cj2024 ${apointMentStatus.code}`) | 86 | + // console.info(`cj2024 ${apointMentStatus.code}`) |
| 87 | }) | 87 | }) |
| 88 | 88 | ||
| 89 | 89 |
| 1 | import { ContentDTO , Action,GoldenPositionExtraBean} from 'wdBean'; | 1 | import { ContentDTO , Action,GoldenPositionExtraBean} from 'wdBean'; |
| 2 | import { CommonConstants ,ViewType} from 'wdConstant'; | 2 | import { CommonConstants ,ViewType} from 'wdConstant'; |
| 3 | import PageViewModel from '../../viewmodel/PageViewModel'; | 3 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 4 | -import RefreshLayout from '../page/RefreshLayout'; | ||
| 5 | -import { RefreshLayoutBean } from '../page/RefreshLayoutBean'; | ||
| 6 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 7 | import { DateTimeUtils, LazyDataSource } from 'wdKit/Index'; | 5 | import { DateTimeUtils, LazyDataSource } from 'wdKit/Index'; |
| 8 | import router from '@ohos.router'; | 6 | import router from '@ohos.router'; |
| @@ -10,6 +8,12 @@ import { CardParser } from '../CardParser'; | @@ -10,6 +8,12 @@ import { CardParser } from '../CardParser'; | ||
| 10 | import { channelSkeleton } from '../skeleton/channelSkeleton' | 8 | import { channelSkeleton } from '../skeleton/channelSkeleton' |
| 11 | import { ErrorComponent } from '../view/ErrorComponent'; | 9 | import { ErrorComponent } from '../view/ErrorComponent'; |
| 12 | import { EmptyComponent } from '../view/EmptyComponent'; | 10 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 11 | +import { listTouchEvent } from '../../utils/PullDownRefresh'; | ||
| 12 | +import PageAdModel from '../../viewmodel/PageAdvModel'; | ||
| 13 | +import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; | ||
| 14 | +import RefreshLayout from '../refresh/RefreshLayout'; | ||
| 15 | +import PageNoMoreLayout from './PageNoMoreLayout'; | ||
| 16 | +import { NoMoreBean } from './NoMoreBean'; | ||
| 13 | 17 | ||
| 14 | const TAG: string = 'ThemeListPage'; | 18 | const TAG: string = 'ThemeListPage'; |
| 15 | 19 | ||
| @@ -17,22 +21,26 @@ const TAG: string = 'ThemeListPage'; | @@ -17,22 +21,26 @@ const TAG: string = 'ThemeListPage'; | ||
| 17 | @Component | 21 | @Component |
| 18 | struct ThemeListPage { | 22 | struct ThemeListPage { |
| 19 | @State private pageModel: PageModel = new PageModel(); | 23 | @State private pageModel: PageModel = new PageModel(); |
| 20 | - @State data: LazyDataSource<ContentDTO> = new LazyDataSource(); | ||
| 21 | sort: number = 1; | 24 | sort: number = 1; |
| 22 | currentPage: number = 1; | 25 | currentPage: number = 1; |
| 23 | pageSize: number = 20; | 26 | pageSize: number = 20; |
| 24 | title: string = '金刚位聚合页' | 27 | title: string = '金刚位聚合页' |
| 25 | extra: string = '' | 28 | extra: string = '' |
| 29 | + @State private pageAdvModel: PageAdModel = new PageAdModel(); | ||
| 26 | 30 | ||
| 27 | aboutToAppear(): void { | 31 | aboutToAppear(): void { |
| 28 | let par:Action = router.getParams() as Action; | 32 | let par:Action = router.getParams() as Action; |
| 29 | let params = par?.params; | 33 | let params = par?.params; |
| 30 | this.extra = params?.extra?.extra || ''; | 34 | this.extra = params?.extra?.extra || ''; |
| 31 | this.title = params?.extra?.title || ''; | 35 | this.title = params?.extra?.title || ''; |
| 32 | - PageViewModel.postThemeList(this.sort, this.currentPage, this.pageSize,this.extra).then((liveReviewDTO) => { | 36 | + |
| 37 | + this.pageModel.pageType = 1; | ||
| 38 | + this.pageModel.extra = this.extra; | ||
| 39 | + | ||
| 40 | + PageViewModel.postThemeList(this.currentPage, this.pageSize,this.extra).then((liveReviewDTO) => { | ||
| 33 | console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`) | 41 | console.log(`postThemeList${JSON.stringify(liveReviewDTO)}`) |
| 34 | - this.data.push(...liveReviewDTO.list) | ||
| 35 | - if(this.data.getDataArray().length > 0){ | 42 | + this.pageModel.compList.addItems(liveReviewDTO.list) |
| 43 | + if(this.pageModel.compList.getDataArray().length > 0){ | ||
| 36 | this.pageModel.viewType = ViewType.LOADED; | 44 | this.pageModel.viewType = ViewType.LOADED; |
| 37 | }else{ | 45 | }else{ |
| 38 | this.pageModel.viewType = ViewType.EMPTY | 46 | this.pageModel.viewType = ViewType.EMPTY |
| @@ -56,6 +64,13 @@ struct ThemeListPage { | @@ -56,6 +64,13 @@ struct ThemeListPage { | ||
| 56 | .padding({ | 64 | .padding({ |
| 57 | bottom: $r('app.float.card_comp_pagePadding_tb') | 65 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 58 | }) | 66 | }) |
| 67 | + .onTouch((event: TouchEvent | undefined) => { | ||
| 68 | + if (event) { | ||
| 69 | + if (this.pageModel.viewType === ViewType.LOADED) { | ||
| 70 | + listTouchEvent(this.pageModel, this.pageAdvModel, event); | ||
| 71 | + } | ||
| 72 | + } | ||
| 73 | + }) | ||
| 59 | } | 74 | } |
| 60 | @Builder | 75 | @Builder |
| 61 | LoadingLayout() { | 76 | LoadingLayout() { |
| @@ -105,12 +120,12 @@ struct ThemeListPage { | @@ -105,12 +120,12 @@ struct ThemeListPage { | ||
| 105 | // 下拉刷新 | 120 | // 下拉刷新 |
| 106 | ListItem() { | 121 | ListItem() { |
| 107 | RefreshLayout({ | 122 | RefreshLayout({ |
| 108 | - refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.pullDownRefreshImage, | ||
| 109 | - this.pageModel.pullDownRefreshText, this.pageModel.pullDownRefreshHeight) | 123 | + refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullDown, this.pageModel.load, |
| 124 | + this.pageModel.offsetY) | ||
| 110 | }) | 125 | }) |
| 111 | } | 126 | } |
| 112 | 127 | ||
| 113 | - LazyForEach(this.data, (contentDTO: ContentDTO, contentIndex: number) => { | 128 | + LazyForEach(this.pageModel.compList, (contentDTO: ContentDTO, contentIndex: number) => { |
| 114 | ListItem() { | 129 | ListItem() { |
| 115 | Column() { | 130 | Column() { |
| 116 | CardParser({ contentDTO }); | 131 | CardParser({ contentDTO }); |
| @@ -119,6 +134,17 @@ struct ThemeListPage { | @@ -119,6 +134,17 @@ struct ThemeListPage { | ||
| 119 | }, | 134 | }, |
| 120 | (contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString() | 135 | (contentDTO: ContentDTO, contentIndex: number) => contentDTO.pageId + contentIndex.toString() |
| 121 | ) | 136 | ) |
| 137 | + // 加载更多 | ||
| 138 | + ListItem() { | ||
| 139 | + if (this.pageModel.hasMore) { | ||
| 140 | + // LoadMoreLayout({ | ||
| 141 | + // refreshBean: new RefreshLayoutBean(this.pageModel.isVisiblePullUpLoad, this.pageModel.pullUpLoadImage, | ||
| 142 | + // this.pageModel.pullUpLoadText, this.pageModel.pullUpLoadHeight) | ||
| 143 | + // }) | ||
| 144 | + } else if (!this.pageModel.contentNeedScroll) { | ||
| 145 | + PageNoMoreLayout({ noMoreBean: new NoMoreBean(this.pageModel.pageInfo.baselineCopywriting) }) | ||
| 146 | + } | ||
| 147 | + } | ||
| 122 | } | 148 | } |
| 123 | .scrollBar(BarState.Off) | 149 | .scrollBar(BarState.Off) |
| 124 | .cachedCount(8) | 150 | .cachedCount(8) |
| @@ -31,6 +31,7 @@ export struct SearchHotsComponent{ | @@ -31,6 +31,7 @@ export struct SearchHotsComponent{ | ||
| 31 | 31 | ||
| 32 | build(){ | 32 | build(){ |
| 33 | Column(){ | 33 | Column(){ |
| 34 | + if(this.searchHotsData.length>0){ | ||
| 34 | Row() { | 35 | Row() { |
| 35 | Image($r('app.media.search_hot_icon')) | 36 | Image($r('app.media.search_hot_icon')) |
| 36 | .width('46lpx') | 37 | .width('46lpx') |
| @@ -49,6 +50,7 @@ export struct SearchHotsComponent{ | @@ -49,6 +50,7 @@ export struct SearchHotsComponent{ | ||
| 49 | } | 50 | } |
| 50 | .width('100%') | 51 | .width('100%') |
| 51 | .margin({bottom:"15lpx"}) | 52 | .margin({bottom:"15lpx"}) |
| 53 | + } | ||
| 52 | 54 | ||
| 53 | List(){ | 55 | List(){ |
| 54 | ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{ | 56 | ForEach(this.searchHotsData,(item:SearchHotContentItem,index:number)=>{ |
| @@ -172,7 +172,7 @@ export struct SearchResultContentComponent{ | @@ -172,7 +172,7 @@ export struct SearchResultContentComponent{ | ||
| 172 | relId: value.data.relId, | 172 | relId: value.data.relId, |
| 173 | relType: value.data.relType, | 173 | relType: value.data.relType, |
| 174 | newsTitle: value.data.titleLiteral, | 174 | newsTitle: value.data.titleLiteral, |
| 175 | - publishTime: value.data.publishTime, | 175 | + publishTime: StringUtils.isNotEmpty(value.data.firstPublishTime)?value.data.firstPublishTime:value.data.publishTime, |
| 176 | visitorComment: -1, | 176 | visitorComment: -1, |
| 177 | fullColumnImgUrls: photos, | 177 | fullColumnImgUrls: photos, |
| 178 | newsSummary: "", | 178 | newsSummary: "", |
| @@ -41,7 +41,7 @@ export struct BigPicCardComponent { | @@ -41,7 +41,7 @@ export struct BigPicCardComponent { | ||
| 41 | Text(this.compDTO.operDataList[0].newsTitle) | 41 | Text(this.compDTO.operDataList[0].newsTitle) |
| 42 | .fontSize(17) | 42 | .fontSize(17) |
| 43 | .fontColor('#222222') | 43 | .fontColor('#222222') |
| 44 | - .maxLines(3) | 44 | + .maxLines(2) |
| 45 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | 45 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 |
| 46 | .align(Alignment.Start) | 46 | .align(Alignment.Start) |
| 47 | //大图 | 47 | //大图 |
| @@ -70,6 +70,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -70,6 +70,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 70 | .textAlign(TextAlign.Start) | 70 | .textAlign(TextAlign.Start) |
| 71 | .margin({ top: 8 }) | 71 | .margin({ top: 8 }) |
| 72 | .width(150) | 72 | .width(150) |
| 73 | + .lineHeight(17) | ||
| 73 | } | 74 | } |
| 74 | } | 75 | } |
| 75 | .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) | 76 | .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) |
| @@ -27,7 +27,7 @@ export struct LiveHorizontalCardComponent { | @@ -27,7 +27,7 @@ export struct LiveHorizontalCardComponent { | ||
| 27 | .fontWeight(600) | 27 | .fontWeight(600) |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | - if (this.compDTO.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING') { | 30 | + if (this.compDTO.dataSourceType === 'LIVE_HORIZONTAL_CARD' || this.compDTO.dataSourceType === 'LIVE_MONTHLY_RANKING' || this.compDTO.dataSourceType === 'OBJECT_POS') { |
| 31 | Row() { | 31 | Row() { |
| 32 | Text("更多") | 32 | Text("更多") |
| 33 | .fontSize($r("app.float.font_size_14")) | 33 | .fontSize($r("app.float.font_size_14")) |
| @@ -22,6 +22,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | @@ -22,6 +22,7 @@ import { HttpUrlUtils } from 'wdNetwork/Index'; | ||
| 22 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 22 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 23 | import { PageRepository } from '../../repository/PageRepository'; | 23 | import { PageRepository } from '../../repository/PageRepository'; |
| 24 | import { SpConstants } from 'wdConstant/Index'; | 24 | import { SpConstants } from 'wdConstant/Index'; |
| 25 | +import { WDShare } from 'wdShare/Index'; | ||
| 25 | 26 | ||
| 26 | const TAG = 'OperRowListView'; | 27 | const TAG = 'OperRowListView'; |
| 27 | 28 | ||
| @@ -42,6 +43,8 @@ const TAG = 'OperRowListView'; | @@ -42,6 +43,8 @@ const TAG = 'OperRowListView'; | ||
| 42 | @Preview | 43 | @Preview |
| 43 | @Component | 44 | @Component |
| 44 | export struct OperRowListView { | 45 | export struct OperRowListView { |
| 46 | + private onBack: () => void = () => { | ||
| 47 | + } | ||
| 45 | @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 | 48 | @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 |
| 46 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 | 49 | @State operationButtonList: string[] = ['comment', 'collect', 'share'] // 组件展示条件 |
| 47 | @ObjectLink publishCommentModel: publishCommentModel | 50 | @ObjectLink publishCommentModel: publishCommentModel |
| @@ -49,13 +52,16 @@ export struct OperRowListView { | @@ -49,13 +52,16 @@ export struct OperRowListView { | ||
| 49 | @State interactData: InteractDataDTO = {} as InteractDataDTO | 52 | @State interactData: InteractDataDTO = {} as InteractDataDTO |
| 50 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 | 53 | @State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态 |
| 51 | @State likeBean: Record<string, string> = {} | 54 | @State likeBean: Record<string, string> = {} |
| 52 | - @State audioUrl: string= '' | 55 | + @State audioUrl: string = '' |
| 56 | + @State bgColor: ResourceColor = Color.White | ||
| 53 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 57 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 54 | needLike: boolean = true | 58 | needLike: boolean = true |
| 55 | 59 | ||
| 56 | // async aboutToAppear() { | 60 | // async aboutToAppear() { |
| 57 | async onDetailUpdated() { | 61 | async onDetailUpdated() { |
| 58 | - if (!this.contentDetailData) return | 62 | + if (!this.contentDetailData) { |
| 63 | + return | ||
| 64 | + } | ||
| 59 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | 65 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 60 | if (user_id) { | 66 | if (user_id) { |
| 61 | this.getInteractDataStatus() | 67 | this.getInteractDataStatus() |
| @@ -98,6 +104,9 @@ export struct OperRowListView { | @@ -98,6 +104,9 @@ export struct OperRowListView { | ||
| 98 | } | 104 | } |
| 99 | .hoverEffect(HoverEffect.Scale) | 105 | .hoverEffect(HoverEffect.Scale) |
| 100 | .onClick(() => { | 106 | .onClick(() => { |
| 107 | + if (this.onBack) { | ||
| 108 | + this.onBack() | ||
| 109 | + } | ||
| 101 | router.back(); | 110 | router.back(); |
| 102 | }) | 111 | }) |
| 103 | .width(42) | 112 | .width(42) |
| @@ -123,7 +132,7 @@ export struct OperRowListView { | @@ -123,7 +132,7 @@ export struct OperRowListView { | ||
| 123 | .justifyContent(FlexAlign.Start) | 132 | .justifyContent(FlexAlign.Start) |
| 124 | } | 133 | } |
| 125 | .width('100%') | 134 | .width('100%') |
| 126 | - .backgroundColor(Color.White) | 135 | + .backgroundColor(this.bgColor) |
| 127 | .padding({ | 136 | .padding({ |
| 128 | top: 10, | 137 | top: 10, |
| 129 | // bottom: `${this.bottomSafeHeight}px` | 138 | // bottom: `${this.bottomSafeHeight}px` |
| @@ -173,7 +182,8 @@ export struct OperRowListView { | @@ -173,7 +182,8 @@ export struct OperRowListView { | ||
| 173 | builderCollect() { | 182 | builderCollect() { |
| 174 | Column() { | 183 | Column() { |
| 175 | Stack({ alignContent: Alignment.TopEnd }) { | 184 | Stack({ alignContent: Alignment.TopEnd }) { |
| 176 | - Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check') : $r('app.media.iv_live_comment_collect_un')) | 185 | + Image(this.newsStatusOfUser?.collectStatus == 1 ? $r('app.media.ic_collect_check') : |
| 186 | + $r('app.media.iv_live_comment_collect_un')) | ||
| 177 | .width(24) | 187 | .width(24) |
| 178 | .height(24) | 188 | .height(24) |
| 179 | .interpolation(ImageInterpolation.High) | 189 | .interpolation(ImageInterpolation.High) |
| @@ -225,12 +235,17 @@ export struct OperRowListView { | @@ -225,12 +235,17 @@ export struct OperRowListView { | ||
| 225 | .aspectRatio(1) | 235 | .aspectRatio(1) |
| 226 | .interpolation(ImageInterpolation.High) | 236 | .interpolation(ImageInterpolation.High) |
| 227 | .onClick((event: ClickEvent) => { | 237 | .onClick((event: ClickEvent) => { |
| 228 | - ToastUtils.showToast('分享为公共方法,待开发', 1000); | 238 | + // ToastUtils.showToast('分享为公共方法,待开发', 1000); |
| 239 | + this.share() | ||
| 229 | }) | 240 | }) |
| 230 | } | 241 | } |
| 231 | .width(42) | 242 | .width(42) |
| 232 | } | 243 | } |
| 233 | 244 | ||
| 245 | + share() { | ||
| 246 | + WDShare.shareContent(this.contentDetailData) | ||
| 247 | + } | ||
| 248 | + | ||
| 234 | // 已登录->查询用户对作品收藏状态 | 249 | // 已登录->查询用户对作品收藏状态 |
| 235 | private async getInteractDataStatus() { | 250 | private async getInteractDataStatus() { |
| 236 | try { | 251 | try { |
| @@ -273,7 +288,7 @@ export struct OperRowListView { | @@ -273,7 +288,7 @@ export struct OperRowListView { | ||
| 273 | PageRepository.postExecuteCollectRecord(params).then(res => { | 288 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 274 | if (this.newsStatusOfUser) { | 289 | if (this.newsStatusOfUser) { |
| 275 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 290 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 276 | - if(this.newsStatusOfUser.collectStatus === 1){ | 291 | + if (this.newsStatusOfUser.collectStatus === 1) { |
| 277 | promptAction.showToast({ message: '收藏成功' }) | 292 | promptAction.showToast({ message: '收藏成功' }) |
| 278 | } | 293 | } |
| 279 | this.queryContentInteractCount() | 294 | this.queryContentInteractCount() |
| @@ -299,7 +314,8 @@ export struct OperRowListView { | @@ -299,7 +314,8 @@ export struct OperRowListView { | ||
| 299 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) | 314 | this.interactData.collectNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.collectNum) |
| 300 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) | 315 | this.interactData.commentNum = NumberFormatterUtils.formatNumberWithWan(res.data[0]?.commentNum) |
| 301 | // 评论组件需要数据 | 316 | // 评论组件需要数据 |
| 302 | - if (Number.parseInt(this.interactData.commentNum) > Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 317 | + if (Number.parseInt(this.interactData.commentNum) > |
| 318 | + Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | ||
| 303 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' | 319 | this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' |
| 304 | } | 320 | } |
| 305 | } | 321 | } |
| @@ -180,7 +180,7 @@ export class PageRepository { | @@ -180,7 +180,7 @@ export class PageRepository { | ||
| 180 | * 早晚报pageInfo请求 | 180 | * 早晚报pageInfo请求 |
| 181 | * */ | 181 | * */ |
| 182 | static getMorningEveningPageInfoUrl(pageId: string) { | 182 | static getMorningEveningPageInfoUrl(pageId: string) { |
| 183 | - let url = HttpUrlUtils.getHost() + HttpUrlUtils.MORNING_EVENING_PAGE_INFO_PATH; | 183 | + let url = HttpUrlUtils.getHost() + HttpUrlUtils.PAGE_INFO_PATH; |
| 184 | url = url + "?pageId=" + pageId; | 184 | url = url + "?pageId=" + pageId; |
| 185 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) | 185 | Logger.info(TAG, "getMorningEveningPageInfoUrl url = " + url) |
| 186 | return url; | 186 | return url; |
| @@ -4,7 +4,7 @@ import PageModel from '../viewmodel/PageModel'; | @@ -4,7 +4,7 @@ import PageModel from '../viewmodel/PageModel'; | ||
| 4 | import PageHelper from '../viewmodel/PageHelper'; | 4 | import PageHelper from '../viewmodel/PageHelper'; |
| 5 | import PageAdModel from '../viewmodel/PageAdvModel'; | 5 | import PageAdModel from '../viewmodel/PageAdvModel'; |
| 6 | import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; | 6 | import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; |
| 7 | - | 7 | +//下拉刷新上拉加载更多组件 |
| 8 | export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) { | 8 | export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) { |
| 9 | switch (event.type) { | 9 | switch (event.type) { |
| 10 | case TouchType.Down: | 10 | case TouchType.Down: |
| @@ -5,6 +5,17 @@ import { LiveDetailsBean, ReserveBean } from 'wdBean/Index'; | @@ -5,6 +5,17 @@ import { LiveDetailsBean, ReserveBean } from 'wdBean/Index'; | ||
| 5 | 5 | ||
| 6 | const TAG = 'LiveModel' | 6 | const TAG = 'LiveModel' |
| 7 | 7 | ||
| 8 | +interface ReserveRes { | ||
| 9 | + code: string | number, | ||
| 10 | + data: ReserveItem[] | ||
| 11 | +} | ||
| 12 | + | ||
| 13 | +interface ReserveItem { | ||
| 14 | + liveId: number, | ||
| 15 | + relationId: string, | ||
| 16 | + subscribe: boolean | ||
| 17 | +} | ||
| 18 | + | ||
| 8 | export class LiveModel { | 19 | export class LiveModel { |
| 9 | /** | 20 | /** |
| 10 | * 直播内容详情 | 21 | * 直播内容详情 |
| @@ -46,6 +57,9 @@ export class LiveModel { | @@ -46,6 +57,9 @@ export class LiveModel { | ||
| 46 | params['relationId'] = relationId | 57 | params['relationId'] = relationId |
| 47 | params['liveId'] = liveId | 58 | params['liveId'] = liveId |
| 48 | params['isSubscribe'] = `${isSubscribe}` | 59 | params['isSubscribe'] = `${isSubscribe}` |
| 60 | + Logger.info('relationId', relationId) | ||
| 61 | + Logger.info('liveId', liveId) | ||
| 62 | + Logger.info('isSubscribe', typeof isSubscribe) | ||
| 49 | return new Promise<ResponseDTO<string>>((success, fail) => { | 63 | return new Promise<ResponseDTO<string>>((success, fail) => { |
| 50 | HttpRequest.post<ResponseDTO<string>>( | 64 | HttpRequest.post<ResponseDTO<string>>( |
| 51 | HttpUrlUtils.getLiveAppointmentUrl(), | 65 | HttpUrlUtils.getLiveAppointmentUrl(), |
| @@ -74,17 +88,21 @@ export class LiveModel { | @@ -74,17 +88,21 @@ export class LiveModel { | ||
| 74 | static getAppointmentStatus(reserveBean: ReserveBean[]) { | 88 | static getAppointmentStatus(reserveBean: ReserveBean[]) { |
| 75 | // let params: Record<string, ArrayList<ReserveBean>> = {}; | 89 | // let params: Record<string, ArrayList<ReserveBean>> = {}; |
| 76 | // params = reserveBean | 90 | // params = reserveBean |
| 77 | - return new Promise<ResponseDTO<string>>((success, fail) => { | ||
| 78 | - HttpRequest.post<ResponseDTO<string>>( | 91 | + return new Promise<Array<ReserveItem>>((success, fail) => { |
| 92 | + HttpRequest.post<ResponseDTO<Array<ReserveItem>>>( | ||
| 79 | HttpUrlUtils.getAppointmentStatusUrl(), | 93 | HttpUrlUtils.getAppointmentStatusUrl(), |
| 80 | reserveBean, | 94 | reserveBean, |
| 81 | - ).then((data: ResponseDTO<string>) => { | 95 | + ).then((data: ResponseDTO<Array<ReserveItem>>) => { |
| 96 | + if (!data || !data.data) { | ||
| 97 | + fail("数据为空") | ||
| 98 | + return | ||
| 99 | + } | ||
| 82 | if (data.code != 0) { | 100 | if (data.code != 0) { |
| 83 | fail(data.message) | 101 | fail(data.message) |
| 84 | ToastUtils.shortToast(data.message) | 102 | ToastUtils.shortToast(data.message) |
| 85 | return | 103 | return |
| 86 | } | 104 | } |
| 87 | - success(data) | 105 | + success(data.data) |
| 88 | }, (error: Error) => { | 106 | }, (error: Error) => { |
| 89 | fail(error.message) | 107 | fail(error.message) |
| 90 | Logger.debug(TAG + ":error ", error.toString()) | 108 | Logger.debug(TAG + ":error ", error.toString()) |
| @@ -51,6 +51,21 @@ export class PageHelper { | @@ -51,6 +51,21 @@ export class PageHelper { | ||
| 51 | 51 | ||
| 52 | getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { | 52 | getPageInfo(pageModel: PageModel, pageAdvModel: PageAdModel) { |
| 53 | pageModel.currentPage = 1; | 53 | pageModel.currentPage = 1; |
| 54 | + if(pageModel.pageType == 1){ | ||
| 55 | + PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize,pageModel.extra).then((liveReviewDTO) => { | ||
| 56 | + if(liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0){ | ||
| 57 | + pageModel.viewType = ViewType.EMPTY; | ||
| 58 | + pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; | ||
| 59 | + return; | ||
| 60 | + }else{ | ||
| 61 | + //更新数据 | ||
| 62 | + pageModel.compList.addItems(liveReviewDTO.list); | ||
| 63 | + closeRefresh(pageModel, true); | ||
| 64 | + } | ||
| 65 | + }).catch((err: string | Resource) => { | ||
| 66 | + promptAction.showToast({ message: err }); | ||
| 67 | + }) | ||
| 68 | + }else{ | ||
| 54 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { | 69 | PageViewModel.getPageInfo(pageModel.pageId).then(pageInfo => { |
| 55 | if (pageInfo == null) { | 70 | if (pageInfo == null) { |
| 56 | pageModel.viewType = ViewType.EMPTY; | 71 | pageModel.viewType = ViewType.EMPTY; |
| @@ -66,6 +81,7 @@ export class PageHelper { | @@ -66,6 +81,7 @@ export class PageHelper { | ||
| 66 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_ContentFailed; | 81 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_ContentFailed; |
| 67 | }) | 82 | }) |
| 68 | } | 83 | } |
| 84 | + } | ||
| 69 | 85 | ||
| 70 | 86 | ||
| 71 | async parseGroup(pageModel: PageModel) { | 87 | async parseGroup(pageModel: PageModel) { |
| @@ -292,6 +308,24 @@ export class PageHelper { | @@ -292,6 +308,24 @@ export class PageHelper { | ||
| 292 | * comp加载更多,分页加载 | 308 | * comp加载更多,分页加载 |
| 293 | */ | 309 | */ |
| 294 | private compLoadMore(pageModel: PageModel) { | 310 | private compLoadMore(pageModel: PageModel) { |
| 311 | + //聚合页 | ||
| 312 | + if(pageModel.pageType == 1){ | ||
| 313 | + PageViewModel.postThemeList(pageModel.currentPage, pageModel.pageSize,pageModel.extra).then((liveReviewDTO) => { | ||
| 314 | + if(liveReviewDTO == null || liveReviewDTO.list == null || liveReviewDTO.list.length == 0){ | ||
| 315 | + pageModel.hasMore = false; | ||
| 316 | + return; | ||
| 317 | + }else{ | ||
| 318 | + //更新数据 | ||
| 319 | + pageModel.compList.addItems(liveReviewDTO.list); | ||
| 320 | + // 直接认为有分页,一直加载分页。直到没有数据,再停止 | ||
| 321 | + pageModel.currentPage++; | ||
| 322 | + pageModel.hasMore = true; | ||
| 323 | + pageModel.pageTotalCompSize = liveReviewDTO.list.length + pageModel.pageTotalCompSize | ||
| 324 | + } | ||
| 325 | + }).catch((err: string | Resource) => { | ||
| 326 | + promptAction.showToast({ message: err }); | ||
| 327 | + }) | ||
| 328 | + }else{ | ||
| 295 | PageViewModel.getPageData(pageModel.bizCopy()) | 329 | PageViewModel.getPageData(pageModel.bizCopy()) |
| 296 | .then((data: PageDTO) => { | 330 | .then((data: PageDTO) => { |
| 297 | pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() | 331 | pageModel.timestamp = DateTimeUtils.getTimeStamp().toString() |
| @@ -318,6 +352,7 @@ export class PageHelper { | @@ -318,6 +352,7 @@ export class PageHelper { | ||
| 318 | promptAction.showToast({ message: err }); | 352 | promptAction.showToast({ message: err }); |
| 319 | }) | 353 | }) |
| 320 | } | 354 | } |
| 355 | + } | ||
| 321 | 356 | ||
| 322 | 357 | ||
| 323 | /** | 358 | /** |
| @@ -7,6 +7,7 @@ import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/P | @@ -7,6 +7,7 @@ import { GroupInfoDTO, PageInfoDTO } from 'wdBean/src/main/ets/bean/navigation/P | ||
| 7 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; | 7 | import { AdvRuleBean, CompAdvBean } from 'wdBean/src/main/ets/bean/adv/AdvsRuleBean'; |
| 8 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; | 8 | import { WDViewDefaultType } from '../components/view/EmptyComponent'; |
| 9 | import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; | 9 | import { LoadStatus } from '../components/refresh/RefreshLayoutBean'; |
| 10 | +import { BaseDTO } from 'wdBean/src/main/ets/bean/component/BaseDTO'; | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * 页面下拉刷新、上拉加载数据bean。 | 13 | * 页面下拉刷新、上拉加载数据bean。 |
| @@ -22,7 +23,7 @@ export default class PageModel { | @@ -22,7 +23,7 @@ export default class PageModel { | ||
| 22 | groupList: GroupInfoDTO[] = []; | 23 | groupList: GroupInfoDTO[] = []; |
| 23 | // 当前请求数据的group | 24 | // 当前请求数据的group |
| 24 | groupData: GroupInfoDTO = {} as GroupInfoDTO; | 25 | groupData: GroupInfoDTO = {} as GroupInfoDTO; |
| 25 | - compList: LazyDataSource<CompDTO> = new LazyDataSource(); | 26 | + compList: LazyDataSource<BaseDTO> = new LazyDataSource(); |
| 26 | // 是否comp自己处理分页加载;默认是最后一个comp下的content有分页数据,需要节目内容的分页加载 | 27 | // 是否comp自己处理分页加载;默认是最后一个comp下的content有分页数据,需要节目内容的分页加载 |
| 27 | // (如:首页-视频tab-直播tab,最后一个comp是直播回看列表,视频内容需要分页加载) | 28 | // (如:首页-视频tab-直播tab,最后一个comp是直播回看列表,视频内容需要分页加载) |
| 28 | contentNeedScroll: boolean = false; | 29 | contentNeedScroll: boolean = false; |
| @@ -58,7 +59,10 @@ export default class PageModel { | @@ -58,7 +59,10 @@ export default class PageModel { | ||
| 58 | 59 | ||
| 59 | // 记录已经展示的稿件和组件数量 | 60 | // 记录已经展示的稿件和组件数量 |
| 60 | pageTotalCompSize: number = 0; | 61 | pageTotalCompSize: number = 0; |
| 62 | + //0默认信息流,1聚合页 | ||
| 63 | + pageType: number = 0; | ||
| 61 | 64 | ||
| 65 | + extra: string = '' | ||
| 62 | /** | 66 | /** |
| 63 | * 简单复制业务数据 | 67 | * 简单复制业务数据 |
| 64 | */ | 68 | */ |
| @@ -380,7 +380,7 @@ export class PageViewModel extends BaseViewModel { | @@ -380,7 +380,7 @@ export class PageViewModel extends BaseViewModel { | ||
| 380 | }) | 380 | }) |
| 381 | } | 381 | } |
| 382 | 382 | ||
| 383 | - async postThemeList(sort: number, pageNum: number, pageSize: number,extra: string) : Promise<LiveReviewDTO> { | 383 | + async postThemeList(pageNum: number, pageSize: number,extra: string) : Promise<LiveReviewDTO> { |
| 384 | let bean: GoldenPositionExtraBean = JSON.parse(extra) | 384 | let bean: GoldenPositionExtraBean = JSON.parse(extra) |
| 385 | bean.pageNum = pageNum | 385 | bean.pageNum = pageNum |
| 386 | bean.pageSize = pageSize | 386 | bean.pageSize = pageSize |
| @@ -43,6 +43,8 @@ export struct DetailPlayLiveCommon { | @@ -43,6 +43,8 @@ export struct DetailPlayLiveCommon { | ||
| 43 | } | 43 | } |
| 44 | .height('100%') | 44 | .height('100%') |
| 45 | .width('100%') | 45 | .width('100%') |
| 46 | + .backgroundColor(Color.Black) | ||
| 47 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 46 | } | 48 | } |
| 47 | 49 | ||
| 48 | getLiveDetails() { | 50 | getLiveDetails() { |
| 1 | -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import { TabComponent } from '../widgets/details/TabComponent'; | 3 | import { TabComponent } from '../widgets/details/TabComponent'; |
| 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; | 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; |
| @@ -9,6 +9,9 @@ import { router, window } from '@kit.ArkUI'; | @@ -9,6 +9,9 @@ import { router, window } from '@kit.ArkUI'; | ||
| 9 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; | 9 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; |
| 10 | import { LiveCommentComponent } from 'wdComponent/Index'; | 10 | import { LiveCommentComponent } from 'wdComponent/Index'; |
| 11 | import { WDPlayerController } from 'wdPlayer/Index'; | 11 | import { WDPlayerController } from 'wdPlayer/Index'; |
| 12 | +import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; | ||
| 13 | +import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | ||
| 14 | +import { ResponseDTO } from 'wdNetwork/Index'; | ||
| 12 | 15 | ||
| 13 | let TAG: string = 'DetailPlayLivePage'; | 16 | let TAG: string = 'DetailPlayLivePage'; |
| 14 | 17 | ||
| @@ -29,6 +32,8 @@ export struct DetailPlayLivePage { | @@ -29,6 +32,8 @@ export struct DetailPlayLivePage { | ||
| 29 | @Consume @Watch('onPageShowCus') pageShow: number | 32 | @Consume @Watch('onPageShowCus') pageShow: number |
| 30 | @Consume @Watch('onPageHideCus') pageHide: number | 33 | @Consume @Watch('onPageHideCus') pageHide: number |
| 31 | @Consume @Watch('onBackPressCus') pageBackPress: number | 34 | @Consume @Watch('onBackPressCus') pageBackPress: number |
| 35 | + @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | ||
| 36 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 32 | 37 | ||
| 33 | aboutToAppear(): void { | 38 | aboutToAppear(): void { |
| 34 | Logger.info(TAG, `wyj-aboutToAppear`) | 39 | Logger.info(TAG, `wyj-aboutToAppear`) |
| @@ -43,6 +48,7 @@ export struct DetailPlayLivePage { | @@ -43,6 +48,7 @@ export struct DetailPlayLivePage { | ||
| 43 | }) | 48 | }) |
| 44 | this.getLiveDetails() | 49 | this.getLiveDetails() |
| 45 | this.getLiveRoomData() | 50 | this.getLiveRoomData() |
| 51 | + this.getContentDetail() | ||
| 46 | } | 52 | } |
| 47 | 53 | ||
| 48 | build() { | 54 | build() { |
| @@ -52,8 +58,17 @@ export struct DetailPlayLivePage { | @@ -52,8 +58,17 @@ export struct DetailPlayLivePage { | ||
| 52 | TabComponent({ tabs: this.tabs }) | 58 | TabComponent({ tabs: this.tabs }) |
| 53 | .layoutWeight(503) | 59 | .layoutWeight(503) |
| 54 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 60 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 55 | - LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | 61 | + |
| 62 | + OperRowListView({ | ||
| 63 | + operationButtonList: ['comment', 'collect', 'share', 'like'], | ||
| 64 | + contentDetailData: this.contentDetailData, | ||
| 65 | + publishCommentModel: this.publishCommentModel, | ||
| 66 | + }) | ||
| 56 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 67 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 68 | + | ||
| 69 | + | ||
| 70 | + // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | ||
| 71 | + // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | ||
| 57 | } | 72 | } |
| 58 | .height('100%') | 73 | .height('100%') |
| 59 | .width('100%') | 74 | .width('100%') |
| @@ -91,6 +106,28 @@ export struct DetailPlayLivePage { | @@ -91,6 +106,28 @@ export struct DetailPlayLivePage { | ||
| 91 | return true | 106 | return true |
| 92 | } | 107 | } |
| 93 | 108 | ||
| 109 | + /** | ||
| 110 | + * 查询视频详情用于评论展示 | ||
| 111 | + */ | ||
| 112 | + getContentDetail() { | ||
| 113 | + this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType) | ||
| 114 | + .then((data: Array<ContentDetailDTO>) => { | ||
| 115 | + console.log(TAG, 'getContentDetail:', JSON.stringify(data)) | ||
| 116 | + if (data) { | ||
| 117 | + this.contentDetailData = data?.[0]; | ||
| 118 | + if (this.contentDetailData?.openComment) { | ||
| 119 | + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 120 | + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | ||
| 121 | + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 122 | + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType) | ||
| 123 | + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | ||
| 124 | + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | ||
| 125 | + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | ||
| 126 | + } | ||
| 127 | + } | ||
| 128 | + }) | ||
| 129 | + } | ||
| 130 | + | ||
| 94 | getLiveDetails() { | 131 | getLiveDetails() { |
| 95 | this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) | 132 | this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) |
| 96 | .then( | 133 | .then( |
| @@ -86,7 +86,6 @@ export struct DetailPlayVLivePage { | @@ -86,7 +86,6 @@ export struct DetailPlayVLivePage { | ||
| 86 | .width(40) | 86 | .width(40) |
| 87 | .aspectRatio(1) | 87 | .aspectRatio(1) |
| 88 | .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) | 88 | .visibility(this.swiperIndex === 0 ? Visibility.Visible : Visibility.Hidden) |
| 89 | - .animation({ duration: 500 }) | ||
| 90 | .position({ x: '100%', y: '100%' }) | 89 | .position({ x: '100%', y: '100%' }) |
| 91 | .markAnchor({ x: 56, y: 56 }) | 90 | .markAnchor({ x: 56, y: 56 }) |
| 92 | .onClick(() => { | 91 | .onClick(() => { |
| @@ -107,7 +106,8 @@ export struct DetailPlayVLivePage { | @@ -107,7 +106,8 @@ export struct DetailPlayVLivePage { | ||
| 107 | (data) => { | 106 | (data) => { |
| 108 | if (data.length > 0) { | 107 | if (data.length > 0) { |
| 109 | this.liveDetailsBean = data[0] | 108 | this.liveDetailsBean = data[0] |
| 110 | - this.liveState = this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 109 | + this.liveState = |
| 110 | + this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | ||
| 111 | if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | 111 | if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { |
| 112 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | 112 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url |
| 113 | } | 113 | } |
| 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; | 1 | import { HttpUrlUtils, ResponseDTO } from 'wdNetwork'; |
| 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; | 2 | import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest'; |
| 3 | import { Logger, ToastUtils } from 'wdKit'; | 3 | import { Logger, ToastUtils } from 'wdKit'; |
| 4 | -import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'; | 4 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'; |
| 5 | +import { ContentDetailRequest } from 'wdDetailPlayApi/Index'; | ||
| 5 | 6 | ||
| 6 | const TAG = 'LiveModel' | 7 | const TAG = 'LiveModel' |
| 7 | 8 | ||
| 8 | export class LiveModel { | 9 | export class LiveModel { |
| 10 | + getContentDetail(contentId: string, relId: string, relType: string) { | ||
| 11 | + return new Promise<Array<ContentDetailDTO>>((success, fail) => { | ||
| 12 | + ContentDetailRequest.getContentDetail({ | ||
| 13 | + contentId: contentId, | ||
| 14 | + relId: relId, | ||
| 15 | + relType: relType | ||
| 16 | + }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | ||
| 17 | + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | ||
| 18 | + if (resDTO.data) { | ||
| 19 | + success(resDTO.data) | ||
| 20 | + } | ||
| 21 | + }).catch(() => { | ||
| 22 | + fail("数据为空") | ||
| 23 | + }) | ||
| 24 | + | ||
| 25 | + }) | ||
| 26 | + | ||
| 27 | + } | ||
| 28 | + | ||
| 9 | /** | 29 | /** |
| 10 | * 直播内容详情 | 30 | * 直播内容详情 |
| 11 | * @param contentId | 31 | * @param contentId |
| 1 | -import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index' |
| 2 | + | ||
| 2 | import { ResponseDTO } from 'wdNetwork/Index' | 3 | import { ResponseDTO } from 'wdNetwork/Index' |
| 3 | import { LiveModel } from './LiveModel' | 4 | import { LiveModel } from './LiveModel' |
| 4 | 5 | ||
| @@ -11,6 +12,45 @@ export class LiveViewModel { | @@ -11,6 +12,45 @@ export class LiveViewModel { | ||
| 11 | this.liveModel = new LiveModel() | 12 | this.liveModel = new LiveModel() |
| 12 | } | 13 | } |
| 13 | 14 | ||
| 15 | + // 视频信息 | ||
| 16 | + getContentDetail(contentId: string, relId: string, relType: string) { | ||
| 17 | + return new Promise<Array<ContentDetailDTO>>((success, fail) => { | ||
| 18 | + this.liveModel.getContentDetail(contentId, relId, relType).then((data) => { | ||
| 19 | + success(data) | ||
| 20 | + }).catch((message: string) => { | ||
| 21 | + fail(message) | ||
| 22 | + }) | ||
| 23 | + }) | ||
| 24 | + | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + // async getContentDetail(contentId: string, relId: string, relType: string) { | ||
| 29 | + // return ContentDetailRequest.getContentDetail({ | ||
| 30 | + // contentId: contentId, | ||
| 31 | + // relId: relId, | ||
| 32 | + // relType: relType | ||
| 33 | + // }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | ||
| 34 | + // console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | ||
| 35 | + // if (resDTO.data) { | ||
| 36 | + // | ||
| 37 | + // this.contentDetailData = resDTO.data?.[0]; | ||
| 38 | + // | ||
| 39 | + // if (this.contentDetailData?.openComment) { | ||
| 40 | + // this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 41 | + // this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | ||
| 42 | + // this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 43 | + // this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType) | ||
| 44 | + // this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | ||
| 45 | + // this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | ||
| 46 | + // this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | ||
| 47 | + // } | ||
| 48 | + // | ||
| 49 | + // | ||
| 50 | + // } | ||
| 51 | + // }) | ||
| 52 | + // } | ||
| 53 | + | ||
| 14 | //直播详情 | 54 | //直播详情 |
| 15 | getLiveDetails(contentId: string, relId: string, relType: string) { | 55 | getLiveDetails(contentId: string, relId: string, relType: string) { |
| 16 | return new Promise<Array<LiveDetailsBean>>((success, fail) => { | 56 | return new Promise<Array<LiveDetailsBean>>((success, fail) => { |
| 1 | -import { LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | +import { Action, ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | import { LiveCommentComponent } from 'wdComponent/Index' | 2 | import { LiveCommentComponent } from 'wdComponent/Index' |
| 3 | +import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel' | ||
| 4 | +import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView' | ||
| 3 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' | 5 | import PageModel from 'wdComponent/src/main/ets/viewmodel/PageModel' |
| 4 | import { DisplayDirection, ViewType } from 'wdConstant/Index' | 6 | import { DisplayDirection, ViewType } from 'wdConstant/Index' |
| 7 | +import { ContentDetailRequest } from 'wdDetailPlayApi/Index' | ||
| 8 | +import { ResponseDTO } from 'wdNetwork/Index' | ||
| 5 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 9 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 6 | import { ChartItemCompereComponent } from './ChartItemCompereComponent' | 10 | import { ChartItemCompereComponent } from './ChartItemCompereComponent' |
| 7 | import { ChatItemComponent } from './ChartItemComponent' | 11 | import { ChatItemComponent } from './ChartItemComponent' |
| 12 | +import { router } from '@kit.ArkUI' | ||
| 13 | +import { WindowModel } from 'wdKit/Index' | ||
| 8 | 14 | ||
| 15 | +const TAG = "PlayerCommentComponent" | ||
| 9 | 16 | ||
| 10 | @Component | 17 | @Component |
| 11 | export struct PlayerCommentComponent { | 18 | export struct PlayerCommentComponent { |
| @@ -15,10 +22,25 @@ export struct PlayerCommentComponent { | @@ -15,10 +22,25 @@ export struct PlayerCommentComponent { | ||
| 15 | @Consume displayDirection: DisplayDirection | 22 | @Consume displayDirection: DisplayDirection |
| 16 | @State private pageModel: PageModel = new PageModel() | 23 | @State private pageModel: PageModel = new PageModel() |
| 17 | @State liveChatList: Array<LiveRoomItemBean> = [] | 24 | @State liveChatList: Array<LiveRoomItemBean> = [] |
| 25 | + @State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | ||
| 26 | + @State publishCommentModel: publishCommentModel = new publishCommentModel() | ||
| 27 | + @State contentId: string = '' | ||
| 28 | + @State relId: string = '' | ||
| 29 | + @State relType: string = '' | ||
| 18 | scroller: Scroller = new Scroller() | 30 | scroller: Scroller = new Scroller() |
| 19 | 31 | ||
| 20 | aboutToAppear(): void { | 32 | aboutToAppear(): void { |
| 21 | this.getLiveChatList() | 33 | this.getLiveChatList() |
| 34 | + const action: Action = router.getParams() as Action | ||
| 35 | + if (action) { | ||
| 36 | + this.contentId = action.params?.contentID || '' | ||
| 37 | + if (action.params && action.params.extra) { | ||
| 38 | + this.relId = action.params.extra.relId || '' | ||
| 39 | + this.relType = action.params.extra.relType || '' | ||
| 40 | + } | ||
| 41 | + this.getContentDetail(this.contentId, this.relId, this.relType) | ||
| 42 | + } | ||
| 43 | + | ||
| 22 | } | 44 | } |
| 23 | 45 | ||
| 24 | liveDetailsBeanChange() { | 46 | liveDetailsBeanChange() { |
| @@ -58,6 +80,32 @@ export struct PlayerCommentComponent { | @@ -58,6 +80,32 @@ export struct PlayerCommentComponent { | ||
| 58 | }) | 80 | }) |
| 59 | } | 81 | } |
| 60 | 82 | ||
| 83 | + async getContentDetail(contentId: string, relId: string, relType: string) { | ||
| 84 | + await ContentDetailRequest.getContentDetail({ | ||
| 85 | + contentId: contentId, | ||
| 86 | + relId: relId, | ||
| 87 | + relType: relType | ||
| 88 | + }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => { | ||
| 89 | + console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data)) | ||
| 90 | + if (resDTO.data) { | ||
| 91 | + | ||
| 92 | + this.contentDetailData = resDTO.data?.[0]; | ||
| 93 | + | ||
| 94 | + if (this.contentDetailData?.openComment) { | ||
| 95 | + this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 96 | + this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId) | ||
| 97 | + this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 98 | + this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType) | ||
| 99 | + this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId) | ||
| 100 | + this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle) | ||
| 101 | + this.publishCommentModel.targetType = String(this.contentDetailData?.newsType) | ||
| 102 | + } | ||
| 103 | + | ||
| 104 | + | ||
| 105 | + } | ||
| 106 | + }) | ||
| 107 | + } | ||
| 108 | + | ||
| 61 | build() { | 109 | build() { |
| 62 | Column() { | 110 | Column() { |
| 63 | List({ scroller: this.scroller }) { | 111 | List({ scroller: this.scroller }) { |
| @@ -76,9 +124,21 @@ export struct PlayerCommentComponent { | @@ -76,9 +124,21 @@ export struct PlayerCommentComponent { | ||
| 76 | .scrollBar(BarState.Off) | 124 | .scrollBar(BarState.Off) |
| 77 | .margin({ bottom: 20 }) | 125 | .margin({ bottom: 20 }) |
| 78 | 126 | ||
| 79 | - LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | 127 | + OperRowListView({ |
| 128 | + bgColor: Color.Transparent, | ||
| 129 | + operationButtonList: ['comment', 'collect', 'share', 'like'], | ||
| 130 | + contentDetailData: this.contentDetailData, | ||
| 131 | + publishCommentModel: this.publishCommentModel, | ||
| 132 | + onBack: () => { | ||
| 133 | + WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 134 | + WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 135 | + } | ||
| 136 | + }) | ||
| 80 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 137 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 81 | - .backgroundColor(Color.Black) | 138 | + |
| 139 | + // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | ||
| 140 | + // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | ||
| 141 | + // .backgroundColor(Color.Black) | ||
| 82 | }.alignItems(HorizontalAlign.Start) | 142 | }.alignItems(HorizontalAlign.Start) |
| 83 | 143 | ||
| 84 | } | 144 | } |
| @@ -10,6 +10,8 @@ export struct PlayerComponent { | @@ -10,6 +10,8 @@ export struct PlayerComponent { | ||
| 10 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 10 | @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean |
| 11 | @Consume @Watch('pageShowChange') pageShow: number | 11 | @Consume @Watch('pageShowChange') pageShow: number |
| 12 | @Consume @Watch('pageHideChange') pageHide: number | 12 | @Consume @Watch('pageHideChange') pageHide: number |
| 13 | + @Consume isShowControl: boolean | ||
| 14 | + @Consume liveState: string | ||
| 13 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 15 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 14 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 16 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 15 | @State imgUrl: string = '' | 17 | @State imgUrl: string = '' |
| @@ -36,8 +38,7 @@ export struct PlayerComponent { | @@ -36,8 +38,7 @@ export struct PlayerComponent { | ||
| 36 | } | 38 | } |
| 37 | 39 | ||
| 38 | aboutToDisappear(): void { | 40 | aboutToDisappear(): void { |
| 39 | - this.playerController.onCanplay = () => { | ||
| 40 | - } | 41 | + |
| 41 | this.playerController?.pause() | 42 | this.playerController?.pause() |
| 42 | this.playerController?.stop() | 43 | this.playerController?.stop() |
| 43 | this.playerController?.release() | 44 | this.playerController?.release() |
| @@ -92,6 +93,11 @@ export struct PlayerComponent { | @@ -92,6 +93,11 @@ export struct PlayerComponent { | ||
| 92 | .width('100%') | 93 | .width('100%') |
| 93 | .align(Alignment.Top) | 94 | .align(Alignment.Top) |
| 94 | .alignContent(Alignment.Top) | 95 | .alignContent(Alignment.Top) |
| 96 | + .onClick(() => { | ||
| 97 | + if (this.liveState === 'end') { | ||
| 98 | + this.isShowControl = !this.isShowControl | ||
| 99 | + } | ||
| 100 | + }) | ||
| 95 | } | 101 | } |
| 96 | .height('100%') | 102 | .height('100%') |
| 97 | .width('100%') | 103 | .width('100%') |
| @@ -26,11 +26,11 @@ export struct PlayerInfoComponent { | @@ -26,11 +26,11 @@ export struct PlayerInfoComponent { | ||
| 26 | .width('100%') | 26 | .width('100%') |
| 27 | .height('100%') | 27 | .height('100%') |
| 28 | .index(this.swiperIndex) | 28 | .index(this.swiperIndex) |
| 29 | - .onClick(() => { | ||
| 30 | - if (this.liveState === 'end') { | ||
| 31 | - this.isShowControl = !this.isShowControl | ||
| 32 | - } | ||
| 33 | - }) | 29 | + // .onClick(() => { |
| 30 | + // if (this.liveState === 'end') { | ||
| 31 | + // this.isShowControl = !this.isShowControl | ||
| 32 | + // } | ||
| 33 | + // }) | ||
| 34 | .onChange((index) => { | 34 | .onChange((index) => { |
| 35 | this.swiperIndex = index | 35 | this.swiperIndex = index |
| 36 | }) | 36 | }) |
| @@ -29,7 +29,7 @@ export struct VideoChannelDetail { | @@ -29,7 +29,7 @@ export struct VideoChannelDetail { | ||
| 29 | private groupId: string = '' // 楼层id | 29 | private groupId: string = '' // 楼层id |
| 30 | private pageId: string = '' //页面id | 30 | private pageId: string = '' //页面id |
| 31 | private pageNum: number = 1 | 31 | private pageNum: number = 1 |
| 32 | - private pageSize: number = 10 | 32 | + private pageSize: number = 5 |
| 33 | private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down | 33 | private loadStrategy: string = 'first_load' // 首次加载: first_load, 上推刷新: push_up, 下拉刷新: pull_down |
| 34 | private refreshTime: number = new Date().getTime() // 第一页刷新时间,用于频道分页排序时过滤,查询时携带【首刷、下拉取当前最新时间;其他的都使用首刷的时间】 | 34 | private refreshTime: number = new Date().getTime() // 第一页刷新时间,用于频道分页排序时过滤,查询时携带【首刷、下拉取当前最新时间;其他的都使用首刷的时间】 |
| 35 | private channelId: string = '' // 频道id | 35 | private channelId: string = '' // 频道id |
| @@ -56,11 +56,11 @@ export struct DetailDialog { | @@ -56,11 +56,11 @@ export struct DetailDialog { | ||
| 56 | .width('100%') | 56 | .width('100%') |
| 57 | .alignItems(HorizontalAlign.Start) | 57 | .alignItems(HorizontalAlign.Start) |
| 58 | // .backgroundColor('#80000000') | 58 | // .backgroundColor('#80000000') |
| 59 | - // .linearGradient({ | ||
| 60 | - // direction: GradientDirection.Top, // 渐变方向 | ||
| 61 | - // repeating: false, // 渐变颜色是否重复 | ||
| 62 | - // colors: [['rgba(0, 0, 0, 0.1)', 0.0], ['rgba(0, 0, 0, 0)', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果 | ||
| 63 | - // }) | 59 | + .linearGradient({ |
| 60 | + direction: GradientDirection.Bottom, // 渐变方向 | ||
| 61 | + colors: [['rgba(0,0,0,0)', 0.1], ['#000000', 0.66], | ||
| 62 | + ['#000000', 1.0]] // 数组末尾元素占比小于1时满足重复着色效果 | ||
| 63 | + }) | ||
| 64 | .padding({ | 64 | .padding({ |
| 65 | top: 20, | 65 | top: 20, |
| 66 | bottom: 30, | 66 | bottom: 30, |
| @@ -5,7 +5,7 @@ import router from '@ohos.router' | @@ -5,7 +5,7 @@ import router from '@ohos.router' | ||
| 5 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; | 5 | import { WDRouterRule, WDRouterPage } from 'wdRouter'; |
| 6 | import { SettingPasswordParams } from './SettingPasswordLayout' | 6 | import { SettingPasswordParams } from './SettingPasswordLayout' |
| 7 | import { Router } from '@ohos.arkui.UIContext' | 7 | import { Router } from '@ohos.arkui.UIContext' |
| 8 | -import { CustomToast, EmitterEventId, EmitterUtils, SPHelper, ToastUtils } from 'wdKit/Index' | 8 | +import { CustomToast, EmitterEventId, EmitterUtils, NetworkUtil, SPHelper, ToastUtils } from 'wdKit/Index' |
| 9 | import { SpConstants } from 'wdConstant/Index' | 9 | import { SpConstants } from 'wdConstant/Index' |
| 10 | import { emitter } from '@kit.BasicServicesKit' | 10 | import { emitter } from '@kit.BasicServicesKit' |
| 11 | 11 | ||
| @@ -128,7 +128,12 @@ struct ForgetPasswordPage { | @@ -128,7 +128,12 @@ struct ForgetPasswordPage { | ||
| 128 | this.isCodeSend=false | 128 | this.isCodeSend=false |
| 129 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) | 129 | Logger.debug(TAG, "sendVerifyCode: " + verifyCode) |
| 130 | }).catch((message: string)=>{ | 130 | }).catch((message: string)=>{ |
| 131 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 132 | + if (netStatus) { | ||
| 131 | this.showToastTip(message) | 133 | this.showToastTip(message) |
| 134 | + } else { | ||
| 135 | + this.showToastTip("验证码获取失败,请重新尝试") | ||
| 136 | + } | ||
| 132 | this.codeStateSuccess=false | 137 | this.codeStateSuccess=false |
| 133 | this.isCodeSend=false | 138 | this.isCodeSend=false |
| 134 | }) | 139 | }) |
| @@ -13,12 +13,25 @@ export struct LoginInputComponent { | @@ -13,12 +13,25 @@ export struct LoginInputComponent { | ||
| 13 | pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2 | 13 | pageType?:number; //0、登录->忘记密码 1、设置->重置密码 2、设置->更换手机号页面1 3、设置->更换手机号页面2 |
| 14 | lastTime: number = 0 | 14 | lastTime: number = 0 |
| 15 | @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时 | 15 | @Link @Watch('startCount') codeStateSuccess: boolean //验证码获取成功与否回调 成功显示倒计时 |
| 16 | + @Watch('onCheckChange') @Prop protocolState: boolean = false //协议勾选状态 | ||
| 17 | + @State isNeedProtocol:boolean = false | ||
| 18 | + | ||
| 16 | build() { | 19 | build() { |
| 17 | Column() { | 20 | Column() { |
| 18 | this.addCodeLayout() | 21 | this.addCodeLayout() |
| 19 | }.width('100%').padding({ left: 25, right: 25 }) | 22 | }.width('100%').padding({ left: 25, right: 25 }) |
| 20 | } | 23 | } |
| 21 | 24 | ||
| 25 | + onCheckChange(){ | ||
| 26 | + if(this.isNeedProtocol){ | ||
| 27 | + if(this.protocolState && this.phoneContent.length >= 11){ | ||
| 28 | + this.codeBtnState = true | ||
| 29 | + }else{ | ||
| 30 | + this.codeBtnState = false | ||
| 31 | + } | ||
| 32 | + } | ||
| 33 | + } | ||
| 34 | + | ||
| 22 | async aboutToAppear(){ | 35 | async aboutToAppear(){ |
| 23 | if (this.pageType == 1) { | 36 | if (this.pageType == 1) { |
| 24 | this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string; | 37 | this.phoneContent = await SPHelper.default.get(SpConstants.USER_PHONE,"") as string; |
| @@ -27,7 +40,7 @@ export struct LoginInputComponent { | @@ -27,7 +40,7 @@ export struct LoginInputComponent { | ||
| 27 | @Builder | 40 | @Builder |
| 28 | addCodeLayout() { | 41 | addCodeLayout() { |
| 29 | if (this.pageType == 1){ | 42 | if (this.pageType == 1){ |
| 30 | - TextInput({ placeholder: this.securityPhone(this.phoneContent) }) | 43 | + TextInput({ text: this.securityPhone(this.phoneContent) }) |
| 31 | .placeholderColor("#CCCCCC") | 44 | .placeholderColor("#CCCCCC") |
| 32 | .fontSize(16) | 45 | .fontSize(16) |
| 33 | .height(48) | 46 | .height(48) |
| @@ -59,11 +72,20 @@ export struct LoginInputComponent { | @@ -59,11 +72,20 @@ export struct LoginInputComponent { | ||
| 59 | .onChange((content) => { | 72 | .onChange((content) => { |
| 60 | this.phoneContent = content | 73 | this.phoneContent = content |
| 61 | this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4) | 74 | this.isSubmit = (this.phoneContent.length >= 11 && this.codeContent.length >= 4) |
| 62 | - if (content.length >= 11) { | 75 | + |
| 76 | + if(this.isNeedProtocol){ | ||
| 77 | + if (content.length >= 11 && this.protocolState) { | ||
| 63 | this.codeBtnState = true | 78 | this.codeBtnState = true |
| 64 | } else { | 79 | } else { |
| 65 | this.codeBtnState = false | 80 | this.codeBtnState = false |
| 66 | } | 81 | } |
| 82 | + }else{ | ||
| 83 | + if (content.length >= 11 ) { | ||
| 84 | + this.codeBtnState = true | ||
| 85 | + } else { | ||
| 86 | + this.codeBtnState = false | ||
| 87 | + } | ||
| 88 | + } | ||
| 67 | }) | 89 | }) |
| 68 | } | 90 | } |
| 69 | 91 | ||
| @@ -97,6 +119,12 @@ export struct LoginInputComponent { | @@ -97,6 +119,12 @@ export struct LoginInputComponent { | ||
| 97 | if (this.phoneContent.length < 11) { | 119 | if (this.phoneContent.length < 11) { |
| 98 | return | 120 | return |
| 99 | } | 121 | } |
| 122 | + if(this.isNeedProtocol){ | ||
| 123 | + if (!this.protocolState ) { | ||
| 124 | + return | ||
| 125 | + } | ||
| 126 | + } | ||
| 127 | + | ||
| 100 | let currentTime = DateTimeUtils.getTimeStamp() | 128 | let currentTime = DateTimeUtils.getTimeStamp() |
| 101 | if (currentTime - this.lastTime < 500) { | 129 | if (currentTime - this.lastTime < 500) { |
| 102 | return | 130 | return |
| 1 | -import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils } from 'wdKit' | 1 | +import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, StringUtils, NetworkUtil } from 'wdKit' |
| 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' | 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' |
| 3 | import router from '@ohos.router' | 3 | import router from '@ohos.router' |
| 4 | import { LoginViewModel } from './LoginViewModel' | 4 | import { LoginViewModel } from './LoginViewModel' |
| @@ -106,7 +106,9 @@ struct LoginPage { | @@ -106,7 +106,9 @@ struct LoginPage { | ||
| 106 | codeContent: $codeContent, | 106 | codeContent: $codeContent, |
| 107 | isSubmit: $isSubmit, | 107 | isSubmit: $isSubmit, |
| 108 | isCodeSend: $isCodeSend, | 108 | isCodeSend: $isCodeSend, |
| 109 | - codeStateSuccess:$codeStateSuccess | 109 | + codeStateSuccess:$codeStateSuccess, |
| 110 | + protocolState:this.protocolState, | ||
| 111 | + isNeedProtocol:true | ||
| 110 | }) | 112 | }) |
| 111 | } else { | 113 | } else { |
| 112 | this.addPassword() | 114 | this.addPassword() |
| @@ -347,7 +349,12 @@ struct LoginPage { | @@ -347,7 +349,12 @@ struct LoginPage { | ||
| 347 | this.codeStateSuccess=true | 349 | this.codeStateSuccess=true |
| 348 | this.isCodeSend=false | 350 | this.isCodeSend=false |
| 349 | }).catch((message:string)=>{ | 351 | }).catch((message:string)=>{ |
| 352 | + let netStatus = NetworkUtil.isNetConnected() | ||
| 353 | + if (netStatus) { | ||
| 350 | this.showToastTip(message) | 354 | this.showToastTip(message) |
| 355 | + } else { | ||
| 356 | + this.showToastTip("验证码获取失败,请重新尝试") | ||
| 357 | + } | ||
| 351 | this.codeStateSuccess=false | 358 | this.codeStateSuccess=false |
| 352 | this.isCodeSend=false | 359 | this.isCodeSend=false |
| 353 | Logger.debug(TAG, "sendVerifyCode: " + message) | 360 | Logger.debug(TAG, "sendVerifyCode: " + message) |
| 1 | { | 1 | { |
| 2 | - "hvigorVersion": "file:../dependencies/hvigor-4.1.2.tgz", | 2 | + "hvigorVersion": "file:../dependencies/hvigor-4.3.0.tgz", |
| 3 | "dependencies": { | 3 | "dependencies": { |
| 4 | - "@ohos/hvigor-ohos-plugin": "file:../dependencies/hvigor-ohos-plugin-4.1.2.tgz", | 4 | + "@ohos/hvigor-ohos-plugin": "file:../dependencies/hvigor-ohos-plugin-4.3.0.tgz", |
| 5 | "rollup": "file:../dependencies/rollup.tgz", | 5 | "rollup": "file:../dependencies/rollup.tgz", |
| 6 | }, | 6 | }, |
| 7 | "execution": { | 7 | "execution": { |
| @@ -21,7 +21,7 @@ struct MainPage { | @@ -21,7 +21,7 @@ struct MainPage { | ||
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | aboutToAppear() { | 23 | aboutToAppear() { |
| 24 | - HWLocationUtils.startLocationService() | 24 | + |
| 25 | this.breakpointSystem.register() | 25 | this.breakpointSystem.register() |
| 26 | 26 | ||
| 27 | let context = getContext(this) as common.UIAbilityContext | 27 | let context = getContext(this) as common.UIAbilityContext |
| @@ -31,6 +31,7 @@ struct MainPage { | @@ -31,6 +31,7 @@ struct MainPage { | ||
| 31 | 31 | ||
| 32 | // WDPushNotificationManager.getInstance().sendLocalNotification() | 32 | // WDPushNotificationManager.getInstance().sendLocalNotification() |
| 33 | } | 33 | } |
| 34 | + HWLocationUtils.startLocationService() | ||
| 34 | }) | 35 | }) |
| 35 | 36 | ||
| 36 | Logger.info(TAG, `aboutToAppear `); | 37 | Logger.info(TAG, `aboutToAppear `); |
| @@ -17,7 +17,7 @@ struct MorningEveningPaperPage { | @@ -17,7 +17,7 @@ struct MorningEveningPaperPage { | ||
| 17 | 17 | ||
| 18 | pageTransition() { | 18 | pageTransition() { |
| 19 | // 定义页面进入时的效果,从底侧滑入 | 19 | // 定义页面进入时的效果,从底侧滑入 |
| 20 | - PageTransitionEnter({ type: RouteType.None, duration: 300 }) | 20 | + PageTransitionEnter({ type: RouteType.Push, duration: 300 }) |
| 21 | .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { | 21 | .slide(SlideEffect.Bottom).onEnter((type: RouteType, progress: number) => { |
| 22 | if (progress >= 0.99) { | 22 | if (progress >= 0.99) { |
| 23 | WindowModel.shared.setWindowLayoutFullScreen(true) | 23 | WindowModel.shared.setWindowLayoutFullScreen(true) |
| @@ -25,7 +25,7 @@ struct MorningEveningPaperPage { | @@ -25,7 +25,7 @@ struct MorningEveningPaperPage { | ||
| 25 | } | 25 | } |
| 26 | }) | 26 | }) |
| 27 | // 定义页面退出时的效果,向底侧滑出 | 27 | // 定义页面退出时的效果,向底侧滑出 |
| 28 | - PageTransitionExit({ type: RouteType.None, duration: 300 }) | 28 | + PageTransitionExit({ type: RouteType.Pop, duration: 300 }) |
| 29 | .slide(SlideEffect.Bottom) | 29 | .slide(SlideEffect.Bottom) |
| 30 | } | 30 | } |
| 31 | 31 |
-
Please register or login to post a comment