chengen02

Merge remote-tracking branch 'origin/main'

@@ -181,6 +181,10 @@ @@ -181,6 +181,10 @@
181 "value": "40vp" 181 "value": "40vp"
182 }, 182 },
183 { 183 {
  184 + "name": "top_tab_bar_height_common",
  185 + "value": "44vp"
  186 + },
  187 + {
184 "name": "top_tab_item_max_width", 188 "name": "top_tab_item_max_width",
185 "value": "300vp" 189 "value": "300vp"
186 }, 190 },
@@ -27,6 +27,7 @@ export struct Card5Component { @@ -27,6 +27,7 @@ export struct Card5Component {
27 @State str03: string = ''; 27 @State str03: string = '';
28 28
29 async aboutToAppear(): Promise<void> { 29 async aboutToAppear(): Promise<void> {
  30 + console.log('Card2Component', JSON.stringify(this.compDTO))
30 this.clicked = hasClicked(this.contentDTO.objectId) 31 this.clicked = hasClicked(this.contentDTO.objectId)
31 this.loadImg = await onlyWifiLoadImg(); 32 this.loadImg = await onlyWifiLoadImg();
32 33
@@ -47,9 +48,9 @@ export struct Card5Component { @@ -47,9 +48,9 @@ export struct Card5Component {
47 Image(this.loadImg ? this.contentDTO.coverUrl : '') 48 Image(this.loadImg ? this.contentDTO.coverUrl : '')
48 .backgroundColor(0xf5f5f5) 49 .backgroundColor(0xf5f5f5)
49 .width(CommonConstants.FULL_WIDTH) 50 .width(CommonConstants.FULL_WIDTH)
50 - .autoResize(true)  
51 .borderRadius($r('app.float.image_border_radius')) 51 .borderRadius($r('app.float.image_border_radius'))
52 - if (this.titleShowPolicy === 1 || this.titleShowPolicy === null) { 52 + .aspectRatio(343 / 225)
  53 + if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') {
53 Row() 54 Row()
54 .width(CommonConstants.FULL_WIDTH) 55 .width(CommonConstants.FULL_WIDTH)
55 .height(59) 56 .height(59)
@@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem'; @@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
5 import { LazyDataSource, StringUtils } from 'wdKit'; 5 import { LazyDataSource, StringUtils } from 'wdKit';
6 import MinePageDatasModel from '../../../model/MinePageDatasModel'; 6 import MinePageDatasModel from '../../../model/MinePageDatasModel';
7 import { EmptyComponent } from '../../view/EmptyComponent'; 7 import { EmptyComponent } from '../../view/EmptyComponent';
8 -import { Action } from 'wdBean/Index'; 8 +import { Action, ContentDTO } from 'wdBean/Index';
9 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; 9 import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; 10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
  11 +import { TrackingContent, TrackConstants, TrackParamConvert, ParamType } from 'wdTracking/Index';
  12 +import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils';
11 13
12 const TAG = "AppointmentListUI" 14 const TAG = "AppointmentListUI"
13 15
@@ -77,7 +79,9 @@ export struct AppointmentListUI { @@ -77,7 +79,9 @@ export struct AppointmentListUI {
77 AppointmentListChildComponent({ item: item }) 79 AppointmentListChildComponent({ item: item })
78 } 80 }
79 .onClick(() => { 81 .onClick(() => {
80 - //TODO 跳转 82 + let contentDTO = getParams(item)
  83 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live,TrackParamConvert.program(contentDTO))
  84 +
81 let action = { 85 let action = {
82 type:"2", 86 type:"2",
83 params:{ 87 params:{
@@ -90,6 +94,12 @@ export struct AppointmentListUI { @@ -90,6 +94,12 @@ export struct AppointmentListUI {
90 } as Action 94 } as Action
91 WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action) 95 WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
92 }) 96 })
  97 + .onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
  98 + if (isVisible) {
  99 + let contentDTO = getParams(item)
  100 + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live, TrackParamConvert.program(contentDTO))
  101 + }
  102 + })
93 }, (item: MineAppointmentItem, index: number) => index.toString()) 103 }, (item: MineAppointmentItem, index: number) => index.toString())
94 104
95 //没有更多数据 显示提示 105 //没有更多数据 显示提示
@@ -175,4 +185,15 @@ export struct AppointmentListUI { @@ -175,4 +185,15 @@ export struct AppointmentListUI {
175 console.log(TAG, JSON.stringify(dealData)) 185 console.log(TAG, JSON.stringify(dealData))
176 return dealData 186 return dealData
177 } 187 }
178 -}  
  188 +}
  189 +
  190 + function getParams(item: MineAppointmentItem) : ContentDTO{
  191 + let contentDTO = new ContentDTO();
  192 +
  193 + contentDTO.objectType = item.relType + ""
  194 + contentDTO.objectId = item.liveId + ""
  195 + contentDTO.newsTitle = item.title
  196 + // contentDTO.channelId =
  197 + // contentDTO.rmhPlatform
  198 + return contentDTO
  199 + }
@@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel' @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'
5 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem' 5 import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
6 import { CommentListItem } from '../../../viewmodel/CommentListItem' 6 import { CommentListItem } from '../../../viewmodel/CommentListItem'
7 import measure from '@ohos.measure' 7 import measure from '@ohos.measure'
  8 +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'
8 9
9 @Component 10 @Component
10 export struct ChildCommentComponent { 11 export struct ChildCommentComponent {
@@ -16,6 +17,7 @@ export struct ChildCommentComponent { @@ -16,6 +17,7 @@ export struct ChildCommentComponent {
16 @State isOverLines: boolean = false 17 @State isOverLines: boolean = false
17 @State isOverLinesParent: boolean = false 18 @State isOverLinesParent: boolean = false
18 testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸" 19 testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸"
  20 + @Link fromPage:number
19 21
20 build() { 22 build() {
21 Column() { 23 Column() {
@@ -195,11 +197,12 @@ export struct ChildCommentComponent { @@ -195,11 +197,12 @@ export struct ChildCommentComponent {
195 }.height('69lpx') 197 }.height('69lpx')
196 .justifyContent(FlexAlign.Center) 198 .justifyContent(FlexAlign.Center)
197 .onClick(() => { 199 .onClick(() => {
198 - let content = new ContentDTO()  
199 - content.objectId = this.data.targetId;  
200 - content.relType = this.data.targetRelType + "";  
201 - content.relId = this.data.targetRelId;  
202 - content.objectType = this.data.targetType + ""; 200 + let content = getParams(this.data)
  201 + if(this.fromPage === 0 ){
  202 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
  203 + }else{
  204 + TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
  205 + }
203 ProcessUtils.processPage(content) 206 ProcessUtils.processPage(content)
204 }) 207 })
205 } 208 }
@@ -284,3 +287,20 @@ function textStyle() { @@ -284,3 +287,20 @@ function textStyle() {
284 .lineHeight('46lpx') 287 .lineHeight('46lpx')
285 } 288 }
286 289
  290 +function getParams(item: CommentListItem) : ContentDTO{
  291 + let contentDTO = new ContentDTO();
  292 +
  293 + // contentDTO.objectType = item.targetType + ""
  294 + // contentDTO.objectId = item.targetId + ""
  295 + // contentDTO.newsTitle = item.targetTitle
  296 + // contentDTO.channelId =
  297 + // contentDTO.rmhPlatform =
  298 +
  299 + contentDTO.objectId = item.targetId;
  300 + contentDTO.relType = item.targetRelType + "";
  301 + contentDTO.relId = item.targetRelId;
  302 + contentDTO.objectType = item.targetType + "";
  303 + contentDTO.newsTitle = item.targetTitle
  304 +
  305 + return contentDTO
  306 +}
@@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent'; @@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent';
8 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem'; 8 import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
9 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem'; 9 import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; 10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
  11 +import { ContentDTO } from 'wdBean/Index';
  12 +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
11 13
12 const TAG = "HomePageBottomCommentComponent" 14 const TAG = "HomePageBottomCommentComponent"
13 15
@@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent { @@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent {
83 ChildCommentComponent({ 85 ChildCommentComponent({
84 data: item, 86 data: item,
85 levelHead: UserDataLocal.getUserLevelHeaderUrl(), 87 levelHead: UserDataLocal.getUserLevelHeaderUrl(),
86 - isLastItem: index === this.data_comment.totalCount() - 1 88 + isLastItem: index === this.data_comment.totalCount() - 1,
  89 + fromPage:0
87 }) 90 })
88 - } 91 + }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
  92 + if (isVisible) {
  93 + let contentDTO = getParams(item)
  94 + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO))
  95 + }
  96 + })
89 }, (item: CommentListItem, index: number) => index.toString()) 97 }, (item: CommentListItem, index: number) => index.toString())
90 98
91 //没有更多数据 显示提示 99 //没有更多数据 显示提示
@@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent { @@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent {
217 this.isGetRequest = true 225 this.isGetRequest = true
218 }) 226 })
219 } 227 }
220 -}  
  228 +}
  229 +
  230 +
  231 +function getParams(item: CommentListItem) : ContentDTO{
  232 + let contentDTO = new ContentDTO();
  233 +
  234 + // contentDTO.objectType = item.targetType + ""
  235 + // contentDTO.objectId = item.targetId + ""
  236 + // contentDTO.newsTitle = item.targetTitle
  237 + // contentDTO.channelId =
  238 + // contentDTO.rmhPlatform =
  239 +
  240 + contentDTO.objectId = item.targetId;
  241 + contentDTO.relType = item.targetRelType + "";
  242 + contentDTO.relId = item.targetRelId;
  243 + contentDTO.objectType = item.targetType + "";
  244 + contentDTO.newsTitle = item.targetTitle
  245 +
  246 + return contentDTO
  247 +}
@@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU @@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU
8 import { ChildCommentComponent } from './ChildCommentComponent'; 8 import { ChildCommentComponent } from './ChildCommentComponent';
9 import { EmptyComponent } from '../../view/EmptyComponent'; 9 import { EmptyComponent } from '../../view/EmptyComponent';
10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh'; 10 import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
  11 +import { ContentDTO } from 'wdBean/Index';
  12 +import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
11 13
12 const TAG = "HomePageBottomComponent" 14 const TAG = "HomePageBottomComponent"
13 /** 15 /**
@@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent { @@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent {
84 ChildCommentComponent({ 86 ChildCommentComponent({
85 data: item, 87 data: item,
86 levelHead: this.levelHead, 88 levelHead: this.levelHead,
87 - isLastItem: index === this.data_comment.totalCount() - 1 89 + isLastItem: index === this.data_comment.totalCount() - 1,
  90 + fromPage:1
88 }) 91 })
89 - } 92 + }.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
  93 + if (isVisible) {
  94 + let contentDTO = getParams(item)
  95 + TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO))
  96 + }
  97 + })
90 }, (item: CommentListItem, index: number) => index.toString()) 98 }, (item: CommentListItem, index: number) => index.toString())
91 99
92 //没有更多数据 显示提示 100 //没有更多数据 显示提示
@@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent { @@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent {
214 this.isGetRequest = true 222 this.isGetRequest = true
215 }) 223 })
216 } 224 }
217 -}  
  225 +}
  226 +
  227 +function getParams(item: CommentListItem) : ContentDTO{
  228 + let contentDTO = new ContentDTO();
  229 +
  230 + // contentDTO.objectType = item.targetType + ""
  231 + // contentDTO.objectId = item.targetId + ""
  232 + // contentDTO.newsTitle = item.targetTitle
  233 + // contentDTO.channelId =
  234 + // contentDTO.rmhPlatform =
  235 +
  236 + contentDTO.objectId = item.targetId;
  237 + contentDTO.relType = item.targetRelType + "";
  238 + contentDTO.relId = item.targetRelId;
  239 + contentDTO.objectType = item.targetType + "";
  240 + contentDTO.newsTitle = item.targetTitle
  241 +
  242 + return contentDTO
  243 +}
@@ -368,7 +368,6 @@ export struct TopNavigationComponent { @@ -368,7 +368,6 @@ export struct TopNavigationComponent {
368 .alignItems(VerticalAlign.Center) 368 .alignItems(VerticalAlign.Center)
369 .justifyContent(FlexAlign.Center) 369 .justifyContent(FlexAlign.Center)
370 .onClick(() => { 370 .onClick(() => {
371 - TrackingButton.click("", TrackConstants.PageName.Search, "PEOPLE")  
372 WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 371 WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
373 }) 372 })
374 } 373 }
@@ -172,7 +172,8 @@ export struct TopNavigationComponentNew { @@ -172,7 +172,8 @@ export struct TopNavigationComponentNew {
172 .onClick(() => { 172 .onClick(() => {
173 if (NetworkUtil.isNetConnected()) { 173 if (NetworkUtil.isNetConnected()) {
174 ProcessUtils.gotoMorningEveningPaper() 174 ProcessUtils.gotoMorningEveningPaper()
175 - TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews) 175 + TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
  176 + TrackConstants.SummaryType.MorningAndEveningNews)
176 } else { 177 } else {
177 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000) 178 ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
178 } 179 }
@@ -240,7 +241,7 @@ export struct TopNavigationComponentNew { @@ -240,7 +241,7 @@ export struct TopNavigationComponentNew {
240 .width('24vp') 241 .width('24vp')
241 .height('24vp') 242 .height('24vp')
242 } 243 }
243 - .height('40vp') 244 + .height($r('app.float.top_tab_bar_height_common'))
244 .width('40vp') 245 .width('40vp')
245 .margin({ right: 10 }) 246 .margin({ right: 10 })
246 .alignItems(VerticalAlign.Center) 247 .alignItems(VerticalAlign.Center)
@@ -251,7 +252,9 @@ export struct TopNavigationComponentNew { @@ -251,7 +252,9 @@ export struct TopNavigationComponentNew {
251 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End } 252 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End }
252 }) 253 })
253 .onClick(() => { 254 .onClick(() => {
254 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 255 + TrackingButton.searchClick(TrackConstants.PageName.Search, "PEOPLE")
  256 + let params = { 'tabName': "PEOPLE" } as Record<string, string>
  257 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
255 }) 258 })
256 259
257 List({ scroller: this.listScroller }) { 260 List({ scroller: this.listScroller }) {
@@ -264,9 +267,9 @@ export struct TopNavigationComponentNew { @@ -264,9 +267,9 @@ export struct TopNavigationComponentNew {
264 .listDirection(Axis.Horizontal) 267 .listDirection(Axis.Horizontal)
265 .scrollBar(BarState.Off) 268 .scrollBar(BarState.Off)
266 .edgeEffect(EdgeEffect.None) 269 .edgeEffect(EdgeEffect.None)
267 - .height($r('app.float.top_tab_bar_height')) 270 + .height($r('app.float.top_tab_bar_height_common'))
268 .backgroundColor(this.barBackgroundColor) 271 .backgroundColor(this.barBackgroundColor)
269 - .padding({ top: 6 }) 272 + .margin({top:10})
270 .onAreaChange((oldValue: Area, newValue: Area) => { 273 .onAreaChange((oldValue: Area, newValue: Area) => {
271 let width = Number.parseFloat(newValue.width.toString()) 274 let width = Number.parseFloat(newValue.width.toString())
272 this.tabsWidth = Number.isNaN(width) ? 0 : width 275 this.tabsWidth = Number.isNaN(width) ? 0 : width
@@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent { @@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent {
8 Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { 8 Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
9 Button({type: ButtonType.Normal, stateEffect: false } ) { 9 Button({type: ButtonType.Normal, stateEffect: false } ) {
10 Stack() { 10 Stack() {
11 - Image(this.isAttention == '0'? $r('app.media.home_attention_no_left') : $r('app.media.home_attention_left')) 11 + Row()
12 .width('100%') 12 .width('100%')
13 .height('100%') 13 .height('100%')
14 - .objectFit(ImageFit.Cover) 14 + .backgroundColor(this.isAttention == '0'? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5'))
  15 + .borderRadius("5lpx")
15 Row() { 16 Row() {
16 if(this.isAttention == '0') { 17 if(this.isAttention == '0') {
17 if(this.isLoadingAttention) { 18 if(this.isLoadingAttention) {
@@ -78,8 +78,9 @@ export struct FirstTabTopSearchComponent { @@ -78,8 +78,9 @@ export struct FirstTabTopSearchComponent {
78 .backgroundImage($r('app.media.background_search')) 78 .backgroundImage($r('app.media.background_search'))
79 .backgroundImageSize(ImageSize.Cover) 79 .backgroundImageSize(ImageSize.Cover)
80 .onClick(() => { 80 .onClick(() => {
81 - TrackingButton.click("", TrackConstants.PageName.Search, "NEWS")  
82 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 81 + TrackingButton.searchClick( TrackConstants.PageName.Search, "NEWS")
  82 + let params = { 'tabName': "NEWS" } as Record<string, string>
  83 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
83 }) 84 })
84 } 85 }
85 } 86 }
1 import router from '@ohos.router' 1 import router from '@ohos.router'
2 import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit' 2 import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
  3 +import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
3 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 4 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
4 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem' 5 import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
5 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem' 6 import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
@@ -30,7 +31,8 @@ export struct SearchComponent { @@ -30,7 +31,8 @@ export struct SearchComponent {
30 @State relatedSearchContentsData: SearchRelatedItem[] = [] 31 @State relatedSearchContentsData: SearchRelatedItem[] = []
31 scroller: Scroller = new Scroller() 32 scroller: Scroller = new Scroller()
32 @State count:string[] = [] 33 @State count:string[] = []
33 - @State isGetRequest:boolean = false; 34 + @State isGetRequest:boolean = false
  35 + @Link fromTabName: string
34 36
35 aboutToAppear() { 37 aboutToAppear() {
36 //获取提示滚动 38 //获取提示滚动
@@ -175,6 +177,7 @@ export struct SearchComponent { @@ -175,6 +177,7 @@ export struct SearchComponent {
175 } 177 }
176 178
177 searchResData(content:string){ 179 searchResData(content:string){
  180 + trackSearchClick(this.fromTabName,content)
178 //赋值 181 //赋值
179 this.searchText = content 182 this.searchText = content
180 //保存搜索记录 183 //保存搜索记录
@@ -386,4 +389,16 @@ export struct SearchComponent { @@ -386,4 +389,16 @@ export struct SearchComponent {
386 this.isClickedInputSearch = false 389 this.isClickedInputSearch = false
387 this.isClickedHintSearch = false 390 this.isClickedHintSearch = false
388 } 391 }
  392 +}
  393 +
  394 +function trackSearchClick(upOneLevelPageName: string,keyword:string){
  395 + let params: ParamType = {}
  396 +
  397 + params["keyword"] = keyword
  398 + params["searchType"] = "0"
  399 + params["pageName"] = TrackConstants.PageName.Search
  400 + params["pageId"] = TrackConstants.PageName.Search
  401 + params["upOneLevelPageName"] = upOneLevelPageName
  402 +
  403 + Tracking.event("search_confirm_click", params)
389 } 404 }
1 import { DateTimeUtils } from 'wdKit/Index'; 1 import { DateTimeUtils } from 'wdKit/Index';
2 import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'; 2 import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
3 import { SearchComponent } from '../components/search/SearchComponent' 3 import { SearchComponent } from '../components/search/SearchComponent'
  4 +import { router } from '@kit.ArkUI';
4 5
5 @Entry 6 @Entry
6 @Component 7 @Component
7 struct SearchPage { 8 struct SearchPage {
  9 + @State params:Record<string, string> = router.getParams() as Record<string, string>;
  10 + @State fromTabName: string = 'NEWS';
8 pageShowTime:number = 0; 11 pageShowTime:number = 0;
9 pageHideTime:number = 0; 12 pageHideTime:number = 0;
10 13
11 onPageShow() { 14 onPageShow() {
  15 + this.fromTabName = this.params?.['tabName'];
12 this.pageShowTime = DateTimeUtils.getTimeStamp() 16 this.pageShowTime = DateTimeUtils.getTimeStamp()
13 } 17 }
14 18
@@ -21,7 +25,7 @@ struct SearchPage { @@ -21,7 +25,7 @@ struct SearchPage {
21 25
22 build() { 26 build() {
23 Column(){ 27 Column(){
24 - SearchComponent() 28 + SearchComponent({fromTabName:$fromTabName})
25 }.height('100%') 29 }.height('100%')
26 .width('100%') 30 .width('100%')
27 .backgroundColor($r('app.color.white')) 31 .backgroundColor($r('app.color.white'))
@@ -181,6 +181,10 @@ @@ -181,6 +181,10 @@
181 "value": "40vp" 181 "value": "40vp"
182 }, 182 },
183 { 183 {
  184 + "name": "top_tab_bar_height_common",
  185 + "value": "44vp"
  186 + },
  187 + {
184 "name": "top_tab_item_max_width", 188 "name": "top_tab_item_max_width",
185 "value": "300vp" 189 "value": "300vp"
186 }, 190 },
@@ -16,6 +16,13 @@ export class TrackingButton { @@ -16,6 +16,13 @@ export class TrackingButton {
16 Tracking.event("name_click", params) 16 Tracking.event("name_click", params)
17 } 17 }
18 18
  19 + static searchClick( pageId: string, pageName: string, extParams?: ParamType) {
  20 + let params = TrackingUtils.generateParams(extParams)
19 21
  22 + params["pageId"] = pageId
  23 + params["pageName"] = pageName
  24 +
  25 + Tracking.event("search_button_click ", params)
  26 + }
20 27
21 } 28 }
@@ -111,6 +111,7 @@ export struct VideoChannelPage { @@ -111,6 +111,7 @@ export struct VideoChannelPage {
111 }, (item: TopNavDTO) => item.channelId + '') 111 }, (item: TopNavDTO) => item.channelId + '')
112 } 112 }
113 .width('100%') 113 .width('100%')
  114 +
114 .justifyContent(FlexAlign.Center) 115 .justifyContent(FlexAlign.Center)
115 .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White) 116 .backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White)
116 117
@@ -128,13 +129,16 @@ export struct VideoChannelPage { @@ -128,13 +129,16 @@ export struct VideoChannelPage {
128 .alignItems(VerticalAlign.Center) 129 .alignItems(VerticalAlign.Center)
129 .justifyContent(FlexAlign.Center) 130 .justifyContent(FlexAlign.Center)
130 .onClick(() => { 131 .onClick(() => {
131 - TrackingButton.click("", TrackConstants.PageName.Search, "VIDEOS")  
132 - WDRouterRule.jumpWithPage(WDRouterPage.searchPage) 132 + TrackingButton.searchClick(TrackConstants.PageName.Search, "VIDEOS")
  133 + let params = { 'tabName': "VIDEOS" } as Record<string, string>
  134 + WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
133 }) 135 })
134 .backgroundColor(Color.Transparent) 136 .backgroundColor(Color.Transparent)
135 137
136 } 138 }
137 .zIndex(20) 139 .zIndex(20)
  140 + .height($r('app.float.top_tab_bar_height_common'))
  141 + .margin({top:10})
138 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) 142 .visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
139 143
140 } 144 }
@@ -172,6 +176,7 @@ export struct VideoChannelPage { @@ -172,6 +176,7 @@ export struct VideoChannelPage {
172 .cachedCount(-1) 176 .cachedCount(-1)
173 .displayCount(1, true) 177 .displayCount(1, true)
174 .alignSelf(ItemAlign.Start) 178 .alignSelf(ItemAlign.Start)
  179 + .effectMode(EdgeEffect.None)
175 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) 180 .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
176 .onChange((index: number) => { 181 .onChange((index: number) => {
177 this.currentTopNavSelectedIndex = index 182 this.currentTopNavSelectedIndex = index