chengen02

Merge remote-tracking branch 'origin/main'

... ... @@ -181,6 +181,10 @@
"value": "40vp"
},
{
"name": "top_tab_bar_height_common",
"value": "44vp"
},
{
"name": "top_tab_item_max_width",
"value": "300vp"
},
... ...
... ... @@ -27,6 +27,7 @@ export struct Card5Component {
@State str03: string = '';
async aboutToAppear(): Promise<void> {
console.log('Card2Component', JSON.stringify(this.compDTO))
this.clicked = hasClicked(this.contentDTO.objectId)
this.loadImg = await onlyWifiLoadImg();
... ... @@ -47,9 +48,9 @@ export struct Card5Component {
Image(this.loadImg ? this.contentDTO.coverUrl : '')
.backgroundColor(0xf5f5f5)
.width(CommonConstants.FULL_WIDTH)
.autoResize(true)
.borderRadius($r('app.float.image_border_radius'))
if (this.titleShowPolicy === 1 || this.titleShowPolicy === null) {
.aspectRatio(343 / 225)
if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') {
Row()
.width(CommonConstants.FULL_WIDTH)
.height(59)
... ...
... ... @@ -5,9 +5,11 @@ import { MineAppointmentItem } from '../../../viewmodel/MineAppointmentItem';
import { LazyDataSource, StringUtils } from 'wdKit';
import MinePageDatasModel from '../../../model/MinePageDatasModel';
import { EmptyComponent } from '../../view/EmptyComponent';
import { Action } from 'wdBean/Index';
import { Action, ContentDTO } from 'wdBean/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { TrackingContent, TrackConstants, TrackParamConvert, ParamType } from 'wdTracking/Index';
import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils';
const TAG = "AppointmentListUI"
... ... @@ -77,7 +79,9 @@ export struct AppointmentListUI {
AppointmentListChildComponent({ item: item })
}
.onClick(() => {
//TODO 跳转
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live,TrackParamConvert.program(contentDTO))
let action = {
type:"2",
params:{
... ... @@ -90,6 +94,12 @@ export struct AppointmentListUI {
} as Action
WDRouterRule.jumpWithPage(WDRouterPage.detailPlayLiveCommon, action)
})
.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live, TrackParamConvert.program(contentDTO))
}
})
}, (item: MineAppointmentItem, index: number) => index.toString())
//没有更多数据 显示提示
... ... @@ -175,4 +185,15 @@ export struct AppointmentListUI {
console.log(TAG, JSON.stringify(dealData))
return dealData
}
}
\ No newline at end of file
}
function getParams(item: MineAppointmentItem) : ContentDTO{
let contentDTO = new ContentDTO();
contentDTO.objectType = item.relType + ""
contentDTO.objectId = item.liveId + ""
contentDTO.newsTitle = item.title
// contentDTO.channelId =
// contentDTO.rmhPlatform
return contentDTO
}
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@ import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { CommentLikeOperationRequestItem } from '../../../viewmodel/CommentLikeOperationRequestItem'
import { CommentListItem } from '../../../viewmodel/CommentListItem'
import measure from '@ohos.measure'
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index'
@Component
export struct ChildCommentComponent {
... ... @@ -16,6 +17,7 @@ export struct ChildCommentComponent {
@State isOverLines: boolean = false
@State isOverLinesParent: boolean = false
testText:string = "1,因为读书的人\n是低着头向上看的人\n身处一隅,却能放眼世界\n2,因为读书的人\n总是比不读书的人\n活得有趣一点\n3,因为读书的人\n即使平凡,绝不平庸"
@Link fromPage:number
build() {
Column() {
... ... @@ -195,11 +197,12 @@ export struct ChildCommentComponent {
}.height('69lpx')
.justifyContent(FlexAlign.Center)
.onClick(() => {
let content = new ContentDTO()
content.objectId = this.data.targetId;
content.relType = this.data.targetRelType + "";
content.relId = this.data.targetRelId;
content.objectType = this.data.targetType + "";
let content = getParams(this.data)
if(this.fromPage === 0 ){
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal,TrackParamConvert.program(content))
}else{
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal,TrackParamConvert.program(content))
}
ProcessUtils.processPage(content)
})
}
... ... @@ -284,3 +287,20 @@ function textStyle() {
.lineHeight('46lpx')
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...
... ... @@ -8,6 +8,8 @@ import { ChildCommentComponent } from './ChildCommentComponent';
import { MineCommentListDetailItem } from '../../../viewmodel/MineCommentListDetailItem';
import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherUserCommentLikeStatusRequestItem';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
const TAG = "HomePageBottomCommentComponent"
... ... @@ -83,9 +85,15 @@ export struct HomePageBottomCommentComponent {
ChildCommentComponent({
data: item,
levelHead: UserDataLocal.getUserLevelHeaderUrl(),
isLastItem: index === this.data_comment.totalCount() - 1
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:0
})
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Main_Personal,TrackConstants.PageName.Main_Personal, TrackParamConvert.program(contentDTO))
}
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
... ... @@ -217,4 +225,23 @@ export struct HomePageBottomCommentComponent {
this.isGetRequest = true
})
}
}
\ No newline at end of file
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...
... ... @@ -8,6 +8,8 @@ import { OtherUserCommentLikeStatusRequestItem } from '../../../viewmodel/OtherU
import { ChildCommentComponent } from './ChildCommentComponent';
import { EmptyComponent } from '../../view/EmptyComponent';
import { CustomPullToRefresh } from '../../reusable/CustomPullToRefresh';
import { ContentDTO } from 'wdBean/Index';
import { TrackingContent, TrackConstants, TrackParamConvert } from 'wdTracking/Index';
const TAG = "HomePageBottomComponent"
/**
... ... @@ -84,9 +86,15 @@ export struct OtherHomePageBottomCommentComponent {
ChildCommentComponent({
data: item,
levelHead: this.levelHead,
isLastItem: index === this.data_comment.totalCount() - 1
isLastItem: index === this.data_comment.totalCount() - 1,
fromPage:1
})
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
let contentDTO = getParams(item)
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.Customer_Personal,TrackConstants.PageName.Customer_Personal, TrackParamConvert.program(contentDTO))
}
})
}, (item: CommentListItem, index: number) => index.toString())
//没有更多数据 显示提示
... ... @@ -214,4 +222,22 @@ export struct OtherHomePageBottomCommentComponent {
this.isGetRequest = true
})
}
}
\ No newline at end of file
}
function getParams(item: CommentListItem) : ContentDTO{
let contentDTO = new ContentDTO();
// contentDTO.objectType = item.targetType + ""
// contentDTO.objectId = item.targetId + ""
// contentDTO.newsTitle = item.targetTitle
// contentDTO.channelId =
// contentDTO.rmhPlatform =
contentDTO.objectId = item.targetId;
contentDTO.relType = item.targetRelType + "";
contentDTO.relId = item.targetRelId;
contentDTO.objectType = item.targetType + "";
contentDTO.newsTitle = item.targetTitle
return contentDTO
}
... ...
... ... @@ -368,7 +368,6 @@ export struct TopNavigationComponent {
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.onClick(() => {
TrackingButton.click("", TrackConstants.PageName.Search, "PEOPLE")
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
})
}
... ...
... ... @@ -172,7 +172,8 @@ export struct TopNavigationComponentNew {
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
TrackingButton.click('morning_evening_news_click', TrackConstants.SummaryType.MorningAndEveningNews,
TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
... ... @@ -240,7 +241,7 @@ export struct TopNavigationComponentNew {
.width('24vp')
.height('24vp')
}
.height('40vp')
.height($r('app.float.top_tab_bar_height_common'))
.width('40vp')
.margin({ right: 10 })
.alignItems(VerticalAlign.Center)
... ... @@ -251,7 +252,9 @@ export struct TopNavigationComponentNew {
'right': { 'anchor': '__container__', 'align': HorizontalAlign.End }
})
.onClick(() => {
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
TrackingButton.searchClick(TrackConstants.PageName.Search, "PEOPLE")
let params = { 'tabName': "PEOPLE" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
})
List({ scroller: this.listScroller }) {
... ... @@ -264,9 +267,9 @@ export struct TopNavigationComponentNew {
.listDirection(Axis.Horizontal)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.height($r('app.float.top_tab_bar_height'))
.height($r('app.float.top_tab_bar_height_common'))
.backgroundColor(this.barBackgroundColor)
.padding({ top: 6 })
.margin({top:10})
.onAreaChange((oldValue: Area, newValue: Area) => {
let width = Number.parseFloat(newValue.width.toString())
this.tabsWidth = Number.isNaN(width) ? 0 : width
... ...
... ... @@ -8,10 +8,11 @@ export struct PeopleShipHomeAttentionComponent {
Flex({ alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Button({type: ButtonType.Normal, stateEffect: false } ) {
Stack() {
Image(this.isAttention == '0'? $r('app.media.home_attention_no_left') : $r('app.media.home_attention_left'))
Row()
.width('100%')
.height('100%')
.objectFit(ImageFit.Cover)
.backgroundColor(this.isAttention == '0'? $r('app.color.color_ED2800') : $r('app.color.color_F5F5F5'))
.borderRadius("5lpx")
Row() {
if(this.isAttention == '0') {
if(this.isLoadingAttention) {
... ...
... ... @@ -78,8 +78,9 @@ export struct FirstTabTopSearchComponent {
.backgroundImage($r('app.media.background_search'))
.backgroundImageSize(ImageSize.Cover)
.onClick(() => {
TrackingButton.click("", TrackConstants.PageName.Search, "NEWS")
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
TrackingButton.searchClick( TrackConstants.PageName.Search, "NEWS")
let params = { 'tabName': "NEWS" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
})
}
}
\ No newline at end of file
... ...
import router from '@ohos.router'
import { NetworkUtil, StringUtils, ToastUtils } from 'wdKit'
import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
import { SearchHistoryItem } from '../../viewmodel/SearchHistoryItem'
import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
... ... @@ -30,7 +31,8 @@ export struct SearchComponent {
@State relatedSearchContentsData: SearchRelatedItem[] = []
scroller: Scroller = new Scroller()
@State count:string[] = []
@State isGetRequest:boolean = false;
@State isGetRequest:boolean = false
@Link fromTabName: string
aboutToAppear() {
//获取提示滚动
... ... @@ -175,6 +177,7 @@ export struct SearchComponent {
}
searchResData(content:string){
trackSearchClick(this.fromTabName,content)
//赋值
this.searchText = content
//保存搜索记录
... ... @@ -386,4 +389,16 @@ export struct SearchComponent {
this.isClickedInputSearch = false
this.isClickedHintSearch = false
}
}
function trackSearchClick(upOneLevelPageName: string,keyword:string){
let params: ParamType = {}
params["keyword"] = keyword
params["searchType"] = "0"
params["pageName"] = TrackConstants.PageName.Search
params["pageId"] = TrackConstants.PageName.Search
params["upOneLevelPageName"] = upOneLevelPageName
Tracking.event("search_confirm_click", params)
}
\ No newline at end of file
... ...
import { DateTimeUtils } from 'wdKit/Index';
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index';
import { SearchComponent } from '../components/search/SearchComponent'
import { router } from '@kit.ArkUI';
@Entry
@Component
struct SearchPage {
@State params:Record<string, string> = router.getParams() as Record<string, string>;
@State fromTabName: string = 'NEWS';
pageShowTime:number = 0;
pageHideTime:number = 0;
onPageShow() {
this.fromTabName = this.params?.['tabName'];
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
... ... @@ -21,7 +25,7 @@ struct SearchPage {
build() {
Column(){
SearchComponent()
SearchComponent({fromTabName:$fromTabName})
}.height('100%')
.width('100%')
.backgroundColor($r('app.color.white'))
... ...
... ... @@ -181,6 +181,10 @@
"value": "40vp"
},
{
"name": "top_tab_bar_height_common",
"value": "44vp"
},
{
"name": "top_tab_item_max_width",
"value": "300vp"
},
... ...
... ... @@ -16,6 +16,13 @@ export class TrackingButton {
Tracking.event("name_click", params)
}
static searchClick( pageId: string, pageName: string, extParams?: ParamType) {
let params = TrackingUtils.generateParams(extParams)
params["pageId"] = pageId
params["pageName"] = pageName
Tracking.event("search_button_click ", params)
}
}
\ No newline at end of file
... ...
... ... @@ -111,6 +111,7 @@ export struct VideoChannelPage {
}, (item: TopNavDTO) => item.channelId + '')
}
.width('100%')
.justifyContent(FlexAlign.Center)
.backgroundColor(this.currentTopNavSelectedIndex === 0 ? Color.Transparent : Color.White)
... ... @@ -128,13 +129,16 @@ export struct VideoChannelPage {
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
.onClick(() => {
TrackingButton.click("", TrackConstants.PageName.Search, "VIDEOS")
WDRouterRule.jumpWithPage(WDRouterPage.searchPage)
TrackingButton.searchClick(TrackConstants.PageName.Search, "VIDEOS")
let params = { 'tabName': "VIDEOS" } as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
})
.backgroundColor(Color.Transparent)
}
.zIndex(20)
.height($r('app.float.top_tab_bar_height_common'))
.margin({top:10})
.visibility(this.displayDirection === DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
... ... @@ -172,6 +176,7 @@ export struct VideoChannelPage {
.cachedCount(-1)
.displayCount(1, true)
.alignSelf(ItemAlign.Start)
.effectMode(EdgeEffect.None)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
.onChange((index: number) => {
this.currentTopNavSelectedIndex = index
... ...