Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
Showing
24 changed files
with
268 additions
and
109 deletions
| @@ -751,7 +751,7 @@ export struct DynamicDetailComponent { | @@ -751,7 +751,7 @@ export struct DynamicDetailComponent { | ||
| 751 | return | 751 | return |
| 752 | } | 752 | } |
| 753 | const params: postExecuteLikeParams = { | 753 | const params: postExecuteLikeParams = { |
| 754 | - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', | 754 | + status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1, |
| 755 | contentId: this.contentDetailData?.newsId + '', | 755 | contentId: this.contentDetailData?.newsId + '', |
| 756 | contentType: this.contentDetailData?.newsType + '', | 756 | contentType: this.contentDetailData?.newsType + '', |
| 757 | } | 757 | } |
| @@ -10,6 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; | @@ -10,6 +10,7 @@ import { ENewspaperPageDialog } from '../dialog/ENewspaperPageDialog'; | ||
| 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; | 10 | import { RMCalendarBean } from './calendar/RMCalendarBean'; |
| 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; | 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; |
| 13 | +import { promptAction } from '@kit.ArkUI'; | ||
| 13 | 14 | ||
| 14 | @Component | 15 | @Component |
| 15 | export struct ENewspaperPageComponent { | 16 | export struct ENewspaperPageComponent { |
| @@ -270,6 +271,10 @@ export struct ENewspaperPageComponent { | @@ -270,6 +271,10 @@ export struct ENewspaperPageComponent { | ||
| 270 | }) | 271 | }) |
| 271 | .id('e_newspaper_page_num') | 272 | .id('e_newspaper_page_num') |
| 272 | .onClick((event: ClickEvent) => { | 273 | .onClick((event: ClickEvent) => { |
| 274 | + if(!NetworkUtil.isNetConnected()){ | ||
| 275 | + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | ||
| 276 | + return | ||
| 277 | + } | ||
| 273 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 278 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 274 | this.pageDialogShow = !this.pageDialogShow | 279 | this.pageDialogShow = !this.pageDialogShow |
| 275 | if (this.pageDialogShow) { | 280 | if (this.pageDialogShow) { |
| @@ -305,6 +310,10 @@ export struct ENewspaperPageComponent { | @@ -305,6 +310,10 @@ export struct ENewspaperPageComponent { | ||
| 305 | }) | 310 | }) |
| 306 | .id('e_newspaper_read') | 311 | .id('e_newspaper_read') |
| 307 | .onClick((event: ClickEvent) => { | 312 | .onClick((event: ClickEvent) => { |
| 313 | + if(!NetworkUtil.isNetConnected()){ | ||
| 314 | + ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | ||
| 315 | + return | ||
| 316 | + } | ||
| 308 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { | 317 | if (this.newspaperListBean.list && this.newspaperListBean.list.length > 0) { |
| 309 | this.isOpenListDialog = true | 318 | this.isOpenListDialog = true |
| 310 | }else { | 319 | }else { |
| @@ -24,6 +24,10 @@ export struct ImageDownloadComponent { | @@ -24,6 +24,10 @@ export struct ImageDownloadComponent { | ||
| 24 | 24 | ||
| 25 | build() { | 25 | build() { |
| 26 | Column() { | 26 | Column() { |
| 27 | + // Image($r('app.media.save_detail_img')) | ||
| 28 | + // .width(24) | ||
| 29 | + // .height(24) | ||
| 30 | + // .margin({bottom:6}) | ||
| 27 | SaveButton({ icon: SaveIconStyle.LINES }) | 31 | SaveButton({ icon: SaveIconStyle.LINES }) |
| 28 | .iconSize(24) | 32 | .iconSize(24) |
| 29 | .iconColor(Color.White) | 33 | .iconColor(Color.White) |
| @@ -33,7 +37,8 @@ export struct ImageDownloadComponent { | @@ -33,7 +37,8 @@ export struct ImageDownloadComponent { | ||
| 33 | await this.saveImage(this.imageBuffer); | 37 | await this.saveImage(this.imageBuffer); |
| 34 | promptAction.showToast({ | 38 | promptAction.showToast({ |
| 35 | message: $r('app.string.image_request_success'), | 39 | message: $r('app.string.image_request_success'), |
| 36 | - duration: 2000 | 40 | + duration: 2000, |
| 41 | + alignment:Alignment.Center | ||
| 37 | }) | 42 | }) |
| 38 | } | 43 | } |
| 39 | }) | 44 | }) |
| @@ -239,15 +239,9 @@ export struct MorningEveningPaperComponent { | @@ -239,15 +239,9 @@ export struct MorningEveningPaperComponent { | ||
| 239 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 239 | // WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | - onPageShow(){ | ||
| 243 | - TrackingPageBrowseUtils.TrackingPageBrowseExposureStart() | ||
| 244 | - } | ||
| 245 | - | ||
| 246 | onPageHide() { | 242 | onPageHide() { |
| 247 | this.status = PlayerConstants.STATUS_PAUSE; | 243 | this.status = PlayerConstants.STATUS_PAUSE; |
| 248 | this.playerController?.pause(); | 244 | this.playerController?.pause(); |
| 249 | - | ||
| 250 | - TrackingPageBrowseUtils.TrackingPageBrowseExposureEnd('','',TrackParamConvert.pageInfoBean_ParamType(this.pageInfoBean)) | ||
| 251 | } | 245 | } |
| 252 | 246 | ||
| 253 | build() { | 247 | build() { |
| @@ -259,11 +253,12 @@ export struct MorningEveningPaperComponent { | @@ -259,11 +253,12 @@ export struct MorningEveningPaperComponent { | ||
| 259 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) | 253 | topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject }) |
| 260 | } | 254 | } |
| 261 | 255 | ||
| 262 | - if (this.audioPlayUrl.length > 0){ | ||
| 263 | - ListItem() { | ||
| 264 | - this.AudioBarView(this.simpleAudioDialog) | ||
| 265 | - } | ||
| 266 | - } | 256 | + //暂时不展示音频播报 |
| 257 | + // if (this.audioPlayUrl.length > 0){ | ||
| 258 | + // ListItem() { | ||
| 259 | + // this.AudioBarView(this.simpleAudioDialog) | ||
| 260 | + // } | ||
| 261 | + // } | ||
| 267 | } | 262 | } |
| 268 | 263 | ||
| 269 | ListItem() { | 264 | ListItem() { |
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
| @@ -18,11 +18,10 @@ const TAG = 'QualityCommentsComponent'; | @@ -18,11 +18,10 @@ const TAG = 'QualityCommentsComponent'; | ||
| 18 | @Preview | 18 | @Preview |
| 19 | @Component | 19 | @Component |
| 20 | export struct QualityCommentsComponent { | 20 | export struct QualityCommentsComponent { |
| 21 | - | ||
| 22 | //刷新 | 21 | //刷新 |
| 23 | - @State viewType:number = ViewType.LOADING; | 22 | + @State viewType: number = ViewType.LOADING; |
| 24 | @State hasMore: boolean = true; | 23 | @State hasMore: boolean = true; |
| 25 | - @State currentPage: number = 1; | 24 | + @State currentPage: number = 1; |
| 26 | private scroller: Scroller = new Scroller(); | 25 | private scroller: Scroller = new Scroller(); |
| 27 | @State tileOpacity: number = 0; | 26 | @State tileOpacity: number = 0; |
| 28 | firstPositionY: number = 0; | 27 | firstPositionY: number = 0; |
| @@ -32,11 +31,9 @@ export struct QualityCommentsComponent { | @@ -32,11 +31,9 @@ export struct QualityCommentsComponent { | ||
| 32 | currentWindowColor: string = '#FF4202' | 31 | currentWindowColor: string = '#FF4202' |
| 33 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); | 32 | @State allDatas: LazyDataSource<commentItemModel> = new LazyDataSource(); |
| 34 | @State dialogController: CustomDialogController | null = null; | 33 | @State dialogController: CustomDialogController | null = null; |
| 35 | - | ||
| 36 | /*必传*/ | 34 | /*必传*/ |
| 37 | @State publishCommentModel: publishCommentModel = new publishCommentModel() | 35 | @State publishCommentModel: publishCommentModel = new publishCommentModel() |
| 38 | 36 | ||
| 39 | - | ||
| 40 | aboutToDisappear(): void { | 37 | aboutToDisappear(): void { |
| 41 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) | 38 | // windowClass.setWindowSystemBarProperties({ statusBarColor: '#000' }) |
| 42 | this.dialogController = null // 将dialogController置空 | 39 | this.dialogController = null // 将dialogController置空 |
| @@ -55,7 +52,7 @@ export struct QualityCommentsComponent { | @@ -55,7 +52,7 @@ export struct QualityCommentsComponent { | ||
| 55 | this.showAlert() | 52 | this.showAlert() |
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | - showAlert(){ | 55 | + showAlert() { |
| 59 | this.dialogController = new CustomDialogController({ | 56 | this.dialogController = new CustomDialogController({ |
| 60 | builder: CommentCustomDialog({ | 57 | builder: CommentCustomDialog({ |
| 61 | confirm: (value: Record<string, string>) => { | 58 | confirm: (value: Record<string, string>) => { |
| @@ -74,9 +71,11 @@ export struct QualityCommentsComponent { | @@ -74,9 +71,11 @@ export struct QualityCommentsComponent { | ||
| 74 | }) | 71 | }) |
| 75 | } | 72 | } |
| 76 | 73 | ||
| 77 | - getData(resolve?: (value: string | PromiseLike<string>) => void){ | 74 | + getData(resolve?: (value: string | PromiseLike<string>) => void) { |
| 78 | commentViewModel.fetchQualityCommentList(this.currentPage + '').then((commentListModel) => { | 75 | commentViewModel.fetchQualityCommentList(this.currentPage + '').then((commentListModel) => { |
| 79 | - if(resolve) resolve('刷新成功') | 76 | + if (resolve) { |
| 77 | + resolve('刷新成功') | ||
| 78 | + } | ||
| 80 | 79 | ||
| 81 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | 80 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { |
| 82 | if (this.currentPage === 1) { | 81 | if (this.currentPage === 1) { |
| @@ -143,6 +142,7 @@ export struct QualityCommentsComponent { | @@ -143,6 +142,7 @@ export struct QualityCommentsComponent { | ||
| 143 | .height(this.topSafeHeight + vp2px(44) + 'px') | 142 | .height(this.topSafeHeight + vp2px(44) + 'px') |
| 144 | .width('100%') | 143 | .width('100%') |
| 145 | .backgroundColor($r('app.color.color_transparent')) | 144 | .backgroundColor($r('app.color.color_transparent')) |
| 145 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | /*导航栏*/ | 148 | /*导航栏*/ |
| @@ -187,62 +187,66 @@ export struct QualityCommentsComponent { | @@ -187,62 +187,66 @@ export struct QualityCommentsComponent { | ||
| 187 | .height(this.topSafeHeight + vp2px(44) + 'px') | 187 | .height(this.topSafeHeight + vp2px(44) + 'px') |
| 188 | .width('100%') | 188 | .width('100%') |
| 189 | .backgroundColor($r('app.color.white')) | 189 | .backgroundColor($r('app.color.white')) |
| 190 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | ||
| 190 | } | 191 | } |
| 191 | 192 | ||
| 192 | build() { | 193 | build() { |
| 193 | - Column() { | ||
| 194 | - | ||
| 195 | - | ||
| 196 | - Stack({ alignContent: Alignment.Top }) { | ||
| 197 | - | ||
| 198 | - Scroll() { | ||
| 199 | - Column() { | ||
| 200 | - Stack() { | ||
| 201 | - this.titleHeader() | ||
| 202 | - | ||
| 203 | - if(this.viewType == ViewType.ERROR){ | ||
| 204 | - ErrorComponent() | ||
| 205 | - }else if(this.viewType == ViewType.EMPTY){ | ||
| 206 | - EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoComment}) | ||
| 207 | - }else { | 194 | + Stack({ alignContent: Alignment.Top }) { |
| 195 | + Scroll() { | ||
| 196 | + Column() { | ||
| 197 | + Stack() { | ||
| 198 | + this.titleHeader() | ||
| 199 | + | ||
| 200 | + if (this.viewType == ViewType.ERROR) { | ||
| 201 | + ErrorComponent() | ||
| 202 | + } else if (this.viewType == ViewType.EMPTY) { | ||
| 203 | + EmptyComponent({ emptyType: WDViewDefaultType.WDViewDefaultType_NoComment }) | ||
| 204 | + } else { | ||
| 208 | this.listLayout() | 205 | this.listLayout() |
| 209 | - } | 206 | + } |
| 210 | 207 | ||
| 211 | - }.alignContent(Alignment.Top) | ||
| 212 | - }.backgroundColor(this.currentWindowColor).width('100%') | 208 | + }.alignContent(Alignment.Top) |
| 213 | } | 209 | } |
| 214 | - .friction(0.6) | ||
| 215 | - .scrollBar(BarState.Off) | ||
| 216 | - .edgeEffect(EdgeEffect.None) | ||
| 217 | - .width('100%') | ||
| 218 | - .height('100%') | ||
| 219 | - | ||
| 220 | - this.TabbarTransparent() | ||
| 221 | - this.TabbarNormal() | ||
| 222 | - | 210 | + .backgroundColor(this.currentWindowColor).width('100%') |
| 223 | } | 211 | } |
| 212 | + .friction(0.6) | ||
| 213 | + .scrollBar(BarState.Off) | ||
| 214 | + .edgeEffect(EdgeEffect.None) | ||
| 215 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 224 | 216 | ||
| 217 | + this.TabbarTransparent() | ||
| 218 | + this.TabbarNormal() | ||
| 225 | } | 219 | } |
| 220 | + .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM]) | ||
| 226 | 221 | ||
| 227 | } | 222 | } |
| 228 | 223 | ||
| 229 | @Builder | 224 | @Builder |
| 230 | - listLayout(){ | ||
| 231 | - List({ space: 12, scroller:this.scroller }) { | 225 | + listLayout() { |
| 226 | + List({ space: 12, scroller: this.scroller }) { | ||
| 232 | // ListItemGroup({ header: this.titleHeader() }) | 227 | // ListItemGroup({ header: this.titleHeader() }) |
| 233 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { | 228 | LazyForEach(this.allDatas, (item: commentItemModel, index: number) => { |
| 234 | ListItem() { | 229 | ListItem() { |
| 235 | - QualityCommentItem({ item: item, index: index , dialogController:this.dialogController, publishCommentModel:this.publishCommentModel}).margin({ left: 12, right: 12 }) | 230 | + QualityCommentItem({ |
| 231 | + item: item, | ||
| 232 | + index: index, | ||
| 233 | + dialogController: this.dialogController, | ||
| 234 | + publishCommentModel: this.publishCommentModel | ||
| 235 | + }).margin({ left: 12, right: 12 }) | ||
| 236 | } | 236 | } |
| 237 | }) | 237 | }) |
| 238 | // 加载更多 | 238 | // 加载更多 |
| 239 | ListItem() { | 239 | ListItem() { |
| 240 | - if (this.hasMore === false) NoMoreLayout() | 240 | + if (this.hasMore === false) { |
| 241 | + NoMoreLayout() | ||
| 242 | + } | ||
| 241 | } | 243 | } |
| 244 | + | ||
| 242 | // ListItem() { | 245 | // ListItem() { |
| 243 | // | 246 | // |
| 244 | // }.height(`${this.bottomSafeHeight}` + 'px') | 247 | // }.height(`${this.bottomSafeHeight}` + 'px') |
| 245 | - }.onReachEnd(()=>{ | 248 | + } |
| 249 | + .onReachEnd(() => { | ||
| 246 | this.currentPage++ | 250 | this.currentPage++ |
| 247 | this.getData() | 251 | this.getData() |
| 248 | }) | 252 | }) |
| @@ -255,14 +259,9 @@ export struct QualityCommentsComponent { | @@ -255,14 +259,9 @@ export struct QualityCommentsComponent { | ||
| 255 | scrollBackward: NestedScrollMode.SELF_FIRST | 259 | scrollBackward: NestedScrollMode.SELF_FIRST |
| 256 | }) | 260 | }) |
| 257 | } | 261 | } |
| 258 | - | ||
| 259 | - | ||
| 260 | - | ||
| 261 | } | 262 | } |
| 262 | 263 | ||
| 263 | 264 | ||
| 264 | - | ||
| 265 | - | ||
| 266 | @Component | 265 | @Component |
| 267 | struct QualityCommentItem { | 266 | struct QualityCommentItem { |
| 268 | @ObjectLink publishCommentModel: publishCommentModel | 267 | @ObjectLink publishCommentModel: publishCommentModel |
| @@ -279,7 +278,8 @@ struct QualityCommentItem { | @@ -279,7 +278,8 @@ struct QualityCommentItem { | ||
| 279 | 278 | ||
| 280 | Image(this.item.fromUserHeader) | 279 | Image(this.item.fromUserHeader) |
| 281 | 280 | ||
| 282 | - .alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ? 'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon')) | 281 | + .alt($r(commentViewModel.adjustUserType(this.item.fromUserType) ? |
| 282 | + 'app.media.WDAccountOwnerHedaerDefaultIcon' : 'app.media.WDAccountDefaultIcon')) | ||
| 283 | .width(50) | 283 | .width(50) |
| 284 | .height(50) | 284 | .height(50) |
| 285 | .borderRadius(25) | 285 | .borderRadius(25) |
| @@ -296,7 +296,7 @@ struct QualityCommentItem { | @@ -296,7 +296,7 @@ struct QualityCommentItem { | ||
| 296 | } | 296 | } |
| 297 | ) | 297 | ) |
| 298 | .onClick(() => { | 298 | .onClick(() => { |
| 299 | - this.jumpToAccountOwner() | 299 | + this.jumpToAccountOwner() |
| 300 | }) | 300 | }) |
| 301 | Text(this.item.fromUserName) | 301 | Text(this.item.fromUserName) |
| 302 | .fontSize(14) | 302 | .fontSize(14) |
| @@ -376,7 +376,7 @@ struct QualityCommentItem { | @@ -376,7 +376,7 @@ struct QualityCommentItem { | ||
| 376 | Row() { | 376 | Row() { |
| 377 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) | 377 | Image($r('app.media.comment_icon_pinglun')).width(16).height(16) |
| 378 | }.height('100%') | 378 | }.height('100%') |
| 379 | - .onClick(()=>{ | 379 | + .onClick(() => { |
| 380 | this.replyComment() | 380 | this.replyComment() |
| 381 | }) | 381 | }) |
| 382 | 382 |
| @@ -3,6 +3,9 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; | @@ -3,6 +3,9 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant'; | ||
| 3 | import { Logger, ToastUtils, DateTimeUtils } from 'wdKit'; | 3 | import { Logger, ToastUtils, DateTimeUtils } from 'wdKit'; |
| 4 | import { CompUtils } from '../../utils/CompUtils'; | 4 | import { CompUtils } from '../../utils/CompUtils'; |
| 5 | import { ProcessUtils, WDRouterRule } from 'wdRouter'; | 5 | import { ProcessUtils, WDRouterRule } from 'wdRouter'; |
| 6 | +import { TrackConstants, | ||
| 7 | + TrackingButton, | ||
| 8 | + TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index'; | ||
| 6 | 9 | ||
| 7 | const TAG: string = 'CardView'; | 10 | const TAG: string = 'CardView'; |
| 8 | 11 | ||
| @@ -528,6 +531,11 @@ export struct PaperSingleColumn999CardView { | @@ -528,6 +531,11 @@ export struct PaperSingleColumn999CardView { | ||
| 528 | .borderRadius(4) | 531 | .borderRadius(4) |
| 529 | .onClick(() => { | 532 | .onClick(() => { |
| 530 | ProcessUtils.processPage(this.item) | 533 | ProcessUtils.processPage(this.item) |
| 534 | + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item)) | ||
| 535 | + }).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { | ||
| 536 | + if (isVisible) { | ||
| 537 | + TrackingContent.common(TrackConstants.EventType.Show,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item)) | ||
| 538 | + } | ||
| 531 | }) | 539 | }) |
| 532 | } | 540 | } |
| 533 | 541 |
| @@ -73,13 +73,14 @@ struct EditUserInfoPage { | @@ -73,13 +73,14 @@ struct EditUserInfoPage { | ||
| 73 | .width('30') | 73 | .width('30') |
| 74 | .height('30') | 74 | .height('30') |
| 75 | } | 75 | } |
| 76 | - }.margin({top:20,bottom:-10}) | ||
| 77 | - | ||
| 78 | - Button('点击更换头像') | ||
| 79 | - .fontColor(Color.Gray) | ||
| 80 | - .fontSize(15) | ||
| 81 | - .backgroundColor(Color.White) | ||
| 82 | - .margin(20) | 76 | + }.margin({top:20,bottom:40}) |
| 77 | + | ||
| 78 | + ///目前不支持头像上传,暂时屏蔽 | ||
| 79 | + // Button('点击更换头像') | ||
| 80 | + // .fontColor(Color.Gray) | ||
| 81 | + // .fontSize(15) | ||
| 82 | + // .backgroundColor(Color.White) | ||
| 83 | + // .margin(20) | ||
| 83 | 84 | ||
| 84 | List({}){ | 85 | List({}){ |
| 85 | ForEach(this.listData,(item:EditListInfo,index:number) =>{ | 86 | ForEach(this.listData,(item:EditListInfo,index:number) =>{ |
| @@ -14,7 +14,7 @@ import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | @@ -14,7 +14,7 @@ import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh'; | ||
| 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' | 14 | import { MyCustomDialog } from '../reusable/MyCustomDialog' |
| 15 | import { NetworkUtil } from 'wdKit/Index'; | 15 | import { NetworkUtil } from 'wdKit/Index'; |
| 16 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | 16 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' |
| 17 | -import { TrackConstants } from 'wdTracking/Index'; | 17 | +import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index'; |
| 18 | 18 | ||
| 19 | @Entry | 19 | @Entry |
| 20 | @Component | 20 | @Component |
| @@ -36,6 +36,9 @@ struct MyCollectionListPage { | @@ -36,6 +36,9 @@ struct MyCollectionListPage { | ||
| 36 | builder: MyCustomDialog({ | 36 | builder: MyCustomDialog({ |
| 37 | confirm: () => { | 37 | confirm: () => { |
| 38 | this.deleteDatas() | 38 | this.deleteDatas() |
| 39 | + if (this.isAllSelect) { | ||
| 40 | + TrackingButton.click('morning_evening_news_click',TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect) | ||
| 41 | + } | ||
| 39 | }, | 42 | }, |
| 40 | titleShow:false, | 43 | titleShow:false, |
| 41 | tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏' | 44 | tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏' |
| @@ -146,7 +149,14 @@ struct MyCollectionListPage { | @@ -146,7 +149,14 @@ struct MyCollectionListPage { | ||
| 146 | Column() { | 149 | Column() { |
| 147 | BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO}) | 150 | BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO}) |
| 148 | } | 151 | } |
| 149 | - } | 152 | + }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => { |
| 153 | + if (isVisible) { | ||
| 154 | + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) | ||
| 155 | + } | ||
| 156 | + }) | ||
| 157 | + // .onClick(()=>{ | ||
| 158 | + // TrackingContent.common(TrackConstants.EventType.Click, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO)) | ||
| 159 | + // }) | ||
| 150 | } | 160 | } |
| 151 | 161 | ||
| 152 | 162 |
| @@ -8,6 +8,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | @@ -8,6 +8,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent | ||
| 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; | 8 | import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils'; |
| 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; | 9 | import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent'; |
| 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; | 10 | import { channelSkeleton } from '../skeleton/channelSkeleton'; |
| 11 | +import { TrackConstants, TrackingButton } from 'wdTracking/Index'; | ||
| 11 | 12 | ||
| 12 | const TAG = 'TopNavigationComponent'; | 13 | const TAG = 'TopNavigationComponent'; |
| 13 | 14 | ||
| @@ -83,16 +84,16 @@ export struct TopNavigationComponentNew { | @@ -83,16 +84,16 @@ export struct TopNavigationComponentNew { | ||
| 83 | PeopleShipMainComponent({ | 84 | PeopleShipMainComponent({ |
| 84 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 85 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 85 | navIndex: index, | 86 | navIndex: index, |
| 86 | - pageId: navItem.pageId + '', | ||
| 87 | - channelId: navItem.channelId + '', | 87 | + pageId: navItem?.pageId + '', |
| 88 | + channelId: navItem?.channelId + '', | ||
| 88 | }) | 89 | }) |
| 89 | } else | 90 | } else |
| 90 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { | 91 | if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { |
| 91 | PageComponent({ | 92 | PageComponent({ |
| 92 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 93 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 93 | navIndex: index, | 94 | navIndex: index, |
| 94 | - pageId: navItem.pageId + '', | ||
| 95 | - channelId: navItem.channelId + '', | 95 | + pageId: navItem?.pageId + '', |
| 96 | + channelId: navItem?.channelId + '', | ||
| 96 | autoRefresh: this.autoRefresh2Page | 97 | autoRefresh: this.autoRefresh2Page |
| 97 | }) | 98 | }) |
| 98 | } else { | 99 | } else { |
| @@ -171,6 +172,7 @@ export struct TopNavigationComponentNew { | @@ -171,6 +172,7 @@ export struct TopNavigationComponentNew { | ||
| 171 | .onClick(() => { | 172 | .onClick(() => { |
| 172 | if (NetworkUtil.isNetConnected()) { | 173 | if (NetworkUtil.isNetConnected()) { |
| 173 | ProcessUtils.gotoMorningEveningPaper() | 174 | ProcessUtils.gotoMorningEveningPaper() |
| 175 | + TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews) | ||
| 174 | } else { | 176 | } else { |
| 175 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) | 177 | ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) |
| 176 | } | 178 | } |
| @@ -5,6 +5,11 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -5,6 +5,11 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 5 | import { SpConstants } from 'wdConstant/Index'; | 5 | import { SpConstants } from 'wdConstant/Index'; |
| 6 | import { ContentDetailDTO } from 'wdBean/Index'; | 6 | import { ContentDetailDTO } from 'wdBean/Index'; |
| 7 | import measure from '@ohos.measure' | 7 | import measure from '@ohos.measure' |
| 8 | +import { | ||
| 9 | + ContentDetailRequest, | ||
| 10 | + postExecuteLikeParams, | ||
| 11 | + batchLikeAndCollectParams, | ||
| 12 | +} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | ||
| 8 | 13 | ||
| 9 | const TAG = 'LikeComponent'; | 14 | const TAG = 'LikeComponent'; |
| 10 | 15 | ||
| @@ -40,8 +45,9 @@ export struct LikeComponent { | @@ -40,8 +45,9 @@ export struct LikeComponent { | ||
| 40 | } | 45 | } |
| 41 | 46 | ||
| 42 | onDataUpdated() { | 47 | onDataUpdated() { |
| 48 | + console.log(TAG, '点赞点击') | ||
| 43 | if (this.data) { | 49 | if (this.data) { |
| 44 | - if (this.data['channelId'] !== 'undefined') { | 50 | + if (this.data['contentType'] !== 'undefined') { |
| 45 | //获取点赞状态 | 51 | //获取点赞状态 |
| 46 | this.getLikeStatus() | 52 | this.getLikeStatus() |
| 47 | //获取点赞数 | 53 | //获取点赞数 |
| @@ -300,13 +306,26 @@ export struct LikeComponent { | @@ -300,13 +306,26 @@ export struct LikeComponent { | ||
| 300 | 306 | ||
| 301 | executeLike(status: string) { | 307 | executeLike(status: string) { |
| 302 | console.log(TAG, '点赞接口调用', status) | 308 | console.log(TAG, '点赞接口调用', status) |
| 303 | - this.data['status'] = status | ||
| 304 | - this.data['contentId'] = this.contentDetailData?.newsId + '' | ||
| 305 | - this.data['contentType'] = this.contentDetailData?.newsType + '' | ||
| 306 | 309 | ||
| 307 | - this.viewModel.executeLike2(this.data).then(() => { | 310 | + const params: postExecuteLikeParams = { |
| 311 | + status: Number(status), | ||
| 312 | + contentId: this.data['contentId'], | ||
| 313 | + contentType: this.data['contentType'] | ||
| 314 | + } | ||
| 315 | + if(this.data['relType']) { | ||
| 316 | + params.relType = this.data['relType'] | ||
| 317 | + } | ||
| 318 | + if(this.data['contentRelId']) { | ||
| 319 | + params.contentRelId = this.data['contentRelId'] | ||
| 320 | + } | ||
| 321 | + if(this.data['channelId']) { | ||
| 322 | + params.channelId = this.data['channelId'] | ||
| 323 | + } | ||
| 324 | + | ||
| 325 | + console.log(TAG, "点赞 params", JSON.stringify(params)) | ||
| 326 | + ContentDetailRequest.postExecuteLike(params).then((data) => { | ||
| 308 | 327 | ||
| 309 | - console.log(TAG, '点赞接口调用成功') | 328 | + console.log(TAG, '点赞接口调用成功', JSON.stringify(data)) |
| 310 | 329 | ||
| 311 | // 直播点赞一直增加 | 330 | // 直播点赞一直增加 |
| 312 | if (this.contentDetailData.liveInfo) { | 331 | if (this.contentDetailData.liveInfo) { |
| @@ -333,11 +352,25 @@ export struct LikeComponent { | @@ -333,11 +352,25 @@ export struct LikeComponent { | ||
| 333 | } | 352 | } |
| 334 | 353 | ||
| 335 | getLikeStatus() { | 354 | getLikeStatus() { |
| 336 | - this.viewModel.getLikeStatus(this.data).then((data) => { | ||
| 337 | - if (data && data['data'].length && data['data'][0]['likeStatus']) { | ||
| 338 | - this.likeStatus = data['data'][0]['likeStatus'] | ||
| 339 | - } else { | ||
| 340 | - this.likeStatus = false | 355 | + // console.log(TAG, "this.data", JSON.stringify(this.data)) |
| 356 | + const params: batchLikeAndCollectParams = { | ||
| 357 | + contentList: [ | ||
| 358 | + { | ||
| 359 | + contentId: this.data['contentId'], | ||
| 360 | + contentType: this.data['contentType'], | ||
| 361 | + contentRelId: this.data['contentRelId'] || '' + '', | ||
| 362 | + } | ||
| 363 | + ] | ||
| 364 | + } | ||
| 365 | + console.log(TAG, "查询点赞状态params", JSON.stringify(params)) | ||
| 366 | + ContentDetailRequest.postBatchLikeAndCollectStatus(params).then(res => { | ||
| 367 | + console.log(TAG, '查询点赞、收藏状态==', JSON.stringify(res.data)) | ||
| 368 | + if (res.data) { | ||
| 369 | + if(res.data[0].likeStatus) { | ||
| 370 | + this.likeStatus = res.data[0].likeStatus ? true : false | ||
| 371 | + } else { | ||
| 372 | + this.likeStatus = false | ||
| 373 | + } | ||
| 341 | } | 374 | } |
| 342 | }).catch(() => { | 375 | }).catch(() => { |
| 343 | this.likeStatus = false | 376 | this.likeStatus = false |
| @@ -36,6 +36,7 @@ const TAG = 'OperRowListView'; | @@ -36,6 +36,7 @@ const TAG = 'OperRowListView'; | ||
| 36 | * 注意:外层需注册 @Provide contentDetailData:contentDetailData = {} as contentDetailData | 36 | * 注意:外层需注册 @Provide contentDetailData:contentDetailData = {} as contentDetailData |
| 37 | * 传值示例: | 37 | * 传值示例: |
| 38 | OperRowListView({ | 38 | OperRowListView({ |
| 39 | + | ||
| 39 | contentDetailData: this.contentDetailData[0], | 40 | contentDetailData: this.contentDetailData[0], |
| 40 | operationButtonList: ['comment', 'like', 'collect', 'listen', 'share'] | 41 | operationButtonList: ['comment', 'like', 'collect', 'listen', 'share'] |
| 41 | }) | 42 | }) |
| @@ -123,11 +124,25 @@ export struct OperRowListView { | @@ -123,11 +124,25 @@ export struct OperRowListView { | ||
| 123 | await this.queryContentInteractCount() | 124 | await this.queryContentInteractCount() |
| 124 | // 点赞需要数据 | 125 | // 点赞需要数据 |
| 125 | this.likeBean['contentId'] = this.contentDetailData.newsId + '' | 126 | this.likeBean['contentId'] = this.contentDetailData.newsId + '' |
| 126 | - this.likeBean['userName'] = this.contentDetailData.userInfo?.userName + '' | 127 | + if(this.contentDetailData.userInfo?.userName) { |
| 128 | + this.likeBean['userName'] = this.contentDetailData.userInfo?.userName + '' | ||
| 129 | + } | ||
| 127 | this.likeBean['contentType'] = this.contentDetailData.newsType + '' | 130 | this.likeBean['contentType'] = this.contentDetailData.newsType + '' |
| 128 | - this.likeBean['title'] = this.contentDetailData.newsTitle + '' | ||
| 129 | - this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' | ||
| 130 | - this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' | 131 | + if(this.contentDetailData.newsTitle) { |
| 132 | + this.likeBean['title'] = this.contentDetailData.newsTitle + '' | ||
| 133 | + } | ||
| 134 | + if(this.contentDetailData.userInfo?.headPhotoUrl) { | ||
| 135 | + this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + '' | ||
| 136 | + } | ||
| 137 | + if(this.contentDetailData.reLInfo?.channelId) { | ||
| 138 | + this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + '' | ||
| 139 | + } | ||
| 140 | + if(this.contentDetailData?.reLInfo?.relType) { | ||
| 141 | + this.likeBean['relType'] = this.contentDetailData?.reLInfo?.relType + '' | ||
| 142 | + } | ||
| 143 | + if(this.contentDetailData?.reLInfo?.relId) { | ||
| 144 | + this.likeBean['contentRelId'] = this.contentDetailData?.reLInfo?.relId + '' | ||
| 145 | + } | ||
| 131 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) | 146 | console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData)) |
| 132 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) | 147 | console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean)) |
| 133 | // 评论需要数据 | 148 | // 评论需要数据 |
| @@ -202,7 +217,7 @@ export struct OperRowListView { | @@ -202,7 +217,7 @@ export struct OperRowListView { | ||
| 202 | .padding({ | 217 | .padding({ |
| 203 | top: 10, | 218 | top: 10, |
| 204 | // bottom: 10 | 219 | // bottom: 10 |
| 205 | - bottom: px2vp(this.bottomSafeHeight) | 220 | + bottom: `${this.bottomSafeHeight}px` |
| 206 | // bottom: 50 | 221 | // bottom: 50 |
| 207 | }) | 222 | }) |
| 208 | } | 223 | } |
| @@ -387,6 +402,7 @@ export struct OperRowListView { | @@ -387,6 +402,7 @@ export struct OperRowListView { | ||
| 387 | } | 402 | } |
| 388 | ] | 403 | ] |
| 389 | } | 404 | } |
| 405 | + console.info(TAG, '查询用户对作品收藏1', JSON.stringify(params)) | ||
| 390 | // console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params)) | 406 | // console.info(TAG, '查询用户对作品收藏11', JSON.stringify(params)) |
| 391 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) | 407 | let data = await MultiPictureDetailViewModel.getInteractDataStatus(params) |
| 392 | console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data)) | 408 | console.info(TAG, '查询用户对作品收藏22', JSON.stringify(data)) |
No preview for this file type
| @@ -119,7 +119,7 @@ export interface postBatchAttentionStatusResult { | @@ -119,7 +119,7 @@ export interface postBatchAttentionStatusResult { | ||
| 119 | 119 | ||
| 120 | 120 | ||
| 121 | export interface postExecuteLikeParams { | 121 | export interface postExecuteLikeParams { |
| 122 | - status: string; | 122 | + status: number; |
| 123 | contentId: string; | 123 | contentId: string; |
| 124 | contentType: string; | 124 | contentType: string; |
| 125 | relType?: string; | 125 | relType?: string; |
| @@ -112,7 +112,7 @@ export struct DetailPlayShortVideoPage { | @@ -112,7 +112,7 @@ export struct DetailPlayShortVideoPage { | ||
| 112 | { | 112 | { |
| 113 | contentId: this.contentDetailData?.newsId + '', | 113 | contentId: this.contentDetailData?.newsId + '', |
| 114 | contentType: this.contentDetailData?.newsType + '', | 114 | contentType: this.contentDetailData?.newsType + '', |
| 115 | - contentRelId: this.contentDetailData?.reLInfo?.relId + '', | 115 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', |
| 116 | } | 116 | } |
| 117 | ] | 117 | ] |
| 118 | } | 118 | } |
| @@ -74,7 +74,7 @@ export struct OperationListView { | @@ -74,7 +74,7 @@ export struct OperationListView { | ||
| 74 | return | 74 | return |
| 75 | } | 75 | } |
| 76 | const params: postExecuteLikeParams = { | 76 | const params: postExecuteLikeParams = { |
| 77 | - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', | 77 | + status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1, |
| 78 | contentId: this.contentDetailData?.newsId + '', | 78 | contentId: this.contentDetailData?.newsId + '', |
| 79 | contentType: this.contentDetailData?.newsType + '', | 79 | contentType: this.contentDetailData?.newsType + '', |
| 80 | } | 80 | } |
| @@ -56,15 +56,22 @@ export struct PlayerRightView { | @@ -56,15 +56,22 @@ export struct PlayerRightView { | ||
| 56 | return | 56 | return |
| 57 | } | 57 | } |
| 58 | const params: postExecuteLikeParams = { | 58 | const params: postExecuteLikeParams = { |
| 59 | - status: this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1', | 59 | + status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1, |
| 60 | contentId: this.contentDetailData?.newsId + '', | 60 | contentId: this.contentDetailData?.newsId + '', |
| 61 | contentType: this.contentDetailData?.newsType + '', | 61 | contentType: this.contentDetailData?.newsType + '', |
| 62 | + userName: this.contentDetailData?.userInfo?.userName || '' + '', | ||
| 63 | + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '', | ||
| 64 | + title: this.contentDetailData?.newsTitle || '' + '', | ||
| 65 | + channelId: this.contentDetailData?.reLInfo?.channelId + '', | ||
| 66 | + relType: this.contentDetailData?.reLInfo?.relType || '' + '', | ||
| 67 | + userHeaderUrl: this.contentDetailData?.userInfo?.headPhotoUrl || '' + '', | ||
| 62 | } | 68 | } |
| 69 | + console.log(TAG, '点赞params', JSON.stringify(params)) | ||
| 63 | ContentDetailRequest.postExecuteLike(params).then(res => { | 70 | ContentDetailRequest.postExecuteLike(params).then(res => { |
| 64 | - | 71 | + console.log(TAG, '点赞this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser)) |
| 65 | if (this.newsStatusOfUser) { | 72 | if (this.newsStatusOfUser) { |
| 66 | - this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1' | ||
| 67 | - if (this.newsStatusOfUser.likeStatus === '1') { | 73 | + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1' |
| 74 | + if (this.newsStatusOfUser.likeStatus == '1') { | ||
| 68 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 | 75 | this.interactData.likeNum = Number(this.interactData.likeNum || 0) + 1 |
| 69 | } else { | 76 | } else { |
| 70 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) | 77 | this.interactData.likeNum = Math.max(0, Number(this.interactData.likeNum || 0) - 1) |
| @@ -237,17 +244,17 @@ export struct PlayerRightView { | @@ -237,17 +244,17 @@ export struct PlayerRightView { | ||
| 237 | transLikeStyle(): ILikeStyleResp { | 244 | transLikeStyle(): ILikeStyleResp { |
| 238 | if (this.likesStyle === 1) { | 245 | if (this.likesStyle === 1) { |
| 239 | return { | 246 | return { |
| 240 | - url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`), | 247 | + url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_like_check`) : $r(`app.media.ic_like_uncheck`), |
| 241 | name: '赞' | 248 | name: '赞' |
| 242 | } | 249 | } |
| 243 | } else if (this.likesStyle === 2) { | 250 | } else if (this.likesStyle === 2) { |
| 244 | return { | 251 | return { |
| 245 | - url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), | 252 | + url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_thub_check`) : $r(`app.media.ic_thub_uncheck`), |
| 246 | name: '祈祷' | 253 | name: '祈祷' |
| 247 | } | 254 | } |
| 248 | } else if (this.likesStyle === 3) { | 255 | } else if (this.likesStyle === 3) { |
| 249 | return { | 256 | return { |
| 250 | - url: this.newsStatusOfUser.likeStatus === '1' ? $r(`app.media.ic_candle_check`) : | 257 | + url: this.newsStatusOfUser.likeStatus == '1' ? $r(`app.media.ic_candle_check`) : |
| 251 | $r(`app.media.ic_candle_uncheck`), | 258 | $r(`app.media.ic_candle_uncheck`), |
| 252 | name: '默哀' | 259 | name: '默哀' |
| 253 | } | 260 | } |
| @@ -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 | } |
| @@ -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() { |
| 1 | import { MorningEveningPaperComponent } from 'wdComponent'; | 1 | import { MorningEveningPaperComponent } from 'wdComponent'; |
| 2 | -import { Logger, WindowModel } from 'wdKit'; | 2 | +import { DateTimeUtils, Logger, WindowModel } from 'wdKit'; |
| 3 | +import { TrackConstants, TrackingPageBrowse} from 'wdTracking/Index'; | ||
| 3 | 4 | ||
| 4 | const TAG = 'MorningEveningPaperPage'; | 5 | const TAG = 'MorningEveningPaperPage'; |
| 5 | 6 | ||
| @@ -7,6 +8,8 @@ const TAG = 'MorningEveningPaperPage'; | @@ -7,6 +8,8 @@ const TAG = 'MorningEveningPaperPage'; | ||
| 7 | @Component | 8 | @Component |
| 8 | struct MorningEveningPaperPage { | 9 | struct MorningEveningPaperPage { |
| 9 | @State isPageShow: boolean = false | 10 | @State isPageShow: boolean = false |
| 11 | + pageShowTime:number = 0; | ||
| 12 | + pageHideTime:number = 0; | ||
| 10 | build() { | 13 | build() { |
| 11 | Column() { | 14 | Column() { |
| 12 | MorningEveningPaperComponent() | 15 | MorningEveningPaperComponent() |
| @@ -43,6 +46,7 @@ struct MorningEveningPaperPage { | @@ -43,6 +46,7 @@ struct MorningEveningPaperPage { | ||
| 43 | WindowModel.shared.setWindowLayoutFullScreen(true) | 46 | WindowModel.shared.setWindowLayoutFullScreen(true) |
| 44 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 47 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 45 | } | 48 | } |
| 49 | + this.pageShowTime = DateTimeUtils.getTimeStamp() | ||
| 46 | } | 50 | } |
| 47 | 51 | ||
| 48 | onPageHide() { | 52 | onPageHide() { |
| @@ -50,6 +54,12 @@ struct MorningEveningPaperPage { | @@ -50,6 +54,12 @@ struct MorningEveningPaperPage { | ||
| 50 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) | 54 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', }) |
| 51 | this.isPageShow = true | 55 | this.isPageShow = true |
| 52 | Logger.info(TAG, 'onPageHide'); | 56 | Logger.info(TAG, 'onPageHide'); |
| 57 | + | ||
| 58 | + //早晚报埋点 | ||
| 59 | + this.pageHideTime = DateTimeUtils.getTimeStamp() | ||
| 60 | + let duration = 0 | ||
| 61 | + duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000) | ||
| 62 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,duration) | ||
| 53 | } | 63 | } |
| 54 | 64 | ||
| 55 | onBackPress() { | 65 | onBackPress() { |
| 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 | } |
| @@ -25,7 +25,9 @@ import { EmptyComponent, | @@ -25,7 +25,9 @@ import { EmptyComponent, | ||
| 25 | viewBlogItemInsightIntentShare} from 'wdComponent/Index'; | 25 | viewBlogItemInsightIntentShare} from 'wdComponent/Index'; |
| 26 | 26 | ||
| 27 | const TAG = 'MultiPictureDetailPageComponent'; | 27 | const TAG = 'MultiPictureDetailPageComponent'; |
| 28 | - | 28 | +/** |
| 29 | + * 多图(图集详情页)UI | ||
| 30 | + */ | ||
| 29 | @Component | 31 | @Component |
| 30 | export struct MultiPictureDetailPageComponent { | 32 | export struct MultiPictureDetailPageComponent { |
| 31 | private relId: string = '' | 33 | private relId: string = '' |
-
Please register or login to post a comment