Showing
21 changed files
with
463 additions
and
251 deletions
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | "app": { | 2 | "app": { |
| 3 | "bundleName": "com.peopledailychina.hosactivity", | 3 | "bundleName": "com.peopledailychina.hosactivity", |
| 4 | "vendor": "$string:app_vendor", | 4 | "vendor": "$string:app_vendor", |
| 5 | - "versionCode": 7370, | ||
| 6 | - "versionName": "7.3.7.0", | 5 | + "versionCode": 7390, |
| 6 | + "versionName": "7.3.9.0", | ||
| 7 | "icon": "$media:app_icon", | 7 | "icon": "$media:app_icon", |
| 8 | "label": "$string:app_name" | 8 | "label": "$string:app_name" |
| 9 | } | 9 | } |
| @@ -48,9 +48,9 @@ export struct ENewspaperItemComponent { | @@ -48,9 +48,9 @@ export struct ENewspaperItemComponent { | ||
| 48 | this.isShowSkeleton = false | 48 | this.isShowSkeleton = false |
| 49 | }) | 49 | }) |
| 50 | .objectFit(ImageFit.Fill) | 50 | .objectFit(ImageFit.Fill) |
| 51 | - .visibility(this.isShowSkeleton ? Visibility.None : Visibility.Visible) | 51 | + .zIndex(10) |
| 52 | newsSkeleton() | 52 | newsSkeleton() |
| 53 | - .visibility(this.isShowSkeleton ? Visibility.Visible : Visibility.None) | 53 | + .zIndex(1) |
| 54 | if (this.contentWidth !== 0) { | 54 | if (this.contentWidth !== 0) { |
| 55 | Canvas(this.context) | 55 | Canvas(this.context) |
| 56 | .width(px2vp(this.contentWidth)) | 56 | .width(px2vp(this.contentWidth)) |
| @@ -59,6 +59,7 @@ export struct ENewspaperItemComponent { | @@ -59,6 +59,7 @@ export struct ENewspaperItemComponent { | ||
| 59 | .onReady(() => { | 59 | .onReady(() => { |
| 60 | 60 | ||
| 61 | }) | 61 | }) |
| 62 | + .zIndex(15) | ||
| 62 | } | 63 | } |
| 63 | } | 64 | } |
| 64 | .padding({ | 65 | .padding({ |
| @@ -14,6 +14,7 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | @@ -14,6 +14,7 @@ import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | ||
| 14 | import { common } from '@kit.AbilityKit'; | 14 | import { common } from '@kit.AbilityKit'; |
| 15 | import { PageRepository } from '../repository/PageRepository'; | 15 | import { PageRepository } from '../repository/PageRepository'; |
| 16 | import { CommentDialogView } from './CommentDialogView'; | 16 | import { CommentDialogView } from './CommentDialogView'; |
| 17 | +import { faceDetector } from '@kit.CoreVisionKit'; | ||
| 17 | 18 | ||
| 18 | const TAG: string = 'SpacialTopicPageComponent' | 19 | const TAG: string = 'SpacialTopicPageComponent' |
| 19 | 20 | ||
| @@ -40,7 +41,7 @@ export struct SpacialTopicPageComponent { | @@ -40,7 +41,7 @@ export struct SpacialTopicPageComponent { | ||
| 40 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 | 41 | @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0 |
| 41 | @State isNetConnected: boolean = true | 42 | @State isNetConnected: boolean = true |
| 42 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 43 | @Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | - | 44 | + @State showComment: boolean = false |
| 44 | private trySendData2H5() { | 45 | private trySendData2H5() { |
| 45 | if (!this.webPrepared || !this.dataPrepared) { | 46 | if (!this.webPrepared || !this.dataPrepared) { |
| 46 | return | 47 | return |
| @@ -204,14 +205,14 @@ export struct SpacialTopicPageComponent { | @@ -204,14 +205,14 @@ export struct SpacialTopicPageComponent { | ||
| 204 | this.showCommentList = true | 205 | this.showCommentList = true |
| 205 | } | 206 | } |
| 206 | }) | 207 | }) |
| 207 | - // //全部评论 | ||
| 208 | - // CommentDialogView({ | ||
| 209 | - // index: $index, | ||
| 210 | - // currentIndex: $currentIndex, | ||
| 211 | - // showCommentList: $showCommentList, | ||
| 212 | - // publishCommentModel: $publishCommentModel, | ||
| 213 | - // interactData: $interactData, | ||
| 214 | - // }) | 208 | + //全部评论 |
| 209 | + CommentDialogView({ | ||
| 210 | + index: $index, | ||
| 211 | + currentIndex: $currentIndex, | ||
| 212 | + showCommentList: $showCommentList, | ||
| 213 | + publishCommentModel: $publishCommentModel, | ||
| 214 | + interactData: $interactData, | ||
| 215 | + }).visibility(this.showComment?Visibility.Visible:Visibility.Hidden) | ||
| 215 | } | 216 | } |
| 216 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) | 217 | }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) |
| 217 | } | 218 | } |
| @@ -4,6 +4,8 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' | @@ -4,6 +4,8 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' | ||
| 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' | 4 | import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' |
| 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' | 5 | import { CommentListItem } from '../../../viewmodel/CommentListItem' |
| 6 | import measure from '@ohos.measure' | 6 | import measure from '@ohos.measure' |
| 7 | +import { TrackConstants, TrackingContent, TrackParamConvert } from 'wdTracking/Index' | ||
| 8 | +import { ProcessUtils } from 'wdRouter/Index' | ||
| 7 | 9 | ||
| 8 | @Component | 10 | @Component |
| 9 | export struct ChildCommentComponent { | 11 | export struct ChildCommentComponent { |
| @@ -189,6 +191,11 @@ export struct ChildCommentComponent { | @@ -189,6 +191,11 @@ export struct ChildCommentComponent { | ||
| 189 | .width('100%') | 191 | .width('100%') |
| 190 | .height('69lpx') | 192 | .height('69lpx') |
| 191 | .justifyContent(FlexAlign.SpaceBetween) | 193 | .justifyContent(FlexAlign.SpaceBetween) |
| 194 | + .onClick(()=>{ | ||
| 195 | + let content = getParams(this.data) | ||
| 196 | + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content)) | ||
| 197 | + ProcessUtils.processPage(content) | ||
| 198 | + }) | ||
| 192 | 199 | ||
| 193 | }.height('69lpx') | 200 | }.height('69lpx') |
| 194 | .justifyContent(FlexAlign.Center) | 201 | .justifyContent(FlexAlign.Center) |
| @@ -90,12 +90,12 @@ export struct HomePageBottomCommentComponent { | @@ -90,12 +90,12 @@ export struct HomePageBottomCommentComponent { | ||
| 90 | isLastItem: index === this.data_comment.totalCount() - 1 | 90 | isLastItem: index === this.data_comment.totalCount() - 1 |
| 91 | }) | 91 | }) |
| 92 | } | 92 | } |
| 93 | - .onClick(()=>{ | ||
| 94 | - let content = getParams(item) | ||
| 95 | - TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content)) | ||
| 96 | - content.customParamTargetLayout = "comment" | ||
| 97 | - ProcessUtils.processPage(content) | ||
| 98 | - }) | 93 | + // .onClick(()=>{ |
| 94 | + // let content = getParams(item) | ||
| 95 | + // TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content)) | ||
| 96 | + // content.customParamTargetLayout = "comment" | ||
| 97 | + // ProcessUtils.processPage(content) | ||
| 98 | + // }) | ||
| 99 | .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 99 | .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 100 | if (isVisible) { | 100 | if (isVisible) { |
| 101 | let contentDTO = getParams(item) | 101 | let contentDTO = getParams(item) |
| @@ -109,6 +109,7 @@ export struct HomePageBottomFollowComponent { | @@ -109,6 +109,7 @@ export struct HomePageBottomFollowComponent { | ||
| 109 | CustomPullToRefresh({ | 109 | CustomPullToRefresh({ |
| 110 | alldata:this.data_follow, | 110 | alldata:this.data_follow, |
| 111 | scroller:this.scroller, | 111 | scroller:this.scroller, |
| 112 | + hasMore:this.hasMore, | ||
| 112 | customList:()=>{ | 113 | customList:()=>{ |
| 113 | this.ListLayout() | 114 | this.ListLayout() |
| 114 | }, | 115 | }, |
| @@ -128,6 +129,7 @@ export struct HomePageBottomFollowComponent { | @@ -128,6 +129,7 @@ export struct HomePageBottomFollowComponent { | ||
| 128 | this.isLoading = true | 129 | this.isLoading = true |
| 129 | //加载分页数据 | 130 | //加载分页数据 |
| 130 | this.getNewPageData() | 131 | this.getNewPageData() |
| 132 | + if(resolve) resolve('刷新成功') | ||
| 131 | } | 133 | } |
| 132 | } | 134 | } |
| 133 | }) | 135 | }) |
| @@ -197,7 +199,7 @@ export struct HomePageBottomFollowComponent { | @@ -197,7 +199,7 @@ export struct HomePageBottomFollowComponent { | ||
| 197 | 199 | ||
| 198 | getMyFollowListDetail() { | 200 | getMyFollowListDetail() { |
| 199 | if (this.hasMore) { | 201 | if (this.hasMore) { |
| 200 | - let object = new FollowListDetailRequestItem(-1, 20, this.curPageNum) | 202 | + let object = new FollowListDetailRequestItem(-1, 10, this.curPageNum) |
| 201 | 203 | ||
| 202 | MinePageDatasModel.getMineFollowListData(object, getContext(this)).then((value) => { | 204 | MinePageDatasModel.getMineFollowListData(object, getContext(this)).then((value) => { |
| 203 | if (this.curPageNum === 1) this.data_follow.clear() | 205 | if (this.curPageNum === 1) this.data_follow.clear() |
| @@ -222,7 +224,7 @@ export struct HomePageBottomFollowComponent { | @@ -222,7 +224,7 @@ export struct HomePageBottomFollowComponent { | ||
| 222 | }) | 224 | }) |
| 223 | this.data_follow.notifyDataReload() | 225 | this.data_follow.notifyDataReload() |
| 224 | this.count = this.data_follow.totalCount() | 226 | this.count = this.data_follow.totalCount() |
| 225 | - if (this.data_follow.totalCount() < value.totalCount) { | 227 | + if (value.hasNext === 1) { |
| 226 | this.curPageNum++ | 228 | this.curPageNum++ |
| 227 | } else { | 229 | } else { |
| 228 | this.hasMore = false | 230 | this.hasMore = false |
| @@ -91,11 +91,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -91,11 +91,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 91 | isLastItem: index === this.data_comment.totalCount() - 1, | 91 | isLastItem: index === this.data_comment.totalCount() - 1, |
| 92 | }) | 92 | }) |
| 93 | } | 93 | } |
| 94 | - .onClick(()=>{ | ||
| 95 | - let content = getParams(item) | ||
| 96 | - TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content)) | ||
| 97 | - ProcessUtils.processPage(content) | ||
| 98 | - }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | 94 | + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 99 | if (isVisible) { | 95 | if (isVisible) { |
| 100 | let contentDTO = getParams(item) | 96 | let contentDTO = getParams(item) |
| 101 | //埋点crash 后面看看 | 97 | //埋点crash 后面看看 |
| @@ -70,6 +70,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -70,6 +70,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 70 | CustomPullToRefresh({ | 70 | CustomPullToRefresh({ |
| 71 | alldata:this.data_follow, | 71 | alldata:this.data_follow, |
| 72 | scroller:this.scroller, | 72 | scroller:this.scroller, |
| 73 | + hasMore:this.hasMore, | ||
| 73 | customList:()=>{ | 74 | customList:()=>{ |
| 74 | this.ListLayout() | 75 | this.ListLayout() |
| 75 | }, | 76 | }, |
| @@ -89,6 +90,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -89,6 +90,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 89 | this.isLoading = true | 90 | this.isLoading = true |
| 90 | //加载分页数据 | 91 | //加载分页数据 |
| 91 | this.getNewPageData() | 92 | this.getNewPageData() |
| 93 | + if(resolve) resolve('刷新成功') | ||
| 92 | } | 94 | } |
| 93 | } | 95 | } |
| 94 | }) | 96 | }) |
| @@ -160,7 +162,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -160,7 +162,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 160 | this.isLoading = true | 162 | this.isLoading = true |
| 161 | //关注列表 | 163 | //关注列表 |
| 162 | if(this.hasMore){ | 164 | if(this.hasMore){ |
| 163 | - let object = new UserFollowListRequestItem(Number(this.curUserId),20,this.curPageNum,"1") | 165 | + let object = new UserFollowListRequestItem(Number(this.curUserId),10,this.curPageNum,"1") |
| 164 | 166 | ||
| 165 | MinePageDatasModel.getOtherUserFollowListData(object,getContext(this)).then((value)=>{ | 167 | MinePageDatasModel.getOtherUserFollowListData(object,getContext(this)).then((value)=>{ |
| 166 | 168 | ||
| @@ -186,7 +188,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -186,7 +188,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 186 | this.data_follow.notifyDataReload() | 188 | this.data_follow.notifyDataReload() |
| 187 | this.count = this.data_follow.totalCount() | 189 | this.count = this.data_follow.totalCount() |
| 188 | 190 | ||
| 189 | - if (this.data_follow.totalCount() < value.totalCount) { | 191 | + if (value.hasNext === 1) { |
| 190 | this.curPageNum++ | 192 | this.curPageNum++ |
| 191 | }else { | 193 | }else { |
| 192 | this.hasMore = false | 194 | this.hasMore = false |
| @@ -665,7 +665,7 @@ export struct PaperSingleColumn999CardView { | @@ -665,7 +665,7 @@ export struct PaperSingleColumn999CardView { | ||
| 665 | buildSourceString(): string { | 665 | buildSourceString(): string { |
| 666 | let contentString: string = '' | 666 | let contentString: string = '' |
| 667 | if (this.item?.rmhInfo?.rmhName.length > 0) { | 667 | if (this.item?.rmhInfo?.rmhName.length > 0) { |
| 668 | - contentString = this.item?.rmhInfo?.rmhName | 668 | + // contentString = this.item?.rmhInfo?.rmhName |
| 669 | }else if(this.item?.source.length > 0){ | 669 | }else if(this.item?.source.length > 0){ |
| 670 | contentString = this.item?.source | 670 | contentString = this.item?.source |
| 671 | } | 671 | } |
| @@ -12,7 +12,9 @@ const MORE_CHANNEL: string = '更多频道' | @@ -12,7 +12,9 @@ const MORE_CHANNEL: string = '更多频道' | ||
| 12 | const LOCAL_CHANNEL: string = '地方频道' | 12 | const LOCAL_CHANNEL: string = '地方频道' |
| 13 | 13 | ||
| 14 | const TAG: string = 'ChannelSubscriptionLayout' | 14 | const TAG: string = 'ChannelSubscriptionLayout' |
| 15 | + | ||
| 15 | export { ChannelSubscriptionLayout } | 16 | export { ChannelSubscriptionLayout } |
| 17 | + | ||
| 16 | @Component | 18 | @Component |
| 17 | struct ChannelSubscriptionLayout { | 19 | struct ChannelSubscriptionLayout { |
| 18 | @State indexSettingArray: string [] = ['推荐', '热点'] | 20 | @State indexSettingArray: string [] = ['推荐', '热点'] |
| @@ -20,14 +22,13 @@ struct ChannelSubscriptionLayout { | @@ -20,14 +22,13 @@ struct ChannelSubscriptionLayout { | ||
| 20 | @Link currentTopNavSelectedIndex: number; | 22 | @Link currentTopNavSelectedIndex: number; |
| 21 | @Prop homeChannelList: TopNavDTO [] | 23 | @Prop homeChannelList: TopNavDTO [] |
| 22 | // 我的频道栏目的频道信息数组 | 24 | // 我的频道栏目的频道信息数组 |
| 23 | - @Link myChannelList: TopNavDTO [] | 25 | + @Link @Watch('changeMyChannelData') myChannelList: TopNavDTO [] |
| 24 | // 更多频道栏目频道信息数组 | 26 | // 更多频道栏目频道信息数组 |
| 25 | @Link moreChannelList: TopNavDTO [] | 27 | @Link moreChannelList: TopNavDTO [] |
| 26 | // 地方频道栏目频道信息数组 | 28 | // 地方频道栏目频道信息数组 |
| 27 | @Link localChannelList: TopNavDTO [] | 29 | @Link localChannelList: TopNavDTO [] |
| 28 | // 收集到的我的频道栏目中的频道id | 30 | // 收集到的我的频道栏目中的频道id |
| 29 | @State channelIds: number [] = [] | 31 | @State channelIds: number [] = [] |
| 30 | - | ||
| 31 | @State isShow: boolean = false | 32 | @State isShow: boolean = false |
| 32 | @State dragItem: number = -1 | 33 | @State dragItem: number = -1 |
| 33 | private dragRefOffsetX: number = 0 | 34 | private dragRefOffsetX: number = 0 |
| @@ -38,17 +39,14 @@ struct ChannelSubscriptionLayout { | @@ -38,17 +39,14 @@ struct ChannelSubscriptionLayout { | ||
| 38 | private FIX_VP_Y: number = 48 | 39 | private FIX_VP_Y: number = 48 |
| 39 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 | 40 | @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 |
| 40 | @State isEditIng: boolean = false | 41 | @State isEditIng: boolean = false |
| 41 | - // @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO | ||
| 42 | changeTab: (index: number) => void = () => { | 42 | changeTab: (index: number) => void = () => { |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | aboutToAppear() { | 45 | aboutToAppear() { |
| 46 | - // this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] | ||
| 47 | - this.myChannelList.forEach(item => { | ||
| 48 | - if(item != undefined && item.channelId != undefined){ | ||
| 49 | - this.channelIds.push(item.channelId) | ||
| 50 | - } | ||
| 51 | - }) | 46 | + this.changeMyChannelData() |
| 47 | + } | ||
| 48 | + | ||
| 49 | + aboutToDisappear(): void { | ||
| 52 | } | 50 | } |
| 53 | 51 | ||
| 54 | //交换我的频道数组中的位置 | 52 | //交换我的频道数组中的位置 |
| @@ -79,24 +77,22 @@ struct ChannelSubscriptionLayout { | @@ -79,24 +77,22 @@ struct ChannelSubscriptionLayout { | ||
| 79 | 77 | ||
| 80 | 78 | ||
| 81 | // 删除频道的索引值大于 我的栏目中频道最大索引值 | 79 | // 删除频道的索引值大于 我的栏目中频道最大索引值 |
| 82 | - if(this.currentTopNavSelectedIndex > this.channelIds.length-1){ | 80 | + if (this.currentTopNavSelectedIndex > this.channelIds.length - 1) { |
| 83 | //使用默认频道 | 81 | //使用默认频道 |
| 84 | //缓存首页频道 | 82 | //缓存首页频道 |
| 85 | let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) | 83 | let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) |
| 86 | - console.debug('TopNavigationComponent','index='+index) | ||
| 87 | if (index > -1) { | 84 | if (index > -1) { |
| 88 | this.currentTopNavSelectedIndex = index | 85 | this.currentTopNavSelectedIndex = index |
| 89 | } | 86 | } |
| 90 | - }else { | ||
| 91 | - //检测删除频道后的当前频道是否是特殊频道 | ||
| 92 | - let item = this.myChannelList[this.currentTopNavSelectedIndex] | ||
| 93 | - if(this.isBroadcast(item) || this.isLayout(item)){ | 87 | + } else { |
| 88 | + //检测删除频道后的当前频道是否是特殊频道 | ||
| 89 | + let item = this.myChannelList[this.currentTopNavSelectedIndex] | ||
| 90 | + if (this.isBroadcast(item) || this.isLayout(item)) { | ||
| 94 | 91 | ||
| 95 | this.changeTab(this.currentTopNavSelectedIndex) | 92 | this.changeTab(this.currentTopNavSelectedIndex) |
| 96 | this.isShow = false | 93 | this.isShow = false |
| 97 | 94 | ||
| 98 | let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) | 95 | let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) |
| 99 | - console.debug('TopNavigationComponent','index='+index) | ||
| 100 | if (index > -1) { | 96 | if (index > -1) { |
| 101 | this.currentTopNavSelectedIndex = index | 97 | this.currentTopNavSelectedIndex = index |
| 102 | this.changeTab(this.currentTopNavSelectedIndex) | 98 | this.changeTab(this.currentTopNavSelectedIndex) |
| @@ -129,6 +125,9 @@ struct ChannelSubscriptionLayout { | @@ -129,6 +125,9 @@ struct ChannelSubscriptionLayout { | ||
| 129 | this.channelIds.push(item.channelId) | 125 | this.channelIds.push(item.channelId) |
| 130 | this.myChannelList.push(item) | 126 | this.myChannelList.push(item) |
| 131 | AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) | 127 | AppStorage.setOrCreate('channelIds', this.channelIds.join(',')) |
| 128 | + | ||
| 129 | + // let storageChannelIds: string = AppStorage.get<string>('channelIds') || '' | ||
| 130 | + // console.debug('TopNavigationComponent', 'addChannelItem==>' + storageChannelIds) | ||
| 132 | } | 131 | } |
| 133 | 132 | ||
| 134 | itemMove(index: number, newIndex: number): void { | 133 | itemMove(index: number, newIndex: number): void { |
| @@ -273,6 +272,7 @@ struct ChannelSubscriptionLayout { | @@ -273,6 +272,7 @@ struct ChannelSubscriptionLayout { | ||
| 273 | .width(24) | 272 | .width(24) |
| 274 | .onClick(() => { | 273 | .onClick(() => { |
| 275 | this.isShow = false | 274 | this.isShow = false |
| 275 | + this.isEditIng = false | ||
| 276 | }) | 276 | }) |
| 277 | } | 277 | } |
| 278 | .width('100%') | 278 | .width('100%') |
| @@ -567,7 +567,30 @@ struct ChannelSubscriptionLayout { | @@ -567,7 +567,30 @@ struct ChannelSubscriptionLayout { | ||
| 567 | .onClick(() => { | 567 | .onClick(() => { |
| 568 | this.isShow = true | 568 | this.isShow = true |
| 569 | }) | 569 | }) |
| 570 | - .bindContentCover(this.isShow, this.sheetBuilder()) | 570 | + .bindContentCover(this.isShow, this.sheetBuilder(), { |
| 571 | + modalTransition: ModalTransition.DEFAULT, | ||
| 572 | + onWillAppear: () => {console.log("BindContentCover onWillAppear.")}, | ||
| 573 | + onAppear: () => {console.log("BindContentCover onAppear.")}, | ||
| 574 | + onWillDisappear: () => {console.log("BindContentCover onWillDisappear.")}, | ||
| 575 | + onDisappear: () => {console.log("BindContentCover onDisappear.") | ||
| 576 | + this.isShow = false | ||
| 577 | + this.isEditIng = false} | ||
| 578 | + }) | ||
| 579 | + } | ||
| 580 | + | ||
| 581 | + | ||
| 582 | + | ||
| 583 | + /** | ||
| 584 | + * 改变我的频道栏目中频道id数据 | ||
| 585 | + */ | ||
| 586 | + changeMyChannelData() { | ||
| 587 | + | ||
| 588 | + this.channelIds = [] | ||
| 589 | + this.myChannelList.forEach(item => { | ||
| 590 | + if (item != undefined && item.channelId != undefined) { | ||
| 591 | + this.channelIds.push(item.channelId) | ||
| 592 | + } | ||
| 593 | + }) | ||
| 571 | } | 594 | } |
| 572 | } | 595 | } |
| 573 | 596 |
| @@ -346,12 +346,11 @@ export struct TopNavigationComponentNew { | @@ -346,12 +346,11 @@ export struct TopNavigationComponentNew { | ||
| 346 | }) | 346 | }) |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | - | ||
| 350 | /** | 349 | /** |
| 351 | * 频道信息跳转页面方法 | 350 | * 频道信息跳转页面方法 |
| 352 | * @param index | 351 | * @param index |
| 353 | */ | 352 | */ |
| 354 | - private channelJumpToPage(index :number){ | 353 | + private channelJumpToPage(index: number) { |
| 355 | if (this.isBroadcastByIndex(index)) { | 354 | if (this.isBroadcastByIndex(index)) { |
| 356 | // 跳转到播报页面 | 355 | // 跳转到播报页面 |
| 357 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) | 356 | ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) |
| @@ -375,104 +374,6 @@ export struct TopNavigationComponentNew { | @@ -375,104 +374,6 @@ export struct TopNavigationComponentNew { | ||
| 375 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) | 374 | this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) |
| 376 | } | 375 | } |
| 377 | 376 | ||
| 378 | - //处理新闻tab顶导频道数据 | ||
| 379 | - topNavListHandle() { | ||
| 380 | - let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string | ||
| 381 | - let _myChannelList: TopNavDTO [] = [] | ||
| 382 | - let _storageChannelIds: string [] = [] //list1 | ||
| 383 | - let defaultMyChannelList: TopNavDTO[] = [] | ||
| 384 | - let defaultList = [...this.topNavList] | ||
| 385 | - defaultList.sort((a, b) => { | ||
| 386 | - return a.num - b.num; | ||
| 387 | - }); | ||
| 388 | - | ||
| 389 | - //defaultMyChannelList | ||
| 390 | - defaultList.forEach(item => { | ||
| 391 | - if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || | ||
| 392 | - item.headlinesOn === 1) { | ||
| 393 | - defaultMyChannelList.push(item); | ||
| 394 | - } | ||
| 395 | - if (item.defaultPermitted === 1) { | ||
| 396 | - this.homeChannelList.push(item) | ||
| 397 | - } | ||
| 398 | - }) | ||
| 399 | - | ||
| 400 | - //有缓存频道id | ||
| 401 | - if (this.storageChannelIds) { | ||
| 402 | - _storageChannelIds = this.storageChannelIds.split(',') | ||
| 403 | - } | ||
| 404 | - | ||
| 405 | - defaultMyChannelList.forEach(item => { | ||
| 406 | - item.myChannel = '1' | ||
| 407 | - if (item.defaultPermitted === 1) { | ||
| 408 | - item.homeChannel = '1' | ||
| 409 | - } | ||
| 410 | - let index = defaultList.findIndex(_item => _item.channelId === item.channelId) | ||
| 411 | - if (index !== -1) { | ||
| 412 | - defaultList.splice(index, 1) | ||
| 413 | - } | ||
| 414 | - }) | ||
| 415 | - defaultList.unshift(...defaultMyChannelList) | ||
| 416 | - defaultList.forEach((item, index) => { | ||
| 417 | - if (item.channelType === 2) { | ||
| 418 | - if (cityName.includes(item.name)) { | ||
| 419 | - item.myChannel = '1' | ||
| 420 | - } | ||
| 421 | - item.localChannel = '1' | ||
| 422 | - } | ||
| 423 | - if (index >= 11) { | ||
| 424 | - if (item.channelType === 1) { | ||
| 425 | - item.moreChannel = '1' | ||
| 426 | - } | ||
| 427 | - } else { | ||
| 428 | - if (item.channelType === 1 && item.myChannel !== '1') { | ||
| 429 | - item.moreChannel = '1' | ||
| 430 | - } | ||
| 431 | - } | ||
| 432 | - if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) { | ||
| 433 | - item.myChannel = '1' | ||
| 434 | - } | ||
| 435 | - //频道分类 | ||
| 436 | - //TODO 暂时隐藏播报 | ||
| 437 | - if (item.name !== '播报') { | ||
| 438 | - if (item.myChannel === '1') { | ||
| 439 | - _myChannelList.push(item) | ||
| 440 | - } | ||
| 441 | - if (item.moreChannel === '1' && item.myChannel !== '1') { | ||
| 442 | - this.moreChannelList.push(item) | ||
| 443 | - } | ||
| 444 | - if (item.localChannel === '1' && item.myChannel !== '1') { | ||
| 445 | - this.localChannelList.push(item) | ||
| 446 | - } | ||
| 447 | - } | ||
| 448 | - }) | ||
| 449 | - | ||
| 450 | - //根据缓存数组排序 | ||
| 451 | - if (this.storageChannelIds) { | ||
| 452 | - let sortedyChannelList = _myChannelList.sort((item1, item2) => { | ||
| 453 | - let index1 = this.storageChannelIds.indexOf(String(item1.channelId)); | ||
| 454 | - let index2 = this.storageChannelIds.indexOf(String(item2.channelId)); | ||
| 455 | - return index1 - index2; | ||
| 456 | - }); | ||
| 457 | - _myChannelList = sortedyChannelList | ||
| 458 | - } | ||
| 459 | - | ||
| 460 | - | ||
| 461 | - if (cityName) { | ||
| 462 | - let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) | ||
| 463 | - const localChannelitem = _myChannelList.splice(index, 1)[0]; | ||
| 464 | - // 将当前地区频道插入到第四个 | ||
| 465 | - _myChannelList.splice(3, 0, localChannelitem); | ||
| 466 | - } | ||
| 467 | - | ||
| 468 | - this.myChannelList = _myChannelList | ||
| 469 | - | ||
| 470 | - //缓存首页频道 | ||
| 471 | - let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) | ||
| 472 | - if (index > -1) { | ||
| 473 | - this.currentTopNavSelectedIndex = index | ||
| 474 | - } | ||
| 475 | - } | ||
| 476 | 377 | ||
| 477 | /** | 378 | /** |
| 478 | * 频道是播报 | 379 | * 频道是播报 |
| @@ -517,12 +418,24 @@ export struct TopNavigationComponentNew { | @@ -517,12 +418,24 @@ export struct TopNavigationComponentNew { | ||
| 517 | return item?.channelType === 3 | 418 | return item?.channelType === 3 |
| 518 | } | 419 | } |
| 519 | 420 | ||
| 520 | - aboutToAppear() { | ||
| 521 | - //处理新闻tab顶导频道数据 | ||
| 522 | - this.topNavListHandle() | ||
| 523 | - this.changePage(this.currentTopNavSelectedIndex) | 421 | + async aboutToAppear() { |
| 422 | + | ||
| 423 | + | ||
| 424 | + if (CompUtils.isNews(this.navItem)) { | ||
| 425 | + | ||
| 426 | + // 请求顶导网络数据 | ||
| 427 | + this.getTopNavList(this.navItem.id) | ||
| 428 | + | ||
| 429 | + } else { | ||
| 430 | + // if(CompUtils.isNews(this.navItem)){ | ||
| 431 | + // //处理新闻tab顶导频道数据 | ||
| 432 | + // this.topNavListHandle() | ||
| 433 | + // } | ||
| 434 | + | ||
| 435 | + this.changePage(this.currentTopNavSelectedIndex) | ||
| 436 | + } | ||
| 437 | + | ||
| 524 | 438 | ||
| 525 | - this.getTopNavList(this.navItem.id) | ||
| 526 | } | 439 | } |
| 527 | 440 | ||
| 528 | onTopNavigationDataUpdated() { | 441 | onTopNavigationDataUpdated() { |
| @@ -534,7 +447,6 @@ export struct TopNavigationComponentNew { | @@ -534,7 +447,6 @@ export struct TopNavigationComponentNew { | ||
| 534 | * | 447 | * |
| 535 | */ | 448 | */ |
| 536 | updateCurrentTopNavSelectedIndex() { | 449 | updateCurrentTopNavSelectedIndex() { |
| 537 | - console.debug(TAG, 'updateCurrentTopNavSelectedIndex=>' + this.currentTopNavSelectedIndex) | ||
| 538 | if (CompUtils.isNews(this.navItem)) { | 450 | if (CompUtils.isNews(this.navItem)) { |
| 539 | const tab = this.myChannelList[this.currentTopNavSelectedIndex] | 451 | const tab = this.myChannelList[this.currentTopNavSelectedIndex] |
| 540 | // 埋点 | 452 | // 埋点 |
| @@ -583,10 +495,14 @@ export struct TopNavigationComponentNew { | @@ -583,10 +495,14 @@ export struct TopNavigationComponentNew { | ||
| 583 | * 频道id变化,即指定频道跳转场景 | 495 | * 频道id变化,即指定频道跳转场景 |
| 584 | */ | 496 | */ |
| 585 | onAssignChannelChange() { | 497 | onAssignChannelChange() { |
| 498 | + | ||
| 586 | if (!this.isCurrentPage()) { | 499 | if (!this.isCurrentPage()) { |
| 587 | return | 500 | return |
| 588 | } | 501 | } |
| 589 | let channelId = this.assignChannel.channelId | 502 | let channelId = this.assignChannel.channelId |
| 503 | + | ||
| 504 | + Logger.debug(TAG,'------onAssignChannelChange--------->'+channelId+' ==>'+this._currentNavIndex) | ||
| 505 | + | ||
| 590 | let index = -1 | 506 | let index = -1 |
| 591 | if (this._currentNavIndex === 0) { | 507 | if (this._currentNavIndex === 0) { |
| 592 | // 第一个,新闻,先拿我的,再拿其他 | 508 | // 第一个,新闻,先拿我的,再拿其他 |
| @@ -647,19 +563,20 @@ export struct TopNavigationComponentNew { | @@ -647,19 +563,20 @@ export struct TopNavigationComponentNew { | ||
| 647 | for (let i = 0; i < this.moreChannelList.length; i++) { | 563 | for (let i = 0; i < this.moreChannelList.length; i++) { |
| 648 | let topNavDTO: TopNavDTO = this.moreChannelList[i] | 564 | let topNavDTO: TopNavDTO = this.moreChannelList[i] |
| 649 | if (topNavDTO.channelId?.toString() === channelId) { | 565 | if (topNavDTO.channelId?.toString() === channelId) { |
| 566 | + this.moreChannelList.splice(i,1) | ||
| 650 | return topNavDTO | 567 | return topNavDTO |
| 651 | } | 568 | } |
| 652 | } | 569 | } |
| 653 | for (let j = 0; j < this.localChannelList.length; j++) { | 570 | for (let j = 0; j < this.localChannelList.length; j++) { |
| 654 | let topNavDTO: TopNavDTO = this.localChannelList[j] | 571 | let topNavDTO: TopNavDTO = this.localChannelList[j] |
| 655 | if (topNavDTO.channelId?.toString() === channelId) { | 572 | if (topNavDTO.channelId?.toString() === channelId) { |
| 573 | + this.localChannelList.splice(j,1) | ||
| 656 | return topNavDTO | 574 | return topNavDTO |
| 657 | } | 575 | } |
| 658 | } | 576 | } |
| 659 | return null | 577 | return null |
| 660 | } | 578 | } |
| 661 | 579 | ||
| 662 | - | ||
| 663 | /** | 580 | /** |
| 664 | * 进入早晚报专题 | 581 | * 进入早晚报专题 |
| 665 | */ | 582 | */ |
| @@ -704,11 +621,128 @@ export struct TopNavigationComponentNew { | @@ -704,11 +621,128 @@ export struct TopNavigationComponentNew { | ||
| 704 | 621 | ||
| 705 | //请求顶导数据 | 622 | //请求顶导数据 |
| 706 | async getTopNavList(id: number) { | 623 | async getTopNavList(id: number) { |
| 707 | - let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id) | 624 | + |
| 625 | + Logger.debug(TAG, 'getTopNavList==>' + this.storageChannelIds) | ||
| 626 | + | ||
| 627 | + let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id, this.storageChannelIds) | ||
| 708 | let topNavList = bottomNavDetail?.topNavChannelList || [] | 628 | let topNavList = bottomNavDetail?.topNavChannelList || [] |
| 709 | - // for (let topNav of topNavList) { | ||
| 710 | - // console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav)) | ||
| 711 | - // | 629 | + |
| 630 | + let cityName = SPHelper.default.getSync(SpConstants.LOCATION_CITY_NAME, '') as string | ||
| 631 | + let _myChannelList: TopNavDTO [] = [] | ||
| 632 | + let _storageChannelIds: string [] = [] //list1 | ||
| 633 | + let defaultMyChannelList: TopNavDTO[] = [] | ||
| 634 | + let defaultList = [...topNavList] | ||
| 635 | + | ||
| 636 | + Logger.debug(TAG, 'cityName=>' + cityName) | ||
| 637 | + // 排序 | ||
| 638 | + defaultList.sort((a, b) => { | ||
| 639 | + return a.num - b.num; | ||
| 640 | + }); | ||
| 641 | + | ||
| 642 | + //defaultMyChannelList | ||
| 643 | + defaultList.forEach(item => { | ||
| 644 | + if (item.defaultPermitted === 1 || item.movePermitted === 0 || item.delPermitted === 0 || | ||
| 645 | + item.headlinesOn === 1) { | ||
| 646 | + defaultMyChannelList.push(item); | ||
| 647 | + } | ||
| 648 | + if (item.defaultPermitted === 1) { | ||
| 649 | + this.homeChannelList.push(item) | ||
| 650 | + } | ||
| 651 | + }) | ||
| 652 | + | ||
| 653 | + //有缓存频道id | ||
| 654 | + if (this.storageChannelIds) { | ||
| 655 | + _storageChannelIds = this.storageChannelIds.split(',') | ||
| 656 | + | ||
| 657 | + } | ||
| 658 | + | ||
| 659 | + defaultMyChannelList.forEach(item => { | ||
| 660 | + item.myChannel = '1' | ||
| 661 | + if (item.defaultPermitted === 1) { | ||
| 662 | + item.homeChannel = '1' | ||
| 663 | + } | ||
| 664 | + let index = defaultList.findIndex(_item => _item.channelId === item.channelId) | ||
| 665 | + if (index !== -1) { | ||
| 666 | + defaultList.splice(index, 1) | ||
| 667 | + } | ||
| 668 | + }) | ||
| 669 | + defaultList.unshift(...defaultMyChannelList) | ||
| 670 | + | ||
| 671 | + defaultList.forEach((item, index) => { | ||
| 672 | + if (item.channelType === 2) { | ||
| 673 | + if (cityName.includes(item.name)) { | ||
| 674 | + item.myChannel = '1' | ||
| 675 | + } | ||
| 676 | + item.localChannel = '1' | ||
| 677 | + } | ||
| 678 | + if (index >= 11) { | ||
| 679 | + if (item.channelType === 1) { | ||
| 680 | + item.moreChannel = '1' | ||
| 681 | + } | ||
| 682 | + } else { | ||
| 683 | + if (item.channelType === 1 && item.myChannel !== '1') { | ||
| 684 | + item.moreChannel = '1' | ||
| 685 | + } | ||
| 686 | + } | ||
| 687 | + if (this.storageChannelIds && _storageChannelIds.includes(String(item.channelId))) { | ||
| 688 | + item.myChannel = '1' | ||
| 689 | + } | ||
| 690 | + //频道分类 | ||
| 691 | + //TODO 暂时隐藏播报 | ||
| 692 | + if (item.name !== '播报') { | ||
| 693 | + if (item.myChannel === '1') { | ||
| 694 | + _myChannelList.push(item) | ||
| 695 | + } | ||
| 696 | + if (item.moreChannel === '1' && item.myChannel !== '1') { | ||
| 697 | + this.moreChannelList.push(item) | ||
| 698 | + } | ||
| 699 | + if (item.localChannel === '1' && item.myChannel !== '1') { | ||
| 700 | + this.localChannelList.push(item) | ||
| 701 | + } | ||
| 702 | + } | ||
| 703 | + }) | ||
| 704 | + | ||
| 705 | + //根据缓存数组排序 | ||
| 706 | + if (this.storageChannelIds) { | ||
| 707 | + | ||
| 708 | + // let sortedyChannelList: TopNavDTO [] = [] | ||
| 709 | + // | ||
| 710 | + // _storageChannelIds.forEach((channelId) => { | ||
| 711 | + // console.debug(TAG, 'getTopNavList=0=>' + channelId) | ||
| 712 | + // for (let a of _myChannelList) { | ||
| 713 | + // | ||
| 714 | + // console.debug(TAG, | ||
| 715 | + // 'getTopNavList=1=>' + channelId + ' ' + a.channelId + ' ' + (channelId == String(a.channelId))) | ||
| 716 | + // if (channelId == String(a.channelId)) { | ||
| 717 | + // sortedyChannelList.push(a) | ||
| 718 | + // break; | ||
| 719 | + // } | ||
| 720 | + // } | ||
| 721 | + // | ||
| 722 | + // }) | ||
| 723 | + | ||
| 724 | + let sortedyChannelList = _myChannelList.sort((item1, item2) => { | ||
| 725 | + let index1 = this.storageChannelIds.indexOf(String(item1.channelId)); | ||
| 726 | + let index2 = this.storageChannelIds.indexOf(String(item2.channelId)); | ||
| 727 | + return index1 - index2; | ||
| 728 | + }); | ||
| 729 | + _myChannelList = sortedyChannelList | ||
| 730 | + } | ||
| 731 | + | ||
| 732 | + // if (cityName) { | ||
| 733 | + // let index = _myChannelList.findIndex(ele => cityName.includes(ele.name)) | ||
| 734 | + // const localChannelitem = _myChannelList.splice(index, 1)[0]; | ||
| 735 | + // // 将当前地区频道插入到第四个 | ||
| 736 | + // _myChannelList.splice(3, 0, localChannelitem); | ||
| 712 | // } | 737 | // } |
| 738 | + | ||
| 739 | + this.myChannelList = _myChannelList | ||
| 740 | + | ||
| 741 | + | ||
| 742 | + //缓存首页频道 | ||
| 743 | + let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId) | ||
| 744 | + if (index > -1) { | ||
| 745 | + this.currentTopNavSelectedIndex = index | ||
| 746 | + } | ||
| 713 | } | 747 | } |
| 714 | } | 748 | } |
| @@ -226,8 +226,25 @@ export class PageRepository { | @@ -226,8 +226,25 @@ export class PageRepository { | ||
| 226 | return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url) | 226 | return WDHttp.get<ResponseDTO<NavigationBodyDTO>>(url) |
| 227 | }; | 227 | }; |
| 228 | 228 | ||
| 229 | - static fetchNavigationDetailDataApi(id:number = 210) { | 229 | + /** |
| 230 | + * 获取顶导详情 | ||
| 231 | + * @param id | ||
| 232 | + * @returns | ||
| 233 | + */ | ||
| 234 | + static fetchNavigationDetailDataApi(id: number = 210, myChannelIds?: string) { | ||
| 230 | let url = PageRepository.getBottomNavGroupDetailUrl() + `?id=${id}`; | 235 | let url = PageRepository.getBottomNavGroupDetailUrl() + `?id=${id}`; |
| 236 | + | ||
| 237 | + let provinceCode = HttpUtils.getProvinceCode() | ||
| 238 | + if (provinceCode) { | ||
| 239 | + url = url + "&districtCode=" + HttpUtils.getDistrictCode() | ||
| 240 | + + "&provinceCode=" + HttpUtils.getProvinceCode() | ||
| 241 | + + "&cityCode=" + HttpUtils.getCityCode() | ||
| 242 | + } | ||
| 243 | + if (myChannelIds) { | ||
| 244 | + url = url + `&channelIds=${myChannelIds}` | ||
| 245 | + } | ||
| 246 | + | ||
| 247 | + | ||
| 231 | return WDHttp.get<ResponseDTO<NavigationDetailDTO>>(url) | 248 | return WDHttp.get<ResponseDTO<NavigationDetailDTO>>(url) |
| 232 | }; | 249 | }; |
| 233 | 250 | ||
| @@ -486,5 +503,4 @@ export class PageRepository { | @@ -486,5 +503,4 @@ export class PageRepository { | ||
| 486 | url = url + "?mliveId=" + mLiveId | 503 | url = url + "?mliveId=" + mLiveId |
| 487 | return WDHttp.get<ResponseDTO<boolean>>(url) | 504 | return WDHttp.get<ResponseDTO<boolean>>(url) |
| 488 | } | 505 | } |
| 489 | - | ||
| 490 | } | 506 | } |
| @@ -44,10 +44,10 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -44,10 +44,10 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 44 | }, | 44 | }, |
| 45 | intentEntityInfo: { | 45 | intentEntityInfo: { |
| 46 | entityName: 'Blog', | 46 | entityName: 'Blog', |
| 47 | - entityId: item?.objectId || '',//必传 | 47 | + entityId: `objectId=${item?.objectId}&objectType=${item?.objectType}` || '',//必传 |
| 48 | displayName: item?.newsTitle || '', //必传 | 48 | displayName: item?.newsTitle || '', //必传 |
| 49 | entityGroupId, //channelId | 49 | entityGroupId, //channelId |
| 50 | - logoURL: item?.coverUrl, | 50 | + logoURL: item?.coverUrl || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', |
| 51 | metadataModificationTime: Number(item?.publishTime) || 0,//int | 51 | metadataModificationTime: Number(item?.publishTime) || 0,//int |
| 52 | blogTitle: item?.newsTitle, | 52 | blogTitle: item?.newsTitle, |
| 53 | blogType: 'Normal', | 53 | blogType: 'Normal', |
| @@ -99,7 +99,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | @@ -99,7 +99,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | ||
| 99 | entityId: String(item?.newsId) || '', | 99 | entityId: String(item?.newsId) || '', |
| 100 | displayName: item?.newsTitle || '', | 100 | displayName: item?.newsTitle || '', |
| 101 | entityGroupId: String(item?.reLInfo?.channelId), //channelId | 101 | entityGroupId: String(item?.reLInfo?.channelId), //channelId |
| 102 | - logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri, | 102 | + logoURL: item.fullColumnImgUrls.length > 0 ? item.fullColumnImgUrls[0]?.url : item.firstFrameImageUri || 'https://cdnjdphoto.aikan.pdnews.cn/WapApi/800/launcher_icon.png', |
| 103 | metadataModificationTime: new Date(item.publishTime).getTime() || 0, | 103 | metadataModificationTime: new Date(item.publishTime).getTime() || 0, |
| 104 | blogTitle: item?.newsTitle, | 104 | blogTitle: item?.newsTitle, |
| 105 | blogType: 'Normal', | 105 | blogType: 'Normal', |
| @@ -75,9 +75,9 @@ export class ChannelViewModel { | @@ -75,9 +75,9 @@ export class ChannelViewModel { | ||
| 75 | /** | 75 | /** |
| 76 | * 获取底导详情(顶导)接口数据 | 76 | * 获取底导详情(顶导)接口数据 |
| 77 | */ | 77 | */ |
| 78 | - async getBottomNavDetailData(id: number): Promise<NavigationDetailDTO> { | 78 | + async getBottomNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> { |
| 79 | Logger.info(TAG, `getBottomNavDetailData start`); | 79 | Logger.info(TAG, `getBottomNavDetailData start`); |
| 80 | - return this.getNavDetailData(id); | 80 | + return this.getNavDetailData(id,myChannelIds); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | private getNavData(): Promise<NavigationBodyDTO> { | 83 | private getNavData(): Promise<NavigationBodyDTO> { |
| @@ -105,10 +105,16 @@ export class ChannelViewModel { | @@ -105,10 +105,16 @@ export class ChannelViewModel { | ||
| 105 | }) | 105 | }) |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | - private getNavDetailData(id: number): Promise<NavigationDetailDTO> { | 108 | + /** |
| 109 | + * 请求获取顶部导航栏数据 | ||
| 110 | + * @param id | ||
| 111 | + * @param myChannelIds | ||
| 112 | + * @returns | ||
| 113 | + */ | ||
| 114 | + private getNavDetailData(id: number, myChannelIds?: string): Promise<NavigationDetailDTO> { | ||
| 109 | return new Promise<NavigationDetailDTO>((success, error) => { | 115 | return new Promise<NavigationDetailDTO>((success, error) => { |
| 110 | Logger.info(TAG, `getNavData start`); | 116 | Logger.info(TAG, `getNavData start`); |
| 111 | - PageRepository.fetchNavigationDetailDataApi(id).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => { | 117 | + PageRepository.fetchNavigationDetailDataApi(id,myChannelIds).then((navResDTO: ResponseDTO<NavigationDetailDTO>) => { |
| 112 | if (!navResDTO || !navResDTO.data) { | 118 | if (!navResDTO || !navResDTO.data) { |
| 113 | Logger.error(TAG, 'getNavData then navResDTO is empty'); | 119 | Logger.error(TAG, 'getNavData then navResDTO is empty'); |
| 114 | error('navResDTO is empty'); | 120 | error('navResDTO is empty'); |
| @@ -44,12 +44,12 @@ export struct PlayerTitleComponent { | @@ -44,12 +44,12 @@ export struct PlayerTitleComponent { | ||
| 44 | Image($r('app.media.icon_arrow_left_white')) | 44 | Image($r('app.media.icon_arrow_left_white')) |
| 45 | .width(24) | 45 | .width(24) |
| 46 | .aspectRatio(1) | 46 | .aspectRatio(1) |
| 47 | - .visibility(this.isLarge ? Visibility.Visible : Visibility.None) | 47 | + .visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None) |
| 48 | .margin({ | 48 | .margin({ |
| 49 | right: 10 | 49 | right: 10 |
| 50 | }) | 50 | }) |
| 51 | .onClick(() => { | 51 | .onClick(() => { |
| 52 | - WindowModel.shared.setPreferredOrientation(this.isLarge ? | 52 | + WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? |
| 53 | window.Orientation.PORTRAIT : | 53 | window.Orientation.PORTRAIT : |
| 54 | window.Orientation.LANDSCAPE_INVERTED) | 54 | window.Orientation.LANDSCAPE_INVERTED) |
| 55 | WindowModel.shared.setSpecificSystemBarEnabled(true) | 55 | WindowModel.shared.setSpecificSystemBarEnabled(true) |
| @@ -74,7 +74,7 @@ export struct PlayerTitleComponent { | @@ -74,7 +74,7 @@ export struct PlayerTitleComponent { | ||
| 74 | Image($r('app.media.icon_share')) | 74 | Image($r('app.media.icon_share')) |
| 75 | .width(24) | 75 | .width(24) |
| 76 | .aspectRatio(1) | 76 | .aspectRatio(1) |
| 77 | - .visibility(this.isLarge ? Visibility.Visible : Visibility.None) | 77 | + .visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None) |
| 78 | .margin({right:16}) | 78 | .margin({right:16}) |
| 79 | }.margin({ bottom: 10 }) | 79 | }.margin({ bottom: 10 }) |
| 80 | 80 |
| @@ -3,6 +3,7 @@ import { ContentDetailDTO } from 'wdBean/Index' | @@ -3,6 +3,7 @@ import { ContentDetailDTO } from 'wdBean/Index' | ||
| 3 | import { DetailDialog } from './DetailDialog' | 3 | import { DetailDialog } from './DetailDialog' |
| 4 | import { componentUtils } from '@kit.ArkUI' | 4 | import { componentUtils } from '@kit.ArkUI' |
| 5 | 5 | ||
| 6 | +const TAG = 'PlayerTitleView'; | ||
| 6 | @Preview | 7 | @Preview |
| 7 | @Component | 8 | @Component |
| 8 | export struct PlayerTitleView { | 9 | export struct PlayerTitleView { |
| @@ -11,6 +12,9 @@ export struct PlayerTitleView { | @@ -11,6 +12,9 @@ export struct PlayerTitleView { | ||
| 11 | @Consume isOpenDetail: boolean | 12 | @Consume isOpenDetail: boolean |
| 12 | @Consume isDragging: boolean | 13 | @Consume isDragging: boolean |
| 13 | @State titleHeight: number = 0 | 14 | @State titleHeight: number = 0 |
| 15 | + @State rmhPlatform: number = 0 // 1是人民号 | ||
| 16 | + @State isOverLines: boolean = false | ||
| 17 | + @State summary: string = '' | ||
| 14 | dialogController: CustomDialogController = new CustomDialogController({ | 18 | dialogController: CustomDialogController = new CustomDialogController({ |
| 15 | builder: DetailDialog({ | 19 | builder: DetailDialog({ |
| 16 | name: this.getName(), | 20 | name: this.getName(), |
| @@ -26,7 +30,11 @@ export struct PlayerTitleView { | @@ -26,7 +30,11 @@ export struct PlayerTitleView { | ||
| 26 | 30 | ||
| 27 | getName(): string { | 31 | getName(): string { |
| 28 | // authTitle | 32 | // authTitle |
| 29 | - return this.contentDetailData?.rmhInfo?.rmhName || '' | 33 | + if (this.rmhPlatform == 0) { |
| 34 | + return this.contentDetailData?.newsSourceName || '' | ||
| 35 | + } else { | ||
| 36 | + return this.contentDetailData?.rmhInfo?.rmhName || '' | ||
| 37 | + } | ||
| 30 | } | 38 | } |
| 31 | 39 | ||
| 32 | getIcon(): string { | 40 | getIcon(): string { |
| @@ -41,7 +49,45 @@ export struct PlayerTitleView { | @@ -41,7 +49,45 @@ export struct PlayerTitleView { | ||
| 41 | return this.contentDetailData?.newIntroduction || '' | 49 | return this.contentDetailData?.newIntroduction || '' |
| 42 | } | 50 | } |
| 43 | 51 | ||
| 52 | + /** | ||
| 53 | + * 截断文本 | ||
| 54 | + * @author liuzhendong(猩猩G) | ||
| 55 | + * @param {string} str 要截断的文本 '啊啊啊啊啊' | ||
| 56 | + * @param {number} fontSize 字体大小(px) | ||
| 57 | + * @param {number} maxLines 最大行数 3 | ||
| 58 | + * @param {number} textWidth 文本宽度(px) vp 需要转换vp2px() | ||
| 59 | + * @returns {string} clipStr 截断后的文本 '啊啊' | ||
| 60 | + */ | ||
| 61 | + clipText(str: string, fontSize: number, maxLines: number, textWidth: number): string { | ||
| 62 | + let strArr: string[] = str.split("") | ||
| 63 | + let truncateContent: string = '啊啊啊啊啊啊' // ...比正常文字宽度更小,这里使用啊啊啊(任意三个文字)代替计算 | ||
| 64 | + let measureTruncateWidth: number = measure.measureText({ | ||
| 65 | + textContent: truncateContent, | ||
| 66 | + fontSize: fontSize, | ||
| 67 | + fontWeight: 400, | ||
| 68 | + lineHeight: 20, | ||
| 69 | + wordBreak:WordBreak.BREAK_ALL | ||
| 70 | + }) | ||
| 71 | + let clipStr: string = '' | ||
| 72 | + for (let i = 0; i < strArr.length; i++) { | ||
| 73 | + if (measure.measureText({ | ||
| 74 | + textContent: clipStr, | ||
| 75 | + fontSize: fontSize, | ||
| 76 | + fontWeight: 400, | ||
| 77 | + lineHeight: 20, | ||
| 78 | + wordBreak:WordBreak.BREAK_ALL | ||
| 79 | + }) >= textWidth * maxLines - measureTruncateWidth) { | ||
| 80 | + this.isOverLines = true | ||
| 81 | + break; | ||
| 82 | + } | ||
| 83 | + clipStr += strArr[i] | ||
| 84 | + } | ||
| 85 | + console.log(TAG, 'clipStr:', clipStr) | ||
| 86 | + return clipStr | ||
| 87 | + } | ||
| 88 | + | ||
| 44 | aboutToAppear(): void { | 89 | aboutToAppear(): void { |
| 90 | + this.rmhPlatform = this.contentDetailData?.rmhPlatform || 0 | ||
| 45 | const info = measure.measureTextSize({ | 91 | const info = measure.measureTextSize({ |
| 46 | textContent: this.getTitle(), | 92 | textContent: this.getTitle(), |
| 47 | fontSize: 15, | 93 | fontSize: 15, |
| @@ -52,6 +98,8 @@ export struct PlayerTitleView { | @@ -52,6 +98,8 @@ export struct PlayerTitleView { | ||
| 52 | }) | 98 | }) |
| 53 | this.titleHeight = info?.height as number || 0 | 99 | this.titleHeight = info?.height as number || 0 |
| 54 | console.log('titleHeight:', this.titleHeight,) | 100 | console.log('titleHeight:', this.titleHeight,) |
| 101 | + console.log(TAG, 'this.contentDetailData:', JSON.stringify(this.contentDetailData)) | ||
| 102 | + this.summary = this.getSummary() | ||
| 55 | } | 103 | } |
| 56 | 104 | ||
| 57 | build() { | 105 | build() { |
| @@ -64,7 +112,7 @@ export struct PlayerTitleView { | @@ -64,7 +112,7 @@ export struct PlayerTitleView { | ||
| 64 | .maxLines(1) | 112 | .maxLines(1) |
| 65 | .lineHeight(25) | 113 | .lineHeight(25) |
| 66 | .fontWeight(600) | 114 | .fontWeight(600) |
| 67 | - .fontFamily('PingFang SC-Regular') | 115 | + .fontFamily('PingFang SC-Semibold') |
| 68 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 116 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 69 | 117 | ||
| 70 | if (this.getIcon()) { | 118 | if (this.getIcon()) { |
| @@ -87,26 +135,70 @@ export struct PlayerTitleView { | @@ -87,26 +135,70 @@ export struct PlayerTitleView { | ||
| 87 | /** | 135 | /** |
| 88 | * 标题大于三行或存在简介显示查看详情按钮 | 136 | * 标题大于三行或存在简介显示查看详情按钮 |
| 89 | */ | 137 | */ |
| 90 | - if (this.titleHeight > 200 || this.getSummary()) { | ||
| 91 | - Text('查看详情 > ') | ||
| 92 | - .padding({ | ||
| 93 | - left: 6, | ||
| 94 | - right: 6, | ||
| 95 | - top: 4, | ||
| 96 | - bottom: 4 | ||
| 97 | - }) | ||
| 98 | - .borderRadius(2) | ||
| 99 | - .backgroundColor('#99636363') | ||
| 100 | - .fontFamily('PingFang SC-Regular') | ||
| 101 | - .fontColor(Color.White) | ||
| 102 | - .fontSize(12) | ||
| 103 | - .lineHeight(14) | ||
| 104 | - .fontWeight(400) | ||
| 105 | - .margin({ bottom: 8 }) | ||
| 106 | - .onClick(() => { | ||
| 107 | - this.isOpenDetail = true | ||
| 108 | - this.dialogController?.open() | ||
| 109 | - }) | 138 | + if (this.rmhPlatform == 1) { |
| 139 | + if (this.titleHeight > 200 || this.summary) { | ||
| 140 | + Text('查看详情 > ') | ||
| 141 | + .padding({ | ||
| 142 | + left: 6, | ||
| 143 | + right: 6, | ||
| 144 | + top: 4, | ||
| 145 | + bottom: 4 | ||
| 146 | + }) | ||
| 147 | + .borderRadius(2) | ||
| 148 | + .backgroundColor('#99636363') | ||
| 149 | + .fontFamily('PingFang SC-Regular') | ||
| 150 | + .fontColor(Color.White) | ||
| 151 | + .fontSize(12) | ||
| 152 | + .lineHeight(14) | ||
| 153 | + .fontWeight(400) | ||
| 154 | + .margin({ bottom: 8 }) | ||
| 155 | + .onClick(() => { | ||
| 156 | + this.isOpenDetail = true | ||
| 157 | + this.dialogController?.open() | ||
| 158 | + }) | ||
| 159 | + } | ||
| 160 | + } else { | ||
| 161 | + if(this.summary) { | ||
| 162 | + Text() { | ||
| 163 | + Span(this.clipText(this.summary, 14, 2, this.windowWidth - 150 - vp2px(50))) | ||
| 164 | + .fontSize(14) | ||
| 165 | + .fontColor(Color.White) | ||
| 166 | + .lineHeight(21) | ||
| 167 | + .fontWeight(400) | ||
| 168 | + .fontFamily('PingFang SC-Regular') | ||
| 169 | + if (this.isOverLines) { | ||
| 170 | + Span('... 全文') | ||
| 171 | + .fontColor('#888888') | ||
| 172 | + .fontWeight(400) | ||
| 173 | + .fontFamily('PingFang SC-Regular') | ||
| 174 | + .fontSize(12) | ||
| 175 | + .onClick(() => { | ||
| 176 | + this.isOpenDetail = true | ||
| 177 | + this.dialogController?.open() | ||
| 178 | + }) | ||
| 179 | + ImageSpan($r('app.media.comment_unfold_svg')) | ||
| 180 | + .width(14) | ||
| 181 | + .height(14) | ||
| 182 | + .objectFit(ImageFit.Fill) | ||
| 183 | + .verticalAlign(ImageSpanAlignment.CENTER) | ||
| 184 | + .padding({ | ||
| 185 | + bottom: 4 | ||
| 186 | + }) | ||
| 187 | + .onClick(() => { | ||
| 188 | + this.isOpenDetail = true | ||
| 189 | + this.dialogController?.open() | ||
| 190 | + }) | ||
| 191 | + | ||
| 192 | + } | ||
| 193 | + } | ||
| 194 | + .padding({ | ||
| 195 | + left: 6, | ||
| 196 | + right: 6, | ||
| 197 | + top: 4, | ||
| 198 | + bottom: 4 | ||
| 199 | + }) | ||
| 200 | + .margin({ bottom: 8 }) | ||
| 201 | + } | ||
| 110 | } | 202 | } |
| 111 | 203 | ||
| 112 | } | 204 | } |
sight_harmony/features/wdDetailPlayShortVideo/src/main/resources/base/media/comment_unfold_svg.svg
0 → 100644
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g transform="matrix(0,-1,1,0,-16,16)"><g><path d="M10.303455641479491,17.960819560243227L4.363755241479492,23.900515460243227Q4.324434578479492,23.939835460243224,4.324704443879492,23.995445460243225Q4.324434578479492,24.051055460243226,4.363755241479492,24.090375460243223L10.303455641479491,30.030075460243225Q10.342505641479491,30.069075460243226,10.397735641479493,30.069075460243226Q10.452965641479492,30.069075460243226,10.492015641479492,30.030075460243225L11.387685641479493,29.134375460243227Q11.406435641479492,29.115675460243224,11.416585641479493,29.091175460243225Q11.426735641479493,29.066675460243225,11.426735641479493,29.040075460243223Q11.426735641479493,29.013575460243224,11.416585641479493,28.989075460243225Q11.406435641479492,28.964575460243225,11.387685641479493,28.945875460243226L6.437285641479493,23.995445460243225L11.387685641479493,19.045045460243227Q11.406435641479492,19.026295460243226,11.416585641479493,19.001795460243226Q11.426735641479493,18.977295460243226,11.426735641479493,18.950765460243225Q11.426735641479493,18.924245460243224,11.416585641479493,18.899744460243227Q11.406435641479492,18.875241460243224,11.387685641479493,18.856488460243224L10.492015641479492,17.960819560243227Q10.452965641479492,17.921767119783226,10.397735641479493,17.921767119783226Q10.342505641479491,17.921767119783226,10.303455641479491,17.960819560243227Z" fill-rule="evenodd" fill="#888888" fill-opacity="1"/></g></g></svg> |
| @@ -128,58 +128,81 @@ struct OneKeyLoginPage { | @@ -128,58 +128,81 @@ struct OneKeyLoginPage { | ||
| 128 | .padding({top: `${this.topSafeHeight}px`}) | 128 | .padding({top: `${this.topSafeHeight}px`}) |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | + // @Builder loginButton() { | ||
| 132 | + // Column() { | ||
| 133 | + // LoginWithHuaweiIDButton({ | ||
| 134 | + // params: { | ||
| 135 | + // // LoginWithHuaweiIDButton支持的样式。 | ||
| 136 | + // style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 137 | + // // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 138 | + // borderRadius: 4, | ||
| 139 | + // // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 140 | + // loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 141 | + // // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 142 | + // supportDarkMode: true, | ||
| 143 | + // customButtonParams: { | ||
| 144 | + // fontColor: loginComponentManager.FontColor.WHITE, | ||
| 145 | + // // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 146 | + // backgroundColor:"#ED2800" | ||
| 147 | + // } | ||
| 148 | + // }, | ||
| 149 | + // controller: this.controller | ||
| 150 | + // }) | ||
| 151 | + // } | ||
| 152 | + // .backgroundColor("#ED2800") | ||
| 153 | + // .height(48) | ||
| 154 | + // .margin({ top: 20 ,left: 25, right: 25 }) | ||
| 155 | + // } | ||
| 156 | + | ||
| 131 | @Builder loginButton() { | 157 | @Builder loginButton() { |
| 132 | - Column() { | ||
| 133 | - LoginWithHuaweiIDButton({ | ||
| 134 | - params: { | ||
| 135 | - // LoginWithHuaweiIDButton支持的样式。 | ||
| 136 | - style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 137 | - // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 138 | - borderRadius: 4, | ||
| 139 | - // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 140 | - loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 141 | - // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 142 | - supportDarkMode: true, | ||
| 143 | - customButtonParams: { | ||
| 144 | - fontColor: loginComponentManager.FontColor.WHITE, | ||
| 145 | - // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 146 | - backgroundColor:"#ED2800" | 158 | + Row() { |
| 159 | + Stack(){ | ||
| 160 | + Button() { | ||
| 161 | + Row() { | ||
| 162 | + Image($r("app.media.huawei_one_key_login_icon")) | ||
| 163 | + .width(24).height(24) | ||
| 164 | + Text("华为账号一键登录") | ||
| 165 | + .fontColor(Color.White) | ||
| 166 | + .margin({left:5}) | ||
| 147 | } | 167 | } |
| 148 | - }, | ||
| 149 | - controller: this.controller | ||
| 150 | - }) | 168 | + } |
| 169 | + .width('100%') | ||
| 170 | + .height(48) | ||
| 171 | + .borderRadius(4) | ||
| 172 | + .type(ButtonType.Normal) | ||
| 173 | + .backgroundColor("#ED2800") | ||
| 174 | + | ||
| 175 | + Stack(){ | ||
| 176 | + //目前不支持文字和图标同时展示,后面优化 | ||
| 177 | + LoginWithHuaweiIDButton({ | ||
| 178 | + params: { | ||
| 179 | + // LoginWithHuaweiIDButton支持的样式。 | ||
| 180 | + style: loginComponentManager.Style.BUTTON_CUSTOM, | ||
| 181 | + // LoginWithHuaweiIDButton的边框圆角半径。 | ||
| 182 | + // borderRadius: 4, | ||
| 183 | + // LoginWithHuaweiIDButton支持的登录类型。 | ||
| 184 | + loginType: loginComponentManager.LoginType.QUICK_LOGIN, | ||
| 185 | + // LoginWithHuaweiIDButton支持按钮的样式跟随系统深浅色模式切换。 | ||
| 186 | + // supportDarkMode: true, | ||
| 187 | + customButtonParams: { | ||
| 188 | + fontColor: loginComponentManager.FontColor.WHITE, | ||
| 189 | + // backgroundColor:!this.agreeProtocol ? "#60ED2800" : "#ED2800" | ||
| 190 | + backgroundColor:"#ED2800" | ||
| 191 | + } | ||
| 192 | + }, | ||
| 193 | + controller: this.controller | ||
| 194 | + }).opacity(0) | ||
| 195 | + } | ||
| 196 | + .width('100%') | ||
| 197 | + .height('100%') | ||
| 198 | + } | ||
| 151 | } | 199 | } |
| 152 | .height(48) | 200 | .height(48) |
| 153 | - .margin({ top: 20 ,left: 25, right: 25 }) | 201 | + .width("100%") |
| 202 | + .padding({ left: 25, right: 25 }) | ||
| 203 | + .margin({top: 20}) | ||
| 154 | } | 204 | } |
| 155 | 205 | ||
| 156 | - // @Builder loginButton() { | ||
| 157 | - // Row() { | ||
| 158 | - // Button() { | ||
| 159 | - // Row() { | ||
| 160 | - // Image($r("app.media.huawei_one_key_login_icon")) | ||
| 161 | - // .width(24).height(24) | ||
| 162 | - // Text("华为账号一键登录") | ||
| 163 | - // .fontColor(Color.White) | ||
| 164 | - // } | ||
| 165 | - // } | ||
| 166 | - // .type(ButtonType.Normal) | ||
| 167 | - // .height(48) | ||
| 168 | - // .backgroundColor(!this.agreeProtocol ? "#60ED2800" : "#ED2800") | ||
| 169 | - // .width("100%") | ||
| 170 | - // .onClick((event) => { | ||
| 171 | - // if (!this.agreeProtocol) { | ||
| 172 | - // return | ||
| 173 | - // } | ||
| 174 | - // | ||
| 175 | - // TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName) | ||
| 176 | - // this.requestLogin() | ||
| 177 | - // }) | ||
| 178 | - // } | ||
| 179 | - // .padding({ left: 25, right: 25 }) | ||
| 180 | - // .margin({top: 20}) | ||
| 181 | - // } | ||
| 182 | - | ||
| 183 | @Builder ProtocolRow() { | 206 | @Builder ProtocolRow() { |
| 184 | Row({space: 4}) { | 207 | Row({space: 4}) { |
| 185 | Image(this.agreeProtocol ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected')) | 208 | Image(this.agreeProtocol ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected')) |
| @@ -21,7 +21,7 @@ export class PublicParams { | @@ -21,7 +21,7 @@ export class PublicParams { | ||
| 21 | "isSign": AccountManagerUtils.isLoginSync() ? "1" : "0", | 21 | "isSign": AccountManagerUtils.isLoginSync() ? "1" : "0", |
| 22 | "environment": PublicParams.getEnv(), | 22 | "environment": PublicParams.getEnv(), |
| 23 | "os": AppUtils.getOSName(), | 23 | "os": AppUtils.getOSName(), |
| 24 | - "actionTime": Math.log(new Date().getTime() / 1000), | 24 | + "actionTime": Math.floor(new Date().getTime() / 1000), |
| 25 | "channel": AppUtils.getAppChannel(), | 25 | "channel": AppUtils.getAppChannel(), |
| 26 | "version": AppUtils.getAppVersionName(), | 26 | "version": AppUtils.getAppVersionName(), |
| 27 | "deviceId": DeviceUtil.clientId(), | 27 | "deviceId": DeviceUtil.clientId(), |
| @@ -24,17 +24,17 @@ export class Tracking { | @@ -24,17 +24,17 @@ export class Tracking { | ||
| 24 | // Logger.error('yyyy','event track failed') | 24 | // Logger.error('yyyy','event track failed') |
| 25 | // }) | 25 | // }) |
| 26 | 26 | ||
| 27 | - // let publicParams = new PublicParams() | ||
| 28 | - // publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | - // | ||
| 30 | - // if (params) { | ||
| 31 | - // for (const obj of Object.entries(params)) { | ||
| 32 | - // // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | - // pubParams[obj[0]] = obj[1] | ||
| 34 | - // } | ||
| 35 | - // } | ||
| 36 | - // sensors.track(eventId, pubParams) | ||
| 37 | - // }) | 27 | + let publicParams = new PublicParams() |
| 28 | + publicParams.getPublicParams().then((pubParams) => { | ||
| 29 | + | ||
| 30 | + if (params) { | ||
| 31 | + for (const obj of Object.entries(params)) { | ||
| 32 | + // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`); | ||
| 33 | + pubParams[obj[0]] = obj[1] | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + sensors.track(eventId, pubParams) | ||
| 37 | + }) | ||
| 38 | } | 38 | } |
| 39 | } | 39 | } |
| 40 | 40 |
| 1 | +import Url from '@ohos.url' | ||
| 1 | import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit'; | 2 | import { insightIntent, InsightIntentExecutor } from '@kit.AbilityKit'; |
| 2 | import { window } from '@kit.ArkUI'; | 3 | import { window } from '@kit.ArkUI'; |
| 3 | import { BusinessError } from '@kit.BasicServicesKit'; | 4 | import { BusinessError } from '@kit.BasicServicesKit'; |
| 4 | import { NetworkUtil, SPHelper, ToastUtils, FastClickUtil } from 'wdKit'; | 5 | import { NetworkUtil, SPHelper, ToastUtils, FastClickUtil } from 'wdKit'; |
| 6 | +import { ContentDTO } from 'wdBean'; | ||
| 5 | import { ProcessUtils } from 'wdRouter'; | 7 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel' | 8 | import DailyPaperTopicModel from 'wdComponent/src/main/ets/model/DailyPaperTopicModel' |
| 7 | 9 | ||
| @@ -52,6 +54,12 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -52,6 +54,12 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 52 | // TODO 热启动是否切到主页 | 54 | // TODO 热启动是否切到主页 |
| 53 | pageLoader.loadContent('pages/MainPage') | 55 | pageLoader.loadContent('pages/MainPage') |
| 54 | .then(() => { | 56 | .then(() => { |
| 57 | + let url: string = param?.entityId as string || '' | ||
| 58 | + let urlParams = new Url.URLParams(url); | ||
| 59 | + let content = new ContentDTO() | ||
| 60 | + content.objectId = urlParams.get('objectId') || '' | ||
| 61 | + content.objectType = urlParams.get('objectType') || '' | ||
| 62 | + ProcessUtils.processPage(content) | ||
| 55 | resolve({ | 63 | resolve({ |
| 56 | code: 0, | 64 | code: 0, |
| 57 | result: { | 65 | result: { |
| @@ -79,7 +87,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -79,7 +87,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 79 | pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> { | 87 | pageLoader: window.WindowStage): Promise<insightIntent.ExecuteResult> { |
| 80 | return new Promise((resolve, reject) => { | 88 | return new Promise((resolve, reject) => { |
| 81 | pageLoader.loadContent('pages/MainPage') | 89 | pageLoader.loadContent('pages/MainPage') |
| 82 | - .then( async () => { | 90 | + .then(async () => { |
| 83 | if (NetworkUtil.isNetConnected()) { | 91 | if (NetworkUtil.isNetConnected()) { |
| 84 | if (await FastClickUtil.isMinDelayTime()) { | 92 | if (await FastClickUtil.isMinDelayTime()) { |
| 85 | return | 93 | return |
| @@ -92,7 +100,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | @@ -92,7 +100,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor { | ||
| 92 | ToastUtils.showToast('暂无早晚报信息', 1000) | 100 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 93 | } | 101 | } |
| 94 | }).catch((err: string) => { | 102 | }).catch((err: string) => { |
| 95 | - console.log('yzlerr',JSON.stringify(err)) | 103 | + console.log('yzlerr', JSON.stringify(err)) |
| 96 | ToastUtils.showToast('暂无早晚报信息', 1000) | 104 | ToastUtils.showToast('暂无早晚报信息', 1000) |
| 97 | }) | 105 | }) |
| 98 | } else { | 106 | } else { |
-
Please register or login to post a comment