陈剑华

Merge remote-tracking branch 'origin/main'

Showing 32 changed files with 502 additions and 268 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 +
@@ -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';
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;
@@ -52,7 +52,7 @@ export struct Card19Component { @@ -52,7 +52,7 @@ export struct Card19Component {
52 .fontColor(0xED2800) 52 .fontColor(0xED2800)
53 Span(this.str03) 53 Span(this.str03)
54 } else { 54 } else {
55 - Span(this.contentDTO.newsTitle) 55 + Span(this.contentDTO.newsTitle=='null'?"":this.contentDTO.newsTitle)
56 } 56 }
57 } 57 }
58 .fontSize($r('app.float.font_size_18')) 58 .fontSize($r('app.float.font_size_18'))
1 /** 1 /**
2 * More_Comp 2 * More_Comp
3 */ 3 */
  4 +import { ContentDTO } from 'wdBean/Index';
  5 +
4 const TAG: string = 'More_Comp'; 6 const TAG: string = 'More_Comp';
5 7
6 @Entry 8 @Entry
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)
@@ -45,7 +45,7 @@ export struct ZhGridLayout02NewsContent { @@ -45,7 +45,7 @@ export struct ZhGridLayout02NewsContent {
45 buildItemCard(item: ContentDTO, index: number) { 45 buildItemCard(item: ContentDTO, index: number) {
46 Column() { 46 Column() {
47 Stack({ alignContent: Alignment.BottomEnd }) { 47 Stack({ alignContent: Alignment.BottomEnd }) {
48 - Image(this.loadImg ? item.fullColumnImgUrls[0].url : '') 48 + Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls[0].url : '')
49 .backgroundColor(0xf5f5f5) 49 .backgroundColor(0xf5f5f5)
50 .width('100%') 50 .width('100%')
51 .height(95) 51 .height(95)
@@ -58,7 +58,12 @@ export struct ZhGridLayout02NewsContent { @@ -58,7 +58,12 @@ export struct ZhGridLayout02NewsContent {
58 .fontSize(12) 58 .fontSize(12)
59 .fontWeight(400) 59 .fontWeight(400)
60 .fontColor(Color.White) 60 .fontColor(Color.White)
61 - .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 + })
62 .margin({ 67 .margin({
63 right: '5vp', 68 right: '5vp',
64 bottom: '5vp' 69 bottom: '5vp'
  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'
@@ -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 }
@@ -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 * 组件样式类型,根据详情页类型传值,组件内部根据样式展现类型做判断
@@ -233,23 +237,23 @@ export struct OperRowListView { @@ -233,23 +237,23 @@ export struct OperRowListView {
233 left: 16 237 left: 16
234 }) 238 })
235 239
236 - if (this.showCommentIcon) { 240 + if (this.showCommentIcon // 页面控制开关,直播传false
  241 + && this.contentDetailData.openComment == 1 // 内容开关
  242 + && this.publishCommentModel?.targetId) {
237 Column() { 243 Column() {
238 - if (this.publishCommentModel?.targetId) {  
239 - CommentIconComponent({  
240 - publishCommentModel: this.publishCommentModel,  
241 - styleType: this.styleType,  
242 - contentDetail: this.contentDetailData  
243 - })  
244 - .onClick(() => {  
245 - this.onCommentIconClick() 244 + CommentIconComponent({
  245 + publishCommentModel: this.publishCommentModel,
  246 + styleType: this.styleType,
  247 + contentDetail: this.contentDetailData
  248 + })
  249 + .onClick(() => {
  250 + this.onCommentIconClick()
246 251
247 - console.log(JSON.stringify(this.dialogController?.open)) 252 + console.log(JSON.stringify(this.dialogController?.open))
248 253
249 - // 评论弹框内部嵌入  
250 - !this.showBackIcon && this.dialogController?.open()  
251 - })  
252 - } 254 + // 评论弹框内部嵌入
  255 + !this.showBackIcon && this.dialogController?.open()
  256 + })
253 } 257 }
254 .width(48) 258 .width(48)
255 } 259 }
@@ -6,6 +6,7 @@ import PageAdModel from '../viewmodel/PageAdvModel'; @@ -6,6 +6,7 @@ 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'; 7 import { Logger } from 'wdKit/Index';
8 8
  9 +const TAG = 'PullDownRefresh'
9 /***********新的下拉、上拉手势 start **********/ 10 /***********新的下拉、上拉手势 start **********/
10 export function onActionStart(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) { 11 export function onActionStart(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) {
11 if (event === undefined) { 12 if (event === undefined) {
@@ -157,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod @@ -157,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod
157 let advSelf: PageAdModel = pageAdvModel; 158 let advSelf: PageAdModel = pageAdvModel;
158 PageHelper.refreshUI(self, advSelf) 159 PageHelper.refreshUI(self, advSelf)
159 }, Const.DELAY_TIME); 160 }, Const.DELAY_TIME);
  161 + setRefreshTimeoutTimer(pageModel)
160 } else { 162 } else {
161 closeRefresh(pageModel, false); 163 closeRefresh(pageModel, false);
162 } 164 }
163 } 165 }
164 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 +
165 /** 177 /**
166 * 自动刷新接口,如首页底导,双击按钮自动刷新 178 * 自动刷新接口,如首页底导,双击按钮自动刷新
167 * @param pageModel 页面数据 179 * @param pageModel 页面数据
@@ -177,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) { @@ -177,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) {
177 pullRefreshState(pageModel, RefreshState.Refreshing); 189 pullRefreshState(pageModel, RefreshState.Refreshing);
178 pageModel.currentPage = 1; 190 pageModel.currentPage = 1;
179 PageHelper.refreshUI(pageModel, pageAdvModel) 191 PageHelper.refreshUI(pageModel, pageAdvModel)
  192 + setRefreshTimeoutTimer(pageModel)
180 } 193 }
181 194
182 export function pullRefreshState(pageModel: PageModel, state: number) { 195 export function pullRefreshState(pageModel: PageModel, state: number) {
@@ -225,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) { @@ -225,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) {
225 238
226 export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) { 239 export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) {
227 let self = pageModel; 240 let self = pageModel;
  241 + // 取消超时关闭定时器
  242 + clearTimeout(self.refreshTimeoutTimerId)
228 setTimeout(() => { 243 setTimeout(() => {
229 let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH; 244 let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH;
230 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 */
@@ -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 }
@@ -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
@@ -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 }
@@ -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 +}
@@ -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();
@@ -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 }