Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: (38 commits) 添加判空保护 ref |> 调整一键登录页面UI ref |> 增加几处埋点 fix:somebug fix:bug[17943] UI还原问题-【uat】开机进去首页,提示文案显示样式问题,看图 fix(图片上传):意见反馈屏蔽上传图片功能 desc:还原意见反馈 入口 desc:屏蔽意见反馈 fix(18055):健康频道>大专题卡详情页>动态视频详情页,页面展示异常 feat:进入直播频道,直播中,横滑卡,显示了参加人数,android不显示 feat: 兴趣卡埋点 fix:bug[18050] UI还原问题-【uat】账号登录注册-登录注册-账号密码登录-忘记密码和登录文案和蓝湖大小不一致 feat: 兴趣卡埋点 ref |> 调整评论弹框滑动评论时,固定全部评论标题栏 feat:一行双图卡 保护数据 fix:bug[18058] UI还原问题-【uat】账号登录注册-登录注册-手机号和密码切换会闪烁 ref |> 调整评论弹框弹出后,点击头像进号主页 评论弹框没有关闭问题 ref |> 解决评论上拉多次后,出现默认页 feat:直播大图卡加阴影 fix(18056):号主-动态,只有动态图片时,不应展示null,见截图 ...
Showing
84 changed files
with
1126 additions
and
400 deletions
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | */ | 3 | */ |
| 4 | 4 | ||
| 5 | export const enum CompStyle { | 5 | export const enum CompStyle { |
| 6 | - Label_03 = 'Label-03', // 标题卡:icon+文字 | 6 | + Label_03 = 'Label-03', // 标题卡:icon+文字 |
| 7 | Carousel_Layout_02 = 'Carousel_Layout-02', // 直播轮播卡:直播 | 7 | Carousel_Layout_02 = 'Carousel_Layout-02', // 直播轮播卡:直播 |
| 8 | Single_Row_02 = 'Zh_Single_Row-02', // 通用横划卡:视频、直播、专题 | 8 | Single_Row_02 = 'Zh_Single_Row-02', // 通用横划卡:视频、直播、专题 |
| 9 | Single_Row_03 = 'Single_Row-03', // 直播横划卡:直播 | 9 | Single_Row_03 = 'Single_Row-03', // 直播横划卡:直播 |
| @@ -64,4 +64,7 @@ export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/Mpaas | @@ -64,4 +64,7 @@ export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/Mpaas | ||
| 64 | 64 | ||
| 65 | export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM' | 65 | export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM' |
| 66 | 66 | ||
| 67 | -export { FastClickUtil } from './src/main/ets/utils/FastClickUtil'; | ||
| 67 | +export { FastClickUtil } from './src/main/ets/utils/FastClickUtil'; | ||
| 68 | + | ||
| 69 | +// export { PublicPopupDialogView } from "./src/main/ets/pubComps/dialog/PublicPopupDialogView" | ||
| 70 | +export { PublicDialogManager, CloseAction } from "./src/main/ets/pubComps/dialog/PublicDialogManager" |
| 1 | + | ||
| 2 | +export type CloseAction = () => void | ||
| 3 | + | ||
| 4 | +export class PublicDialogManager { | ||
| 5 | + | ||
| 6 | + private dialogControllers: CustomDialogController[] = [] | ||
| 7 | + private closeActions: CloseAction[] = [] | ||
| 8 | + | ||
| 9 | + private constructor() { | ||
| 10 | + } | ||
| 11 | + private static manager: PublicDialogManager | ||
| 12 | + static shareInstance(): PublicDialogManager { | ||
| 13 | + if (!PublicDialogManager.manager) { | ||
| 14 | + PublicDialogManager.manager = new PublicDialogManager() | ||
| 15 | + } | ||
| 16 | + return PublicDialogManager.manager | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + openDialog(dialogController: CustomDialogController, closeAction: CloseAction) { | ||
| 20 | + if (!dialogController) { | ||
| 21 | + return | ||
| 22 | + } | ||
| 23 | + dialogController.open() | ||
| 24 | + this.dialogControllers.push(dialogController) | ||
| 25 | + this.closeActions.push(closeAction) | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + closeDialog(dialogController: CustomDialogController) { | ||
| 29 | + if (!dialogController) { | ||
| 30 | + return | ||
| 31 | + } | ||
| 32 | + dialogController.close() | ||
| 33 | + const index = this.dialogControllers.indexOf(dialogController) | ||
| 34 | + if (index != -1) { | ||
| 35 | + this.dialogControllers.splice(index, 1) | ||
| 36 | + this.closeActions.splice(index, 1)[0]() | ||
| 37 | + } | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + closeLastDialog() { | ||
| 41 | + const count = this.dialogControllers.length | ||
| 42 | + if (count > 0) { | ||
| 43 | + this.closeDialog(this.dialogControllers[count - 1]) | ||
| 44 | + } | ||
| 45 | + } | ||
| 46 | +} |
| 1 | +import { PublicDialogManager } from './PublicDialogManager' | ||
| 2 | + | ||
| 3 | +/* | ||
| 4 | + * 公共自定义弹出框,上层赋值showPopup变量,决定是否显示 | ||
| 5 | + * | ||
| 6 | + * 当上层需要关闭,调用 PublicDialogManager.shareInstance().closeDialog(dialogController) 关闭 | ||
| 7 | + * | ||
| 8 | + * ===> customBuilder 当前传值有问题,用不了 | ||
| 9 | + */ | ||
| 10 | +@Component | ||
| 11 | +struct PublicPopupDialogView { | ||
| 12 | + | ||
| 13 | + // 决定是否显示变量 | ||
| 14 | + @Link @Watch('showPopupAction') showPopup: boolean | ||
| 15 | + | ||
| 16 | + // 自定义弹框的 @CustomDialog | ||
| 17 | + private customBuilder: Object | null = null | ||
| 18 | + | ||
| 19 | + private autoCancel: boolean = false | ||
| 20 | + | ||
| 21 | + dialogController: CustomDialogController = new CustomDialogController({ | ||
| 22 | + builder: this.customBuilder, | ||
| 23 | + autoCancel: this.autoCancel, | ||
| 24 | + cancel: () => { | ||
| 25 | + this.showPopup = false | ||
| 26 | + }, | ||
| 27 | + customStyle: true, | ||
| 28 | + alignment: DialogAlignment.Bottom, | ||
| 29 | + }) | ||
| 30 | + | ||
| 31 | + showPopupAction(val: boolean) { | ||
| 32 | + if (this.showPopup) { | ||
| 33 | + PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction) | ||
| 34 | + } else { | ||
| 35 | + PublicDialogManager.shareInstance().closeDialog(this.dialogController) | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + @Builder emptyBuild() { | ||
| 40 | + | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + closeAction() { | ||
| 44 | + this.showPopup = false | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + build() { | ||
| 48 | + this.emptyBuild() | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | +} | ||
| 52 | + |
| @@ -5,12 +5,15 @@ import { BaseDTO } from './BaseDTO'; | @@ -5,12 +5,15 @@ import { BaseDTO } from './BaseDTO'; | ||
| 5 | 5 | ||
| 6 | @Observed | 6 | @Observed |
| 7 | export class CompDTO implements BaseDTO { | 7 | export class CompDTO implements BaseDTO { |
| 8 | + expIds: string = ''; | ||
| 9 | + itemId: string = ''; | ||
| 8 | contentText?: string = ''; | 10 | contentText?: string = ''; |
| 9 | backgroundColor: string = ''; | 11 | backgroundColor: string = ''; |
| 10 | backgroundImgUrl: string = ''; | 12 | backgroundImgUrl: string = ''; |
| 11 | cityCode: string = ''; | 13 | cityCode: string = ''; |
| 12 | compStyle: string = ''; | 14 | compStyle: string = ''; |
| 13 | compType: string = ''; | 15 | compType: string = ''; |
| 16 | + cardItemId: string = ''; | ||
| 14 | // dataSourceRequest: any[]; | 17 | // dataSourceRequest: any[]; |
| 15 | districtCode: string = ''; | 18 | districtCode: string = ''; |
| 16 | extraData?: string; | 19 | extraData?: string; |
| @@ -44,7 +47,7 @@ export class CompDTO implements BaseDTO { | @@ -44,7 +47,7 @@ export class CompDTO implements BaseDTO { | ||
| 44 | matInfo: CompAdvMatInfoBean = new CompAdvMatInfoBean | 47 | matInfo: CompAdvMatInfoBean = new CompAdvMatInfoBean |
| 45 | pageId?: string; | 48 | pageId?: string; |
| 46 | objectType?: string; | 49 | objectType?: string; |
| 47 | - hasMore: number = 1 | 50 | + hasMore: number = 1; |
| 48 | 51 | ||
| 49 | // keyGenerator相关字符串,用于刷新list布局 | 52 | // keyGenerator相关字符串,用于刷新list布局 |
| 50 | timestamp: String = '1' | 53 | timestamp: String = '1' |
| @@ -11,12 +11,17 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean'; | @@ -11,12 +11,17 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean'; | ||
| 11 | 11 | ||
| 12 | @Observed | 12 | @Observed |
| 13 | export class ContentDTO implements BaseDTO { | 13 | export class ContentDTO implements BaseDTO { |
| 14 | + seoTags?:string; | ||
| 15 | + liveType?: string; // 直播新闻-直播状态 | ||
| 16 | + expIds: string = ''; | ||
| 17 | + itemId: string = ''; | ||
| 14 | shareFlag?: string = '1'; | 18 | shareFlag?: string = '1'; |
| 15 | appStyle: string = ''; | 19 | appStyle: string = ''; |
| 16 | cityCode: string = ''; | 20 | cityCode: string = ''; |
| 17 | coverSize: string = ''; | 21 | coverSize: string = ''; |
| 18 | coverType: number = -1; | 22 | coverType: number = -1; |
| 19 | coverUrl: string = ''; | 23 | coverUrl: string = ''; |
| 24 | + cnsTraceId: string = '' | ||
| 20 | description: string = ''; | 25 | description: string = ''; |
| 21 | districtCode: string = ''; | 26 | districtCode: string = ''; |
| 22 | endTime: string = ''; | 27 | endTime: string = ''; |
| @@ -45,6 +50,8 @@ export class ContentDTO implements BaseDTO { | @@ -45,6 +50,8 @@ export class ContentDTO implements BaseDTO { | ||
| 45 | startTime: string = ''; | 50 | startTime: string = ''; |
| 46 | subType: string = ''; | 51 | subType: string = ''; |
| 47 | subtitle: string = ''; | 52 | subtitle: string = ''; |
| 53 | + sceneId: string = ''; | ||
| 54 | + subSceneId: string = ''; | ||
| 48 | title: string = ''; | 55 | title: string = ''; |
| 49 | vImageUrl: string = ''; | 56 | vImageUrl: string = ''; |
| 50 | screenType: string = ''; | 57 | screenType: string = ''; |
| @@ -94,6 +101,8 @@ export class ContentDTO implements BaseDTO { | @@ -94,6 +101,8 @@ export class ContentDTO implements BaseDTO { | ||
| 94 | 101 | ||
| 95 | static clone(old: ContentDTO): ContentDTO { | 102 | static clone(old: ContentDTO): ContentDTO { |
| 96 | let content = new ContentDTO(); | 103 | let content = new ContentDTO(); |
| 104 | + content.liveType = old.liveType; | ||
| 105 | + content.seoTags = old.seoTags; | ||
| 97 | content.appStyle = old.appStyle; | 106 | content.appStyle = old.appStyle; |
| 98 | content.cityCode = old.cityCode; | 107 | content.cityCode = old.cityCode; |
| 99 | content.coverSize = old.coverSize; | 108 | content.coverSize = old.coverSize; |
| @@ -97,4 +97,6 @@ export { PageRepository } from './src/main/ets/repository/PageRepository'; | @@ -97,4 +97,6 @@ export { PageRepository } from './src/main/ets/repository/PageRepository'; | ||
| 97 | 97 | ||
| 98 | export { MultiPictureDetailViewModel } from './src/main/ets/viewmodel/MultiPictureDetailViewModel'; | 98 | export { MultiPictureDetailViewModel } from './src/main/ets/viewmodel/MultiPictureDetailViewModel'; |
| 99 | 99 | ||
| 100 | -export { viewBlogItemInsightIntentShare } from './src/main/ets/utils/InsightIntentShare'; | ||
| 100 | +export { viewBlogItemInsightIntentShare } from './src/main/ets/utils/InsightIntentShare'; | ||
| 101 | + | ||
| 102 | +export { CommentListDialogView } from './src/main/ets/components/comment/view/CommentListDialog'; |
| @@ -23,6 +23,8 @@ import { SearchContentComponent } from './cardview/SearchContentComponent'; | @@ -23,6 +23,8 @@ import { SearchContentComponent } from './cardview/SearchContentComponent'; | ||
| 23 | */ | 23 | */ |
| 24 | @Component | 24 | @Component |
| 25 | export struct CardParser { | 25 | export struct CardParser { |
| 26 | + @State pageId: string = ''; | ||
| 27 | + @State pageName: string = ''; | ||
| 26 | @State contentDTO: ContentDTO = new ContentDTO(); | 28 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 27 | @ObjectLink compDTO: CompDTO | 29 | @ObjectLink compDTO: CompDTO |
| 28 | 30 | ||
| @@ -34,39 +36,39 @@ export struct CardParser { | @@ -34,39 +36,39 @@ export struct CardParser { | ||
| 34 | contentBuilder(contentDTO: ContentDTO) { | 36 | contentBuilder(contentDTO: ContentDTO) { |
| 35 | // Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 37 | // Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) |
| 36 | if (!!contentDTO.contentText) { | 38 | if (!!contentDTO.contentText) { |
| 37 | - SearchContentComponent({ contentDTO }) | 39 | + SearchContentComponent({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 38 | } else { | 40 | } else { |
| 39 | if (contentDTO.appStyle === CompStyle.Card_02) { | 41 | if (contentDTO.appStyle === CompStyle.Card_02) { |
| 40 | - Card2Component({ compDTO: this.compDTO, contentDTO }) | 42 | + Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 41 | } else if (contentDTO.appStyle === CompStyle.Card_03) { | 43 | } else if (contentDTO.appStyle === CompStyle.Card_03) { |
| 42 | - Card3Component({ compDTO: this.compDTO, contentDTO }) | 44 | + Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 43 | } else if (contentDTO.appStyle === CompStyle.Card_04) { | 45 | } else if (contentDTO.appStyle === CompStyle.Card_04) { |
| 44 | - Card4Component({ compDTO: this.compDTO, contentDTO }) | 46 | + Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 45 | } else if (contentDTO.appStyle === CompStyle.Card_05) { | 47 | } else if (contentDTO.appStyle === CompStyle.Card_05) { |
| 46 | - Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy}) | 48 | + Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName}) |
| 47 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle | 49 | } else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle |
| 48 | .Card_13) { | 50 | .Card_13) { |
| 49 | - Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO }) | 51 | + Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 50 | } else if (contentDTO.appStyle === CompStyle.Card_10) { | 52 | } else if (contentDTO.appStyle === CompStyle.Card_10) { |
| 51 | - Card10Component({ compDTO: this.compDTO, contentDTO }) | 53 | + Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 52 | } else if (contentDTO.appStyle === CompStyle.Card_11) { | 54 | } else if (contentDTO.appStyle === CompStyle.Card_11) { |
| 53 | - Card11Component({ compDTO: this.compDTO, contentDTO }) | 55 | + Card11Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 54 | } else if (contentDTO.appStyle === CompStyle.Card_12) { | 56 | } else if (contentDTO.appStyle === CompStyle.Card_12) { |
| 55 | - Card12Component({ contentDTO }) | 57 | + Card12Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 56 | } else if (contentDTO.appStyle === CompStyle.Card_14) { | 58 | } else if (contentDTO.appStyle === CompStyle.Card_14) { |
| 57 | - Card14Component({ contentDTO }) | 59 | + Card14Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 58 | } else if (contentDTO.appStyle === CompStyle.Card_15) { | 60 | } else if (contentDTO.appStyle === CompStyle.Card_15) { |
| 59 | - Card15Component({ contentDTO }) | 61 | + Card15Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 60 | } else if (contentDTO.appStyle === CompStyle.Card_16) { | 62 | } else if (contentDTO.appStyle === CompStyle.Card_16) { |
| 61 | - Card16Component({ contentDTO }) | 63 | + Card16Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 62 | } else if (contentDTO.appStyle === CompStyle.Card_17) { | 64 | } else if (contentDTO.appStyle === CompStyle.Card_17) { |
| 63 | - Card17Component({ compDTO: this.compDTO, contentDTO }) | 65 | + Card17Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName }) |
| 64 | } else if (contentDTO.appStyle === CompStyle.Card_19) { | 66 | } else if (contentDTO.appStyle === CompStyle.Card_19) { |
| 65 | - Card19Component({ contentDTO }) | 67 | + Card19Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 66 | } else if (contentDTO.appStyle === CompStyle.Card_20) { | 68 | } else if (contentDTO.appStyle === CompStyle.Card_20) { |
| 67 | - Card20Component({ contentDTO }) | 69 | + Card20Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 68 | } else if (contentDTO.appStyle === CompStyle.Card_21) { | 70 | } else if (contentDTO.appStyle === CompStyle.Card_21) { |
| 69 | - Card21Component({ contentDTO }) | 71 | + Card21Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 70 | } else { | 72 | } else { |
| 71 | // todo:组件未实现 / Component Not Implemented | 73 | // todo:组件未实现 / Component Not Implemented |
| 72 | // Text(contentDTO.appStyle) | 74 | // Text(contentDTO.appStyle) |
| @@ -33,6 +33,8 @@ import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent' | @@ -33,6 +33,8 @@ import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent' | ||
| 33 | */ | 33 | */ |
| 34 | @Component | 34 | @Component |
| 35 | export struct CompParser { | 35 | export struct CompParser { |
| 36 | + @State pageId: string = ''; | ||
| 37 | + @State pageName: string = ''; | ||
| 36 | @ObjectLink compDTO: CompDTO | 38 | @ObjectLink compDTO: CompDTO |
| 37 | @State compIndex: number = 0; | 39 | @State compIndex: number = 0; |
| 38 | @State private pageModel: PageModel = new PageModel(); | 40 | @State private pageModel: PageModel = new PageModel(); |
| @@ -71,26 +73,26 @@ export struct CompParser { | @@ -71,26 +73,26 @@ export struct CompParser { | ||
| 71 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 73 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 72 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 74 | } else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| 73 | if (this.compDTO.operDataList.length > this.audioItems.length) { | 75 | if (this.compDTO.operDataList.length > this.audioItems.length) { |
| 74 | - ZhCarouselLayout01({ compDTO: this.compDTO }) | 76 | + ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 75 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 77 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 76 | } | 78 | } |
| 77 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && | 79 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && |
| 78 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" | 80 | this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡" |
| 79 | 81 | ||
| 80 | - LiveHorizontalCardComponent({ compDTO: this.compDTO }) | 82 | + LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 81 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 83 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 82 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { | 84 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) { |
| 83 | if (this.compDTO.operDataList.length > 1) { | 85 | if (this.compDTO.operDataList.length > 1) { |
| 84 | - HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO }) | 86 | + HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 85 | } else { | 87 | } else { |
| 86 | - HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO }) | 88 | + HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 87 | } | 89 | } |
| 88 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 90 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 89 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { | 91 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) { |
| 90 | - ZhSingleRow02({ compDTO: this.compDTO }) | 92 | + ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 91 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 93 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 92 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { | 94 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) { |
| 93 | - ZhSingleRow03({ compDTO: this.compDTO }) | 95 | + ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 94 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 96 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 95 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 | 97 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题 |
| 96 | //ZhGridLayout02({ compDTO: this.compDTO }) | 98 | //ZhGridLayout02({ compDTO: this.compDTO }) |
| @@ -98,34 +100,34 @@ export struct CompParser { | @@ -98,34 +100,34 @@ export struct CompParser { | ||
| 98 | // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 100 | // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 99 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 | 101 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 |
| 100 | 102 | ||
| 101 | - ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList }) | 103 | + ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList, pageId: this.pageId, pageName: this.pageName }) |
| 102 | 104 | ||
| 103 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { | 105 | } else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { |
| 104 | - ZhGridLayout03({ compDTO: this.compDTO }) | 106 | + ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 105 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 107 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 106 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { | 108 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) { |
| 107 | - ZhSingleRow04({ compDTO: this.compDTO }) | 109 | + ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 108 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 110 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 109 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { | 111 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) { |
| 110 | // ZhSingleRow05({ compDTO }) | 112 | // ZhSingleRow05({ compDTO }) |
| 111 | // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 113 | // Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 112 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { | 114 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) { |
| 113 | - ZhSingleRow06({ compDTO: this.compDTO }) | 115 | + ZhSingleRow06({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 114 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 116 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 115 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { | 117 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) { |
| 116 | //头图卡 和comStyle 2相同, | 118 | //头图卡 和comStyle 2相同, |
| 117 | - Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy }) | 119 | + Card5Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName }) |
| 118 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 120 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 119 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { | 121 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) { |
| 120 | // 大图卡 | 122 | // 大图卡 |
| 121 | - Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] }) | 123 | + Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) |
| 122 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 124 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 123 | } else if (this.compDTO.compStyle === CompStyle.Card_09) { | 125 | } else if (this.compDTO.compStyle === CompStyle.Card_09) { |
| 124 | //时间链卡 | 126 | //时间链卡 |
| 125 | - Card9Component({ contentDTO:this.compDTO.operDataList[0] }) | 127 | + Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName }) |
| 126 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 128 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 127 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { | 129 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) { |
| 128 | - ZhSingleColumn04({ compDTO: this.compDTO }) | 130 | + ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 129 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 131 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 130 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { | 132 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) { |
| 131 | // ZhSingleColumn05({ compDTO: compDTO }) | 133 | // ZhSingleColumn05({ compDTO: compDTO }) |
| @@ -133,14 +135,14 @@ export struct CompParser { | @@ -133,14 +135,14 @@ export struct CompParser { | ||
| 133 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { | 135 | } else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) { |
| 134 | Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 }) | 136 | Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 }) |
| 135 | Divider().strokeWidth(6).color('#f5f5f5') | 137 | Divider().strokeWidth(6).color('#f5f5f5') |
| 136 | - ZhSingleColumn09({ compDTO: this.compDTO }) | 138 | + ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }) |
| 137 | Divider().strokeWidth(6).color('#f5f5f5') | 139 | Divider().strokeWidth(6).color('#f5f5f5') |
| 138 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 | 140 | } else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告 |
| 139 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) | 141 | AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO }) |
| 140 | //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 }) | 142 | //Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 }) |
| 141 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 143 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 142 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { | 144 | } else if (!Number.isNaN(Number(this.compDTO.compStyle))) { |
| 143 | - CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO }); | 145 | + CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName }); |
| 144 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) | 146 | Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 }) |
| 145 | } else { | 147 | } else { |
| 146 | // Text(this.compDTO.compStyle) | 148 | // Text(this.compDTO.compStyle) |
| @@ -109,7 +109,7 @@ export struct DynamicDetailComponent { | @@ -109,7 +109,7 @@ export struct DynamicDetailComponent { | ||
| 109 | //分割线 | 109 | //分割线 |
| 110 | Image($r('app.media.ic_news_detail_division')) | 110 | Image($r('app.media.ic_news_detail_division')) |
| 111 | .width('100%') | 111 | .width('100%') |
| 112 | - .height($r('app.float.margin_12')) | 112 | + .height($r('app.float.margin_6')) |
| 113 | .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) | 113 | .padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') }) |
| 114 | Stack({ alignContent: Alignment.Bottom }) { | 114 | Stack({ alignContent: Alignment.Bottom }) { |
| 115 | if (!this.isNetConnected) { | 115 | if (!this.isNetConnected) { |
| 1 | -import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean'; | ||
| 2 | -import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'; | 1 | +import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean'; |
| 3 | import { StringUtils } from 'wdKit'; | 2 | import { StringUtils } from 'wdKit'; |
| 4 | -import { WDRouterRule } from 'wdRouter'; | 3 | +import { ProcessUtils } from 'wdRouter'; |
| 5 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 4 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 6 | 5 | ||
| 7 | @Component | 6 | @Component |
| @@ -62,21 +61,15 @@ export struct ENewspaperItemComponent { | @@ -62,21 +61,15 @@ export struct ENewspaperItemComponent { | ||
| 62 | } | 61 | } |
| 63 | if (event.type === TouchType.Up) { | 62 | if (event.type === TouchType.Up) { |
| 64 | this.context.clearRect(0, 0, this.context.width, this.context.height) | 63 | this.context.clearRect(0, 0, this.context.width, this.context.height) |
| 65 | - if (this.itemBeanClicked && this.itemBeanClicked.newsId) { | ||
| 66 | - let taskAction: Action = { | ||
| 67 | - type: 'JUMP_INNER_NEW_PAGE', | ||
| 68 | - params: { | ||
| 69 | - contentID: '' + this.itemBeanClicked.newsId, | ||
| 70 | - pageID: 'IMAGE_TEXT_DETAIL', | ||
| 71 | - extra: { | ||
| 72 | - relType: this.itemBeanClicked.relType ?? '', | ||
| 73 | - relId: '' + this.itemBeanClicked.relId, | ||
| 74 | - sourcePage: '5' | ||
| 75 | - } as ExtraDTO | ||
| 76 | - } as Params, | ||
| 77 | - }; | ||
| 78 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 79 | - | 64 | + if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) { |
| 65 | + //公共跳转 | ||
| 66 | + let content: ContentDTO = { | ||
| 67 | + objectId:this.itemBeanClicked.newsId+'', | ||
| 68 | + objectType:this.itemBeanClicked.newsType+'', | ||
| 69 | + relId:this.itemBeanClicked.relId+'', | ||
| 70 | + relType:this.itemBeanClicked.relType ?? '0' | ||
| 71 | + } as ContentDTO | ||
| 72 | + ProcessUtils.processPage(content) | ||
| 80 | this.itemBeanClicked = {} as NewspaperPositionItemBean | 73 | this.itemBeanClicked = {} as NewspaperPositionItemBean |
| 81 | } | 74 | } |
| 82 | } | 75 | } |
| @@ -139,7 +132,6 @@ export struct ENewspaperItemComponent { | @@ -139,7 +132,6 @@ export struct ENewspaperItemComponent { | ||
| 139 | } | 132 | } |
| 140 | 133 | ||
| 141 | } | 134 | } |
| 142 | - | ||
| 143 | if (vp2px(x) > minX && vp2px(x) < maxX && vp2px(y) > minY && vp2px(y) < maxY) { | 135 | if (vp2px(x) > minX && vp2px(x) < maxX && vp2px(y) > minY && vp2px(y) < maxY) { |
| 144 | this.itemBeanClicked = itemBean; | 136 | this.itemBeanClicked = itemBean; |
| 145 | return xys; | 137 | return xys; |
| @@ -108,15 +108,15 @@ export struct FeedBackActivity { | @@ -108,15 +108,15 @@ export struct FeedBackActivity { | ||
| 108 | GridCol({ | 108 | GridCol({ |
| 109 | }) { | 109 | }) { |
| 110 | if(1 == feedbackImageItem.itemType){ | 110 | if(1 == feedbackImageItem.itemType){ |
| 111 | - Image($r('app.media.feekback_add')) | ||
| 112 | - .width(60) | ||
| 113 | - .height(60) | ||
| 114 | - .onClick(async (event: ClickEvent) => { | ||
| 115 | - if(await FastClickUtil.isMinDelayTime()){ | ||
| 116 | - return | ||
| 117 | - } | ||
| 118 | - this.callFilePickerSelectImage(); | ||
| 119 | - }) | 111 | + // Image($r('app.media.feekback_add')) |
| 112 | + // .width(60) | ||
| 113 | + // .height(60) | ||
| 114 | + // .onClick(async (event: ClickEvent) => { | ||
| 115 | + // if(await FastClickUtil.isMinDelayTime()){ | ||
| 116 | + // return | ||
| 117 | + // } | ||
| 118 | + // this.callFilePickerSelectImage(); | ||
| 119 | + // }) | ||
| 120 | }else{ | 120 | }else{ |
| 121 | Stack({alignContent: Alignment.TopEnd}) { | 121 | Stack({alignContent: Alignment.TopEnd}) { |
| 122 | Image(feedbackImageItem.picPath) | 122 | Image(feedbackImageItem.picPath) |
| @@ -12,13 +12,18 @@ import font from '@ohos.font'; | @@ -12,13 +12,18 @@ import font from '@ohos.font'; | ||
| 12 | */ | 12 | */ |
| 13 | @Component | 13 | @Component |
| 14 | export struct CardMediaInfo { | 14 | export struct CardMediaInfo { |
| 15 | + | ||
| 16 | + @State livePeopleNum :boolean = true | ||
| 15 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 | 17 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 |
| 16 | @State joinPeopleNum: number = 0; | 18 | @State joinPeopleNum: number = 0; |
| 17 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, | 19 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, |
| 18 | // 14动态图文,15动态视频16问政;100人民号,101标签 | 20 | // 14动态图文,15动态视频16问政;100人民号,101标签 |
| 19 | 21 | ||
| 20 | aboutToAppear(): void { | 22 | aboutToAppear(): void { |
| 21 | - this.getJoinPeopleNum(); | 23 | + if(this.livePeopleNum){ |
| 24 | + this.getJoinPeopleNum(); | ||
| 25 | + } | ||
| 26 | + | ||
| 22 | 27 | ||
| 23 | font.registerFont({ | 28 | font.registerFont({ |
| 24 | familyName: 'BebasNeue', | 29 | familyName: 'BebasNeue', |
| @@ -79,36 +84,74 @@ export struct CardMediaInfo { | @@ -79,36 +84,74 @@ export struct CardMediaInfo { | ||
| 79 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 84 | // liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 80 | // 显示直播信息 | 85 | // 显示直播信息 |
| 81 | Row() { | 86 | Row() { |
| 82 | - if (this.contentDTO?.liveInfo?.liveState === 'wait') { | ||
| 83 | - Image($r('app.media.card_wait')) | ||
| 84 | - .mediaLogo() | ||
| 85 | - Text('预约') | ||
| 86 | - .mediaText() | ||
| 87 | - } else if (this.contentDTO?.liveInfo?.liveState === 'running') { | ||
| 88 | - LottieView({ | ||
| 89 | - name: 'live_status_wait', | ||
| 90 | - path: "lottie/live_detail_living.json", | ||
| 91 | - lottieWidth: 14, | ||
| 92 | - lottieHeight: 14, | ||
| 93 | - autoplay: true, | ||
| 94 | - loop: true, | 87 | + // 搜索接口没有返回liveInfo字段所以得做个区分 |
| 88 | + if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') { | ||
| 89 | + // 当liveInfo不存在的时候 | ||
| 90 | + if (this.contentDTO?.liveType === 'wait') { | ||
| 91 | + Image($r('app.media.card_wait')) | ||
| 92 | + .mediaLogo() | ||
| 93 | + Text('预约') | ||
| 94 | + .mediaText() | ||
| 95 | + } else if (this.contentDTO?.liveType === 'running') { | ||
| 96 | + LottieView({ | ||
| 97 | + name: 'live_status_wait', | ||
| 98 | + path: "lottie/live_detail_living.json", | ||
| 99 | + lottieWidth: 14, | ||
| 100 | + lottieHeight: 14, | ||
| 101 | + autoplay: true, | ||
| 102 | + loop: true, | ||
| 95 | }) | 103 | }) |
| 96 | - .margin({ | ||
| 97 | - right: '2vp' | 104 | + .margin({ |
| 105 | + right: '2vp' | ||
| 98 | }) | 106 | }) |
| 99 | - // Image($r('app.media.card_live')) | ||
| 100 | - // .mediaLogo() | ||
| 101 | - Text('直播中') | ||
| 102 | - .mediaText() | ||
| 103 | - } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { | ||
| 104 | - Image($r('app.media.card_play')) | ||
| 105 | - .mediaLogo() | ||
| 106 | - Text('回看') | ||
| 107 | - .mediaText() | ||
| 108 | - }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo | ||
| 109 | - ?.replayUri){ | 107 | + // Image($r('app.media.card_live')) |
| 108 | + // .mediaLogo() | ||
| 109 | + Text('直播中') | ||
| 110 | + .mediaText() | ||
| 111 | + } else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) { | ||
| 112 | + Image($r('app.media.card_play')) | ||
| 113 | + .mediaLogo() | ||
| 114 | + Text('回看') | ||
| 115 | + .mediaText() | ||
| 116 | + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.linkUrl){ | ||
| 110 | Text('已结束') | 117 | Text('已结束') |
| 111 | .mediaText() | 118 | .mediaText() |
| 119 | + } | ||
| 120 | + }else { | ||
| 121 | + // 当liveInfo存在时后 | ||
| 122 | + | ||
| 123 | + if (this.contentDTO?.liveInfo?.liveState === 'wait') { | ||
| 124 | + Image($r('app.media.card_wait')) | ||
| 125 | + .mediaLogo() | ||
| 126 | + Text('预约') | ||
| 127 | + .mediaText() | ||
| 128 | + } else if (this.contentDTO?.liveInfo?.liveState === 'running') { | ||
| 129 | + LottieView({ | ||
| 130 | + name: 'live_status_wait', | ||
| 131 | + path: "lottie/live_detail_living.json", | ||
| 132 | + lottieWidth: 14, | ||
| 133 | + lottieHeight: 14, | ||
| 134 | + autoplay: true, | ||
| 135 | + loop: true, | ||
| 136 | + }) | ||
| 137 | + .margin({ | ||
| 138 | + right: '2vp' | ||
| 139 | + }) | ||
| 140 | + // Image($r('app.media.card_live')) | ||
| 141 | + // .mediaLogo() | ||
| 142 | + Text('直播中') | ||
| 143 | + .mediaText() | ||
| 144 | + } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) { | ||
| 145 | + Image($r('app.media.card_play')) | ||
| 146 | + .mediaLogo() | ||
| 147 | + Text('回看') | ||
| 148 | + .mediaText() | ||
| 149 | + }else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo | ||
| 150 | + ?.replayUri){ | ||
| 151 | + Text('已结束') | ||
| 152 | + .mediaText() | ||
| 153 | + } | ||
| 154 | + | ||
| 112 | } | 155 | } |
| 113 | if (!!this.joinPeopleNum) { | 156 | if (!!this.joinPeopleNum) { |
| 114 | Text(' | ') | 157 | Text(' | ') |
| @@ -49,7 +49,7 @@ export struct CardAdvVideoComponent { | @@ -49,7 +49,7 @@ export struct CardAdvVideoComponent { | ||
| 49 | .borderColor($r('app.color.color_0D000000')) | 49 | .borderColor($r('app.color.color_0D000000')) |
| 50 | //播放状态+时长 | 50 | //播放状态+时长 |
| 51 | CardMediaInfo({ | 51 | CardMediaInfo({ |
| 52 | - contentDTO: this.contentDTO | 52 | + contentDTO: this.contentDTO, livePeopleNum:false, |
| 53 | }) | 53 | }) |
| 54 | } | 54 | } |
| 55 | .alignContent(Alignment.BottomEnd) | 55 | .alignContent(Alignment.BottomEnd) |
| @@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | @@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | ||
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; |
| 6 | import { Notes } from './notes'; | 6 | import { Notes } from './notes'; |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * 大专题卡--CompStyle: 10 | 11 | * 大专题卡--CompStyle: 10 |
| @@ -14,6 +15,8 @@ const TAG: string = 'Card10Component'; | @@ -14,6 +15,8 @@ const TAG: string = 'Card10Component'; | ||
| 14 | @Preview | 15 | @Preview |
| 15 | @Component | 16 | @Component |
| 16 | export struct Card10Component { | 17 | export struct Card10Component { |
| 18 | + @State pageId: string = ''; | ||
| 19 | + @State pageName: string = ''; | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO(); | 20 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State loadImg: boolean = false; | 21 | @State loadImg: boolean = false; |
| 19 | @ObjectLink compDTO: CompDTO | 22 | @ObjectLink compDTO: CompDTO |
| @@ -57,6 +60,7 @@ export struct Card10Component { | @@ -57,6 +60,7 @@ export struct Card10Component { | ||
| 57 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 60 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 58 | .margin({ bottom: 19 }) | 61 | .margin({ bottom: 19 }) |
| 59 | .onClick((event: ClickEvent) => { | 62 | .onClick((event: ClickEvent) => { |
| 63 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 60 | ProcessUtils.processPage(this.contentDTO) | 64 | ProcessUtils.processPage(this.contentDTO) |
| 61 | }) | 65 | }) |
| 62 | } | 66 | } |
| @@ -70,6 +74,7 @@ export struct Card10Component { | @@ -70,6 +74,7 @@ export struct Card10Component { | ||
| 70 | topRight: $r('app.float.image_border_radius') | 74 | topRight: $r('app.float.image_border_radius') |
| 71 | }) | 75 | }) |
| 72 | .onClick((event: ClickEvent) => { | 76 | .onClick((event: ClickEvent) => { |
| 77 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 73 | ProcessUtils.processPage(this.contentDTO) | 78 | ProcessUtils.processPage(this.contentDTO) |
| 74 | }) | 79 | }) |
| 75 | if (this.contentDTO.objectType == '5') { | 80 | if (this.contentDTO.objectType == '5') { |
| @@ -102,6 +107,7 @@ export struct Card10Component { | @@ -102,6 +107,7 @@ export struct Card10Component { | ||
| 102 | .justifyContent(FlexAlign.Center) | 107 | .justifyContent(FlexAlign.Center) |
| 103 | .margin({ top: 5 }) | 108 | .margin({ top: 5 }) |
| 104 | .onClick((event: ClickEvent) => { | 109 | .onClick((event: ClickEvent) => { |
| 110 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 105 | ProcessUtils.processPage(this.contentDTO) | 111 | ProcessUtils.processPage(this.contentDTO) |
| 106 | }) | 112 | }) |
| 107 | } | 113 | } |
| @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | const TAG = 'Card11Component'; | 11 | const TAG = 'Card11Component'; |
| 11 | 12 | ||
| @@ -14,6 +15,8 @@ const TAG = 'Card11Component'; | @@ -14,6 +15,8 @@ const TAG = 'Card11Component'; | ||
| 14 | */ | 15 | */ |
| 15 | @Component | 16 | @Component |
| 16 | export struct Card11Component { | 17 | export struct Card11Component { |
| 18 | + @State pageId: string = ''; | ||
| 19 | + @State pageName: string = ''; | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO(); | 20 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State clicked: boolean = false; | 21 | @State clicked: boolean = false; |
| 19 | @ObjectLink compDTO: CompDTO | 22 | @ObjectLink compDTO: CompDTO |
| @@ -78,6 +81,7 @@ export struct Card11Component { | @@ -78,6 +81,7 @@ export struct Card11Component { | ||
| 78 | }) | 81 | }) |
| 79 | .backgroundColor($r("app.color.white")) | 82 | .backgroundColor($r("app.color.white")) |
| 80 | .onClick((event: ClickEvent) => { | 83 | .onClick((event: ClickEvent) => { |
| 84 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 81 | this.clicked = true; | 85 | this.clicked = true; |
| 82 | persistentStorage(this.contentDTO.objectId); | 86 | persistentStorage(this.contentDTO.objectId); |
| 83 | ProcessUtils.processPage(this.contentDTO) | 87 | ProcessUtils.processPage(this.contentDTO) |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 8 | 9 | ||
| 9 | const TAG = 'Card12Component'; | 10 | const TAG = 'Card12Component'; |
| 10 | 11 | ||
| @@ -13,6 +14,9 @@ const TAG = 'Card12Component'; | @@ -13,6 +14,9 @@ const TAG = 'Card12Component'; | ||
| 13 | */ | 14 | */ |
| 14 | @Component | 15 | @Component |
| 15 | export struct Card12Component { | 16 | export struct Card12Component { |
| 17 | + @ObjectLink compDTO: CompDTO | ||
| 18 | + @State pageId: string = ''; | ||
| 19 | + @State pageName: string = ''; | ||
| 16 | @State contentDTO: ContentDTO = new ContentDTO(); | 20 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | @State clicked: boolean = false; | 21 | @State clicked: boolean = false; |
| 18 | @State titleMarked: boolean = false; | 22 | @State titleMarked: boolean = false; |
| @@ -70,6 +74,7 @@ export struct Card12Component { | @@ -70,6 +74,7 @@ export struct Card12Component { | ||
| 70 | bottom: $r('app.float.card_comp_pagePadding_tb') | 74 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 71 | }) | 75 | }) |
| 72 | .onClick((event: ClickEvent) => { | 76 | .onClick((event: ClickEvent) => { |
| 77 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 73 | this.clicked = true; | 78 | this.clicked = true; |
| 74 | persistentStorage(this.contentDTO.objectId); | 79 | persistentStorage(this.contentDTO.objectId); |
| 75 | ProcessUtils.processPage(this.contentDTO) | 80 | ProcessUtils.processPage(this.contentDTO) |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | const TAG = 'Card14Component'; | 11 | const TAG = 'Card14Component'; |
| 11 | 12 | ||
| @@ -14,6 +15,9 @@ const TAG = 'Card14Component'; | @@ -14,6 +15,9 @@ const TAG = 'Card14Component'; | ||
| 14 | */ | 15 | */ |
| 15 | @Component | 16 | @Component |
| 16 | export struct Card14Component { | 17 | export struct Card14Component { |
| 18 | + @ObjectLink compDTO: CompDTO | ||
| 19 | + @State pageId: string = ''; | ||
| 20 | + @State pageName: string = ''; | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO(); | 21 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State loadImg: boolean = false; | 22 | @State loadImg: boolean = false; |
| 19 | @State clicked: boolean = false; | 23 | @State clicked: boolean = false; |
| @@ -89,6 +93,7 @@ export struct Card14Component { | @@ -89,6 +93,7 @@ export struct Card14Component { | ||
| 89 | bottom: $r('app.float.card_comp_pagePadding_tb') | 93 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 90 | }) | 94 | }) |
| 91 | .onClick((event: ClickEvent) => { | 95 | .onClick((event: ClickEvent) => { |
| 96 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 92 | this.clicked = true; | 97 | this.clicked = true; |
| 93 | persistentStorage(this.contentDTO.objectId); | 98 | persistentStorage(this.contentDTO.objectId); |
| 94 | ProcessUtils.processPage(this.contentDTO) | 99 | ProcessUtils.processPage(this.contentDTO) |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { ProcessUtils } from 'wdRouter'; | 2 | import { ProcessUtils } from 'wdRouter'; |
| 3 | import { RmhTitle } from '../cardCommon/RmhTitle' | 3 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 4 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 4 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| @@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | const TAG: string = 'Card15Component'; | 11 | const TAG: string = 'Card15Component'; |
| 11 | 12 | ||
| @@ -18,6 +19,9 @@ const TAG: string = 'Card15Component'; | @@ -18,6 +19,9 @@ const TAG: string = 'Card15Component'; | ||
| 18 | */ | 19 | */ |
| 19 | @Component | 20 | @Component |
| 20 | export struct Card15Component { | 21 | export struct Card15Component { |
| 22 | + @ObjectLink compDTO: CompDTO | ||
| 23 | + @State pageId: string = ''; | ||
| 24 | + @State pageName: string = ''; | ||
| 21 | @State contentDTO: ContentDTO = new ContentDTO(); | 25 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 22 | @State loadImg: boolean = false; | 26 | @State loadImg: boolean = false; |
| 23 | @State clicked: boolean = false; | 27 | @State clicked: boolean = false; |
| @@ -87,6 +91,7 @@ export struct Card15Component { | @@ -87,6 +91,7 @@ export struct Card15Component { | ||
| 87 | bottom: $r('app.float.card_comp_pagePadding_tb') | 91 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 88 | }) | 92 | }) |
| 89 | .onClick((event: ClickEvent) => { | 93 | .onClick((event: ClickEvent) => { |
| 94 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 90 | this.clicked = true; | 95 | this.clicked = true; |
| 91 | persistentStorage(this.contentDTO.objectId); | 96 | persistentStorage(this.contentDTO.objectId); |
| 92 | ProcessUtils.processPage(this.contentDTO) | 97 | ProcessUtils.processPage(this.contentDTO) |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | const TAG = 'Card16Component'; | 11 | const TAG = 'Card16Component'; |
| 11 | 12 | ||
| @@ -19,6 +20,9 @@ interface fullColumnImgUrlItem { | @@ -19,6 +20,9 @@ interface fullColumnImgUrlItem { | ||
| 19 | */ | 20 | */ |
| 20 | @Component | 21 | @Component |
| 21 | export struct Card16Component { | 22 | export struct Card16Component { |
| 23 | + @ObjectLink compDTO: CompDTO | ||
| 24 | + @State pageId: string = ''; | ||
| 25 | + @State pageName: string = ''; | ||
| 22 | @State contentDTO: ContentDTO = new ContentDTO(); | 26 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 23 | @State loadImg: boolean = false; | 27 | @State loadImg: boolean = false; |
| 24 | @State clicked: boolean = false; | 28 | @State clicked: boolean = false; |
| @@ -88,6 +92,7 @@ export struct Card16Component { | @@ -88,6 +92,7 @@ export struct Card16Component { | ||
| 88 | bottom: $r('app.float.card_comp_pagePadding_tb') | 92 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 89 | }) | 93 | }) |
| 90 | .onClick((event: ClickEvent) => { | 94 | .onClick((event: ClickEvent) => { |
| 95 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 91 | this.clicked = true; | 96 | this.clicked = true; |
| 92 | persistentStorage(this.contentDTO.objectId); | 97 | persistentStorage(this.contentDTO.objectId); |
| 93 | ProcessUtils.processPage(this.contentDTO) | 98 | ProcessUtils.processPage(this.contentDTO) |
| @@ -6,6 +6,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | @@ -6,6 +6,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | ||
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | const TAG = 'Card17Component'; | 11 | const TAG = 'Card17Component'; |
| 11 | 12 | ||
| @@ -14,6 +15,8 @@ const TAG = 'Card17Component'; | @@ -14,6 +15,8 @@ const TAG = 'Card17Component'; | ||
| 14 | */ | 15 | */ |
| 15 | @Component | 16 | @Component |
| 16 | export struct Card17Component { | 17 | export struct Card17Component { |
| 18 | + @State pageId: string = ''; | ||
| 19 | + @State pageName: string = ''; | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO(); | 20 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State loadImg: boolean = false; | 21 | @State loadImg: boolean = false; |
| 19 | @State clicked: boolean = false; | 22 | @State clicked: boolean = false; |
| @@ -106,6 +109,7 @@ export struct Card17Component { | @@ -106,6 +109,7 @@ export struct Card17Component { | ||
| 106 | } | 109 | } |
| 107 | .width(CommonConstants.FULL_WIDTH) | 110 | .width(CommonConstants.FULL_WIDTH) |
| 108 | .onClick((event: ClickEvent) => { | 111 | .onClick((event: ClickEvent) => { |
| 112 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 109 | this.clicked = true; | 113 | this.clicked = true; |
| 110 | persistentStorage(this.contentDTO.objectId); | 114 | persistentStorage(this.contentDTO.objectId); |
| 111 | let taskAction: Action = { | 115 | let taskAction: Action = { |
| 1 | -import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean'; | 1 | +import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean, CompDTO } from 'wdBean'; |
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| 5 | import { CarderInteraction } from '../CarderInteraction' | 5 | import { CarderInteraction } from '../CarderInteraction' |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 8 | 9 | ||
| 9 | const TAG = 'Card19Component'; | 10 | const TAG = 'Card19Component'; |
| 10 | 11 | ||
| @@ -13,6 +14,9 @@ const TAG = 'Card19Component'; | @@ -13,6 +14,9 @@ const TAG = 'Card19Component'; | ||
| 13 | */ | 14 | */ |
| 14 | @Component | 15 | @Component |
| 15 | export struct Card19Component { | 16 | export struct Card19Component { |
| 17 | + @ObjectLink compDTO: CompDTO | ||
| 18 | + @State pageId: string = ''; | ||
| 19 | + @State pageName: string = ''; | ||
| 16 | @State contentDTO: ContentDTO = new ContentDTO() | 20 | @State contentDTO: ContentDTO = new ContentDTO() |
| 17 | @State clicked: boolean = false; | 21 | @State clicked: boolean = false; |
| 18 | @State titleMarked: boolean = false; | 22 | @State titleMarked: boolean = false; |
| @@ -48,7 +52,7 @@ export struct Card19Component { | @@ -48,7 +52,7 @@ export struct Card19Component { | ||
| 48 | .fontColor(0xED2800) | 52 | .fontColor(0xED2800) |
| 49 | Span(this.str03) | 53 | Span(this.str03) |
| 50 | } else { | 54 | } else { |
| 51 | - Span(this.contentDTO.newsTitle) | 55 | + Span(this.contentDTO.newsTitle=='null'?"":this.contentDTO.newsTitle) |
| 52 | } | 56 | } |
| 53 | } | 57 | } |
| 54 | .fontSize($r('app.float.font_size_18')) | 58 | .fontSize($r('app.float.font_size_18')) |
| @@ -58,6 +62,7 @@ export struct Card19Component { | @@ -58,6 +62,7 @@ export struct Card19Component { | ||
| 58 | .width(CommonConstants.FULL_WIDTH) | 62 | .width(CommonConstants.FULL_WIDTH) |
| 59 | .lineHeight(25) | 63 | .lineHeight(25) |
| 60 | .onClick((event: ClickEvent) => { | 64 | .onClick((event: ClickEvent) => { |
| 65 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 61 | this.clicked = true; | 66 | this.clicked = true; |
| 62 | ProcessUtils.processPage(this.contentDTO) | 67 | ProcessUtils.processPage(this.contentDTO) |
| 63 | }) | 68 | }) |
| @@ -75,6 +80,7 @@ export struct Card19Component { | @@ -75,6 +80,7 @@ export struct Card19Component { | ||
| 75 | bottom: $r('app.float.card_comp_pagePadding_tb') | 80 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 76 | }) | 81 | }) |
| 77 | .onClick((event: ClickEvent) => { | 82 | .onClick((event: ClickEvent) => { |
| 83 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 78 | this.clicked = true; | 84 | this.clicked = true; |
| 79 | persistentStorage(this.contentDTO.objectId); | 85 | persistentStorage(this.contentDTO.objectId); |
| 80 | ProcessUtils.processPage(this.contentDTO) | 86 | ProcessUtils.processPage(this.contentDTO) |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { RmhTitle } from '../cardCommon/RmhTitle' | 2 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 3 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 4 | import { CommonConstants } from 'wdConstant/Index'; | 4 | import { CommonConstants } from 'wdConstant/Index'; |
| @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | const TAG = 'Card20Component'; | 11 | const TAG = 'Card20Component'; |
| 11 | 12 | ||
| @@ -14,6 +15,9 @@ const TAG = 'Card20Component'; | @@ -14,6 +15,9 @@ const TAG = 'Card20Component'; | ||
| 14 | */ | 15 | */ |
| 15 | @Component | 16 | @Component |
| 16 | export struct Card20Component { | 17 | export struct Card20Component { |
| 18 | + @ObjectLink compDTO: CompDTO | ||
| 19 | + @State pageId: string = ''; | ||
| 20 | + @State pageName: string = ''; | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO(); | 21 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State clicked: boolean = false; | 22 | @State clicked: boolean = false; |
| 19 | @State titleMarked: boolean = false; | 23 | @State titleMarked: boolean = false; |
| @@ -72,6 +76,7 @@ export struct Card20Component { | @@ -72,6 +76,7 @@ export struct Card20Component { | ||
| 72 | bottom: $r('app.float.card_comp_pagePadding_tb') | 76 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 73 | }) | 77 | }) |
| 74 | .onClick((event: ClickEvent) => { | 78 | .onClick((event: ClickEvent) => { |
| 79 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 75 | this.clicked = true; | 80 | this.clicked = true; |
| 76 | persistentStorage(this.contentDTO.objectId); | 81 | persistentStorage(this.contentDTO.objectId); |
| 77 | ProcessUtils.processPage(this.contentDTO) | 82 | ProcessUtils.processPage(this.contentDTO) |
| @@ -98,7 +103,7 @@ struct createImg { | @@ -98,7 +103,7 @@ struct createImg { | ||
| 98 | 103 | ||
| 99 | build() { | 104 | build() { |
| 100 | GridRow() { | 105 | GridRow() { |
| 101 | - if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) { | 106 | + if (this.contentDTO.fullColumnImgUrls[0].landscape === 1 || this.contentDTO.fullColumnImgUrls[0].weight > this.contentDTO.fullColumnImgUrls[0].height) { |
| 102 | // 横屏 | 107 | // 横屏 |
| 103 | GridCol({ | 108 | GridCol({ |
| 104 | span: { xs: 12 } | 109 | span: { xs: 12 } |
| 1 | -import { ContentDTO } from 'wdBean'; | 1 | +import { ContentDTO, CompDTO } from 'wdBean'; |
| 2 | import { CommonConstants, CompStyle } from 'wdConstant'; | 2 | import { CommonConstants, CompStyle } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | import { RmhTitle } from '../cardCommon/RmhTitle' | 4 | import { RmhTitle } from '../cardCommon/RmhTitle' |
| @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | import {CarderInteraction} from '../CarderInteraction' | 6 | import {CarderInteraction} from '../CarderInteraction' |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | const TAG: string = 'Card6Component-Card13Component'; | 11 | const TAG: string = 'Card6Component-Card13Component'; |
| 11 | 12 | ||
| @@ -14,6 +15,9 @@ const TAG: string = 'Card6Component-Card13Component'; | @@ -14,6 +15,9 @@ const TAG: string = 'Card6Component-Card13Component'; | ||
| 14 | */ | 15 | */ |
| 15 | @Component | 16 | @Component |
| 16 | export struct Card21Component { | 17 | export struct Card21Component { |
| 18 | + @ObjectLink compDTO: CompDTO | ||
| 19 | + @State pageId: string = ''; | ||
| 20 | + @State pageName: string = ''; | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO(); | 21 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 18 | @State loadImg: boolean = false; | 22 | @State loadImg: boolean = false; |
| 19 | @State clicked: boolean = false; | 23 | @State clicked: boolean = false; |
| @@ -80,6 +84,7 @@ export struct Card21Component { | @@ -80,6 +84,7 @@ export struct Card21Component { | ||
| 80 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 | 84 | //TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件 |
| 81 | } | 85 | } |
| 82 | .onClick((event: ClickEvent) => { | 86 | .onClick((event: ClickEvent) => { |
| 87 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 83 | this.clicked = true; | 88 | this.clicked = true; |
| 84 | persistentStorage(this.contentDTO.objectId); | 89 | persistentStorage(this.contentDTO.objectId); |
| 85 | ProcessUtils.processPage(this.contentDTO) | 90 | ProcessUtils.processPage(this.contentDTO) |
| @@ -6,8 +6,9 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | @@ -6,8 +6,9 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | ||
| 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 6 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | - | ||
| 10 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 9 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 10 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 11 | + | ||
| 11 | const TAG: string = 'Card2Component'; | 12 | const TAG: string = 'Card2Component'; |
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| @@ -19,6 +20,8 @@ const TAG: string = 'Card2Component'; | @@ -19,6 +20,8 @@ const TAG: string = 'Card2Component'; | ||
| 19 | */ | 20 | */ |
| 20 | @Component | 21 | @Component |
| 21 | export struct Card2Component { | 22 | export struct Card2Component { |
| 23 | + @State pageId: string = ''; | ||
| 24 | + @State pageName: string = ''; | ||
| 22 | @State contentDTO: ContentDTO = new ContentDTO(); | 25 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 23 | @State loadImg: boolean = false; | 26 | @State loadImg: boolean = false; |
| 24 | @State clicked: boolean = false; | 27 | @State clicked: boolean = false; |
| @@ -55,7 +58,6 @@ export struct Card2Component { | @@ -55,7 +58,6 @@ export struct Card2Component { | ||
| 55 | Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) | 58 | Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center) |
| 56 | //Notes({ objectType: this.contentDTO.objectType }) | 59 | //Notes({ objectType: this.contentDTO.objectType }) |
| 57 | } | 60 | } |
| 58 | - | ||
| 59 | Text() { | 61 | Text() { |
| 60 | if (this.titleMarked) { | 62 | if (this.titleMarked) { |
| 61 | Span(this.str01) | 63 | Span(this.str01) |
| @@ -111,6 +113,7 @@ export struct Card2Component { | @@ -111,6 +113,7 @@ export struct Card2Component { | ||
| 111 | bottom: $r('app.float.card_comp_pagePadding_tb') | 113 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 112 | }) | 114 | }) |
| 113 | .onClick((event: ClickEvent) => { | 115 | .onClick((event: ClickEvent) => { |
| 116 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 114 | this.clicked = true; | 117 | this.clicked = true; |
| 115 | persistentStorage(this.contentDTO.objectId); | 118 | persistentStorage(this.contentDTO.objectId); |
| 116 | ProcessUtils.processPage(this.contentDTO) | 119 | ProcessUtils.processPage(this.contentDTO) |
| @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter'; | @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 7 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 8 | + | ||
| 7 | 9 | ||
| 8 | /** | 10 | /** |
| 9 | * 卡片样式:"appStyle":"3" | 11 | * 卡片样式:"appStyle":"3" |
| @@ -11,6 +13,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | @@ -11,6 +13,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | ||
| 11 | */ | 13 | */ |
| 12 | @Component | 14 | @Component |
| 13 | export struct Card3Component { | 15 | export struct Card3Component { |
| 16 | + @State pageId: string = ''; | ||
| 17 | + @State pageName: string = ''; | ||
| 14 | @State contentDTO: ContentDTO = new ContentDTO(); | 18 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 15 | @State clicked: boolean = false; | 19 | @State clicked: boolean = false; |
| 16 | @ObjectLink compDTO: CompDTO | 20 | @ObjectLink compDTO: CompDTO |
| @@ -71,6 +75,7 @@ export struct Card3Component { | @@ -71,6 +75,7 @@ export struct Card3Component { | ||
| 71 | bottom: $r('app.float.card_comp_pagePadding_tb') | 75 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 72 | }) | 76 | }) |
| 73 | .onClick((event: ClickEvent) => { | 77 | .onClick((event: ClickEvent) => { |
| 78 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 74 | this.clicked = true; | 79 | this.clicked = true; |
| 75 | persistentStorage(this.contentDTO.objectId); | 80 | persistentStorage(this.contentDTO.objectId); |
| 76 | ProcessUtils.processPage(this.contentDTO) | 81 | ProcessUtils.processPage(this.contentDTO) |
| @@ -6,6 +6,8 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | @@ -6,6 +6,8 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | ||
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { Notes } from './notes'; | 7 | import { Notes } from './notes'; |
| 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 8 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 10 | + | ||
| 9 | const TAG: string = 'Card4Component'; | 11 | const TAG: string = 'Card4Component'; |
| 10 | 12 | ||
| 11 | /** | 13 | /** |
| @@ -17,6 +19,8 @@ const TAG: string = 'Card4Component'; | @@ -17,6 +19,8 @@ const TAG: string = 'Card4Component'; | ||
| 17 | */ | 19 | */ |
| 18 | @Component | 20 | @Component |
| 19 | export struct Card4Component { | 21 | export struct Card4Component { |
| 22 | + @State pageId: string = ''; | ||
| 23 | + @State pageName: string = ''; | ||
| 20 | @State contentDTO: ContentDTO = new ContentDTO(); | 24 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 21 | @State loadImg: boolean = false; | 25 | @State loadImg: boolean = false; |
| 22 | @State clicked: boolean = false; | 26 | @State clicked: boolean = false; |
| @@ -106,6 +110,7 @@ export struct Card4Component { | @@ -106,6 +110,7 @@ export struct Card4Component { | ||
| 106 | .justifyContent(FlexAlign.Start) | 110 | .justifyContent(FlexAlign.Start) |
| 107 | .alignItems(HorizontalAlign.Start) | 111 | .alignItems(HorizontalAlign.Start) |
| 108 | .onClick((event: ClickEvent) => { | 112 | .onClick((event: ClickEvent) => { |
| 113 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 109 | this.clicked = true; | 114 | this.clicked = true; |
| 110 | persistentStorage(this.contentDTO.objectId); | 115 | persistentStorage(this.contentDTO.objectId); |
| 111 | ProcessUtils.processPage(this.contentDTO) | 116 | ProcessUtils.processPage(this.contentDTO) |
| @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter'; | @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 4 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 6 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 7 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 8 | + | ||
| 7 | 9 | ||
| 8 | const TAG: string = 'Card5Component'; | 10 | const TAG: string = 'Card5Component'; |
| 9 | 11 | ||
| @@ -12,7 +14,10 @@ const TAG: string = 'Card5Component'; | @@ -12,7 +14,10 @@ const TAG: string = 'Card5Component'; | ||
| 12 | */ | 14 | */ |
| 13 | @Component | 15 | @Component |
| 14 | export struct Card5Component { | 16 | export struct Card5Component { |
| 17 | + @State pageId: string = ''; | ||
| 18 | + @State pageName: string = ''; | ||
| 15 | @State contentDTO: ContentDTO = new ContentDTO(); | 19 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 20 | + @ObjectLink compDTO: CompDTO | ||
| 16 | @Prop titleShowPolicy: number | string | 21 | @Prop titleShowPolicy: number | string |
| 17 | @State loadImg: boolean = false; | 22 | @State loadImg: boolean = false; |
| 18 | @State clicked: boolean = false; | 23 | @State clicked: boolean = false; |
| @@ -96,6 +101,7 @@ export struct Card5Component { | @@ -96,6 +101,7 @@ export struct Card5Component { | ||
| 96 | bottom: $r('app.float.card_comp_pagePadding_tb') | 101 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 97 | }) | 102 | }) |
| 98 | .onClick((event: ClickEvent) => { | 103 | .onClick((event: ClickEvent) => { |
| 104 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 99 | this.clicked = true; | 105 | this.clicked = true; |
| 100 | persistentStorage(this.contentDTO.objectId); | 106 | persistentStorage(this.contentDTO.objectId); |
| 101 | ProcessUtils.processPage(this.contentDTO) | 107 | ProcessUtils.processPage(this.contentDTO) |
| @@ -7,6 +7,7 @@ import { Notes } from './notes'; | @@ -7,6 +7,7 @@ import { Notes } from './notes'; | ||
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | import { Logger } from 'wdKit/Index'; | 8 | import { Logger } from 'wdKit/Index'; |
| 9 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 9 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 10 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 10 | 11 | ||
| 11 | const TAG: string = 'Card6Component-Card13Component'; | 12 | const TAG: string = 'Card6Component-Card13Component'; |
| 12 | 13 | ||
| @@ -15,6 +16,8 @@ const TAG: string = 'Card6Component-Card13Component'; | @@ -15,6 +16,8 @@ const TAG: string = 'Card6Component-Card13Component'; | ||
| 15 | */ | 16 | */ |
| 16 | @Component | 17 | @Component |
| 17 | export struct Card6Component { | 18 | export struct Card6Component { |
| 19 | + @State pageId: string = ''; | ||
| 20 | + @State pageName: string = ''; | ||
| 18 | @State loadImg: boolean = false; | 21 | @State loadImg: boolean = false; |
| 19 | @State clicked: boolean = false; | 22 | @State clicked: boolean = false; |
| 20 | @State titleMarked: boolean = false; | 23 | @State titleMarked: boolean = false; |
| @@ -104,6 +107,7 @@ export struct Card6Component { | @@ -104,6 +107,7 @@ export struct Card6Component { | ||
| 104 | } | 107 | } |
| 105 | } | 108 | } |
| 106 | .onClick((event: ClickEvent) => { | 109 | .onClick((event: ClickEvent) => { |
| 110 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 107 | this.clicked = true; | 111 | this.clicked = true; |
| 108 | persistentStorage(this.contentDTO.objectId); | 112 | persistentStorage(this.contentDTO.objectId); |
| 109 | ProcessUtils.processPage(this.contentDTO) | 113 | ProcessUtils.processPage(this.contentDTO) |
| 1 | -import { ContentDTO, slideShows } from 'wdBean'; | 1 | +import { ContentDTO, slideShows, CompDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | import { Notes } from './notes'; | 5 | import { Notes } from './notes'; |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; | 7 | import { persistentStorage, hasClicked } from '../../utils/persistentStorage'; |
| 8 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 8 | 9 | ||
| 9 | /** | 10 | /** |
| 10 | * 时间链卡--CompStyle: 09 | 11 | * 时间链卡--CompStyle: 09 |
| @@ -13,6 +14,9 @@ const TAG: string = 'Card9Component'; | @@ -13,6 +14,9 @@ const TAG: string = 'Card9Component'; | ||
| 13 | 14 | ||
| 14 | @Component | 15 | @Component |
| 15 | export struct Card9Component { | 16 | export struct Card9Component { |
| 17 | + @ObjectLink compDTO: CompDTO | ||
| 18 | + @State pageId: string = ''; | ||
| 19 | + @State pageName: string = ''; | ||
| 16 | @State contentDTO: ContentDTO = new ContentDTO(); | 20 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 17 | // @State loadImg: boolean = true; | 21 | // @State loadImg: boolean = true; |
| 18 | @State clicked: boolean = false; | 22 | @State clicked: boolean = false; |
| @@ -22,6 +26,7 @@ export struct Card9Component { | @@ -22,6 +26,7 @@ export struct Card9Component { | ||
| 22 | @State str03: string = ''; | 26 | @State str03: string = ''; |
| 23 | 27 | ||
| 24 | async aboutToAppear(): Promise<void> { | 28 | async aboutToAppear(): Promise<void> { |
| 29 | + console.log('Card9Component', JSON.stringify(this.contentDTO)) | ||
| 25 | this.titleInit(); | 30 | this.titleInit(); |
| 26 | // this.loadImg = await onlyWifiLoadImg(); | 31 | // this.loadImg = await onlyWifiLoadImg(); |
| 27 | this.clicked = hasClicked(this.contentDTO.objectId) | 32 | this.clicked = hasClicked(this.contentDTO.objectId) |
| @@ -112,6 +117,7 @@ export struct Card9Component { | @@ -112,6 +117,7 @@ export struct Card9Component { | ||
| 112 | .backgroundColor($r("app.color.white")) | 117 | .backgroundColor($r("app.color.white")) |
| 113 | .margin({ bottom: 8 }) | 118 | .margin({ bottom: 8 }) |
| 114 | .onClick((event: ClickEvent) => { | 119 | .onClick((event: ClickEvent) => { |
| 120 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 115 | this.clicked = true; | 121 | this.clicked = true; |
| 116 | persistentStorage(this.contentDTO.objectId); | 122 | persistentStorage(this.contentDTO.objectId); |
| 117 | ProcessUtils.processPage(this.contentDTO) | 123 | ProcessUtils.processPage(this.contentDTO) |
| @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter'; | @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' | 4 | import { CardSourceInfo } from '../cardCommon/CardSourceInfo' |
| 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' | 5 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo' |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 8 | + | ||
| 7 | const TAG: string = 'Card4Component'; | 9 | const TAG: string = 'Card4Component'; |
| 8 | 10 | ||
| 9 | /** | 11 | /** |
| @@ -11,6 +13,9 @@ const TAG: string = 'Card4Component'; | @@ -11,6 +13,9 @@ const TAG: string = 'Card4Component'; | ||
| 11 | */ | 13 | */ |
| 12 | @Component | 14 | @Component |
| 13 | export struct SearchContentComponent { | 15 | export struct SearchContentComponent { |
| 16 | + @ObjectLink compDTO: CompDTO | ||
| 17 | + @State pageId: string = ''; | ||
| 18 | + @State pageName: string = ''; | ||
| 14 | @State contentDTO: ContentDTO = new ContentDTO(); | 19 | @State contentDTO: ContentDTO = new ContentDTO(); |
| 15 | @State loadImg: boolean = false; | 20 | @State loadImg: boolean = false; |
| 16 | @State clicked: boolean = false; | 21 | @State clicked: boolean = false; |
| @@ -57,6 +62,7 @@ export struct SearchContentComponent { | @@ -57,6 +62,7 @@ export struct SearchContentComponent { | ||
| 57 | .justifyContent(FlexAlign.Start) | 62 | .justifyContent(FlexAlign.Start) |
| 58 | .alignItems(HorizontalAlign.Start) | 63 | .alignItems(HorizontalAlign.Start) |
| 59 | .onClick((event: ClickEvent) => { | 64 | .onClick((event: ClickEvent) => { |
| 65 | + InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 60 | this.clicked = true; | 66 | this.clicked = true; |
| 61 | ProcessUtils.processPage(this.contentDTO) | 67 | ProcessUtils.processPage(this.contentDTO) |
| 62 | }) | 68 | }) |
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | export struct Notes { | 9 | export struct Notes { |
| 10 | @State objectType: number | string = 5 | 10 | @State objectType: number | string = 5 |
| 11 | @State newTags: string = '' | 11 | @State newTags: string = '' |
| 12 | - | 12 | + @State seoTags: string = '' |
| 13 | build() { | 13 | build() { |
| 14 | if (this.returnTypeTitleFn()) { | 14 | if (this.returnTypeTitleFn()) { |
| 15 | Text(this.returnTypeTitleFn()) | 15 | Text(this.returnTypeTitleFn()) |
| 1 | -import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, StringUtils } from 'wdKit/Index'; | 1 | +import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, |
| 2 | + PublicDialogManager, | ||
| 3 | + StringUtils } from 'wdKit/Index'; | ||
| 2 | import { commentItemModel, WDPublicUserType } from '../model/CommentModel'; | 4 | import { commentItemModel, WDPublicUserType } from '../model/CommentModel'; |
| 3 | import commentViewModel from '../viewmodel/CommentViewModel'; | 5 | import commentViewModel from '../viewmodel/CommentViewModel'; |
| 4 | import { CommentText } from './CommentText'; | 6 | import { CommentText } from './CommentText'; |
| @@ -21,6 +23,7 @@ const testString = '因为读书的人\n是低着头向上看的人\n身处一 | @@ -21,6 +23,7 @@ const testString = '因为读书的人\n是低着头向上看的人\n身处一 | ||
| 21 | export struct CommentComponent { | 23 | export struct CommentComponent { |
| 22 | private onCloseClick = () => { | 24 | private onCloseClick = () => { |
| 23 | } | 25 | } |
| 26 | + showTitleComponent: boolean = true | ||
| 24 | @Prop showCloseIcon?: boolean = false | 27 | @Prop showCloseIcon?: boolean = false |
| 25 | @State hasMore: boolean = true; | 28 | @State hasMore: boolean = true; |
| 26 | @State currentPage: number = 1; | 29 | @State currentPage: number = 1; |
| @@ -40,6 +43,9 @@ export struct CommentComponent { | @@ -40,6 +43,9 @@ export struct CommentComponent { | ||
| 40 | @Prop @Watch("parentOnReachEnd") reachEndIncreament: number = 0 | 43 | @Prop @Watch("parentOnReachEnd") reachEndIncreament: number = 0 |
| 41 | reachEndLoadMoreFinish?: () => void | 44 | reachEndLoadMoreFinish?: () => void |
| 42 | 45 | ||
| 46 | + // 是否在弹框中 | ||
| 47 | + @Provide inDialog: boolean = false | ||
| 48 | + | ||
| 43 | // 在自定义组件即将析构销毁时将dialogControlle置空 | 49 | // 在自定义组件即将析构销毁时将dialogControlle置空 |
| 44 | aboutToDisappear() { | 50 | aboutToDisappear() { |
| 45 | this.dialogController = null // 将dialogController置空 | 51 | this.dialogController = null // 将dialogController置空 |
| @@ -163,7 +169,9 @@ export struct CommentComponent { | @@ -163,7 +169,9 @@ export struct CommentComponent { | ||
| 163 | build() { | 169 | build() { |
| 164 | Column() { | 170 | Column() { |
| 165 | List({ scroller: this.listScroller }) { | 171 | List({ scroller: this.listScroller }) { |
| 166 | - ListItemGroup({ header: this.titleHeader() }) | 172 | + if (this.showTitleComponent) { |
| 173 | + ListItemGroup({ header: this.titleHeader() }) | ||
| 174 | + } | ||
| 167 | 175 | ||
| 168 | if (!this.isComments) { | 176 | if (!this.isComments) { |
| 169 | EmptyComponent({ emptyType: 17 }) | 177 | EmptyComponent({ emptyType: 17 }) |
| @@ -259,7 +267,7 @@ export struct CommentComponent { | @@ -259,7 +267,7 @@ export struct CommentComponent { | ||
| 259 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' | 267 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' |
| 260 | } | 268 | } |
| 261 | 269 | ||
| 262 | - if (commentListModel.list.length === 0) { | 270 | + if (commentListModel.list.length === 0 && this.allDatas.totalCount() == 0) { |
| 263 | this.isComments = false | 271 | this.isComments = false |
| 264 | } | 272 | } |
| 265 | 273 | ||
| @@ -299,6 +307,8 @@ struct ChildCommentItem { | @@ -299,6 +307,8 @@ struct ChildCommentItem { | ||
| 299 | @ObjectLink item: commentItemModel | 307 | @ObjectLink item: commentItemModel |
| 300 | @Consume contentDetailData: ContentDetailDTO | 308 | @Consume contentDetailData: ContentDetailDTO |
| 301 | 309 | ||
| 310 | + @Consume inDialog: boolean | ||
| 311 | + | ||
| 302 | build() { | 312 | build() { |
| 303 | Column() { | 313 | Column() { |
| 304 | Row() { | 314 | Row() { |
| @@ -406,7 +416,12 @@ struct ChildCommentItem { | @@ -406,7 +416,12 @@ struct ChildCommentItem { | ||
| 406 | .margin({ left: 47 }) | 416 | .margin({ left: 47 }) |
| 407 | .alignContent(Alignment.Center) | 417 | .alignContent(Alignment.Center) |
| 408 | .onClick(() => { | 418 | .onClick(() => { |
| 409 | - commentViewModel.jumpToAccountPage(this.item) | 419 | + |
| 420 | + commentViewModel.jumpToAccountPage(this.item, () => { | ||
| 421 | + if (this.inDialog) { | ||
| 422 | + PublicDialogManager.shareInstance().closeLastDialog() | ||
| 423 | + } | ||
| 424 | + }) | ||
| 410 | }) | 425 | }) |
| 411 | } | 426 | } |
| 412 | 427 | ||
| @@ -514,6 +529,8 @@ struct commentHeaderView { | @@ -514,6 +529,8 @@ struct commentHeaderView { | ||
| 514 | @Link dialogController: CustomDialogController | null | 529 | @Link dialogController: CustomDialogController | null |
| 515 | @ObjectLink item: commentItemModel | 530 | @ObjectLink item: commentItemModel |
| 516 | 531 | ||
| 532 | + @Consume inDialog: boolean | ||
| 533 | + | ||
| 517 | build() { | 534 | build() { |
| 518 | Column() { | 535 | Column() { |
| 519 | Row() { | 536 | Row() { |
| @@ -607,7 +624,12 @@ struct commentHeaderView { | @@ -607,7 +624,12 @@ struct commentHeaderView { | ||
| 607 | .margin({ left: 8 }) | 624 | .margin({ left: 8 }) |
| 608 | .alignContent(Alignment.Center) | 625 | .alignContent(Alignment.Center) |
| 609 | .onClick(() => { | 626 | .onClick(() => { |
| 610 | - commentViewModel.jumpToAccountPage(this.item) | 627 | + |
| 628 | + commentViewModel.jumpToAccountPage(this.item, () => { | ||
| 629 | + if (this.inDialog) { | ||
| 630 | + PublicDialogManager.shareInstance().closeLastDialog() | ||
| 631 | + } | ||
| 632 | + }) | ||
| 611 | }) | 633 | }) |
| 612 | } | 634 | } |
| 613 | 635 | ||
| @@ -640,6 +662,8 @@ struct commentFooterView { | @@ -640,6 +662,8 @@ struct commentFooterView { | ||
| 640 | @Link dialogController: CustomDialogController | null | 662 | @Link dialogController: CustomDialogController | null |
| 641 | @ObjectLink item: commentItemModel | 663 | @ObjectLink item: commentItemModel |
| 642 | 664 | ||
| 665 | + @Consume inDialog: boolean | ||
| 666 | + | ||
| 643 | build() { | 667 | build() { |
| 644 | Row() { | 668 | Row() { |
| 645 | 669 | ||
| @@ -710,6 +734,9 @@ struct commentFooterView { | @@ -710,6 +734,9 @@ struct commentFooterView { | ||
| 710 | // 未登录,跳转登录 | 734 | // 未登录,跳转登录 |
| 711 | const user_id = HttpUtils.getUserId() | 735 | const user_id = HttpUtils.getUserId() |
| 712 | if (!user_id) { | 736 | if (!user_id) { |
| 737 | + if (this.inDialog) { | ||
| 738 | + PublicDialogManager.shareInstance().closeLastDialog() | ||
| 739 | + } | ||
| 713 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) | 740 | WDRouterRule.jumpWithPage(WDRouterPage.loginPage) |
| 714 | return | 741 | return |
| 715 | } | 742 | } |
| 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' | 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' |
| 2 | +import { PublicDialogManager } from 'wdKit/Index' | ||
| 3 | +import { TrackConstants } from 'wdTracking/Index' | ||
| 2 | import { OperRowListView } from '../../view/OperRowListView' | 4 | import { OperRowListView } from '../../view/OperRowListView' |
| 3 | import { publishCommentModel } from '../model/PublishCommentModel' | 5 | import { publishCommentModel } from '../model/PublishCommentModel' |
| 4 | import { CommentComponent } from './CommentComponent' | 6 | import { CommentComponent } from './CommentComponent' |
| 5 | 7 | ||
| 6 | /// 评论列表弹框 | 8 | /// 评论列表弹框 |
| 9 | +@Component | ||
| 10 | +export struct CommentListDialogView { | ||
| 11 | + @Link @Watch('showCommentListChange') showCommentList: boolean | ||
| 12 | + @Link contentDetailData: ContentDetailDTO // 详情页传 | ||
| 13 | + @Link pageInfo: PageInfoDTO // 专题页传 | ||
| 14 | + onClose?: () => void | ||
| 15 | + | ||
| 16 | + // @Consume pageId: TrackConstants.PageName | ||
| 17 | + // @Consume pageName: TrackConstants.PageName | ||
| 18 | + | ||
| 19 | + private dialogController: CustomDialogController = new CustomDialogController({ | ||
| 20 | + builder: CommentListDialog({ | ||
| 21 | + contentDetailData: this.contentDetailData, | ||
| 22 | + pageInfo: this.pageInfo, | ||
| 23 | + onClose: this.onClose | ||
| 24 | + }), | ||
| 25 | + autoCancel: false, | ||
| 26 | + customStyle: true, | ||
| 27 | + alignment: DialogAlignment.Bottom, | ||
| 28 | + }) | ||
| 29 | + | ||
| 30 | + showCommentListChange(val: boolean) { | ||
| 31 | + if (this.showCommentList) { | ||
| 32 | + PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction.bind(this)) | ||
| 33 | + } else { | ||
| 34 | + PublicDialogManager.shareInstance().closeDialog(this.dialogController) | ||
| 35 | + } | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + closeAction() { | ||
| 39 | + this.showCommentList = false | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + build() { | ||
| 43 | + } | ||
| 44 | +} | ||
| 45 | + | ||
| 7 | @CustomDialog | 46 | @CustomDialog |
| 8 | -export struct CommentListDialog { | 47 | +struct CommentListDialog { |
| 9 | 48 | ||
| 10 | /// 内部使用 | 49 | /// 内部使用 |
| 11 | @State private publishCommentModel: publishCommentModel = new publishCommentModel() | 50 | @State private publishCommentModel: publishCommentModel = new publishCommentModel() |
| @@ -15,12 +54,12 @@ export struct CommentListDialog { | @@ -15,12 +54,12 @@ export struct CommentListDialog { | ||
| 15 | @State windowHeight: number = AppStorage.get<number>('windowHeight') || 0 | 54 | @State windowHeight: number = AppStorage.get<number>('windowHeight') || 0 |
| 16 | 55 | ||
| 17 | /// 外部初始化 | 56 | /// 外部初始化 |
| 18 | - @Consume contentDetailData: ContentDetailDTO // 详情页传 | ||
| 19 | - @Consume pageInfo: PageInfoDTO // 专题页传 | 57 | + @Link contentDetailData: ContentDetailDTO // 详情页传 |
| 58 | + @Link pageInfo: PageInfoDTO // 专题页传 | ||
| 20 | onClose?: () => void | 59 | onClose?: () => void |
| 21 | 60 | ||
| 22 | aboutToAppear(): void { | 61 | aboutToAppear(): void { |
| 23 | - if (this.contentDetailData) { | 62 | + if (this.contentDetailData.newsId) { |
| 24 | if (this.contentDetailData?.openComment) { | 63 | if (this.contentDetailData?.openComment) { |
| 25 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | 64 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') |
| 26 | this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '') | 65 | this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '') |
| @@ -33,40 +72,76 @@ export struct CommentListDialog { | @@ -33,40 +72,76 @@ export struct CommentListDialog { | ||
| 33 | 72 | ||
| 34 | this.operationButtonList.push('comment') | 73 | this.operationButtonList.push('comment') |
| 35 | } | 74 | } |
| 75 | + if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle != 4) { | ||
| 76 | + this.operationButtonList.push('like') | ||
| 77 | + } | ||
| 36 | this.operationButtonList.push('collect') | 78 | this.operationButtonList.push('collect') |
| 79 | + | ||
| 37 | this.operationButtonList.push('share') | 80 | this.operationButtonList.push('share') |
| 38 | } | 81 | } |
| 39 | 82 | ||
| 40 | if (this.pageInfo) { | 83 | if (this.pageInfo) { |
| 84 | + //TODO: 专题的逻辑判断 | ||
| 85 | + | ||
| 41 | } | 86 | } |
| 42 | } | 87 | } |
| 43 | 88 | ||
| 44 | build() { | 89 | build() { |
| 45 | Column() { | 90 | Column() { |
| 91 | + this.titleHeaderView() | ||
| 92 | + | ||
| 46 | CommentComponent({ | 93 | CommentComponent({ |
| 47 | publishCommentModel: this.publishCommentModel, | 94 | publishCommentModel: this.publishCommentModel, |
| 48 | - showCloseIcon: true, | ||
| 49 | fixedHeightMode: true, | 95 | fixedHeightMode: true, |
| 50 | - onCloseClick: () => { | ||
| 51 | - this.controller!.close() | ||
| 52 | - if (this.onClose) { | ||
| 53 | - this.onClose() | ||
| 54 | - } | ||
| 55 | - } | 96 | + inDialog: true, |
| 97 | + showTitleComponent: false | ||
| 56 | }).layoutWeight(1) | 98 | }).layoutWeight(1) |
| 57 | 99 | ||
| 58 | OperRowListView({ | 100 | OperRowListView({ |
| 59 | - componentType: 1, | 101 | + componentType: 4, |
| 60 | pageComponentType: 8, | 102 | pageComponentType: 8, |
| 61 | showBackIcon: false, | 103 | showBackIcon: false, |
| 62 | operationButtonList: this.operationButtonList, | 104 | operationButtonList: this.operationButtonList, |
| 63 | contentDetailData: this.contentDetailData, | 105 | contentDetailData: this.contentDetailData, |
| 64 | publishCommentModel: this.publishCommentModel, | 106 | publishCommentModel: this.publishCommentModel, |
| 65 | showCommentIcon: true, | 107 | showCommentIcon: true, |
| 108 | + styleType: 1, | ||
| 109 | + inDialog: true, | ||
| 110 | + dialogBeforeJumpOtherPageAction: () => { | ||
| 111 | + PublicDialogManager.shareInstance().closeLastDialog() | ||
| 112 | + } | ||
| 66 | }) | 113 | }) |
| 67 | } | 114 | } |
| 68 | .height(this.windowHeight - this.windowWidth * 9 / 16 + 'px') | 115 | .height(this.windowHeight - this.windowWidth * 9 / 16 + 'px') |
| 69 | - .zIndex(1000) | ||
| 70 | .backgroundColor(Color.White) | 116 | .backgroundColor(Color.White) |
| 71 | } | 117 | } |
| 118 | + | ||
| 119 | + @Builder titleHeaderView() { | ||
| 120 | + Row() { | ||
| 121 | + Row() { | ||
| 122 | + Image($r('app.media.redLine')) | ||
| 123 | + .height(16) | ||
| 124 | + .width(3) | ||
| 125 | + Text('全部评论') | ||
| 126 | + .fontSize(18)// .fontColor('#222222') | ||
| 127 | + .fontColor($r('app.color.color_222222')) | ||
| 128 | + .fontWeight(FontWeight.Medium) | ||
| 129 | + .margin({ left: 5 }) | ||
| 130 | + } | ||
| 131 | + .margin({ left: 16 }) | ||
| 132 | + | ||
| 133 | + Image($r('app.media.close_button')) | ||
| 134 | + .height(16) | ||
| 135 | + .width(16) | ||
| 136 | + .margin({ right: 16 })// .visibility(this.showCloseIcon ? Visibility.Visible : Visibility.Hidden) | ||
| 137 | + .onClick(() => { | ||
| 138 | + if (this.onClose) { | ||
| 139 | + this.onClose() | ||
| 140 | + } | ||
| 141 | + }) | ||
| 142 | + } | ||
| 143 | + .height(44) | ||
| 144 | + .width('100%') | ||
| 145 | + .justifyContent(FlexAlign.SpaceBetween) | ||
| 146 | + } | ||
| 72 | } | 147 | } |
| @@ -483,7 +483,7 @@ class CommentViewModel { | @@ -483,7 +483,7 @@ class CommentViewModel { | ||
| 483 | return false | 483 | return false |
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | - jumpToAccountPage(commentItem: commentItemModel) { | 486 | + jumpToAccountPage(commentItem: commentItemModel, beforeJump: () => void = () => {}) { |
| 487 | let url = HttpUrlUtils.getOtherUserDetailDataUrl() | 487 | let url = HttpUrlUtils.getOtherUserDetailDataUrl() |
| 488 | let item : Record<string, string >= {} | 488 | let item : Record<string, string >= {} |
| 489 | 489 | ||
| @@ -504,6 +504,7 @@ class CommentViewModel { | @@ -504,6 +504,7 @@ class CommentViewModel { | ||
| 504 | return | 504 | return |
| 505 | } | 505 | } |
| 506 | 506 | ||
| 507 | + beforeJump() | ||
| 507 | if (result.data.userType === "1") { // 普通用户 | 508 | if (result.data.userType === "1") { // 普通用户 |
| 508 | let params: Record<string, string> = {'userId': result.data.userId}; | 509 | let params: Record<string, string> = {'userId': result.data.userId}; |
| 509 | WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) | 510 | WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params) |
| @@ -7,6 +7,7 @@ import { EmptyComponent } from '../view/EmptyComponent'; | @@ -7,6 +7,7 @@ import { EmptyComponent } from '../view/EmptyComponent'; | ||
| 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; | 7 | import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; |
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | import { Notes } from '../cardview/notes'; | 9 | import { Notes } from '../cardview/notes'; |
| 10 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 10 | 11 | ||
| 11 | const TAG = 'Zh_Carousel_Layout-01'; | 12 | const TAG = 'Zh_Carousel_Layout-01'; |
| 12 | 13 | ||
| @@ -41,6 +42,8 @@ class MyDataSource implements IDataSource { | @@ -41,6 +42,8 @@ class MyDataSource implements IDataSource { | ||
| 41 | 42 | ||
| 42 | @Component | 43 | @Component |
| 43 | export struct ZhCarouselLayout01 { | 44 | export struct ZhCarouselLayout01 { |
| 45 | + @State pageId: string = ''; | ||
| 46 | + @State pageName: string = ''; | ||
| 44 | @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = | 47 | @StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string = |
| 45 | BreakpointConstants.BREAKPOINT_XS; | 48 | BreakpointConstants.BREAKPOINT_XS; |
| 46 | @State compDTO: CompDTO = {} as CompDTO | 49 | @State compDTO: CompDTO = {} as CompDTO |
| @@ -149,6 +152,7 @@ export struct ZhCarouselLayout01 { | @@ -149,6 +152,7 @@ export struct ZhCarouselLayout01 { | ||
| 149 | bottom: $r('app.float.card_comp_pagePadding_tb') | 152 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 150 | }) | 153 | }) |
| 151 | .onClick((event: ClickEvent) => { | 154 | .onClick((event: ClickEvent) => { |
| 155 | + InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[this.swiperIndex], this.pageId, this.pageName) | ||
| 152 | Logger.info(TAG, `ZhCarouselLayout01 onClick event index: ${this.swiperIndex}`); | 156 | Logger.info(TAG, `ZhCarouselLayout01 onClick event index: ${this.swiperIndex}`); |
| 153 | ProcessUtils.processPage(this.compDTO.operDataList[this.swiperIndex]) | 157 | ProcessUtils.processPage(this.compDTO.operDataList[this.swiperIndex]) |
| 154 | }) | 158 | }) |
| @@ -196,7 +200,7 @@ struct CarouselLayout01CardView { | @@ -196,7 +200,7 @@ struct CarouselLayout01CardView { | ||
| 196 | Column() { | 200 | Column() { |
| 197 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 | 201 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 |
| 198 | if (this.item.objectType === '2' || this.item.objectType === '4') { | 202 | if (this.item.objectType === '2' || this.item.objectType === '4') { |
| 199 | - CardMediaInfo({ contentDTO: this.item }) | 203 | + CardMediaInfo({ contentDTO: this.item,livePeopleNum:false }) |
| 200 | .width(CommonConstants.FULL_PARENT) | 204 | .width(CommonConstants.FULL_PARENT) |
| 201 | } | 205 | } |
| 202 | Blank() | 206 | Blank() |
| @@ -4,6 +4,7 @@ import { Logger } from 'wdKit/Index'; | @@ -4,6 +4,7 @@ import { Logger } from 'wdKit/Index'; | ||
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | import PageViewModel from '../../viewmodel/PageViewModel'; | 5 | import PageViewModel from '../../viewmodel/PageViewModel'; |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 7 | 8 | ||
| 8 | let listSize: number = 2; | 9 | let listSize: number = 2; |
| 9 | 10 | ||
| @@ -13,6 +14,8 @@ let listSize: number = 2; | @@ -13,6 +14,8 @@ let listSize: number = 2; | ||
| 13 | */ | 14 | */ |
| 14 | @Component | 15 | @Component |
| 15 | export struct ZhGridLayout02NewsContent { | 16 | export struct ZhGridLayout02NewsContent { |
| 17 | + @State pageId: string = ''; | ||
| 18 | + @State pageName: string = ''; | ||
| 16 | @ObjectLink compDTO: CompDTO | 19 | @ObjectLink compDTO: CompDTO |
| 17 | @State operDataList: ContentDTO[] = [] | 20 | @State operDataList: ContentDTO[] = [] |
| 18 | @State loadImg: boolean = false; | 21 | @State loadImg: boolean = false; |
| @@ -42,7 +45,7 @@ export struct ZhGridLayout02NewsContent { | @@ -42,7 +45,7 @@ export struct ZhGridLayout02NewsContent { | ||
| 42 | buildItemCard(item: ContentDTO, index: number) { | 45 | buildItemCard(item: ContentDTO, index: number) { |
| 43 | Column() { | 46 | Column() { |
| 44 | Stack({ alignContent: Alignment.BottomEnd }) { | 47 | Stack({ alignContent: Alignment.BottomEnd }) { |
| 45 | - Image(this.loadImg ? item.fullColumnImgUrls[0].url : '') | 48 | + Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls[0].url : '') |
| 46 | .backgroundColor(0xf5f5f5) | 49 | .backgroundColor(0xf5f5f5) |
| 47 | .width('100%') | 50 | .width('100%') |
| 48 | .height(95) | 51 | .height(95) |
| @@ -55,7 +58,12 @@ export struct ZhGridLayout02NewsContent { | @@ -55,7 +58,12 @@ export struct ZhGridLayout02NewsContent { | ||
| 55 | .fontSize(12) | 58 | .fontSize(12) |
| 56 | .fontWeight(400) | 59 | .fontWeight(400) |
| 57 | .fontColor(Color.White) | 60 | .fontColor(Color.White) |
| 58 | - .textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 }) | 61 | + .textShadow({ |
| 62 | + radius: 2, | ||
| 63 | + color: 'rgba(0,0,0,0.3)', | ||
| 64 | + offsetX: 0, | ||
| 65 | + offsetY: 2 | ||
| 66 | + }) | ||
| 59 | .margin({ | 67 | .margin({ |
| 60 | right: '5vp', | 68 | right: '5vp', |
| 61 | bottom: '5vp' | 69 | bottom: '5vp' |
| @@ -74,6 +82,7 @@ export struct ZhGridLayout02NewsContent { | @@ -74,6 +82,7 @@ export struct ZhGridLayout02NewsContent { | ||
| 74 | } | 82 | } |
| 75 | .width('100%') | 83 | .width('100%') |
| 76 | .onClick(() => { | 84 | .onClick(() => { |
| 85 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 77 | ProcessUtils.processPage(item) | 86 | ProcessUtils.processPage(item) |
| 78 | }) | 87 | }) |
| 79 | } | 88 | } |
| @@ -4,6 +4,7 @@ import { Logger } from 'wdKit'; | @@ -4,6 +4,7 @@ import { Logger } from 'wdKit'; | ||
| 4 | import { WDRouterRule } from 'wdRouter'; | 4 | import { WDRouterRule } from 'wdRouter'; |
| 5 | import { ProcessUtils } from 'wdRouter'; | 5 | import { ProcessUtils } from 'wdRouter'; |
| 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 6 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 7 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 7 | 8 | ||
| 8 | const TAG = 'Zh_Grid_Layout-03'; | 9 | const TAG = 'Zh_Grid_Layout-03'; |
| 9 | const FULL_PARENT: string = '100%'; | 10 | const FULL_PARENT: string = '100%'; |
| @@ -18,6 +19,8 @@ let listSize: number = 4; | @@ -18,6 +19,8 @@ let listSize: number = 4; | ||
| 18 | @Preview | 19 | @Preview |
| 19 | @Component | 20 | @Component |
| 20 | export struct ZhGridLayout03 { | 21 | export struct ZhGridLayout03 { |
| 22 | + @State pageId: string = ''; | ||
| 23 | + @State pageName: string = ''; | ||
| 21 | @State compDTO: CompDTO = {} as CompDTO | 24 | @State compDTO: CompDTO = {} as CompDTO |
| 22 | @State loadImg: boolean = false; | 25 | @State loadImg: boolean = false; |
| 23 | 26 | ||
| @@ -73,6 +76,7 @@ export struct ZhGridLayout03 { | @@ -73,6 +76,7 @@ export struct ZhGridLayout03 { | ||
| 73 | } | 76 | } |
| 74 | .width('100%') | 77 | .width('100%') |
| 75 | .onClick((event: ClickEvent) => { | 78 | .onClick((event: ClickEvent) => { |
| 79 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 76 | if (item.objectType === '11') { | 80 | if (item.objectType === '11') { |
| 77 | ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle) | 81 | ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle) |
| 78 | } else { | 82 | } else { |
| 1 | import { CompDTO, ContentDTO } from 'wdBean'; | 1 | import { CompDTO, ContentDTO } from 'wdBean'; |
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { ProcessUtils } from 'wdRouter'; | 3 | import { ProcessUtils } from 'wdRouter'; |
| 4 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 4 | 5 | ||
| 5 | const TAG = 'Zh_Single_Column-04'; | 6 | const TAG = 'Zh_Single_Column-04'; |
| 6 | 7 | ||
| @@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-04'; | @@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-04'; | ||
| 10 | */ | 11 | */ |
| 11 | @Component | 12 | @Component |
| 12 | export struct ZhSingleColumn04 { | 13 | export struct ZhSingleColumn04 { |
| 14 | + @State pageId: string = ''; | ||
| 15 | + @State pageName: string = ''; | ||
| 13 | @State compDTO: CompDTO = {} as CompDTO | 16 | @State compDTO: CompDTO = {} as CompDTO |
| 14 | operDataList: ContentDTO[] = [ | 17 | operDataList: ContentDTO[] = [ |
| 15 | // {newsTitle: "民检普法课堂:正当防卫是什么正当防卫是什么正当防卫是什么正当防卫是什么?", tagWord: 1} as ContentDTO, | 18 | // {newsTitle: "民检普法课堂:正当防卫是什么正当防卫是什么正当防卫是什么正当防卫是什么?", tagWord: 1} as ContentDTO, |
| @@ -83,6 +86,7 @@ export struct ZhSingleColumn04 { | @@ -83,6 +86,7 @@ export struct ZhSingleColumn04 { | ||
| 83 | .backgroundImage($r('app.media.rmh_theme_bg')) | 86 | .backgroundImage($r('app.media.rmh_theme_bg')) |
| 84 | .backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH }) | 87 | .backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH }) |
| 85 | .onClick(() => { | 88 | .onClick(() => { |
| 89 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 86 | ProcessUtils.processPage(item) | 90 | ProcessUtils.processPage(item) |
| 87 | }) | 91 | }) |
| 88 | } | 92 | } |
| 1 | import { CommonConstants } from 'wdConstant'; | 1 | import { CommonConstants } from 'wdConstant'; |
| 2 | import { Action, CompDTO, Params } from 'wdBean'; | 2 | import { Action, CompDTO, Params } from 'wdBean'; |
| 3 | import { WDRouterRule } from 'wdRouter'; | 3 | import { WDRouterRule } from 'wdRouter'; |
| 4 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 4 | 5 | ||
| 5 | const TAG = 'Zh_Single_Column-05'; | 6 | const TAG = 'Zh_Single_Column-05'; |
| 6 | 7 | ||
| @@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-05'; | @@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-05'; | ||
| 10 | */ | 11 | */ |
| 11 | @Component | 12 | @Component |
| 12 | export struct ZhSingleColumn05 { | 13 | export struct ZhSingleColumn05 { |
| 14 | + @State pageId: string = ''; | ||
| 15 | + @State pageName: string = ''; | ||
| 13 | @State compDTO: CompDTO = {} as CompDTO | 16 | @State compDTO: CompDTO = {} as CompDTO |
| 14 | 17 | ||
| 15 | build() { | 18 | build() { |
| @@ -29,6 +32,7 @@ export struct ZhSingleColumn05 { | @@ -29,6 +32,7 @@ export struct ZhSingleColumn05 { | ||
| 29 | .justifyContent(FlexAlign.Center) | 32 | .justifyContent(FlexAlign.Center) |
| 30 | .borderRadius($r('app.float.button_border_radius')) | 33 | .borderRadius($r('app.float.button_border_radius')) |
| 31 | .onClick(() => { | 34 | .onClick(() => { |
| 35 | + // InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | ||
| 32 | let taskAction: Action = { | 36 | let taskAction: Action = { |
| 33 | type: 'JUMP_H5_BY_WEB_VIEW', | 37 | type: 'JUMP_H5_BY_WEB_VIEW', |
| 34 | params: { | 38 | params: { |
| @@ -5,6 +5,8 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | @@ -5,6 +5,8 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 5 | import { PageRepository } from '../../repository/PageRepository'; | 5 | import { PageRepository } from '../../repository/PageRepository'; |
| 6 | import { CommonConstants } from 'wdConstant/Index'; | 6 | import { CommonConstants } from 'wdConstant/Index'; |
| 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 7 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 8 | +import { Tracking, TrackingContent, TrackConstants, ParamType } from 'wdTracking'; | ||
| 9 | +import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils' | ||
| 8 | /** | 10 | /** |
| 9 | * 兴趣卡 | 11 | * 兴趣卡 |
| 10 | * Zh_Single_Column-09 | 12 | * Zh_Single_Column-09 |
| @@ -14,6 +16,8 @@ const TAG = 'Zh_Single_Column-09' | @@ -14,6 +16,8 @@ const TAG = 'Zh_Single_Column-09' | ||
| 14 | @Entry | 16 | @Entry |
| 15 | @Component | 17 | @Component |
| 16 | export struct ZhSingleColumn09 { | 18 | export struct ZhSingleColumn09 { |
| 19 | + @State pageId: string = ''; | ||
| 20 | + @State pageName: string = ''; | ||
| 17 | @State compDTO: CompDTO = {} as CompDTO | 21 | @State compDTO: CompDTO = {} as CompDTO |
| 18 | @State activeIndexs: Array<number> = [] | 22 | @State activeIndexs: Array<number> = [] |
| 19 | @State operDataList: ContentDTO[] = this.compDTO?.operDataList || [] | 23 | @State operDataList: ContentDTO[] = this.compDTO?.operDataList || [] |
| @@ -25,6 +29,43 @@ export struct ZhSingleColumn09 { | @@ -25,6 +29,43 @@ export struct ZhSingleColumn09 { | ||
| 25 | this.operDataList = this.shuffleArray(this.compDTO?.operDataList) | 29 | this.operDataList = this.shuffleArray(this.compDTO?.operDataList) |
| 26 | } | 30 | } |
| 27 | 31 | ||
| 32 | + trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') { | ||
| 33 | + try { | ||
| 34 | + const contentDTO = this.compDTO.operDataList[0]; | ||
| 35 | + const extParams: ParamType = { | ||
| 36 | + 'value': type === 'close_interest_card_click' ? 'closeInterestCard' : 'selectInterestCard', | ||
| 37 | + 'duration': 0, | ||
| 38 | + 'action': 'detailPageShow', | ||
| 39 | + 'shareChannel': '', | ||
| 40 | + 'contentName': '兴趣选项卡', | ||
| 41 | + 'contentType': this.compDTO.objectType || '', | ||
| 42 | + 'contentId': this.compDTO.objectId, | ||
| 43 | + // 'channelSourceId': this.compDTO.channelId, | ||
| 44 | + // 'contentShowChannelId': this.compDTO.channelId, | ||
| 45 | + 'regionName': 2, // 信息流:2 | ||
| 46 | + 'componentType': this.compDTO.compStyle, | ||
| 47 | + 'sceneId': contentDTO.sceneId, | ||
| 48 | + 'subSceneId': contentDTO.subSceneId, | ||
| 49 | + 'cnsTraceId': contentDTO.cnsTraceId, | ||
| 50 | + 'cardItemId': this.compDTO.cardItemId, | ||
| 51 | + 'itemId': this.compDTO.itemId || contentDTO.itemId, | ||
| 52 | + 'expIds': this.compDTO.expIds || contentDTO.expIds, | ||
| 53 | + } | ||
| 54 | + if (type === 'interest_card_selecting_click') { | ||
| 55 | + // extParams['interestOptions'] = this.operDataList.map(item => { | ||
| 56 | + // return item. | ||
| 57 | + // }) | ||
| 58 | + } | ||
| 59 | + let params = TrackingUtils.generateParams(extParams); | ||
| 60 | + params['pageId'] = this.pageId; | ||
| 61 | + params['pageName'] = this.pageName; | ||
| 62 | + TrackingUtils.fillPositionWith(params) | ||
| 63 | + Tracking.event(type, params) | ||
| 64 | + } catch (e) { | ||
| 65 | + console.log('Zh_Single_Column-09', JSON.stringify(e)) | ||
| 66 | + } | ||
| 67 | + } | ||
| 68 | + | ||
| 28 | getItemWidth(index: number) { | 69 | getItemWidth(index: number) { |
| 29 | if (index % 4 === 0 || index % 4 === 3) { | 70 | if (index % 4 === 0 || index % 4 === 3) { |
| 30 | return 80 | 71 | return 80 |
| @@ -73,6 +114,7 @@ export struct ZhSingleColumn09 { | @@ -73,6 +114,7 @@ export struct ZhSingleColumn09 { | ||
| 73 | .margin({top: -10}) | 114 | .margin({top: -10}) |
| 74 | .padding({top: 0, bottom: 0, left: 0, right: 0}) | 115 | .padding({top: 0, bottom: 0, left: 0, right: 0}) |
| 75 | .onClick(() => { | 116 | .onClick(() => { |
| 117 | + this.trackClick('interest_card_selecting_click') | ||
| 76 | if (this.activeIndexs.length > 0) { | 118 | if (this.activeIndexs.length > 0) { |
| 77 | this.selfClosed = true; | 119 | this.selfClosed = true; |
| 78 | } | 120 | } |
| @@ -142,6 +184,7 @@ export struct ZhSingleColumn09 { | @@ -142,6 +184,7 @@ export struct ZhSingleColumn09 { | ||
| 142 | .width(14) | 184 | .width(14) |
| 143 | .height(14) | 185 | .height(14) |
| 144 | .onClick(() => { | 186 | .onClick(() => { |
| 187 | + this.trackClick('close_interest_card_click') | ||
| 145 | this.selfClosed = true; | 188 | this.selfClosed = true; |
| 146 | }) | 189 | }) |
| 147 | } | 190 | } |
| @@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index'; | @@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index'; | ||
| 6 | import { ProcessUtils } from 'wdRouter'; | 6 | import { ProcessUtils } from 'wdRouter'; |
| 7 | import { HttpUtils } from 'wdNetwork/Index'; | 7 | import { HttpUtils } from 'wdNetwork/Index'; |
| 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 8 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 9 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 小视频横划卡 | 12 | * 小视频横划卡 |
| @@ -15,6 +16,8 @@ const TAG = 'Zh_Single_Row-02' | @@ -15,6 +16,8 @@ const TAG = 'Zh_Single_Row-02' | ||
| 15 | 16 | ||
| 16 | @Component | 17 | @Component |
| 17 | export struct ZhSingleRow02 { | 18 | export struct ZhSingleRow02 { |
| 19 | + @State pageId: string = ''; | ||
| 20 | + @State pageName: string = ''; | ||
| 18 | @State compDTO: CompDTO = {} as CompDTO | 21 | @State compDTO: CompDTO = {} as CompDTO |
| 19 | 22 | ||
| 20 | build() { | 23 | build() { |
| @@ -26,7 +29,11 @@ export struct ZhSingleRow02 { | @@ -26,7 +29,11 @@ export struct ZhSingleRow02 { | ||
| 26 | List() { | 29 | List() { |
| 27 | ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { | 30 | ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => { |
| 28 | CreatorItem({ | 31 | CreatorItem({ |
| 29 | - item | 32 | + item, |
| 33 | + index, | ||
| 34 | + compDTO: this.compDTO, | ||
| 35 | + pageId: this.pageId, | ||
| 36 | + pageName: this.pageName | ||
| 30 | }) | 37 | }) |
| 31 | .margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0}) | 38 | .margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0}) |
| 32 | }) | 39 | }) |
| @@ -69,11 +76,6 @@ export struct ZhSingleRow02 { | @@ -69,11 +76,6 @@ export struct ZhSingleRow02 { | ||
| 69 | Image($r("app.media.more")) | 76 | Image($r("app.media.more")) |
| 70 | .width(14) | 77 | .width(14) |
| 71 | .height(14) | 78 | .height(14) |
| 72 | - .onClick(() => { | ||
| 73 | - // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 | ||
| 74 | - let params = {'index': "1"} as Record<string, string> | ||
| 75 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 76 | - }) | ||
| 77 | } | 79 | } |
| 78 | .padding({ | 80 | .padding({ |
| 79 | right: $r('app.float.card_comp_pagePadding_lf'), | 81 | right: $r('app.float.card_comp_pagePadding_lf'), |
| @@ -103,7 +105,11 @@ function textOverflowStyle(maxLine: number) { | @@ -103,7 +105,11 @@ function textOverflowStyle(maxLine: number) { | ||
| 103 | 105 | ||
| 104 | @Component | 106 | @Component |
| 105 | struct CreatorItem { | 107 | struct CreatorItem { |
| 108 | + @Prop pageId: string = ''; | ||
| 109 | + @Prop pageName: string = ''; | ||
| 110 | + @Prop compDTO: CompDTO | ||
| 106 | @Prop item: ContentDTO | 111 | @Prop item: ContentDTO |
| 112 | + @Prop index: number | ||
| 107 | @State rmhIsAttention: number = 0 | 113 | @State rmhIsAttention: number = 0 |
| 108 | @State loadImg: boolean = false; | 114 | @State loadImg: boolean = false; |
| 109 | 115 | ||
| @@ -143,6 +149,7 @@ struct CreatorItem { | @@ -143,6 +149,7 @@ struct CreatorItem { | ||
| 143 | .borderRadius($r('app.float.image_border_radius')) | 149 | .borderRadius($r('app.float.image_border_radius')) |
| 144 | } | 150 | } |
| 145 | .onClick((event: ClickEvent) => { | 151 | .onClick((event: ClickEvent) => { |
| 152 | + InfomationCardClick.track(this.compDTO, this.item, this.pageId, this.pageName) | ||
| 146 | ProcessUtils.processPage(this.item) | 153 | ProcessUtils.processPage(this.item) |
| 147 | }) | 154 | }) |
| 148 | } | 155 | } |
| @@ -9,6 +9,7 @@ import { LiveModel } from '../../viewmodel/LiveModel' | @@ -9,6 +9,7 @@ import { LiveModel } from '../../viewmodel/LiveModel' | ||
| 9 | import { Logger, ToastUtils } from 'wdKit'; | 9 | import { Logger, ToastUtils } from 'wdKit'; |
| 10 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 10 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 11 | import { SpConstants } from 'wdConstant/Index' | 11 | import { SpConstants } from 'wdConstant/Index' |
| 12 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| 14 | * 直播预约卡 | 15 | * 直播预约卡 |
| @@ -25,6 +26,8 @@ interface reserveReqItem { | @@ -25,6 +26,8 @@ interface reserveReqItem { | ||
| 25 | @Entry | 26 | @Entry |
| 26 | @Component | 27 | @Component |
| 27 | export struct ZhSingleRow03 { | 28 | export struct ZhSingleRow03 { |
| 29 | + @State pageId: string = ''; | ||
| 30 | + @State pageName: string = ''; | ||
| 28 | @State compDTO: CompDTO = {} as CompDTO | 31 | @State compDTO: CompDTO = {} as CompDTO |
| 29 | @State isEndEdge: boolean = false; | 32 | @State isEndEdge: boolean = false; |
| 30 | // @State reserveStatus: reserveItem[] = [] | 33 | // @State reserveStatus: reserveItem[] = [] |
| @@ -197,6 +200,7 @@ export struct ZhSingleRow03 { | @@ -197,6 +200,7 @@ export struct ZhSingleRow03 { | ||
| 197 | .backgroundColor(0xf9f9f9) | 200 | .backgroundColor(0xf9f9f9) |
| 198 | .margin({right: 8}) | 201 | .margin({right: 8}) |
| 199 | .onClick(() => { | 202 | .onClick(() => { |
| 203 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 200 | ProcessUtils.processPage(item) | 204 | ProcessUtils.processPage(item) |
| 201 | }) | 205 | }) |
| 202 | } | 206 | } |
| @@ -2,6 +2,7 @@ import { CompDTO, ContentDTO } from 'wdBean'; | @@ -2,6 +2,7 @@ import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 2 | import { CommonConstants } from 'wdConstant'; | 2 | import { CommonConstants } from 'wdConstant'; |
| 3 | import { DateTimeUtils } from 'wdKit'; | 3 | import { DateTimeUtils } from 'wdKit'; |
| 4 | import { ProcessUtils } from 'wdRouter'; | 4 | import { ProcessUtils } from 'wdRouter'; |
| 5 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 本地精选卡 | 8 | * 本地精选卡 |
| @@ -10,6 +11,8 @@ import { ProcessUtils } from 'wdRouter'; | @@ -10,6 +11,8 @@ import { ProcessUtils } from 'wdRouter'; | ||
| 10 | 11 | ||
| 11 | @Component | 12 | @Component |
| 12 | export struct ZhSingleRow04 { | 13 | export struct ZhSingleRow04 { |
| 14 | + @State pageId: string = ''; | ||
| 15 | + @State pageName: string = ''; | ||
| 13 | @State compDTO: CompDTO = {} as CompDTO | 16 | @State compDTO: CompDTO = {} as CompDTO |
| 14 | 17 | ||
| 15 | build() { | 18 | build() { |
| @@ -71,6 +74,7 @@ export struct ZhSingleRow04 { | @@ -71,6 +74,7 @@ export struct ZhSingleRow04 { | ||
| 71 | top: 6 | 74 | top: 6 |
| 72 | }) | 75 | }) |
| 73 | .onClick(() => { | 76 | .onClick(() => { |
| 77 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 74 | ProcessUtils.processPage(item) | 78 | ProcessUtils.processPage(item) |
| 75 | }) | 79 | }) |
| 76 | } | 80 | } |
| @@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | @@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean'; | ||
| 4 | import { PageRepository } from '../../repository/PageRepository'; | 4 | import { PageRepository } from '../../repository/PageRepository'; |
| 5 | import { CommonConstants } from 'wdConstant/Index'; | 5 | import { CommonConstants } from 'wdConstant/Index'; |
| 6 | import { HttpUtils } from 'wdNetwork/Index'; | 6 | import { HttpUtils } from 'wdNetwork/Index'; |
| 7 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * 人民号横划卡 | 10 | * 人民号横划卡 |
| @@ -14,6 +15,8 @@ const TAG = 'Zh_Single_Row-05' | @@ -14,6 +15,8 @@ const TAG = 'Zh_Single_Row-05' | ||
| 14 | @Entry | 15 | @Entry |
| 15 | @Component | 16 | @Component |
| 16 | export struct ZhSingleRow05 { | 17 | export struct ZhSingleRow05 { |
| 18 | + @State pageId: string = ''; | ||
| 19 | + @State pageName: string = ''; | ||
| 17 | @State compDTO: CompDTO = { | 20 | @State compDTO: CompDTO = { |
| 18 | // objectTitle: '创作者推荐', | 21 | // objectTitle: '创作者推荐', |
| 19 | // operDataList: [ | 22 | // operDataList: [ |
| @@ -83,8 +86,8 @@ export struct ZhSingleRow05 { | @@ -83,8 +86,8 @@ export struct ZhSingleRow05 { | ||
| 83 | .height(14) | 86 | .height(14) |
| 84 | .onClick(() => { | 87 | .onClick(() => { |
| 85 | // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 | 88 | // TODO 跳转的页面,定义的入参可能不合理。推荐id: 41 |
| 86 | - let params = {'index': "1"} as Record<string, string>; | ||
| 87 | - WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | 89 | + // let params = {'index': "1"} as Record<string, string>; |
| 90 | + // WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params) | ||
| 88 | }) | 91 | }) |
| 89 | } | 92 | } |
| 90 | .padding({ | 93 | .padding({ |
| @@ -10,6 +10,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV | @@ -10,6 +10,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV | ||
| 10 | import commentViewModel from '../../components/comment/viewmodel/CommentViewModel'; | 10 | import commentViewModel from '../../components/comment/viewmodel/CommentViewModel'; |
| 11 | import { commentItemModel } from '../../components/comment/model/CommentModel' | 11 | import { commentItemModel } from '../../components/comment/model/CommentModel' |
| 12 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 12 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 13 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | * 精选评论卡 | 16 | * 精选评论卡 |
| @@ -19,6 +20,8 @@ const TAG = 'Zh_Single_Row-06' | @@ -19,6 +20,8 @@ const TAG = 'Zh_Single_Row-06' | ||
| 19 | @Entry | 20 | @Entry |
| 20 | @Component | 21 | @Component |
| 21 | export struct ZhSingleRow06 { | 22 | export struct ZhSingleRow06 { |
| 23 | + @State pageId: string = ''; | ||
| 24 | + @State pageName: string = ''; | ||
| 22 | @State compDTO: CompDTO = {} as CompDTO | 25 | @State compDTO: CompDTO = {} as CompDTO |
| 23 | @State newsStatusOfUser: batchLikeAndCollectResult = { | 26 | @State newsStatusOfUser: batchLikeAndCollectResult = { |
| 24 | likeStatus: '0' | 27 | likeStatus: '0' |
| @@ -143,8 +146,6 @@ export struct ZhSingleRow06 { | @@ -143,8 +146,6 @@ export struct ZhSingleRow06 { | ||
| 143 | Text(Number(this.newsStatusOfUser?.likeStatus) == 1 ? '已赞' : '点赞') | 146 | Text(Number(this.newsStatusOfUser?.likeStatus) == 1 ? '已赞' : '点赞') |
| 144 | .fontSize(15) | 147 | .fontSize(15) |
| 145 | .fontColor(0x999999) | 148 | .fontColor(0x999999) |
| 146 | - .onClick(() => { | ||
| 147 | - }) | ||
| 148 | } | 149 | } |
| 149 | .onClick(() => { | 150 | .onClick(() => { |
| 150 | this.toggleLikeStatus() | 151 | this.toggleLikeStatus() |
| @@ -160,6 +161,9 @@ export struct ZhSingleRow06 { | @@ -160,6 +161,9 @@ export struct ZhSingleRow06 { | ||
| 160 | bottom: $r('app.float.card_comp_pagePadding_tb') | 161 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 161 | }) | 162 | }) |
| 162 | .backgroundColor($r('app.color.white')) | 163 | .backgroundColor($r('app.color.white')) |
| 164 | + .onClick(() => { | ||
| 165 | + InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName) | ||
| 166 | + }) | ||
| 163 | } | 167 | } |
| 164 | 168 | ||
| 165 | @Builder | 169 | @Builder |
| 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' | 1 | import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel' |
| 2 | import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter' | 2 | import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter' |
| 3 | import { Params } from 'wdBean'; | 3 | import { Params } from 'wdBean'; |
| 4 | -import { ToastUtils } from 'wdKit/Index'; | ||
| 5 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; | 4 | import { TrackingButton, TrackConstants } from 'wdTracking/Index'; |
| 6 | 5 | ||
| 7 | @Component | 6 | @Component |
| 1 | +import { TrackConstants, TrackingButton } from 'wdTracking/Index' | ||
| 1 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 2 | import { onlyWifiLoadImg } from '../../../utils/lazyloadImg' | 3 | import { onlyWifiLoadImg } from '../../../utils/lazyloadImg' |
| 3 | import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem' | 4 | import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem' |
| @@ -200,6 +201,10 @@ export struct AppointmentListChildComponent { | @@ -200,6 +201,10 @@ export struct AppointmentListChildComponent { | ||
| 200 | if (value != null) { | 201 | if (value != null) { |
| 201 | if (value.code === 0 || value.code.toString() === "0") { | 202 | if (value.code === 0 || value.code.toString() === "0") { |
| 202 | this.item.isAppointment = !this.item.isAppointment | 203 | this.item.isAppointment = !this.item.isAppointment |
| 204 | + | ||
| 205 | + if(!this.item.isAppointment){ | ||
| 206 | + TrackingButton.click("mySavedLivePageUnSubscribe",TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live) | ||
| 207 | + } | ||
| 203 | } | 208 | } |
| 204 | } | 209 | } |
| 205 | }) | 210 | }) |
| @@ -2,6 +2,7 @@ import { SpConstants } from 'wdConstant/Index' | @@ -2,6 +2,7 @@ import { SpConstants } from 'wdConstant/Index' | ||
| 2 | import { SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index' | 2 | import { SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index' |
| 3 | import { HttpUtils } from 'wdNetwork/Index' | 3 | import { HttpUtils } from 'wdNetwork/Index' |
| 4 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | 4 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' |
| 5 | +import { TrackConstants, TrackingContent } from 'wdTracking/Index' | ||
| 5 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 6 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 6 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' | 7 | import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem' |
| 7 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem' | 8 | import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem' |
| @@ -266,6 +267,12 @@ export struct FollowChildComponent{ | @@ -266,6 +267,12 @@ export struct FollowChildComponent{ | ||
| 266 | this.data.status = this.data.status ==="0"?"1":"0" | 267 | this.data.status = this.data.status ==="0"?"1":"0" |
| 267 | 268 | ||
| 268 | UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status) | 269 | UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status) |
| 270 | + | ||
| 271 | + if(this.data.status == "1"){//关注 | ||
| 272 | + TrackingContent.follow(true,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow) | ||
| 273 | + }else {//取消关注 | ||
| 274 | + TrackingContent.follow(false,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow) | ||
| 275 | + } | ||
| 269 | } | 276 | } |
| 270 | } | 277 | } |
| 271 | }) | 278 | }) |
| 1 | import { EmitterUtils, EmitterEventId, Logger, NetworkUtil } from 'wdKit/Index' | 1 | import { EmitterUtils, EmitterEventId, Logger, NetworkUtil } from 'wdKit/Index' |
| 2 | +import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index' | ||
| 2 | import MinePageDatasModel from '../../../model/MinePageDatasModel' | 3 | import MinePageDatasModel from '../../../model/MinePageDatasModel' |
| 3 | import { FollowListItem } from '../../../viewmodel/FollowListItem' | 4 | import { FollowListItem } from '../../../viewmodel/FollowListItem' |
| 4 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' | 5 | import { CustomTitleUI } from '../../reusable/CustomTitleUI' |
| @@ -70,6 +71,7 @@ export struct FollowFirstTabsComponent{ | @@ -70,6 +71,7 @@ export struct FollowFirstTabsComponent{ | ||
| 70 | }.onClick(()=>{ | 71 | }.onClick(()=>{ |
| 71 | this.currentIndex = index | 72 | this.currentIndex = index |
| 72 | this.controller.changeIndex(this.currentIndex) | 73 | this.controller.changeIndex(this.currentIndex) |
| 74 | + trackTabFirstClick(item.directoryName) | ||
| 73 | }) | 75 | }) |
| 74 | .height('100%') | 76 | .height('100%') |
| 75 | .margin({right:'9lpx'}) | 77 | .margin({right:'9lpx'}) |
| @@ -103,6 +105,7 @@ export struct FollowFirstTabsComponent{ | @@ -103,6 +105,7 @@ export struct FollowFirstTabsComponent{ | ||
| 103 | .animationDuration(0) | 105 | .animationDuration(0) |
| 104 | .onChange((index: number) => { | 106 | .onChange((index: number) => { |
| 105 | this.currentIndex = index | 107 | this.currentIndex = index |
| 108 | + trackTabFirstClick(this.data[index].directoryName) | ||
| 106 | }) | 109 | }) |
| 107 | .width('100%') | 110 | .width('100%') |
| 108 | .layoutWeight(1) | 111 | .layoutWeight(1) |
| @@ -117,4 +120,13 @@ export struct FollowFirstTabsComponent{ | @@ -117,4 +120,13 @@ export struct FollowFirstTabsComponent{ | ||
| 117 | this.isConnectNetwork = c | 120 | this.isConnectNetwork = c |
| 118 | } | 121 | } |
| 119 | } | 122 | } |
| 120 | -} | ||
| 123 | +} | ||
| 124 | + | ||
| 125 | + function trackTabFirstClick(firstLevelTabName: string){ | ||
| 126 | + let params: ParamType = {} | ||
| 127 | + params["firstLevelTabName"] = firstLevelTabName | ||
| 128 | + params["pageName"] = TrackConstants.PageName.My_Follow | ||
| 129 | + params["pageId"] = TrackConstants.PageName.My_Follow | ||
| 130 | + | ||
| 131 | + Tracking.event("my_follow_page_tab_click", params) | ||
| 132 | + } |
| @@ -265,19 +265,24 @@ struct LiveMorePage { | @@ -265,19 +265,24 @@ struct LiveMorePage { | ||
| 265 | .fontSize('12vp') | 265 | .fontSize('12vp') |
| 266 | .fontWeight(400) | 266 | .fontWeight(400) |
| 267 | .fontColor(Color.White) | 267 | .fontColor(Color.White) |
| 268 | + .textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 }) | ||
| 268 | .margin({ | 269 | .margin({ |
| 269 | right: '5vp' | 270 | right: '5vp' |
| 270 | }) | 271 | }) |
| 271 | - Divider() | ||
| 272 | - .vertical(true) | ||
| 273 | - .strokeWidth(1) | ||
| 274 | - .height('12vp') | ||
| 275 | - .margin({ top: 2, bottom: 2 }) | ||
| 276 | - .color(Color.White) | 272 | + // Divider() |
| 273 | + // .vertical(true) | ||
| 274 | + // .strokeWidth(1) | ||
| 275 | + // .height('12vp') | ||
| 276 | + // .margin({ top: 2, bottom: 2 }) | ||
| 277 | + // .color(Color.White) | ||
| 278 | + | ||
| 279 | + Image($r('app.media.icon_comp_line_live')).height('11vp').width('1.5vp') | ||
| 280 | + | ||
| 277 | if (this.getLiveRoomNumber(item).length > 0) { | 281 | if (this.getLiveRoomNumber(item).length > 0) { |
| 278 | Text(this.getLiveRoomNumber(item)) | 282 | Text(this.getLiveRoomNumber(item)) |
| 279 | .fontSize('12vp') | 283 | .fontSize('12vp') |
| 280 | .fontWeight(400) | 284 | .fontWeight(400) |
| 285 | + .textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 }) | ||
| 281 | .fontColor(Color.White) | 286 | .fontColor(Color.White) |
| 282 | .margin({ | 287 | .margin({ |
| 283 | left: '5vp' | 288 | left: '5vp' |
| @@ -2,7 +2,7 @@ import { CommonConstants, ViewType } from 'wdConstant'; | @@ -2,7 +2,7 @@ import { CommonConstants, ViewType } from 'wdConstant'; | ||
| 2 | import { Logger } from 'wdKit'; | 2 | import { Logger } from 'wdKit'; |
| 3 | import { EmptyComponent } from '../view/EmptyComponent'; | 3 | import { EmptyComponent } from '../view/EmptyComponent'; |
| 4 | import PageModel from '../../viewmodel/PageModel'; | 4 | import PageModel from '../../viewmodel/PageModel'; |
| 5 | -import { autoRefresh, listTouchEvent } from '../../utils/PullDownRefresh'; | 5 | +import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh'; |
| 6 | import LoadMoreLayout from './LoadMoreLayout'; | 6 | import LoadMoreLayout from './LoadMoreLayout'; |
| 7 | import { CompParser } from '../CompParser'; | 7 | import { CompParser } from '../CompParser'; |
| 8 | import { CompDTO } from 'wdBean'; | 8 | import { CompDTO } from 'wdBean'; |
| @@ -14,9 +14,6 @@ import PageNoMoreLayout from './PageNoMoreLayout'; | @@ -14,9 +14,6 @@ import PageNoMoreLayout from './PageNoMoreLayout'; | ||
| 14 | import { NoMoreBean } from './NoMoreBean'; | 14 | import { NoMoreBean } from './NoMoreBean'; |
| 15 | import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; | 15 | import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean'; |
| 16 | import RefreshLayout from '../refresh/RefreshLayout'; | 16 | import RefreshLayout from '../refresh/RefreshLayout'; |
| 17 | -import json from '@ohos.util.json'; | ||
| 18 | -import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare' | ||
| 19 | -import { common } from '@kit.AbilityKit'; | ||
| 20 | const TAG = 'PageComponent'; | 17 | const TAG = 'PageComponent'; |
| 21 | 18 | ||
| 22 | @Component | 19 | @Component |
| @@ -31,6 +28,7 @@ export struct PageComponent { | @@ -31,6 +28,7 @@ export struct PageComponent { | ||
| 31 | // 自动刷新通知 | 28 | // 自动刷新通知 |
| 32 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 | 29 | @Prop @Watch('onAutoRefresh') autoRefresh: number = 0 |
| 33 | private listScroller: Scroller = new Scroller(); | 30 | private listScroller: Scroller = new Scroller(); |
| 31 | + private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down }) | ||
| 34 | needload: boolean = true; | 32 | needload: boolean = true; |
| 35 | build() { | 33 | build() { |
| 36 | Column() { | 34 | Column() { |
| @@ -51,13 +49,26 @@ export struct PageComponent { | @@ -51,13 +49,26 @@ export struct PageComponent { | ||
| 51 | } | 49 | } |
| 52 | .width(CommonConstants.FULL_PARENT) | 50 | .width(CommonConstants.FULL_PARENT) |
| 53 | .height(CommonConstants.FULL_PARENT) | 51 | .height(CommonConstants.FULL_PARENT) |
| 54 | - .onTouch((event: TouchEvent | undefined) => { | ||
| 55 | - if (event) { | ||
| 56 | - if (this.pageModel.viewType === ViewType.LOADED) { | ||
| 57 | - listTouchEvent(this.pageModel, this.pageAdvModel, event); | ||
| 58 | - } | ||
| 59 | - } | ||
| 60 | - }) | 52 | + // .onTouch((event: TouchEvent | undefined) => { |
| 53 | + // if (event) { | ||
| 54 | + // if (this.pageModel.viewType === ViewType.LOADED) { | ||
| 55 | + // listTouchEvent(this.pageModel, this.pageAdvModel, event); | ||
| 56 | + // } | ||
| 57 | + // } | ||
| 58 | + // }) | ||
| 59 | + // 对接新的下拉刷新手势,替换touch事件 | ||
| 60 | + .parallelGesture( | ||
| 61 | + PanGesture(this.panOption) | ||
| 62 | + .onActionStart((event?: GestureEvent) => { | ||
| 63 | + onActionStart(this.pageModel, this.pageAdvModel, event) | ||
| 64 | + }) | ||
| 65 | + .onActionUpdate((event?: GestureEvent) => { | ||
| 66 | + onActionUpdate(this.pageModel, this.pageAdvModel, event) | ||
| 67 | + }) | ||
| 68 | + .onActionEnd(() => { | ||
| 69 | + onActionEnd(this.pageModel, this.pageAdvModel) | ||
| 70 | + }) | ||
| 71 | + ) | ||
| 61 | 72 | ||
| 62 | } | 73 | } |
| 63 | 74 |
| @@ -546,45 +546,45 @@ export struct TopNavigationComponent { | @@ -546,45 +546,45 @@ export struct TopNavigationComponent { | ||
| 546 | return null | 546 | return null |
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | - private getTextInfo(index: number): Record<string, number> { | ||
| 550 | - let strJson = getInspectorByKey(index.toString()) | ||
| 551 | - try { | ||
| 552 | - let obj: Record<string, string> = JSON.parse(strJson) | ||
| 553 | - let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']') | ||
| 554 | - return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) } | ||
| 555 | - } catch (error) { | ||
| 556 | - return { 'left': 0, 'width': 0 } | ||
| 557 | - } | ||
| 558 | - } | ||
| 559 | - | ||
| 560 | - private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> { | ||
| 561 | - let nextIndex = index | ||
| 562 | - if (index > 0 && event.currentOffset > 0) { | ||
| 563 | - nextIndex-- | ||
| 564 | - } else if (index < 3 && event.currentOffset < 0) { | ||
| 565 | - nextIndex++ | ||
| 566 | - } | ||
| 567 | - let indexInfo = this.getTextInfo(index) | ||
| 568 | - let nextIndexInfo = this.getTextInfo(nextIndex) | ||
| 569 | - let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) | ||
| 570 | - let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 | ||
| 571 | - let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio | ||
| 572 | - let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio | ||
| 573 | - return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } | ||
| 574 | - } | ||
| 575 | - | ||
| 576 | - private startAnimateTo(duration: number, leftMargin: number, width: number) { | ||
| 577 | - animateTo({ | ||
| 578 | - duration: duration, // 动画时长 | ||
| 579 | - curve: Curve.Linear, // 动画曲线 | ||
| 580 | - iterations: 1, // 播放次数 | ||
| 581 | - playMode: PlayMode.Normal, // 动画模式 | ||
| 582 | - onFinish: () => { | ||
| 583 | - console.info('play end') | ||
| 584 | - } | ||
| 585 | - }, () => { | ||
| 586 | - this.indicatorLeftMargin = leftMargin | ||
| 587 | - this.indicatorWidth = width | ||
| 588 | - }) | ||
| 589 | - } | 549 | + // private getTextInfo(index: number): Record<string, number> { |
| 550 | + // let strJson = getInspectorByKey(index.toString()) | ||
| 551 | + // try { | ||
| 552 | + // let obj: Record<string, string> = JSON.parse(strJson) | ||
| 553 | + // let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']') | ||
| 554 | + // return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) } | ||
| 555 | + // } catch (error) { | ||
| 556 | + // return { 'left': 0, 'width': 0 } | ||
| 557 | + // } | ||
| 558 | + // } | ||
| 559 | + // | ||
| 560 | + // private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> { | ||
| 561 | + // let nextIndex = index | ||
| 562 | + // if (index > 0 && event.currentOffset > 0) { | ||
| 563 | + // nextIndex-- | ||
| 564 | + // } else if (index < 3 && event.currentOffset < 0) { | ||
| 565 | + // nextIndex++ | ||
| 566 | + // } | ||
| 567 | + // let indexInfo = this.getTextInfo(index) | ||
| 568 | + // let nextIndexInfo = this.getTextInfo(nextIndex) | ||
| 569 | + // let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth) | ||
| 570 | + // let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。 | ||
| 571 | + // let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio | ||
| 572 | + // let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio | ||
| 573 | + // return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth } | ||
| 574 | + // } | ||
| 575 | + | ||
| 576 | + // private startAnimateTo(duration: number, leftMargin: number, width: number) { | ||
| 577 | + // animateTo({ | ||
| 578 | + // duration: duration, // 动画时长 | ||
| 579 | + // curve: Curve.Linear, // 动画曲线 | ||
| 580 | + // iterations: 1, // 播放次数 | ||
| 581 | + // playMode: PlayMode.Normal, // 动画模式 | ||
| 582 | + // onFinish: () => { | ||
| 583 | + // console.info('play end') | ||
| 584 | + // } | ||
| 585 | + // }, () => { | ||
| 586 | + // this.indicatorLeftMargin = leftMargin | ||
| 587 | + // this.indicatorWidth = width | ||
| 588 | + // }) | ||
| 589 | + // } | ||
| 590 | } | 590 | } |
| @@ -84,16 +84,16 @@ export struct TopNavigationComponentNew { | @@ -84,16 +84,16 @@ export struct TopNavigationComponentNew { | ||
| 84 | PeopleShipMainComponent({ | 84 | PeopleShipMainComponent({ |
| 85 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 85 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 86 | navIndex: index, | 86 | navIndex: index, |
| 87 | - pageId: navItem.pageId + '', | ||
| 88 | - channelId: navItem.channelId + '', | 87 | + pageId: navItem?.pageId + '', |
| 88 | + channelId: navItem?.channelId + '', | ||
| 89 | }) | 89 | }) |
| 90 | } else | 90 | } else |
| 91 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { | 91 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { |
| 92 | PageComponent({ | 92 | PageComponent({ |
| 93 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 93 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 94 | navIndex: index, | 94 | navIndex: index, |
| 95 | - pageId: navItem.pageId + '', | ||
| 96 | - channelId: navItem.channelId + '', | 95 | + pageId: navItem?.pageId + '', |
| 96 | + channelId: navItem?.channelId + '', | ||
| 97 | autoRefresh: this.autoRefresh2Page | 97 | autoRefresh: this.autoRefresh2Page |
| 98 | }) | 98 | }) |
| 99 | } else { | 99 | } else { |
| @@ -458,7 +458,12 @@ export struct SearchResultContentComponent { | @@ -458,7 +458,12 @@ export struct SearchResultContentComponent { | ||
| 458 | let rmhInfo = this.getRmhInfo(rem,value) | 458 | let rmhInfo = this.getRmhInfo(rem,value) |
| 459 | console.log('获取photos',JSON.stringify(photos)) | 459 | console.log('获取photos',JSON.stringify(photos)) |
| 460 | console.log('获取value2',JSON.stringify(value)) | 460 | console.log('获取value2',JSON.stringify(value)) |
| 461 | + let liveType = value.data?.liveType; | ||
| 462 | + let seoTags = value.data?.seoTags | ||
| 461 | let contentDTO = new ContentDTO(); | 463 | let contentDTO = new ContentDTO(); |
| 464 | + contentDTO.liveType = liveType?liveType: "" | ||
| 465 | + contentDTO.seoTags = seoTags?seoTags: "" | ||
| 466 | + // console.log('获取value333333333',JSON.stringify(contentDTO.liveType)) | ||
| 462 | contentDTO.appStyle = value.data.appStyle + "" | 467 | contentDTO.appStyle = value.data.appStyle + "" |
| 463 | contentDTO.cityCode = value.data.cityCode | 468 | contentDTO.cityCode = value.data.cityCode |
| 464 | contentDTO.coverSize = "" | 469 | contentDTO.coverSize = "" |
| 1 | import { CommonConstants } from 'wdConstant' | 1 | import { CommonConstants } from 'wdConstant' |
| 2 | import { ContentDTO, CompDTO, Action, Params } from 'wdBean' | 2 | import { ContentDTO, CompDTO, Action, Params } from 'wdBean' |
| 3 | import { ProcessUtils, WDRouterRule, WDRouterPage } from 'wdRouter'; | 3 | import { ProcessUtils, WDRouterRule, WDRouterPage } from 'wdRouter'; |
| 4 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 4 | 5 | ||
| 5 | @Component | 6 | @Component |
| 6 | export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | 7 | export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { |
| 7 | @State compDTO: CompDTO = {} as CompDTO | 8 | @State compDTO: CompDTO = {} as CompDTO |
| 9 | + @State pageId: string = ''; | ||
| 10 | + @State pageName: string = ''; | ||
| 8 | 11 | ||
| 9 | build() { | 12 | build() { |
| 10 | Column() { | 13 | Column() { |
| @@ -76,6 +79,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | @@ -76,6 +79,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent { | ||
| 76 | .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) | 79 | .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) |
| 77 | // .offset({x:16}) | 80 | // .offset({x:16}) |
| 78 | .onClick(() => { | 81 | .onClick(() => { |
| 82 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 79 | ProcessUtils.processPage(item) | 83 | ProcessUtils.processPage(item) |
| 80 | }) | 84 | }) |
| 81 | }) | 85 | }) |
| @@ -3,9 +3,12 @@ import { WDRouterRule } from 'wdRouter/Index' | @@ -3,9 +3,12 @@ import { WDRouterRule } from 'wdRouter/Index' | ||
| 3 | import { Logger } from 'wdKit/Index' | 3 | import { Logger } from 'wdKit/Index' |
| 4 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' | 4 | import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO' |
| 5 | import { LiveModel } from '../../viewmodel/LiveModel' | 5 | import { LiveModel } from '../../viewmodel/LiveModel' |
| 6 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 6 | 7 | ||
| 7 | @Component | 8 | @Component |
| 8 | export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | 9 | export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { |
| 10 | + @State pageId: string = ''; | ||
| 11 | + @State pageName: string = ''; | ||
| 9 | @State compDTO: CompDTO = {} as CompDTO | 12 | @State compDTO: CompDTO = {} as CompDTO |
| 10 | @State clicked: boolean = false; | 13 | @State clicked: boolean = false; |
| 11 | 14 | ||
| @@ -64,6 +67,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | @@ -64,6 +67,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent { | ||
| 64 | .backgroundColor($r("app.color.white")) | 67 | .backgroundColor($r("app.color.white")) |
| 65 | .margin({ bottom: 8 }) | 68 | .margin({ bottom: 8 }) |
| 66 | .onClick(() => { | 69 | .onClick(() => { |
| 70 | + InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName) | ||
| 67 | this.clicked = true; | 71 | this.clicked = true; |
| 68 | this.gotoLive(this.compDTO?.operDataList[0]) | 72 | this.gotoLive(this.compDTO?.operDataList[0]) |
| 69 | }) | 73 | }) |
| @@ -9,10 +9,13 @@ import { LiveModel } from '../../viewmodel/LiveModel' | @@ -9,10 +9,13 @@ import { LiveModel } from '../../viewmodel/LiveModel' | ||
| 9 | import { ContentConstants } from '../../constants/ContentConstants' | 9 | import { ContentConstants } from '../../constants/ContentConstants' |
| 10 | import { ProcessUtils } from 'wdRouter'; | 10 | import { ProcessUtils } from 'wdRouter'; |
| 11 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 11 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 12 | +import { InfomationCardClick } from '../../utils/infomationCardClick'; | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | @Component | 15 | @Component |
| 15 | export struct LiveHorizontalCardComponent { | 16 | export struct LiveHorizontalCardComponent { |
| 17 | + @State pageId: string = ''; | ||
| 18 | + @State pageName: string = ''; | ||
| 16 | @State compDTO: CompDTO = {} as CompDTO | 19 | @State compDTO: CompDTO = {} as CompDTO |
| 17 | @State loadImg: boolean = false; | 20 | @State loadImg: boolean = false; |
| 18 | 21 | ||
| @@ -78,6 +81,7 @@ export struct LiveHorizontalCardComponent { | @@ -78,6 +81,7 @@ export struct LiveHorizontalCardComponent { | ||
| 78 | .borderRadius(4) | 81 | .borderRadius(4) |
| 79 | .objectFit(ImageFit.Cover) | 82 | .objectFit(ImageFit.Cover) |
| 80 | CardMediaInfo({ | 83 | CardMediaInfo({ |
| 84 | + livePeopleNum:false, | ||
| 81 | contentDTO: item | 85 | contentDTO: item |
| 82 | }) | 86 | }) |
| 83 | } | 87 | } |
| @@ -95,6 +99,7 @@ export struct LiveHorizontalCardComponent { | @@ -95,6 +99,7 @@ export struct LiveHorizontalCardComponent { | ||
| 95 | } | 99 | } |
| 96 | .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) | 100 | .padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 }) |
| 97 | .onClick(() => { | 101 | .onClick(() => { |
| 102 | + InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) | ||
| 98 | if (item.objectType != '0') { | 103 | if (item.objectType != '0') { |
| 99 | console.log(item.objectId) | 104 | console.log(item.objectId) |
| 100 | this.gotoLive(item) | 105 | this.gotoLive(item) |
| @@ -15,7 +15,7 @@ export struct LiveHorizontalCardForOneComponent { | @@ -15,7 +15,7 @@ export struct LiveHorizontalCardForOneComponent { | ||
| 15 | .borderRadius(4) | 15 | .borderRadius(4) |
| 16 | .objectFit(ImageFit.Cover) | 16 | .objectFit(ImageFit.Cover) |
| 17 | CardMediaInfo({ | 17 | CardMediaInfo({ |
| 18 | - contentDTO: this.contentDTO | 18 | + contentDTO: this.contentDTO, livePeopleNum:false, |
| 19 | }) | 19 | }) |
| 20 | } | 20 | } |
| 21 | 21 |
| @@ -57,7 +57,7 @@ export struct LiveHorizontalReservationComponent { | @@ -57,7 +57,7 @@ export struct LiveHorizontalReservationComponent { | ||
| 57 | .borderRadius(4) | 57 | .borderRadius(4) |
| 58 | .objectFit(ImageFit.Cover) | 58 | .objectFit(ImageFit.Cover) |
| 59 | CardMediaInfo({ | 59 | CardMediaInfo({ |
| 60 | - contentDTO: item | 60 | + contentDTO: item, livePeopleNum:false, |
| 61 | }) | 61 | }) |
| 62 | } | 62 | } |
| 63 | 63 |
| @@ -50,6 +50,10 @@ export struct OperRowListView { | @@ -50,6 +50,10 @@ export struct OperRowListView { | ||
| 50 | } | 50 | } |
| 51 | private onCommentIconClick: () => void = () => { | 51 | private onCommentIconClick: () => void = () => { |
| 52 | } | 52 | } |
| 53 | + | ||
| 54 | + @Provide inDialog: boolean = false | ||
| 55 | + private dialogBeforeJumpOtherPageAction: () => void = () => {} | ||
| 56 | + | ||
| 53 | @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 | 57 | @Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情 |
| 54 | /** | 58 | /** |
| 55 | * 组件样式类型,根据详情页类型传值,组件内部根据样式展现类型做判断 | 59 | * 组件样式类型,根据详情页类型传值,组件内部根据样式展现类型做判断 |
| @@ -88,8 +92,7 @@ export struct OperRowListView { | @@ -88,8 +92,7 @@ export struct OperRowListView { | ||
| 88 | @State dialogController: CustomDialogController | null = null; | 92 | @State dialogController: CustomDialogController | null = null; |
| 89 | 93 | ||
| 90 | async aboutToAppear() { | 94 | async aboutToAppear() { |
| 91 | - console.info(TAG, '22222----', this.styleType) | ||
| 92 | - console.info(TAG, '3333----', this.needLike) | 95 | + console.info(TAG, 'this.needLike', this.needLike) |
| 93 | this.handleStyle() | 96 | this.handleStyle() |
| 94 | this.onDetailUpdated() | 97 | this.onDetailUpdated() |
| 95 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { | 98 | EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => { |
| @@ -108,7 +111,7 @@ export struct OperRowListView { | @@ -108,7 +111,7 @@ export struct OperRowListView { | ||
| 108 | } | 111 | } |
| 109 | 112 | ||
| 110 | async onDetailUpdated() { | 113 | async onDetailUpdated() { |
| 111 | - console.info(TAG, '111111----', this.styleType) | 114 | + console.info(TAG, 'this.styleType', this.styleType) |
| 112 | this.handleStyle() | 115 | this.handleStyle() |
| 113 | if (!this.contentDetailData) { | 116 | if (!this.contentDetailData) { |
| 114 | return | 117 | return |
| @@ -234,23 +237,23 @@ export struct OperRowListView { | @@ -234,23 +237,23 @@ export struct OperRowListView { | ||
| 234 | left: 16 | 237 | left: 16 |
| 235 | }) | 238 | }) |
| 236 | 239 | ||
| 237 | - if (this.showCommentIcon) { | 240 | + if (this.showCommentIcon // 页面控制开关,直播传false |
| 241 | + && this.contentDetailData.openComment == 1 // 内容开关 | ||
| 242 | + && this.publishCommentModel?.targetId) { | ||
| 238 | Column() { | 243 | Column() { |
| 239 | - if (this.publishCommentModel?.targetId) { | ||
| 240 | - CommentIconComponent({ | ||
| 241 | - publishCommentModel: this.publishCommentModel, | ||
| 242 | - styleType: this.styleType, | ||
| 243 | - contentDetail: this.contentDetailData | ||
| 244 | - }) | ||
| 245 | - .onClick(() => { | ||
| 246 | - this.onCommentIconClick() | 244 | + CommentIconComponent({ |
| 245 | + publishCommentModel: this.publishCommentModel, | ||
| 246 | + styleType: this.styleType, | ||
| 247 | + contentDetail: this.contentDetailData | ||
| 248 | + }) | ||
| 249 | + .onClick(() => { | ||
| 250 | + this.onCommentIconClick() | ||
| 247 | 251 | ||
| 248 | - console.log(JSON.stringify(this.dialogController?.open)) | 252 | + console.log(JSON.stringify(this.dialogController?.open)) |
| 249 | 253 | ||
| 250 | - // 评论弹框内部嵌入 | ||
| 251 | - !this.showBackIcon && this.dialogController?.open() | ||
| 252 | - }) | ||
| 253 | - } | 254 | + // 评论弹框内部嵌入 |
| 255 | + !this.showBackIcon && this.dialogController?.open() | ||
| 256 | + }) | ||
| 254 | } | 257 | } |
| 255 | .width(48) | 258 | .width(48) |
| 256 | } | 259 | } |
| @@ -380,7 +383,7 @@ export struct OperRowListView { | @@ -380,7 +383,7 @@ export struct OperRowListView { | ||
| 380 | { | 383 | { |
| 381 | contentId: this.contentDetailData?.newsId + '', | 384 | contentId: this.contentDetailData?.newsId + '', |
| 382 | contentType: this.contentDetailData?.newsType + '', | 385 | contentType: this.contentDetailData?.newsType + '', |
| 383 | - contentRelId: this.contentDetailData?.reLInfo?.relId + '', | 386 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', |
| 384 | } | 387 | } |
| 385 | ] | 388 | ] |
| 386 | } | 389 | } |
| @@ -397,7 +400,6 @@ export struct OperRowListView { | @@ -397,7 +400,6 @@ export struct OperRowListView { | ||
| 397 | * 收藏、取消收藏 | 400 | * 收藏、取消收藏 |
| 398 | */ | 401 | */ |
| 399 | async toggleCollectStatus() { | 402 | async toggleCollectStatus() { |
| 400 | - console.log(TAG, '收藏点击') | ||
| 401 | // 未登录,跳转登录 | 403 | // 未登录,跳转登录 |
| 402 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') | 404 | const user_id = await SPHelper.default.get(SpConstants.USER_ID, '') |
| 403 | console.log(TAG, '收藏点击,登录', user_id) | 405 | console.log(TAG, '收藏点击,登录', user_id) |
| @@ -411,15 +413,13 @@ export struct OperRowListView { | @@ -411,15 +413,13 @@ export struct OperRowListView { | ||
| 411 | contentList: [{ | 413 | contentList: [{ |
| 412 | contentId: this.contentDetailData?.newsId + '', | 414 | contentId: this.contentDetailData?.newsId + '', |
| 413 | contentType: this.contentDetailData?.newsType + '', | 415 | contentType: this.contentDetailData?.newsType + '', |
| 414 | - relType: this.contentDetailData?.reLInfo?.relType + '', | ||
| 415 | - contentRelId: this.contentDetailData?.reLInfo?.relId + '', | 416 | + relType: this.contentDetailData?.reLInfo?.relType || '' + '', |
| 417 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | ||
| 416 | }], | 418 | }], |
| 417 | 419 | ||
| 418 | } | 420 | } |
| 419 | - // console.log(TAG, '收藏点击', JSON.stringify(params)) | 421 | + console.log(TAG, '收藏点击', JSON.stringify(params)) |
| 420 | PageRepository.postExecuteCollectRecord(params).then(res => { | 422 | PageRepository.postExecuteCollectRecord(params).then(res => { |
| 421 | - console.log(TAG, '收藏点击 res', JSON.stringify(res)) | ||
| 422 | - console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | ||
| 423 | if (this.newsStatusOfUser) { | 423 | if (this.newsStatusOfUser) { |
| 424 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 | 424 | this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1 |
| 425 | if (this.newsStatusOfUser.collectStatus === 1) { | 425 | if (this.newsStatusOfUser.collectStatus === 1) { |
| @@ -427,6 +427,7 @@ export struct OperRowListView { | @@ -427,6 +427,7 @@ export struct OperRowListView { | ||
| 427 | } | 427 | } |
| 428 | this.queryContentInteractCount() | 428 | this.queryContentInteractCount() |
| 429 | } | 429 | } |
| 430 | + console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) | ||
| 430 | }) | 431 | }) |
| 431 | 432 | ||
| 432 | } | 433 | } |
| @@ -31,6 +31,7 @@ export struct PermissionDesComponent { | @@ -31,6 +31,7 @@ export struct PermissionDesComponent { | ||
| 31 | .border({ radius: 5 }) | 31 | .border({ radius: 5 }) |
| 32 | .margin({ top: 12 }) | 32 | .margin({ top: 12 }) |
| 33 | .padding(12) | 33 | .padding(12) |
| 34 | + .zIndex(20) | ||
| 34 | } | 35 | } |
| 35 | 36 | ||
| 36 | startDismiss() { | 37 | startDismiss() { |
| @@ -96,7 +96,7 @@ class MinePageDatasModel{ | @@ -96,7 +96,7 @@ class MinePageDatasModel{ | ||
| 96 | * 包含名字和图标 | 96 | * 包含名字和图标 |
| 97 | */ | 97 | */ |
| 98 | getMoreFunctionsData():MinePageCreatorFunctionsItem[]{ | 98 | getMoreFunctionsData():MinePageCreatorFunctionsItem[]{ |
| 99 | - if(this.moreData.length === 5){ | 99 | + if(this.moreData.length === 3){ |
| 100 | return this.moreData | 100 | return this.moreData |
| 101 | } | 101 | } |
| 102 | // this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) | 102 | // this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan'))) |
| @@ -4,7 +4,88 @@ import PageModel from '../viewmodel/PageModel'; | @@ -4,7 +4,88 @@ 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 | +import { Logger } from 'wdKit/Index'; | ||
| 8 | + | ||
| 9 | +const TAG = 'PullDownRefresh' | ||
| 10 | +/***********新的下拉、上拉手势 start **********/ | ||
| 11 | +export function onActionStart(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) { | ||
| 12 | + if (event === undefined) { | ||
| 13 | + return | ||
| 14 | + } | ||
| 15 | + pageModel.downY = event.offsetY; | ||
| 16 | + pageModel.lastMoveY = event.offsetY; | ||
| 17 | +} | ||
| 18 | + | ||
| 19 | +export function onActionUpdate(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) { | ||
| 20 | + if (event === undefined) { | ||
| 21 | + return | ||
| 22 | + } | ||
| 23 | + if ((pageModel.isRefreshing === true) || (pageModel.isLoading === true)) { | ||
| 24 | + return; | ||
| 25 | + } | ||
| 26 | + let isDownPull = event.offsetY - pageModel.lastMoveY > 0; | ||
| 27 | + if (((isDownPull === true) || (pageModel.isPullRefreshOperation === true)) && | ||
| 28 | + (pageModel.isCanLoadMore === false)) { | ||
| 29 | + actionUpdatePullRefresh(pageModel, event); | ||
| 30 | + } else { | ||
| 31 | + actionUpdateLoadMore(pageModel, event); | ||
| 32 | + } | ||
| 33 | + pageModel.lastMoveY = event.offsetY; | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +export function onActionEnd(pageModel: PageModel, pageAdvModel: PageAdModel) { | ||
| 37 | + if ((pageModel.isRefreshing === true) || (pageModel.isLoading === true)) { | ||
| 38 | + return; | ||
| 39 | + } | ||
| 40 | + if ((pageModel.isPullRefreshOperation === true)) { | ||
| 41 | + touchUpPullRefresh(pageModel, pageAdvModel); | ||
| 42 | + } else { | ||
| 43 | + // touchUpLoadMore(pageModel); | ||
| 44 | + } | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | +export function actionUpdatePullRefresh(pageModel: PageModel, event: GestureEvent) { | ||
| 48 | + if (pageModel.startIndex === 0) { | ||
| 49 | + pageModel.isPullRefreshOperation = true; | ||
| 50 | + let height = vp2px(Const.CUSTOM_REFRESH_DECIDE_HEIGHT); | ||
| 51 | + pageModel.offsetY = event.offsetY - pageModel.downY; | ||
| 52 | + if (pageModel.offsetY >= height) { | ||
| 53 | + pullRefreshState(pageModel, RefreshState.Release); | ||
| 54 | + pageModel.offsetY = height + pageModel.offsetY * Const.Y_OFF_SET_COEFFICIENT; | ||
| 55 | + } else { | ||
| 56 | + pullRefreshState(pageModel, RefreshState.DropDown); | ||
| 57 | + } | ||
| 58 | + if (pageModel.offsetY < 0) { | ||
| 59 | + pageModel.offsetY = 0; | ||
| 60 | + pageModel.isPullRefreshOperation = false; | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +export function actionUpdateLoadMore(model: PageModel, event: GestureEvent) { | ||
| 66 | + // list size +1 | ||
| 67 | + if (model.endIndex >= model.compList.totalCount() - 3 && model.endIndex <= model.compList.totalCount()) { | ||
| 68 | + // model.offsetY = event.touches[0].y - model.downY; | ||
| 69 | + // if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) { | ||
| 70 | + // model.isCanLoadMore = true; | ||
| 71 | + // model.isVisiblePullUpLoad = true; | ||
| 72 | + // model.offsetY = -vp2px(model.pullUpLoadHeight) + model.offsetY * Const.Y_OFF_SET_COEFFICIENT; | ||
| 73 | + // } | ||
| 74 | + | ||
| 75 | + // 不用分页动画,直接预加载 | ||
| 76 | + model.isCanLoadMore = true; | ||
| 77 | + model.isVisiblePullUpLoad = true; | ||
| 78 | + touchUpLoadMore(model); | ||
| 79 | + } | ||
| 80 | +} | ||
| 81 | + | ||
| 82 | +/***********新的下拉、上拉手势 end **********/ | ||
| 83 | + | ||
| 84 | + | ||
| 7 | //下拉刷新上拉加载更多组件 | 85 | //下拉刷新上拉加载更多组件 |
| 86 | +/** | ||
| 87 | + * @deprecated | ||
| 88 | + */ | ||
| 8 | export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) { | 89 | export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) { |
| 9 | switch (event.type) { | 90 | switch (event.type) { |
| 10 | case TouchType.Down: | 91 | case TouchType.Down: |
| @@ -16,7 +97,8 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, | @@ -16,7 +97,8 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, | ||
| 16 | return; | 97 | return; |
| 17 | } | 98 | } |
| 18 | let isDownPull = event.touches[0].y - pageModel.lastMoveY > 0; | 99 | let isDownPull = event.touches[0].y - pageModel.lastMoveY > 0; |
| 19 | - if (((isDownPull === true) || (pageModel.isPullRefreshOperation === true)) && (pageModel.isCanLoadMore === false)) { | 100 | + if (((isDownPull === true) || (pageModel.isPullRefreshOperation === true)) && |
| 101 | + (pageModel.isCanLoadMore === false)) { | ||
| 20 | // Finger movement, processing pull-down refresh. | 102 | // Finger movement, processing pull-down refresh. |
| 21 | touchMovePullRefresh(pageModel, event); | 103 | touchMovePullRefresh(pageModel, event); |
| 22 | } else { | 104 | } else { |
| @@ -44,6 +126,9 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, | @@ -44,6 +126,9 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, | ||
| 44 | } | 126 | } |
| 45 | } | 127 | } |
| 46 | 128 | ||
| 129 | +/** | ||
| 130 | + * @deprecated | ||
| 131 | + */ | ||
| 47 | export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) { | 132 | export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) { |
| 48 | if (pageModel.startIndex === 0) { | 133 | if (pageModel.startIndex === 0) { |
| 49 | pageModel.isPullRefreshOperation = true; | 134 | pageModel.isPullRefreshOperation = true; |
| @@ -73,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod | @@ -73,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod | ||
| 73 | let advSelf: PageAdModel = pageAdvModel; | 158 | let advSelf: PageAdModel = pageAdvModel; |
| 74 | PageHelper.refreshUI(self, advSelf) | 159 | PageHelper.refreshUI(self, advSelf) |
| 75 | }, Const.DELAY_TIME); | 160 | }, Const.DELAY_TIME); |
| 161 | + setRefreshTimeoutTimer(pageModel) | ||
| 76 | } else { | 162 | } else { |
| 77 | closeRefresh(pageModel, false); | 163 | closeRefresh(pageModel, false); |
| 78 | } | 164 | } |
| 79 | } | 165 | } |
| 80 | 166 | ||
| 167 | +export function setRefreshTimeoutTimer(pageModel: PageModel) { | ||
| 168 | + let timeoutId = setTimeout(() => { | ||
| 169 | + closeRefresh(pageModel, false); | ||
| 170 | + Logger.error(TAG, 'closeRefresh by timeout') | ||
| 171 | + }, Const.REFRESH_TIMEOUT__TIME); | ||
| 172 | + // 取消超时关闭定时器 | ||
| 173 | + clearTimeout(pageModel.refreshTimeoutTimerId) | ||
| 174 | + pageModel.refreshTimeoutTimerId = timeoutId | ||
| 175 | +} | ||
| 176 | + | ||
| 81 | /** | 177 | /** |
| 82 | * 自动刷新接口,如首页底导,双击按钮自动刷新 | 178 | * 自动刷新接口,如首页底导,双击按钮自动刷新 |
| 83 | * @param pageModel 页面数据 | 179 | * @param pageModel 页面数据 |
| @@ -93,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) { | @@ -93,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) { | ||
| 93 | pullRefreshState(pageModel, RefreshState.Refreshing); | 189 | pullRefreshState(pageModel, RefreshState.Refreshing); |
| 94 | pageModel.currentPage = 1; | 190 | pageModel.currentPage = 1; |
| 95 | PageHelper.refreshUI(pageModel, pageAdvModel) | 191 | PageHelper.refreshUI(pageModel, pageAdvModel) |
| 192 | + setRefreshTimeoutTimer(pageModel) | ||
| 96 | } | 193 | } |
| 97 | 194 | ||
| 98 | export function pullRefreshState(pageModel: PageModel, state: number) { | 195 | export function pullRefreshState(pageModel: PageModel, state: number) { |
| @@ -141,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | @@ -141,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) { | ||
| 141 | 238 | ||
| 142 | export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) { | 239 | export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) { |
| 143 | let self = pageModel; | 240 | let self = pageModel; |
| 241 | + // 取消超时关闭定时器 | ||
| 242 | + clearTimeout(self.refreshTimeoutTimerId) | ||
| 144 | setTimeout(() => { | 243 | setTimeout(() => { |
| 145 | let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH; | 244 | let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH; |
| 146 | if (self.isCanRefresh === true) { | 245 | if (self.isCanRefresh === true) { |
| 1 | import PageModel from '../viewmodel/PageModel'; | 1 | import PageModel from '../viewmodel/PageModel'; |
| 2 | import { RefreshConstants as Const } from './RefreshConstants'; | 2 | import { RefreshConstants as Const } from './RefreshConstants'; |
| 3 | import PageHelper from '../viewmodel/PageHelper'; | 3 | import PageHelper from '../viewmodel/PageHelper'; |
| 4 | +import { Logger } from 'wdKit/Index'; | ||
| 5 | + | ||
| 6 | +const TAG = 'PullUpLoadMore' | ||
| 4 | 7 | ||
| 5 | export function touchMoveLoadMore(model: PageModel, event: TouchEvent) { | 8 | export function touchMoveLoadMore(model: PageModel, event: TouchEvent) { |
| 6 | // list size +1 | 9 | // list size +1 |
| 7 | - if (model.endIndex >= model.compList.totalCount()-3 && model.endIndex <= model.compList.totalCount()) { | 10 | + if (model.endIndex >= model.compList.totalCount() - 3 && model.endIndex <= model.compList.totalCount()) { |
| 8 | // model.offsetY = event.touches[0].y - model.downY; | 11 | // model.offsetY = event.touches[0].y - model.downY; |
| 9 | // if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) { | 12 | // if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) { |
| 10 | // model.isCanLoadMore = true; | 13 | // model.isCanLoadMore = true; |
| @@ -32,6 +35,7 @@ export function touchUpLoadMore(model: PageModel) { | @@ -32,6 +35,7 @@ export function touchUpLoadMore(model: PageModel) { | ||
| 32 | // closeLoadMore(model); | 35 | // closeLoadMore(model); |
| 33 | PageHelper.loadMore(self) | 36 | PageHelper.loadMore(self) |
| 34 | }, Const.DELAY_TIME); | 37 | }, Const.DELAY_TIME); |
| 38 | + setLoadMoreTimeoutTimer(self) | ||
| 35 | } else { | 39 | } else { |
| 36 | closeLoadMore(self); | 40 | closeLoadMore(self); |
| 37 | } | 41 | } |
| @@ -41,4 +45,14 @@ export function closeLoadMore(model: PageModel) { | @@ -41,4 +45,14 @@ export function closeLoadMore(model: PageModel) { | ||
| 41 | model.isCanLoadMore = false; | 45 | model.isCanLoadMore = false; |
| 42 | model.isLoading = false; | 46 | model.isLoading = false; |
| 43 | model.isVisiblePullUpLoad = false; | 47 | model.isVisiblePullUpLoad = false; |
| 48 | +} | ||
| 49 | + | ||
| 50 | +export function setLoadMoreTimeoutTimer(pageModel: PageModel) { | ||
| 51 | + let timeoutId = setTimeout(() => { | ||
| 52 | + closeLoadMore(pageModel); | ||
| 53 | + Logger.error(TAG, 'closeLoadMore by timeout') | ||
| 54 | + }, Const.REFRESH_TIMEOUT__TIME); | ||
| 55 | + // 取消超时关闭定时器 | ||
| 56 | + clearTimeout(pageModel.loadMoreTimeoutTimerId) | ||
| 57 | + pageModel.loadMoreTimeoutTimerId = timeoutId | ||
| 44 | } | 58 | } |
| @@ -14,7 +14,7 @@ export class RefreshConstants { | @@ -14,7 +14,7 @@ export class RefreshConstants { | ||
| 14 | * The delay time. | 14 | * The delay time. |
| 15 | */ | 15 | */ |
| 16 | static readonly DELAY_TIME: number = 50; | 16 | static readonly DELAY_TIME: number = 50; |
| 17 | - | 17 | + static readonly REFRESH_TIMEOUT__TIME: number = 10000; |
| 18 | /** | 18 | /** |
| 19 | * The animation duration. | 19 | * The animation duration. |
| 20 | */ | 20 | */ |
| @@ -25,12 +25,10 @@ export class RefreshConstants { | @@ -25,12 +25,10 @@ export class RefreshConstants { | ||
| 25 | static readonly RefreshConstant_DELAY_PULL_DOWN_REFRESH: number = 50; | 25 | static readonly RefreshConstant_DELAY_PULL_DOWN_REFRESH: number = 50; |
| 26 | static readonly RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME: number = 150; | 26 | static readonly RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME: number = 150; |
| 27 | static readonly RefreshConstant_DELAY_SHRINK_ANIMATION_TIME: number = 1500; | 27 | static readonly RefreshConstant_DELAY_SHRINK_ANIMATION_TIME: number = 1500; |
| 28 | - | ||
| 29 | /** | 28 | /** |
| 30 | * The page size. | 29 | * The page size. |
| 31 | */ | 30 | */ |
| 32 | static readonly PAGE_SIZE: number = 20; | 31 | static readonly PAGE_SIZE: number = 20; |
| 33 | - | ||
| 34 | /** | 32 | /** |
| 35 | * The refresh and load height. | 33 | * The refresh and load height. |
| 36 | */ | 34 | */ |
| @@ -59,6 +57,7 @@ export class RefreshConstants { | @@ -59,6 +57,7 @@ export class RefreshConstants { | ||
| 59 | static readonly RefreshLayout_IMAGE_WIDTH: number = 18; | 57 | static readonly RefreshLayout_IMAGE_WIDTH: number = 18; |
| 60 | static readonly RefreshLayout_IMAGE_HEIGHT: number = 18; | 58 | static readonly RefreshLayout_IMAGE_HEIGHT: number = 18; |
| 61 | } | 59 | } |
| 60 | + | ||
| 62 | /** | 61 | /** |
| 63 | * The refresh state enum. | 62 | * The refresh state enum. |
| 64 | */ | 63 | */ |
| 1 | +import { TrackingContent, TrackConstants, ParamType } from 'wdTracking'; | ||
| 2 | +import { CompDTO, ContentDTO } from 'wdBean'; | ||
| 3 | + | ||
| 4 | +export class InfomationCardClick { | ||
| 5 | + | ||
| 6 | + private static getLiveState(contentDTO: ContentDTO) { | ||
| 7 | + if (contentDTO?.liveInfo?.liveState === 'wait') { | ||
| 8 | + return 'liveSubscribe' | ||
| 9 | + } else if (contentDTO?.liveInfo?.liveState === 'running') { | ||
| 10 | + return 'livePlaying' | ||
| 11 | + } else if (contentDTO?.liveInfo?.liveState === 'end') { | ||
| 12 | + return 'liveEnd' | ||
| 13 | + } else { | ||
| 14 | + return '' | ||
| 15 | + } | ||
| 16 | + } | ||
| 17 | + | ||
| 18 | + private static getSummaryType(objectType: string) { | ||
| 19 | + let summaryType: string = '' | ||
| 20 | + switch(objectType) { | ||
| 21 | + case '2': | ||
| 22 | + summaryType = 'liveTopic'; | ||
| 23 | + break; | ||
| 24 | + case '8': | ||
| 25 | + summaryType = 'articleTopic'; | ||
| 26 | + break; | ||
| 27 | + case '13': | ||
| 28 | + summaryType = 'audioTopic'; | ||
| 29 | + break; | ||
| 30 | + // case '': | ||
| 31 | + // summaryType = 'talkTopic'; | ||
| 32 | + // break; | ||
| 33 | + // case '': | ||
| 34 | + // summaryType = 'morningAndEveningNewsTopic'; | ||
| 35 | + // break; | ||
| 36 | + // case '': | ||
| 37 | + // summaryType = 'timeAxisTopic'; | ||
| 38 | + // break; | ||
| 39 | + default: | ||
| 40 | + summaryType = ''; | ||
| 41 | + break; | ||
| 42 | + } | ||
| 43 | + return summaryType; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | + public static track(compDTO: CompDTO, contentDTO: ContentDTO, pageId: string, pageName: string): void { | ||
| 47 | + try { | ||
| 48 | + const extParams: ParamType = { | ||
| 49 | + 'action': 'detailPageShow', | ||
| 50 | + 'shareChannel': '', | ||
| 51 | + 'duration': 0, | ||
| 52 | + 'contentName': contentDTO.newsTitle, | ||
| 53 | + 'contentType': contentDTO.objectType, | ||
| 54 | + // 'contentClassify': '' // 废除 | ||
| 55 | + 'contentId': contentDTO.objectId, | ||
| 56 | + // 'compId': contentDTO.relId, | ||
| 57 | + 'contentStyle': contentDTO.appStyle, | ||
| 58 | + 'liveType': InfomationCardClick.getLiveState(contentDTO), | ||
| 59 | + 'channelSourceId': contentDTO.channelId, | ||
| 60 | + 'contentShowChannelId': contentDTO.channelId, | ||
| 61 | + // 'contentShowChannelName': '', | ||
| 62 | + 'linkUrl': contentDTO.linkUrl, | ||
| 63 | + 'regionName': 2, // 信息流:2 | ||
| 64 | + 'componentType': compDTO.compStyle, | ||
| 65 | + 'sceneId': contentDTO.sceneId, | ||
| 66 | + 'subSceneId': contentDTO.subSceneId, | ||
| 67 | + 'cnsTraceId': contentDTO.cnsTraceId, | ||
| 68 | + 'cardItemId': compDTO.cardItemId, | ||
| 69 | + 'itemId': compDTO.itemId || contentDTO.itemId, | ||
| 70 | + 'expIds': compDTO.expIds || contentDTO.expIds | ||
| 71 | + } | ||
| 72 | + if (contentDTO.objectType === '5') { | ||
| 73 | + extParams['summaryId'] = contentDTO.objectId; | ||
| 74 | + extParams['summaryType'] = InfomationCardClick.getSummaryType(contentDTO.objectType); | ||
| 75 | + extParams['specialLink'] = contentDTO.linkUrl; | ||
| 76 | + } | ||
| 77 | + if (contentDTO.objectType === '2') { | ||
| 78 | + extParams['liveStreamType'] = contentDTO?.liveInfo.vrType === 0 ? 1 : 2; | ||
| 79 | + extParams['vliveId'] = contentDTO.objectId; | ||
| 80 | + extParams['vliveName'] = contentDTO.newsTitle; | ||
| 81 | + extParams['liveMode'] = 1; | ||
| 82 | + } | ||
| 83 | + if (contentDTO.rmhPlatform === 1) { | ||
| 84 | + extParams['saAuthorName'] = contentDTO.rmhInfo?.rmhName; | ||
| 85 | + extParams['saAuthorId'] = contentDTO.rmhInfo?.rmhId; | ||
| 86 | + } else if (contentDTO.source) { | ||
| 87 | + extParams['saAuthorName'] = contentDTO.source; | ||
| 88 | + } | ||
| 89 | + console.log('InfomationCardClick-params:', JSON.stringify(extParams)) | ||
| 90 | + TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams) | ||
| 91 | + } catch (err) { | ||
| 92 | + console.log('InfomationCardClick-err', JSON.stringify(err)) | ||
| 93 | + } | ||
| 94 | + } | ||
| 95 | +} |
| @@ -49,6 +49,9 @@ export class PageHelper { | @@ -49,6 +49,9 @@ export class PageHelper { | ||
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) { | 51 | private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) { |
| 52 | + if (pageModel.loadStrategy != 2) { | ||
| 53 | + return | ||
| 54 | + } | ||
| 52 | closeRefresh(pageModel, isRefreshSuccess) | 55 | closeRefresh(pageModel, isRefreshSuccess) |
| 53 | } | 56 | } |
| 54 | 57 | ||
| @@ -119,6 +122,7 @@ export class PageHelper { | @@ -119,6 +122,7 @@ export class PageHelper { | ||
| 119 | } | 122 | } |
| 120 | }).catch((err: string | Resource) => { | 123 | }).catch((err: string | Resource) => { |
| 121 | promptAction.showToast({ message: err }); | 124 | promptAction.showToast({ message: err }); |
| 125 | + this.refreshUIEnd(pageModel, false) | ||
| 122 | }) | 126 | }) |
| 123 | } else { | 127 | } else { |
| 124 | Logger.debug(TAG, 'getPageInfo') | 128 | Logger.debug(TAG, 'getPageInfo') |
| @@ -127,6 +131,7 @@ export class PageHelper { | @@ -127,6 +131,7 @@ export class PageHelper { | ||
| 127 | if (pageInfo == null) { | 131 | if (pageInfo == null) { |
| 128 | pageModel.viewType = ViewType.EMPTY; | 132 | pageModel.viewType = ViewType.EMPTY; |
| 129 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; | 133 | pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1; |
| 134 | + this.refreshUIEnd(pageModel, false) | ||
| 130 | return; | 135 | return; |
| 131 | } | 136 | } |
| 132 | pageModel.pageInfo = pageInfo; | 137 | pageModel.pageInfo = pageInfo; |
| @@ -146,6 +151,7 @@ export class PageHelper { | @@ -146,6 +151,7 @@ export class PageHelper { | ||
| 146 | Logger.debug(TAG, 'getPageInfo go on') | 151 | Logger.debug(TAG, 'getPageInfo go on') |
| 147 | this.parseGroup(pageModel, false) | 152 | this.parseGroup(pageModel, false) |
| 148 | }).catch(() => { | 153 | }).catch(() => { |
| 154 | + this.refreshUIEnd(pageModel, false) | ||
| 149 | if (this.isPageLoaded(pageModel)) { | 155 | if (this.isPageLoaded(pageModel)) { |
| 150 | return | 156 | return |
| 151 | } | 157 | } |
| @@ -406,7 +412,7 @@ export class PageHelper { | @@ -406,7 +412,7 @@ export class PageHelper { | ||
| 406 | /** | 412 | /** |
| 407 | * 竖直方向list,将数据拆出来,组装成comp | 413 | * 竖直方向list,将数据拆出来,组装成comp |
| 408 | */ | 414 | */ |
| 409 | - private createSpecialComp(compList: CompDTO[]): CompDTO[]{ | 415 | + private createSpecialComp(compList: CompDTO[]): CompDTO[] { |
| 410 | if (!compList) { | 416 | if (!compList) { |
| 411 | return compList | 417 | return compList |
| 412 | } | 418 | } |
| @@ -458,7 +464,6 @@ export class PageHelper { | @@ -458,7 +464,6 @@ export class PageHelper { | ||
| 458 | 464 | ||
| 459 | // 批查直播观看人数 | 465 | // 批查直播观看人数 |
| 460 | this.getLiveRoomDataInfo(compList) | 466 | this.getLiveRoomDataInfo(compList) |
| 461 | - | ||
| 462 | // | 467 | // |
| 463 | 468 | ||
| 464 | 469 |
| @@ -28,13 +28,28 @@ export default class PageModel { | @@ -28,13 +28,28 @@ export default class PageModel { | ||
| 28 | loadStrategy: number = 1; | 28 | loadStrategy: number = 1; |
| 29 | currentPage: number = 1; | 29 | currentPage: number = 1; |
| 30 | pageSize: number = Const.PAGE_SIZE; | 30 | pageSize: number = Const.PAGE_SIZE; |
| 31 | + /** | ||
| 32 | + * @deprecated | ||
| 33 | + */ | ||
| 31 | pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text'); | 34 | pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text'); |
| 35 | + /** | ||
| 36 | + * @deprecated | ||
| 37 | + */ | ||
| 32 | pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh'); | 38 | pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh'); |
| 33 | pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; | 39 | pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; |
| 34 | isVisiblePullDown: boolean = false; | 40 | isVisiblePullDown: boolean = false; |
| 35 | load: LoadStatus = LoadStatus.IDLE; | 41 | load: LoadStatus = LoadStatus.IDLE; |
| 42 | + /** | ||
| 43 | + * @deprecated | ||
| 44 | + */ | ||
| 36 | pullUpLoadText: Resource = $r('app.string.pull_up_load_text'); | 45 | pullUpLoadText: Resource = $r('app.string.pull_up_load_text'); |
| 46 | + /** | ||
| 47 | + * @deprecated | ||
| 48 | + */ | ||
| 37 | pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load'); | 49 | pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load'); |
| 50 | + /** | ||
| 51 | + * @deprecated | ||
| 52 | + */ | ||
| 38 | pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; | 53 | pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT; |
| 39 | isVisiblePullUpLoad: boolean = false; | 54 | isVisiblePullUpLoad: boolean = false; |
| 40 | offsetY: number = 0; | 55 | offsetY: number = 0; |
| @@ -50,6 +65,8 @@ export default class PageModel { | @@ -50,6 +65,8 @@ export default class PageModel { | ||
| 50 | isPullRefreshOperation = false; | 65 | isPullRefreshOperation = false; |
| 51 | isLoading: boolean = false; | 66 | isLoading: boolean = false; |
| 52 | isCanLoadMore: boolean = false; | 67 | isCanLoadMore: boolean = false; |
| 68 | + refreshTimeoutTimerId: number = 0; | ||
| 69 | + loadMoreTimeoutTimerId: number = 0; | ||
| 53 | // keyGenerator相关字符串,用于刷新list布局 | 70 | // keyGenerator相关字符串,用于刷新list布局 |
| 54 | timestamp: String = '1'; | 71 | timestamp: String = '1'; |
| 55 | 72 |
119 Bytes
| @@ -83,23 +83,29 @@ export struct DetailPlayLiveCommon { | @@ -83,23 +83,29 @@ export struct DetailPlayLiveCommon { | ||
| 83 | * 获取直播信息,可区分横竖屏直播 | 83 | * 获取直播信息,可区分横竖屏直播 |
| 84 | */ | 84 | */ |
| 85 | getLiveDetails() { | 85 | getLiveDetails() { |
| 86 | + | ||
| 86 | this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) | 87 | this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) |
| 87 | .then( | 88 | .then( |
| 88 | (data) => { | 89 | (data) => { |
| 89 | if (data.length > 0) { | 90 | if (data.length > 0) { |
| 90 | - this.liveDetailsBean = data[0] | ||
| 91 | - this.liveState = this.liveDetailsBean.liveInfo?.liveState | ||
| 92 | - this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle | ||
| 93 | 91 | ||
| 94 | - if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | ||
| 95 | - this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | 92 | + //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行 |
| 93 | + setTimeout(() => { | ||
| 94 | + this.liveDetailsBean = data[0] | ||
| 95 | + }, 10) | ||
| 96 | + | ||
| 97 | + this.liveState = data[0].liveInfo?.liveState | ||
| 98 | + this.liveStyle = data[0].liveInfo.liveStyle | ||
| 99 | + | ||
| 100 | + if (data[0].fullColumnImgUrls && data[0].fullColumnImgUrls.length > 0) { | ||
| 101 | + this.imgUrl = data[0].fullColumnImgUrls[0].url | ||
| 96 | } | 102 | } |
| 97 | 103 | ||
| 98 | - if (this.liveDetailsBean.liveInfo.liveState == 'end') { | ||
| 99 | - this.playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | 104 | + if (data[0].liveInfo.liveState == 'end') { |
| 105 | + this.playUrl = data[0].liveInfo.vlive[0].replayUri | ||
| 100 | } | 106 | } |
| 101 | 107 | ||
| 102 | - console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean))) | 108 | + // console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean))) |
| 103 | } | 109 | } |
| 104 | }, | 110 | }, |
| 105 | () => { | 111 | () => { |
| @@ -36,6 +36,7 @@ export struct DetailPlayVLivePage { | @@ -36,6 +36,7 @@ export struct DetailPlayVLivePage { | ||
| 36 | aboutToAppear(): void { | 36 | aboutToAppear(): void { |
| 37 | this.openFullScreen() | 37 | this.openFullScreen() |
| 38 | this.getLiveRoomData() | 38 | this.getLiveRoomData() |
| 39 | + | ||
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | aboutToDisappear(): void { | 42 | aboutToDisappear(): void { |
| @@ -21,6 +21,7 @@ export struct PlayerComponent { | @@ -21,6 +21,7 @@ export struct PlayerComponent { | ||
| 21 | @State playUrl: string = '' | 21 | @State playUrl: string = '' |
| 22 | @State isCanplay: boolean = false | 22 | @State isCanplay: boolean = false |
| 23 | 23 | ||
| 24 | + | ||
| 24 | pageShowChange() { | 25 | pageShowChange() { |
| 25 | this.playerController?.play() | 26 | this.playerController?.play() |
| 26 | } | 27 | } |
| @@ -30,15 +31,10 @@ export struct PlayerComponent { | @@ -30,15 +31,10 @@ export struct PlayerComponent { | ||
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | aboutToAppear(): void { | 33 | aboutToAppear(): void { |
| 33 | - console.log(TAG, 'aboutToAppear') | ||
| 34 | - this.playerController.onCanplay = () => { | ||
| 35 | - console.log('可以播放了') | ||
| 36 | - this.playerController?.play() | ||
| 37 | - this.isCanplay = true | ||
| 38 | - } | ||
| 39 | } | 34 | } |
| 40 | 35 | ||
| 41 | async aboutToDisappear(): Promise<void> { | 36 | async aboutToDisappear(): Promise<void> { |
| 37 | + | ||
| 42 | await this.playerController?.pause() | 38 | await this.playerController?.pause() |
| 43 | await this.playerController?.stop() | 39 | await this.playerController?.stop() |
| 44 | await this.playerController?.release() | 40 | await this.playerController?.release() |
| @@ -63,7 +59,6 @@ export struct PlayerComponent { | @@ -63,7 +59,6 @@ export struct PlayerComponent { | ||
| 63 | 59 | ||
| 64 | this.liveStreamType = liveStreamType | 60 | this.liveStreamType = liveStreamType |
| 65 | this.playUrl = playUrl | 61 | this.playUrl = playUrl |
| 66 | - | ||
| 67 | } | 62 | } |
| 68 | } | 63 | } |
| 69 | 64 | ||
| @@ -75,6 +70,7 @@ export struct PlayerComponent { | @@ -75,6 +70,7 @@ export struct PlayerComponent { | ||
| 75 | WDPlayerRenderVLiveView({ | 70 | WDPlayerRenderVLiveView({ |
| 76 | playerController: this.playerController, | 71 | playerController: this.playerController, |
| 77 | onLoad: () => { | 72 | onLoad: () => { |
| 73 | + this.isCanplay = true | ||
| 78 | this.playerController?.firstPlay(this.playUrl); | 74 | this.playerController?.firstPlay(this.playUrl); |
| 79 | } | 75 | } |
| 80 | }) | 76 | }) |
| @@ -82,12 +78,14 @@ export struct PlayerComponent { | @@ -82,12 +78,14 @@ export struct PlayerComponent { | ||
| 82 | AliPlayerRenderView({ | 78 | AliPlayerRenderView({ |
| 83 | playerController: this.playerController, | 79 | playerController: this.playerController, |
| 84 | onLoad: () => { | 80 | onLoad: () => { |
| 81 | + this.isCanplay = true | ||
| 85 | this.playerController?.firstPlay(this.playUrl); | 82 | this.playerController?.firstPlay(this.playUrl); |
| 86 | } | 83 | } |
| 87 | }).margin({ top: 195 }).height(211) | 84 | }).margin({ top: 195 }).height(211) |
| 88 | } | 85 | } |
| 89 | 86 | ||
| 90 | PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible) | 87 | PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible) |
| 88 | + | ||
| 91 | } | 89 | } |
| 92 | .height('100%') | 90 | .height('100%') |
| 93 | .width('100%') | 91 | .width('100%') |
| @@ -98,8 +96,11 @@ export struct PlayerComponent { | @@ -98,8 +96,11 @@ export struct PlayerComponent { | ||
| 98 | this.isShowControl = !this.isShowControl | 96 | this.isShowControl = !this.isShowControl |
| 99 | } | 97 | } |
| 100 | }) | 98 | }) |
| 99 | + | ||
| 101 | } | 100 | } |
| 102 | .height('100%') | 101 | .height('100%') |
| 103 | .width('100%') | 102 | .width('100%') |
| 104 | } | 103 | } |
| 104 | + | ||
| 105 | + | ||
| 105 | } | 106 | } |
| @@ -185,7 +185,7 @@ export struct DetailPlayShortVideoPage { | @@ -185,7 +185,7 @@ export struct DetailPlayShortVideoPage { | ||
| 185 | index: $index, | 185 | index: $index, |
| 186 | currentIndex: $currentIndex, | 186 | currentIndex: $currentIndex, |
| 187 | showCommentList: $showCommentList, | 187 | showCommentList: $showCommentList, |
| 188 | - publishCommentModel: $publishCommentModel | 188 | + // publishCommentModel: $publishCommentModel |
| 189 | }) | 189 | }) |
| 190 | this.playerViewBuilder() | 190 | this.playerViewBuilder() |
| 191 | 191 |
| 1 | -import { ContentDetailDTO } from 'wdBean/Index' | ||
| 2 | -import { WindowModel } from 'wdKit/Index' | ||
| 3 | -import { | ||
| 4 | - publishCommentModel | ||
| 5 | -} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel' | ||
| 6 | -import { CommentComponent } from '../../../../../wdComponent/src/main/ets/components/comment/view/CommentComponent' | ||
| 7 | -import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView' | 1 | +import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' |
| 8 | 2 | ||
| 3 | +import { CommentListDialogView } from 'wdComponent/Index' | ||
| 9 | 4 | ||
| 10 | @Component | 5 | @Component |
| 11 | export struct CommentDialogView { | 6 | export struct CommentDialogView { |
| 12 | - @Link publishCommentModel: publishCommentModel | ||
| 13 | @Link @Watch('showCommentListChange') showCommentList: boolean | 7 | @Link @Watch('showCommentListChange') showCommentList: boolean |
| 14 | @Link index: number | 8 | @Link index: number |
| 15 | @Link currentIndex: number | 9 | @Link currentIndex: number |
| 16 | - @Consume windowWidth: number | ||
| 17 | - @Consume windowHeight: number | ||
| 18 | - @Consume bottomSafeHeight: number | ||
| 19 | - @Consume topSafeHeight: number | ||
| 20 | @Consume contentDetailData: ContentDetailDTO | 10 | @Consume contentDetailData: ContentDetailDTO |
| 11 | + @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | ||
| 21 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | 12 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) |
| 22 | - // @State modifier: DrawModifier = new DrawModifier(); | ||
| 23 | - dialogController: CustomDialogController = new CustomDialogController({ | ||
| 24 | - builder: DetailDialog({ | ||
| 25 | - publishCommentModel: $publishCommentModel, | ||
| 26 | - contentDetailData: $contentDetailData, | ||
| 27 | - dialogOffsetY: $dialogOffsetY, | ||
| 28 | - showCommentList: $showCommentList, | ||
| 29 | - windowWidth: this.windowWidth, | ||
| 30 | - windowHeight: this.windowHeight | ||
| 31 | - }), | ||
| 32 | - autoCancel: false, | ||
| 33 | - customStyle: true, | ||
| 34 | - alignment: DialogAlignment.Bottom, | ||
| 35 | - // onWillDismiss: (dismissDialogAction: DismissDialogAction) => { | ||
| 36 | - // this.showCommentList = false | ||
| 37 | - // dismissDialogAction.dismiss() | ||
| 38 | - // }, | ||
| 39 | - // openAnimation: { duration: 0 }, | ||
| 40 | - // closeAnimation: { duration: 0 }, | ||
| 41 | - }) | ||
| 42 | 13 | ||
| 43 | - /** | ||
| 44 | - * 问题:弹窗从底部到上动画无法添加 | ||
| 45 | - */ | 14 | + @State @Watch("innerShowCommentChange") innerShowComment: boolean = false |
| 46 | 15 | ||
| 47 | showCommentListChange(val: boolean) { | 16 | showCommentListChange(val: boolean) { |
| 48 | if (this.showCommentList && this.index === this.currentIndex) { | 17 | if (this.showCommentList && this.index === this.currentIndex) { |
| 49 | - this.dialogController.open() | ||
| 50 | - console.log('open') | ||
| 51 | - // animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => { | ||
| 52 | - // this.dialogOffsetY = 500 | ||
| 53 | - // this.modifier.invalidate() | ||
| 54 | - // }) | 18 | + this.innerShowComment = true |
| 55 | } else { | 19 | } else { |
| 56 | - this.dialogController.close() | ||
| 57 | - console.log('close') | 20 | + this.innerShowComment = false |
| 58 | } | 21 | } |
| 59 | } | 22 | } |
| 60 | 23 | ||
| 61 | - build() { | 24 | + innerShowCommentChange() { |
| 25 | + this.showCommentList = this.innerShowComment | ||
| 62 | } | 26 | } |
| 63 | -} | ||
| 64 | - | ||
| 65 | -@CustomDialog | ||
| 66 | -export struct DetailDialog { | ||
| 67 | - controller: CustomDialogController | ||
| 68 | - @Link publishCommentModel: publishCommentModel | ||
| 69 | - @Link dialogOffsetY: number | ||
| 70 | - @Link contentDetailData: ContentDetailDTO | ||
| 71 | - @Link showCommentList: boolean | ||
| 72 | - @Prop windowWidth: number | ||
| 73 | - @Prop windowHeight: number | ||
| 74 | 27 | ||
| 75 | build() { | 28 | build() { |
| 76 | - Column() { | ||
| 77 | - CommentComponent({ | ||
| 78 | - publishCommentModel: this.publishCommentModel, | ||
| 79 | - showCloseIcon: true, | ||
| 80 | - fixedHeightMode: true, | ||
| 81 | - onCloseClick: () => { | ||
| 82 | - console.log('onCloseClick') | ||
| 83 | - this.showCommentList = false | ||
| 84 | - this.controller.close() | ||
| 85 | - // setTimeout(() => { | ||
| 86 | - // | ||
| 87 | - // }, 1000) | ||
| 88 | - | ||
| 89 | - } | ||
| 90 | - }).layoutWeight(1) | ||
| 91 | - | ||
| 92 | - OperRowListView({ | ||
| 93 | - componentType: 4, | ||
| 94 | - pageComponentType: 8, | ||
| 95 | - showBackIcon: false, | ||
| 96 | - operationButtonList: ['comment', 'like', 'collect', 'share'], | ||
| 97 | - contentDetailData: this.contentDetailData, | ||
| 98 | - publishCommentModel: this.publishCommentModel, | ||
| 99 | - showCommentIcon: true, | ||
| 100 | - styleType: 1, | ||
| 101 | - onBack: () => { | ||
| 102 | - WindowModel.shared.setWindowLayoutFullScreen(false) | ||
| 103 | - WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | ||
| 104 | - } | ||
| 105 | - }) | ||
| 106 | - } | ||
| 107 | - .height(this.windowHeight - this.windowWidth * 9 / 16 + 'px') | ||
| 108 | - // .margin({ top: this.dialogOffsetY + 'px' }) | ||
| 109 | - .zIndex(1000) | ||
| 110 | - .backgroundColor(Color.White) | 29 | + CommentListDialogView({ |
| 30 | + showCommentList: this.innerShowComment, | ||
| 31 | + contentDetailData: this.contentDetailData, | ||
| 32 | + pageInfo: this.fakePageInfo, | ||
| 33 | + onClose: () => { | ||
| 34 | + this.showCommentList = false | ||
| 35 | + } | ||
| 36 | + }) | ||
| 111 | } | 37 | } |
| 112 | } | 38 | } |
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | "wdKit": "file:../../commons/wdKit", | 13 | "wdKit": "file:../../commons/wdKit", |
| 14 | "wdBean": "file:../../features/wdBean", | 14 | "wdBean": "file:../../features/wdBean", |
| 15 | "wdRouter": "file:../../commons/wdRouter", | 15 | "wdRouter": "file:../../commons/wdRouter", |
| 16 | + "wdTracking": "file:../../features/wdTracking", | ||
| 16 | "wdNetwork": "file:../../commons/wdNetwork" | 17 | "wdNetwork": "file:../../commons/wdNetwork" |
| 17 | } | 18 | } |
| 18 | } | 19 | } |
| @@ -11,6 +11,7 @@ import { notificationManager } from '@kit.NotificationKit'; | @@ -11,6 +11,7 @@ import { notificationManager } from '@kit.NotificationKit'; | ||
| 11 | import { BusinessError } from '@kit.BasicServicesKit'; | 11 | import { BusinessError } from '@kit.BasicServicesKit'; |
| 12 | import { SpConstants } from 'wdConstant/Index'; | 12 | import { SpConstants } from 'wdConstant/Index'; |
| 13 | import { PushContentBean, PushContentParser } from './PushContentParser'; | 13 | import { PushContentBean, PushContentParser } from './PushContentParser'; |
| 14 | +import { ParamType, Tracking } from 'wdTracking/Index'; | ||
| 14 | 15 | ||
| 15 | const TAG = "GetuiPush" | 16 | const TAG = "GetuiPush" |
| 16 | 17 | ||
| @@ -220,6 +221,15 @@ export class GetuiPush { | @@ -220,6 +221,15 @@ export class GetuiPush { | ||
| 220 | this.lastPushContent = undefined | 221 | this.lastPushContent = undefined |
| 221 | } | 222 | } |
| 222 | 223 | ||
| 224 | + private trackingClick(content: PushContentBean) { | ||
| 225 | + let param: ParamType = { | ||
| 226 | + "pushResourceId": "", | ||
| 227 | + "pushTitle": content.notifyTitle || "", | ||
| 228 | + "pushContent": content.notifyContent || "", | ||
| 229 | + } | ||
| 230 | + Tracking.event("push_click", param) | ||
| 231 | + } | ||
| 232 | + | ||
| 223 | private dealWithCmdMessage(result: GTCmdMessage) { | 233 | private dealWithCmdMessage(result: GTCmdMessage) { |
| 224 | let action: Number = result.action; | 234 | let action: Number = result.action; |
| 225 | if (action === PushConst.BIND_ALIAS_RESULT) { | 235 | if (action === PushConst.BIND_ALIAS_RESULT) { |
| @@ -9,6 +9,8 @@ export interface PushContentBean { | @@ -9,6 +9,8 @@ export interface PushContentBean { | ||
| 9 | want?: Want // want参数 (用来在消费时,回执) | 9 | want?: Want // want参数 (用来在消费时,回执) |
| 10 | online: boolean // 解析want,是否为在线消息(在线走的是个推通道,离线走的是华为厂商通道) | 10 | online: boolean // 解析want,是否为在线消息(在线走的是个推通道,离线走的是华为厂商通道) |
| 11 | pushLink?: string // 解析want,对应pushLink参数 | 11 | pushLink?: string // 解析want,对应pushLink参数 |
| 12 | + notifyTitle?: string | ||
| 13 | + notifyContent?: string | ||
| 12 | } | 14 | } |
| 13 | 15 | ||
| 14 | /* | 16 | /* |
| @@ -66,7 +68,9 @@ export class PushContentParser { | @@ -66,7 +68,9 @@ export class PushContentParser { | ||
| 66 | if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) { | 68 | if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) { |
| 67 | let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string | 69 | let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string |
| 68 | return { | 70 | return { |
| 69 | - isPush: true, online: true, pushLink: pushLink, want: want | 71 | + isPush: true, online: true, pushLink: pushLink, want: want, |
| 72 | + notifyTitle: gtData["title"] as string, | ||
| 73 | + notifyContent: gtData["content"] as string, | ||
| 70 | } | 74 | } |
| 71 | } | 75 | } |
| 72 | } | 76 | } |
| @@ -105,7 +109,9 @@ export class PushContentParser { | @@ -105,7 +109,9 @@ export class PushContentParser { | ||
| 105 | if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) { | 109 | if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) { |
| 106 | let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string | 110 | let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string |
| 107 | return { | 111 | return { |
| 108 | - isPush: true, online: false, pushLink: pushLink, want: want | 112 | + isPush: true, online: false, pushLink: pushLink, want: want, |
| 113 | + notifyTitle: want.parameters["title"] as string, | ||
| 114 | + notifyContent: want.parameters["content"] as string, | ||
| 109 | } | 115 | } |
| 110 | } | 116 | } |
| 111 | } | 117 | } |
| @@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String | @@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String | ||
| 2 | import router from '@ohos.router' | 2 | import router from '@ohos.router' |
| 3 | import { LoginViewModel } from './LoginViewModel' | 3 | import { LoginViewModel } from './LoginViewModel' |
| 4 | import { LoginInputComponent } from './LoginInputComponent' | 4 | import { LoginInputComponent } from './LoginInputComponent' |
| 5 | -import { ErrorToastUtils, SPHelper } from 'wdKit' | ||
| 6 | import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; | 5 | import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage'; |
| 7 | import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; | 6 | import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule'; |
| 8 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params' | 7 | import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params' |
| 9 | import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' | 8 | import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' |
| 10 | -import HuaweiAuth from '../../utils/HuaweiAuth' | ||
| 11 | -import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent' | ||
| 12 | -import { BusinessError } from '@ohos.base' | ||
| 13 | -import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index' | 9 | +import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index' |
| 14 | 10 | ||
| 15 | @Extend(Row) | 11 | @Extend(Row) |
| 16 | function otherStyle() { | 12 | function otherStyle() { |
| @@ -43,7 +39,6 @@ struct LoginPage { | @@ -43,7 +39,6 @@ struct LoginPage { | ||
| 43 | @State isSubmit: boolean = false | 39 | @State isSubmit: boolean = false |
| 44 | @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录 | 40 | @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录 |
| 45 | @State passwordSwitch: boolean = true //密码显示 | 41 | @State passwordSwitch: boolean = true //密码显示 |
| 46 | - // @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录 | ||
| 47 | lastTime: number = 0 | 42 | lastTime: number = 0 |
| 48 | @State codeStateSuccess:boolean=false | 43 | @State codeStateSuccess:boolean=false |
| 49 | @State toastText:string = "" | 44 | @State toastText:string = "" |
| @@ -64,6 +59,7 @@ struct LoginPage { | @@ -64,6 +59,7 @@ struct LoginPage { | ||
| 64 | onCodeSend() { | 59 | onCodeSend() { |
| 65 | Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "") | 60 | Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "") |
| 66 | if (this.isCodeSend) { | 61 | if (this.isCodeSend) { |
| 62 | + TrackingButton.click("loginPageGetVerificationCode",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 67 | this.sendVerifyCode() | 63 | this.sendVerifyCode() |
| 68 | } | 64 | } |
| 69 | } | 65 | } |
| @@ -81,7 +77,12 @@ struct LoginPage { | @@ -81,7 +77,12 @@ struct LoginPage { | ||
| 81 | this.pageHideTime = DateTimeUtils.getTimeStamp() | 77 | this.pageHideTime = DateTimeUtils.getTimeStamp() |
| 82 | let duration = 0 | 78 | let duration = 0 |
| 83 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | 79 | duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) |
| 84 | - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) | 80 | + |
| 81 | + if(this.checkCodePage){ | ||
| 82 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page,duration) | ||
| 83 | + }else{ | ||
| 84 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration) | ||
| 85 | + } | ||
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | build() { | 88 | build() { |
| @@ -96,20 +97,16 @@ struct LoginPage { | @@ -96,20 +97,16 @@ struct LoginPage { | ||
| 96 | .margin({ top: 78 }) | 97 | .margin({ top: 78 }) |
| 97 | .align(Alignment.Center) | 98 | .align(Alignment.Center) |
| 98 | 99 | ||
| 99 | - if (this.checkCodePage) { | ||
| 100 | - LoginInputComponent({ | ||
| 101 | - phoneContent: $phoneContent, | ||
| 102 | - codeContent: $codeContent, | ||
| 103 | - isSubmit: $isSubmit, | ||
| 104 | - isCodeSend: $isCodeSend, | ||
| 105 | - codeStateSuccess:$codeStateSuccess, | ||
| 106 | - protocolState:this.protocolState, | ||
| 107 | - isNeedProtocol:true | ||
| 108 | - }) | ||
| 109 | - } else { | ||
| 110 | - this.addPassword() | ||
| 111 | - } | ||
| 112 | - | 100 | + LoginInputComponent({ |
| 101 | + phoneContent: $phoneContent, | ||
| 102 | + codeContent: $codeContent, | ||
| 103 | + isSubmit: $isSubmit, | ||
| 104 | + isCodeSend: $isCodeSend, | ||
| 105 | + codeStateSuccess:$codeStateSuccess, | ||
| 106 | + protocolState:this.protocolState, | ||
| 107 | + isNeedProtocol:true | ||
| 108 | + }).visibility(this.checkCodePage ? Visibility.Visible : Visibility.None) | ||
| 109 | + this.addPassword() | ||
| 113 | 110 | ||
| 114 | Row() { | 111 | Row() { |
| 115 | Image(this.protocolState ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected')) | 112 | Image(this.protocolState ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected')) |
| @@ -122,11 +119,21 @@ struct LoginPage { | @@ -122,11 +119,21 @@ struct LoginPage { | ||
| 122 | Text() { | 119 | Text() { |
| 123 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) | 120 | Span("我已阅读并同意").fontColor("#999999").fontSize(12) |
| 124 | Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => { | 121 | Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 122 | + if(this.checkCodePage){ | ||
| 123 | + TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 124 | + }else{ | ||
| 125 | + TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) | ||
| 126 | + } | ||
| 125 | let bean = { contentID: "1", pageID: "" } as Params | 127 | let bean = { contentID: "1", pageID: "" } as Params |
| 126 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 128 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 127 | }) | 129 | }) |
| 128 | Span("及").fontColor("#999999").fontSize(12) | 130 | Span("及").fontColor("#999999").fontSize(12) |
| 129 | Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => { | 131 | Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => { |
| 132 | + if(this.checkCodePage){ | ||
| 133 | + TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 134 | + }else{ | ||
| 135 | + TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) | ||
| 136 | + } | ||
| 130 | let bean = { contentID: "2", pageID: "" } as Params | 137 | let bean = { contentID: "2", pageID: "" } as Params |
| 131 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) | 138 | WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean) |
| 132 | }) | 139 | }) |
| @@ -137,10 +144,11 @@ struct LoginPage { | @@ -137,10 +144,11 @@ struct LoginPage { | ||
| 137 | Text("登录") | 144 | Text("登录") |
| 138 | .borderRadius(4) | 145 | .borderRadius(4) |
| 139 | .fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF") | 146 | .fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF") |
| 140 | - .fontSize(18) | ||
| 141 | - .fontWeight(FontWeight.Medium) | 147 | + .fontSize("31lpx") |
| 148 | + .fontWeight(400) | ||
| 142 | .margin({ top: 20 }) | 149 | .margin({ top: 20 }) |
| 143 | - .height(44) | 150 | + .lineHeight("50lpx") |
| 151 | + .height(44) | ||
| 144 | .textAlign(TextAlign.Center) | 152 | .textAlign(TextAlign.Center) |
| 145 | .width("100%") | 153 | .width("100%") |
| 146 | .backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800") | 154 | .backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800") |
| @@ -160,9 +168,14 @@ struct LoginPage { | @@ -160,9 +168,14 @@ struct LoginPage { | ||
| 160 | 168 | ||
| 161 | 169 | ||
| 162 | if (!this.checkCodePage) { | 170 | if (!this.checkCodePage) { |
| 163 | - Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 }) | 171 | + Text('忘记密码') |
| 172 | + .fontColor('#666666') | ||
| 173 | + .fontSize("31lpx") | ||
| 174 | + .fontWeight(400) | ||
| 175 | + .lineHeight("38lpx") | ||
| 176 | + .margin({ top: 16 }) | ||
| 164 | .onClick(() => { | 177 | .onClick(() => { |
| 165 | - // router.pushUrl({ url: 'pages/login/ForgetPasswordPage' }) | 178 | + TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) |
| 166 | if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){ | 179 | if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){ |
| 167 | let pageType = { 'pageType': 0, 'phone': Number(this.accountContent) } as Record<string, number>; | 180 | let pageType = { 'pageType': 0, 'phone': Number(this.accountContent) } as Record<string, number>; |
| 168 | WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) | 181 | WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType) |
| @@ -228,11 +241,7 @@ struct LoginPage { | @@ -228,11 +241,7 @@ struct LoginPage { | ||
| 228 | }) | 241 | }) |
| 229 | 242 | ||
| 230 | RelativeContainer() { | 243 | RelativeContainer() { |
| 231 | - // if (this.passwordSwitch) { | ||
| 232 | this.addPasswordInputLayout() | 244 | this.addPasswordInputLayout() |
| 233 | - // } else { | ||
| 234 | - // this.addPasswordInputLayout() | ||
| 235 | - // } | ||
| 236 | 245 | ||
| 237 | Image(this.passwordSwitch ? $r('app.media.login_password_off') : $r('app.media.login_password_on')) | 246 | Image(this.passwordSwitch ? $r('app.media.login_password_off') : $r('app.media.login_password_on')) |
| 238 | .onClick(() => { | 247 | .onClick(() => { |
| @@ -251,6 +260,7 @@ struct LoginPage { | @@ -251,6 +260,7 @@ struct LoginPage { | ||
| 251 | .height(48) | 260 | .height(48) |
| 252 | .width('100%') | 261 | .width('100%') |
| 253 | }.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 }) | 262 | }.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 }) |
| 263 | + .visibility(this.checkCodePage ? Visibility.None : Visibility.Visible) | ||
| 254 | 264 | ||
| 255 | } | 265 | } |
| 256 | 266 | ||
| @@ -289,24 +299,6 @@ struct LoginPage { | @@ -289,24 +299,6 @@ struct LoginPage { | ||
| 289 | }.width('100%') | 299 | }.width('100%') |
| 290 | 300 | ||
| 291 | Row() { | 301 | Row() { |
| 292 | - /*Row() { | ||
| 293 | - Image($r('app.media.login_wx')) | ||
| 294 | - .width(20).height(20).onClick(()=>{ | ||
| 295 | - ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK) | ||
| 296 | - }) | ||
| 297 | - }.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat) | ||
| 298 | - .otherStyle() | ||
| 299 | - | ||
| 300 | - Row() { | ||
| 301 | - Image($r('app.media.login_qq')).size({ width: 20, height: 20 }) | ||
| 302 | - }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat) | ||
| 303 | - .otherStyle() | ||
| 304 | - | ||
| 305 | - Row() { | ||
| 306 | - Image($r('app.media.login_wb')).size({ width: 20, height: 20 }) | ||
| 307 | - }.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat) | ||
| 308 | - .otherStyle()*/ | ||
| 309 | - | ||
| 310 | Row() { | 302 | Row() { |
| 311 | Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) | 303 | Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password')) |
| 312 | .size({ width: "35lpx", height: "35lpx" }) | 304 | .size({ width: "35lpx", height: "35lpx" }) |
| @@ -320,10 +312,19 @@ struct LoginPage { | @@ -320,10 +312,19 @@ struct LoginPage { | ||
| 320 | .lineHeight("38lpx") | 312 | .lineHeight("38lpx") |
| 321 | } | 313 | } |
| 322 | .onClick(() => { | 314 | .onClick(() => { |
| 315 | + this.onPageHide() | ||
| 316 | + | ||
| 317 | + if(this.checkCodePage){ | ||
| 318 | + trackTypeClick(0,TrackConstants.PageName.Phone_Login_Page) | ||
| 319 | + }else{ | ||
| 320 | + trackTypeClick(6,TrackConstants.PageName.Login_Page) | ||
| 321 | + } | ||
| 322 | + | ||
| 323 | this.updateAccount() | 323 | this.updateAccount() |
| 324 | - this.checkCodePage = !this.checkCodePage; | 324 | + this.checkCodePage = !this.checkCodePage |
| 325 | this.passwordSwitch = true | 325 | this.passwordSwitch = true |
| 326 | this.isSubmit = false | 326 | this.isSubmit = false |
| 327 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 327 | }).width('100%') | 328 | }).width('100%') |
| 328 | .alignItems(VerticalAlign.Center) | 329 | .alignItems(VerticalAlign.Center) |
| 329 | .justifyContent(FlexAlign.Center) | 330 | .justifyContent(FlexAlign.Center) |
| @@ -374,6 +375,7 @@ struct LoginPage { | @@ -374,6 +375,7 @@ struct LoginPage { | ||
| 374 | requestLogin() { | 375 | requestLogin() { |
| 375 | Logger.debug('LoginViewModel', "requestLogin") | 376 | Logger.debug('LoginViewModel', "requestLogin") |
| 376 | if (this.checkCodePage) { | 377 | if (this.checkCodePage) { |
| 378 | + TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page) | ||
| 377 | this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => { | 379 | this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => { |
| 378 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) | 380 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) |
| 379 | ///同步兴趣tag | 381 | ///同步兴趣tag |
| @@ -385,6 +387,7 @@ struct LoginPage { | @@ -385,6 +387,7 @@ struct LoginPage { | ||
| 385 | this.showToastTip(error) | 387 | this.showToastTip(error) |
| 386 | }) | 388 | }) |
| 387 | } else { | 389 | } else { |
| 390 | + TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page) | ||
| 388 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { | 391 | this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => { |
| 389 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) | 392 | Logger.debug(TAG, "requestLogin: " + data.jwtToken) |
| 390 | this.showToastTip('登录成功') | 393 | this.showToastTip('登录成功') |
| @@ -588,3 +591,12 @@ struct ProtocolComponent { | @@ -588,3 +591,12 @@ struct ProtocolComponent { | ||
| 588 | 591 | ||
| 589 | } | 592 | } |
| 590 | } | 593 | } |
| 594 | + | ||
| 595 | +function trackTypeClick(typeValue: number,pageId: string){ | ||
| 596 | + let params: ParamType = {} | ||
| 597 | + params["loginType"] = typeValue | ||
| 598 | + params["pageName"] = pageId | ||
| 599 | + params["pageId"] = pageId | ||
| 600 | + | ||
| 601 | + Tracking.event("login_type_click", params) | ||
| 602 | +} |
| @@ -6,6 +6,7 @@ import { BusinessError } from '@kit.BasicServicesKit' | @@ -6,6 +6,7 @@ import { BusinessError } from '@kit.BasicServicesKit' | ||
| 6 | import { Logger, ToastUtils, CustomToast, EmitterUtils, EmitterEventId } from 'wdKit/Index' | 6 | import { Logger, ToastUtils, CustomToast, EmitterUtils, EmitterEventId } from 'wdKit/Index' |
| 7 | import { LoginViewModel } from './LoginViewModel' | 7 | import { LoginViewModel } from './LoginViewModel' |
| 8 | import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' | 8 | import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel' |
| 9 | +import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index' | ||
| 9 | 10 | ||
| 10 | const TAG = "OneKeyLoginPage" | 11 | const TAG = "OneKeyLoginPage" |
| 11 | 12 | ||
| @@ -28,10 +29,35 @@ struct OneKeyLoginPage { | @@ -28,10 +29,35 @@ struct OneKeyLoginPage { | ||
| 28 | maskColor:"#00000000" | 29 | maskColor:"#00000000" |
| 29 | }) | 30 | }) |
| 30 | 31 | ||
| 32 | + // 埋点计算页面浏览时长 | ||
| 33 | + private pageStartDate: number = 0 | ||
| 34 | + private pageName = TrackConstants.PageName.OneClick_Login | ||
| 35 | + | ||
| 31 | aboutToAppear(): void { | 36 | aboutToAppear(): void { |
| 32 | this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||"" | 37 | this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||"" |
| 33 | } | 38 | } |
| 34 | 39 | ||
| 40 | + onPageShow(): void { | ||
| 41 | + this.pageStartDate = Date.now() | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + onPageHide(): void { | ||
| 45 | + const duration = (Date.now() - this.pageStartDate!) | ||
| 46 | + TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration) | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + // pageTransition() { | ||
| 50 | + // // 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。 | ||
| 51 | + // PageTransitionEnter({ type: RouteType.Push, duration: 300 }) | ||
| 52 | + // .slide(SlideEffect.Right) | ||
| 53 | + // PageTransitionEnter({ type: RouteType.Pop, duration: 300 }) | ||
| 54 | + // .slide(SlideEffect.Left) | ||
| 55 | + // PageTransitionExit({ type: RouteType.Push, duration: 300 }) | ||
| 56 | + // .slide(SlideEffect.Left) | ||
| 57 | + // PageTransitionExit({ type: RouteType.Pop, duration: 300 }) | ||
| 58 | + // .slide(SlideEffect.Right) | ||
| 59 | + // } | ||
| 60 | + | ||
| 35 | build() { | 61 | build() { |
| 36 | Column() { | 62 | Column() { |
| 37 | this.CloseRow() | 63 | this.CloseRow() |
| @@ -39,14 +65,21 @@ struct OneKeyLoginPage { | @@ -39,14 +65,21 @@ struct OneKeyLoginPage { | ||
| 39 | Image($r("app.media.login_logo")) | 65 | Image($r("app.media.login_logo")) |
| 40 | .width(120) | 66 | .width(120) |
| 41 | .height(66) | 67 | .height(66) |
| 42 | - .margin({ top: 78, bottom: 74}) | 68 | + .margin({ top: 34, bottom: 64}) |
| 43 | .align(Alignment.Center) | 69 | .align(Alignment.Center) |
| 44 | 70 | ||
| 45 | Text(this.anonymousPhone) | 71 | Text(this.anonymousPhone) |
| 46 | .fontSize(30) | 72 | .fontSize(30) |
| 47 | .fontWeight(600) | 73 | .fontWeight(600) |
| 48 | .fontColor("#222222") | 74 | .fontColor("#222222") |
| 49 | - .margin({bottom: 10}) | 75 | + .margin({bottom: 12}) |
| 76 | + .align(Alignment.Center) | ||
| 77 | + | ||
| 78 | + Text("华为账号绑定号码") | ||
| 79 | + .fontSize(12) | ||
| 80 | + .fontWeight(400) | ||
| 81 | + .fontColor("#999999") | ||
| 82 | + .margin({bottom: 40}) | ||
| 50 | .align(Alignment.Center) | 83 | .align(Alignment.Center) |
| 51 | 84 | ||
| 52 | this.ProtocolRow() | 85 | this.ProtocolRow() |
| @@ -68,21 +101,26 @@ struct OneKeyLoginPage { | @@ -68,21 +101,26 @@ struct OneKeyLoginPage { | ||
| 68 | if (!this.agreeProtocol) { | 101 | if (!this.agreeProtocol) { |
| 69 | return | 102 | return |
| 70 | } | 103 | } |
| 104 | + | ||
| 105 | + TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName) | ||
| 71 | this.requestLogin() | 106 | this.requestLogin() |
| 72 | }) | 107 | }) |
| 73 | } | 108 | } |
| 74 | .padding({ left: 25, right: 25 }) | 109 | .padding({ left: 25, right: 25 }) |
| 75 | - .margin({top: 15}) | 110 | + .margin({top: 20}) |
| 76 | 111 | ||
| 77 | Button("账号密码登录") | 112 | Button("账号密码登录") |
| 78 | .type(ButtonType.Normal) | 113 | .type(ButtonType.Normal) |
| 79 | .align(Alignment.Center) | 114 | .align(Alignment.Center) |
| 80 | .foregroundColor("#666666") | 115 | .foregroundColor("#666666") |
| 81 | .backgroundColor(Color.White) | 116 | .backgroundColor(Color.White) |
| 117 | + .height(26) | ||
| 118 | + .margin({top: 20}) | ||
| 82 | .onClick((event) => { | 119 | .onClick((event) => { |
| 83 | router.replaceUrl({url: WDRouterPage.loginPage.url()}) | 120 | router.replaceUrl({url: WDRouterPage.loginPage.url()}) |
| 84 | }) | 121 | }) |
| 85 | } | 122 | } |
| 123 | + .backgroundColor("#FFFFFF") | ||
| 86 | } | 124 | } |
| 87 | 125 | ||
| 88 | @Builder ProtocolRow() { | 126 | @Builder ProtocolRow() { |
| @@ -126,8 +164,9 @@ struct OneKeyLoginPage { | @@ -126,8 +164,9 @@ struct OneKeyLoginPage { | ||
| 126 | .width(24) | 164 | .width(24) |
| 127 | .height(24) | 165 | .height(24) |
| 128 | .onClick(() => router.back()) | 166 | .onClick(() => router.back()) |
| 129 | - }.margin({ top: 15, right: 15 }) | 167 | + }.margin({ top: 10, right: 16 }) |
| 130 | .width("100%") | 168 | .width("100%") |
| 169 | + .height(44) | ||
| 131 | } | 170 | } |
| 132 | 171 | ||
| 133 | async requestLogin() { | 172 | async requestLogin() { |
| @@ -137,7 +137,6 @@ export class WDAliPlayerController { | @@ -137,7 +137,6 @@ export class WDAliPlayerController { | ||
| 137 | onStateChanged: (status: number) => { | 137 | onStateChanged: (status: number) => { |
| 138 | this.avPlayerStatus = status | 138 | this.avPlayerStatus = status |
| 139 | Logger.debug(TAG, "status update:" + `${this.getStatusStringWith(status)}`) | 139 | Logger.debug(TAG, "status update:" + `${this.getStatusStringWith(status)}`) |
| 140 | - | ||
| 141 | switch (status) { | 140 | switch (status) { |
| 142 | case initalized: { | 141 | case initalized: { |
| 143 | //this.avPlayer?.prepare(); | 142 | //this.avPlayer?.prepare(); |
| 1 | import { DeviceUtil, DisplayUtils, UpgradeTipContent } from 'wdKit/Index' | 1 | import { DeviceUtil, DisplayUtils, UpgradeTipContent } from 'wdKit/Index' |
| 2 | +import { TrackConstants, TrackingButton } from 'wdTracking/Index' | ||
| 2 | 3 | ||
| 3 | @Preview | 4 | @Preview |
| 4 | @CustomDialog | 5 | @CustomDialog |
| @@ -35,6 +36,8 @@ export struct UpgradeTipDialog { | @@ -35,6 +36,8 @@ export struct UpgradeTipDialog { | ||
| 35 | .margin({top: 24}) | 36 | .margin({top: 24}) |
| 36 | .onClick(() => { | 37 | .onClick(() => { |
| 37 | this.controller.close() | 38 | this.controller.close() |
| 39 | + | ||
| 40 | + TrackingButton.click("notUpdatedTemporarily", TrackConstants.PageName.Update, TrackConstants.PageName.Update) | ||
| 38 | if (this.cancel) { | 41 | if (this.cancel) { |
| 39 | this.cancel() | 42 | this.cancel() |
| 40 | } | 43 | } |
| @@ -88,6 +91,8 @@ export struct UpgradeTipDialog { | @@ -88,6 +91,8 @@ export struct UpgradeTipDialog { | ||
| 88 | }) | 91 | }) |
| 89 | .onClick(() => { | 92 | .onClick(() => { |
| 90 | this.controller.close() | 93 | this.controller.close() |
| 94 | + | ||
| 95 | + TrackingButton.click("immediateUpdating", TrackConstants.PageName.Update, TrackConstants.PageName.Update) | ||
| 91 | if (this.confirm) { | 96 | if (this.confirm) { |
| 92 | this.confirm() | 97 | this.confirm() |
| 93 | } | 98 | } |
| @@ -99,7 +99,7 @@ export struct MultiPictureDetailPageComponent { | @@ -99,7 +99,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 99 | index: $index, | 99 | index: $index, |
| 100 | currentIndex: $currentIndex, | 100 | currentIndex: $currentIndex, |
| 101 | showCommentList: $showCommentList, | 101 | showCommentList: $showCommentList, |
| 102 | - publishCommentModel: $publishCommentModel | 102 | + // publishCommentModel: $publishCommentModel |
| 103 | }) | 103 | }) |
| 104 | 104 | ||
| 105 | } | 105 | } |
-
Please register or login to post a comment