张善主

Merge remote-tracking branch 'origin/main'

... ... @@ -11,6 +11,8 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
@Observed
export class ContentDTO implements BaseDTO {
seoTags?:string;
liveType?: string; // 直播新闻-直播状态
expIds: string = '';
itemId: string = '';
shareFlag?: string = '1';
... ... @@ -99,6 +101,8 @@ export class ContentDTO implements BaseDTO {
static clone(old: ContentDTO): ContentDTO {
let content = new ContentDTO();
content.liveType = old.liveType;
content.seoTags = old.seoTags;
content.appStyle = old.appStyle;
content.cityCode = old.cityCode;
content.coverSize = old.coverSize;
... ...
... ... @@ -239,15 +239,9 @@ export struct MorningEveningPaperComponent {
// WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
onPageShow(){
TrackingPageBrowseUtils.TrackingPageBrowseExposureStart()
}
onPageHide() {
this.status = PlayerConstants.STATUS_PAUSE;
this.playerController?.pause();
TrackingPageBrowseUtils.TrackingPageBrowseExposureEnd('','',TrackParamConvert.pageInfoBean_ParamType(this.pageInfoBean))
}
build() {
... ... @@ -259,11 +253,12 @@ export struct MorningEveningPaperComponent {
topicInfoView({ frontLinkObject: this.pageInfoBean?.topicInfo?.frontLinkObject })
}
if (this.audioPlayUrl.length > 0){
ListItem() {
this.AudioBarView(this.simpleAudioDialog)
}
}
//暂时不展示音频播报
// if (this.audioPlayUrl.length > 0){
// ListItem() {
// this.AudioBarView(this.simpleAudioDialog)
// }
// }
}
ListItem() {
... ...
... ... @@ -84,36 +84,74 @@ export struct CardMediaInfo {
// liveInfo.liveState 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
// 显示直播信息
Row() {
if (this.contentDTO?.liveInfo?.liveState === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'running') {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
// 搜索接口没有返回liveInfo字段所以得做个区分
if (this.contentDTO && this.contentDTO.liveInfo && JSON.stringify(this.contentDTO.liveInfo) === '{}') {
// 当liveInfo不存在的时候
if (this.contentDTO?.liveType === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
.mediaText()
} else if (this.contentDTO?.liveType === 'running') {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
})
.margin({
right: '2vp'
.margin({
right: '2vp'
})
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
Image($r('app.media.card_play'))
.mediaLogo()
Text('回看')
.mediaText()
}else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo
?.replayUri){
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO?.liveType === 'end' && this.contentDTO?.linkUrl) {
Image($r('app.media.card_play'))
.mediaLogo()
Text('回看')
.mediaText()
}else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.linkUrl){
Text('已结束')
.mediaText()
}
}else {
// 当liveInfo存在时后
if (this.contentDTO?.liveInfo?.liveState === 'wait') {
Image($r('app.media.card_wait'))
.mediaLogo()
Text('预约')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'running') {
LottieView({
name: 'live_status_wait',
path: "lottie/live_detail_living.json",
lottieWidth: 14,
lottieHeight: 14,
autoplay: true,
loop: true,
})
.margin({
right: '2vp'
})
// Image($r('app.media.card_live'))
// .mediaLogo()
Text('直播中')
.mediaText()
} else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo?.replayUri) {
Image($r('app.media.card_play'))
.mediaLogo()
Text('回看')
.mediaText()
}else if(this.contentDTO?.liveInfo?.liveState === 'end' && !this.contentDTO?.liveInfo
?.replayUri){
Text('已结束')
.mediaText()
}
}
if (!!this.joinPeopleNum) {
Text(' | ')
... ...
... ... @@ -58,7 +58,6 @@ export struct Card2Component {
Notes({ objectType: this.contentDTO.objectType }).height(30).align(Alignment.Center)
//Notes({ objectType: this.contentDTO.objectType })
}
Text() {
if (this.titleMarked) {
Span(this.str01)
... ...
... ... @@ -9,7 +9,7 @@
export struct Notes {
@State objectType: number | string = 5
@State newTags: string = ''
@State seoTags: string = ''
build() {
if (this.returnTypeTitleFn()) {
Text(this.returnTypeTitleFn())
... ...
... ... @@ -3,6 +3,9 @@ import { CommonConstants, ConfigConstants, ScreenType } from 'wdConstant';
import { Logger, ToastUtils, DateTimeUtils } from 'wdKit';
import { CompUtils } from '../../utils/CompUtils';
import { ProcessUtils, WDRouterRule } from 'wdRouter';
import { TrackConstants,
TrackingButton,
TrackingContent, TrackingPageBrowse, TrackParamConvert } from 'wdTracking/Index';
const TAG: string = 'CardView';
... ... @@ -528,6 +531,11 @@ export struct PaperSingleColumn999CardView {
.borderRadius(4)
.onClick(() => {
ProcessUtils.processPage(this.item)
TrackingContent.common(TrackConstants.EventType.Click,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
}).onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
TrackingContent.common(TrackConstants.EventType.Show,TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,TrackParamConvert.program(this.item))
}
})
}
... ...
... ... @@ -73,13 +73,14 @@ struct EditUserInfoPage {
.width('30')
.height('30')
}
}.margin({top:20,bottom:-10})
Button('点击更换头像')
.fontColor(Color.Gray)
.fontSize(15)
.backgroundColor(Color.White)
.margin(20)
}.margin({top:20,bottom:40})
///目前不支持头像上传,暂时屏蔽
// Button('点击更换头像')
// .fontColor(Color.Gray)
// .fontSize(15)
// .backgroundColor(Color.White)
// .margin(20)
List({}){
ForEach(this.listData,(item:EditListInfo,index:number) =>{
... ...
... ... @@ -14,7 +14,7 @@ import { CustomPullToRefresh } from '../reusable/CustomPullToRefresh';
import { MyCustomDialog } from '../reusable/MyCustomDialog'
import { NetworkUtil } from 'wdKit/Index';
import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils'
import { TrackConstants } from 'wdTracking/Index';
import { TrackConstants, TrackingButton, TrackingContent, TrackParamConvert } from 'wdTracking/Index';
@Entry
@Component
... ... @@ -36,6 +36,9 @@ struct MyCollectionListPage {
builder: MyCustomDialog({
confirm: () => {
this.deleteDatas()
if (this.isAllSelect) {
TrackingButton.click('morning_evening_news_click',TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect)
}
},
titleShow:false,
tipValue: this.isAllSelect?'是否确认清空?':'确认删除'+this.deleteNum.toString()+'条收藏'
... ... @@ -146,7 +149,14 @@ struct MyCollectionListPage {
Column() {
BigPicCardComponent({compDTO:new CompDTO,contentDTO:compDTO})
}
}
}.onVisibleAreaChange([0.0, 1.0], (isVisible: boolean, currentRatio: number) => {
if (isVisible) {
TrackingContent.common(TrackConstants.EventType.Show, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
}
})
// .onClick(()=>{
// TrackingContent.common(TrackConstants.EventType.Click, TrackConstants.PageName.My_Collect,TrackConstants.PageName.My_Collect, TrackParamConvert.program(compDTO))
// })
}
... ...
... ... @@ -8,6 +8,7 @@ import { FirstTabTopSearchComponent } from '../search/FirstTabTopSearchComponent
import { AssignChannelParam } from 'wdRouter/src/main/ets/utils/HomeChannelUtils';
import { PeopleShipMainComponent } from '../peopleShip/PeopleShipMainComponent';
import { channelSkeleton } from '../skeleton/channelSkeleton';
import { TrackConstants, TrackingButton } from 'wdTracking/Index';
const TAG = 'TopNavigationComponent';
... ... @@ -83,16 +84,16 @@ export struct TopNavigationComponentNew {
PeopleShipMainComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
pageId: navItem?.pageId + '',
channelId: navItem?.channelId + '',
})
} else
if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
pageId: navItem.pageId + '',
channelId: navItem.channelId + '',
pageId: navItem?.pageId + '',
channelId: navItem?.channelId + '',
autoRefresh: this.autoRefresh2Page
})
} else {
... ... @@ -171,6 +172,7 @@ export struct TopNavigationComponentNew {
.onClick(() => {
if (NetworkUtil.isNetConnected()) {
ProcessUtils.gotoMorningEveningPaper()
TrackingButton.click('morning_evening_news_click',TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews)
} else {
ToastUtils.showToast('网络出小差了,请检查网络后重试', 1000)
}
... ...
... ... @@ -458,7 +458,12 @@ export struct SearchResultContentComponent {
let rmhInfo = this.getRmhInfo(rem,value)
console.log('获取photos',JSON.stringify(photos))
console.log('获取value2',JSON.stringify(value))
let liveType = value.data?.liveType;
let seoTags = value.data?.seoTags
let contentDTO = new ContentDTO();
contentDTO.liveType = liveType?liveType: ""
contentDTO.seoTags = seoTags?seoTags: ""
// console.log('获取value333333333',JSON.stringify(contentDTO.liveType))
contentDTO.appStyle = value.data.appStyle + ""
contentDTO.cityCode = value.data.cityCode
contentDTO.coverSize = ""
... ...
... ... @@ -31,6 +31,7 @@ export struct PermissionDesComponent {
.border({ radius: 5 })
.margin({ top: 12 })
.padding(12)
.zIndex(20)
}
startDismiss() {
... ...
... ... @@ -13,6 +13,7 @@
"wdKit": "file:../../commons/wdKit",
"wdBean": "file:../../features/wdBean",
"wdRouter": "file:../../commons/wdRouter",
"wdTracking": "file:../../features/wdTracking",
"wdNetwork": "file:../../commons/wdNetwork"
}
}
\ No newline at end of file
... ...
... ... @@ -11,6 +11,7 @@ import { notificationManager } from '@kit.NotificationKit';
import { BusinessError } from '@kit.BasicServicesKit';
import { SpConstants } from 'wdConstant/Index';
import { PushContentBean, PushContentParser } from './PushContentParser';
import { ParamType, Tracking } from 'wdTracking/Index';
const TAG = "GetuiPush"
... ... @@ -220,6 +221,15 @@ export class GetuiPush {
this.lastPushContent = undefined
}
private trackingClick(content: PushContentBean) {
let param: ParamType = {
"pushResourceId": "",
"pushTitle": content.notifyTitle || "",
"pushContent": content.notifyContent || "",
}
Tracking.event("push_click", param)
}
private dealWithCmdMessage(result: GTCmdMessage) {
let action: Number = result.action;
if (action === PushConst.BIND_ALIAS_RESULT) {
... ...
... ... @@ -9,6 +9,8 @@ export interface PushContentBean {
want?: Want // want参数 (用来在消费时,回执)
online: boolean // 解析want,是否为在线消息(在线走的是个推通道,离线走的是华为厂商通道)
pushLink?: string // 解析want,对应pushLink参数
notifyTitle?: string
notifyContent?: string
}
/*
... ... @@ -66,7 +68,9 @@ export class PushContentParser {
if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
return {
isPush: true, online: true, pushLink: pushLink, want: want
isPush: true, online: true, pushLink: pushLink, want: want,
notifyTitle: gtData["title"] as string,
notifyContent: gtData["content"] as string,
}
}
}
... ... @@ -105,7 +109,9 @@ export class PushContentParser {
if (want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK]) {
let pushLink = want.parameters[PushContentParser.PUSH_PARAM_PUSH_LINK] as string
return {
isPush: true, online: false, pushLink: pushLink, want: want
isPush: true, online: false, pushLink: pushLink, want: want,
notifyTitle: want.parameters["title"] as string,
notifyContent: want.parameters["content"] as string,
}
}
}
... ...
... ... @@ -6,6 +6,7 @@ import { BusinessError } from '@kit.BasicServicesKit'
import { Logger, ToastUtils, CustomToast, EmitterUtils, EmitterEventId } from 'wdKit/Index'
import { LoginViewModel } from './LoginViewModel'
import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
import { TrackConstants, TrackingButton, TrackingPageBrowse } from 'wdTracking/Index'
const TAG = "OneKeyLoginPage"
... ... @@ -28,10 +29,35 @@ struct OneKeyLoginPage {
maskColor:"#00000000"
})
// 埋点计算页面浏览时长
private pageStartDate: number = 0
private pageName = TrackConstants.PageName.OneClick_Login
aboutToAppear(): void {
this.anonymousPhone = HuaweiAuth.sharedInstance().anonymousPhone||""
}
onPageShow(): void {
this.pageStartDate = Date.now()
}
onPageHide(): void {
const duration = (Date.now() - this.pageStartDate!)
TrackingPageBrowse.trackCommonPageExposureEnd(this.pageName, this.pageName, duration)
}
// pageTransition() {
// // 为目标页面时,进入:从右边侧滑入,退出:是右侧划出;跳转别的页面:左侧划出,返回:左侧划入。
// PageTransitionEnter({ type: RouteType.Push, duration: 300 })
// .slide(SlideEffect.Right)
// PageTransitionEnter({ type: RouteType.Pop, duration: 300 })
// .slide(SlideEffect.Left)
// PageTransitionExit({ type: RouteType.Push, duration: 300 })
// .slide(SlideEffect.Left)
// PageTransitionExit({ type: RouteType.Pop, duration: 300 })
// .slide(SlideEffect.Right)
// }
build() {
Column() {
this.CloseRow()
... ... @@ -39,14 +65,21 @@ struct OneKeyLoginPage {
Image($r("app.media.login_logo"))
.width(120)
.height(66)
.margin({ top: 78, bottom: 74})
.margin({ top: 34, bottom: 64})
.align(Alignment.Center)
Text(this.anonymousPhone)
.fontSize(30)
.fontWeight(600)
.fontColor("#222222")
.margin({bottom: 10})
.margin({bottom: 12})
.align(Alignment.Center)
Text("华为账号绑定号码")
.fontSize(12)
.fontWeight(400)
.fontColor("#999999")
.margin({bottom: 40})
.align(Alignment.Center)
this.ProtocolRow()
... ... @@ -68,21 +101,26 @@ struct OneKeyLoginPage {
if (!this.agreeProtocol) {
return
}
TrackingButton.click("oneClickLoginPageLoginButton", this.pageName, this.pageName)
this.requestLogin()
})
}
.padding({ left: 25, right: 25 })
.margin({top: 15})
.margin({top: 20})
Button("账号密码登录")
.type(ButtonType.Normal)
.align(Alignment.Center)
.foregroundColor("#666666")
.backgroundColor(Color.White)
.height(26)
.margin({top: 20})
.onClick((event) => {
router.replaceUrl({url: WDRouterPage.loginPage.url()})
})
}
.backgroundColor("#FFFFFF")
}
@Builder ProtocolRow() {
... ... @@ -126,8 +164,9 @@ struct OneKeyLoginPage {
.width(24)
.height(24)
.onClick(() => router.back())
}.margin({ top: 15, right: 15 })
}.margin({ top: 10, right: 16 })
.width("100%")
.height(44)
}
async requestLogin() {
... ...
import { MorningEveningPaperComponent } from 'wdComponent';
import { Logger, WindowModel } from 'wdKit';
import { DateTimeUtils, Logger, WindowModel } from 'wdKit';
import { TrackConstants, TrackingPageBrowse} from 'wdTracking/Index';
const TAG = 'MorningEveningPaperPage';
... ... @@ -7,6 +8,8 @@ const TAG = 'MorningEveningPaperPage';
@Component
struct MorningEveningPaperPage {
@State isPageShow: boolean = false
pageShowTime:number = 0;
pageHideTime:number = 0;
build() {
Column() {
MorningEveningPaperComponent()
... ... @@ -43,6 +46,7 @@ struct MorningEveningPaperPage {
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
}
this.pageShowTime = DateTimeUtils.getTimeStamp()
}
onPageHide() {
... ... @@ -50,6 +54,12 @@ struct MorningEveningPaperPage {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
this.isPageShow = true
Logger.info(TAG, 'onPageHide');
//早晚报埋点
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.SummaryType.MorningAndEveningNews,TrackConstants.SummaryType.MorningAndEveningNews,duration)
}
onBackPress() {
... ...
import { DeviceUtil, DisplayUtils, UpgradeTipContent } from 'wdKit/Index'
import { TrackConstants, TrackingButton } from 'wdTracking/Index'
@Preview
@CustomDialog
... ... @@ -35,6 +36,8 @@ export struct UpgradeTipDialog {
.margin({top: 24})
.onClick(() => {
this.controller.close()
TrackingButton.click("notUpdatedTemporarily", TrackConstants.PageName.Update, TrackConstants.PageName.Update)
if (this.cancel) {
this.cancel()
}
... ... @@ -88,6 +91,8 @@ export struct UpgradeTipDialog {
})
.onClick(() => {
this.controller.close()
TrackingButton.click("immediateUpdating", TrackConstants.PageName.Update, TrackConstants.PageName.Update)
if (this.confirm) {
this.confirm()
}
... ...