wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool: (38 commits)
  添加判空保护
  ref |> 调整一键登录页面UI
  ref |> 增加几处埋点
  fix:somebug
  fix:bug[17943] UI还原问题-【uat】开机进去首页,提示文案显示样式问题,看图
  fix(图片上传):意见反馈屏蔽上传图片功能
  desc:还原意见反馈 入口
  desc:屏蔽意见反馈
  fix(18055):健康频道>大专题卡详情页>动态视频详情页,页面展示异常
  feat:进入直播频道,直播中,横滑卡,显示了参加人数,android不显示
  feat: 兴趣卡埋点
  fix:bug[18050] UI还原问题-【uat】账号登录注册-登录注册-账号密码登录-忘记密码和登录文案和蓝湖大小不一致
  feat: 兴趣卡埋点
  ref |> 调整评论弹框滑动评论时,固定全部评论标题栏
  feat:一行双图卡 保护数据
  fix:bug[18058] UI还原问题-【uat】账号登录注册-登录注册-手机号和密码切换会闪烁
  ref |> 调整评论弹框弹出后,点击头像进号主页 评论弹框没有关闭问题
  ref |> 解决评论上拉多次后,出现默认页
  feat:直播大图卡加阴影
  fix(18056):号主-动态,只有动态图片时,不应展示null,见截图
  ...
Showing 84 changed files with 1126 additions and 400 deletions
... ... @@ -3,7 +3,7 @@
*/
export const enum CompStyle {
Label_03 = 'Label-03', // 标题卡:icon+文字
Label_03 = 'Label-03', // 标题卡:icon+文字
Carousel_Layout_02 = 'Carousel_Layout-02', // 直播轮播卡:直播
Single_Row_02 = 'Zh_Single_Row-02', // 通用横划卡:视频、直播、专题
Single_Row_03 = 'Single_Row-03', // 直播横划卡:直播
... ...
... ... @@ -64,4 +64,7 @@ export { MpaasUpgradeCheck, UpgradeTipContent } from './src/main/ets/mpaas/Mpaas
export { TingyunAPM } from './src/main/ets/tingyunAPM/TingyunAPM'
export { FastClickUtil } from './src/main/ets/utils/FastClickUtil';
\ No newline at end of file
export { FastClickUtil } from './src/main/ets/utils/FastClickUtil';
// export { PublicPopupDialogView } from "./src/main/ets/pubComps/dialog/PublicPopupDialogView"
export { PublicDialogManager, CloseAction } from "./src/main/ets/pubComps/dialog/PublicDialogManager"
\ No newline at end of file
... ...
export type CloseAction = () => void
export class PublicDialogManager {
private dialogControllers: CustomDialogController[] = []
private closeActions: CloseAction[] = []
private constructor() {
}
private static manager: PublicDialogManager
static shareInstance(): PublicDialogManager {
if (!PublicDialogManager.manager) {
PublicDialogManager.manager = new PublicDialogManager()
}
return PublicDialogManager.manager
}
openDialog(dialogController: CustomDialogController, closeAction: CloseAction) {
if (!dialogController) {
return
}
dialogController.open()
this.dialogControllers.push(dialogController)
this.closeActions.push(closeAction)
}
closeDialog(dialogController: CustomDialogController) {
if (!dialogController) {
return
}
dialogController.close()
const index = this.dialogControllers.indexOf(dialogController)
if (index != -1) {
this.dialogControllers.splice(index, 1)
this.closeActions.splice(index, 1)[0]()
}
}
closeLastDialog() {
const count = this.dialogControllers.length
if (count > 0) {
this.closeDialog(this.dialogControllers[count - 1])
}
}
}
\ No newline at end of file
... ...
import { PublicDialogManager } from './PublicDialogManager'
/*
* 公共自定义弹出框,上层赋值showPopup变量,决定是否显示
*
* 当上层需要关闭,调用 PublicDialogManager.shareInstance().closeDialog(dialogController) 关闭
*
* ===> customBuilder 当前传值有问题,用不了
*/
@Component
struct PublicPopupDialogView {
// 决定是否显示变量
@Link @Watch('showPopupAction') showPopup: boolean
// 自定义弹框的 @CustomDialog
private customBuilder: Object | null = null
private autoCancel: boolean = false
dialogController: CustomDialogController = new CustomDialogController({
builder: this.customBuilder,
autoCancel: this.autoCancel,
cancel: () => {
this.showPopup = false
},
customStyle: true,
alignment: DialogAlignment.Bottom,
})
showPopupAction(val: boolean) {
if (this.showPopup) {
PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction)
} else {
PublicDialogManager.shareInstance().closeDialog(this.dialogController)
}
}
@Builder emptyBuild() {
}
closeAction() {
this.showPopup = false
}
build() {
this.emptyBuild()
}
}
... ...
... ... @@ -5,12 +5,15 @@ import { BaseDTO } from './BaseDTO';
@Observed
export class CompDTO implements BaseDTO {
expIds: string = '';
itemId: string = '';
contentText?: string = '';
backgroundColor: string = '';
backgroundImgUrl: string = '';
cityCode: string = '';
compStyle: string = '';
compType: string = '';
cardItemId: string = '';
// dataSourceRequest: any[];
districtCode: string = '';
extraData?: string;
... ... @@ -44,7 +47,7 @@ export class CompDTO implements BaseDTO {
matInfo: CompAdvMatInfoBean = new CompAdvMatInfoBean
pageId?: string;
objectType?: string;
hasMore: number = 1
hasMore: number = 1;
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1'
... ...
... ... @@ -11,12 +11,17 @@ import { LiveRoomDataBean } from '../live/LiveRoomDataBean';
@Observed
export class ContentDTO implements BaseDTO {
seoTags?:string;
liveType?: string; // 直播新闻-直播状态
expIds: string = '';
itemId: string = '';
shareFlag?: string = '1';
appStyle: string = '';
cityCode: string = '';
coverSize: string = '';
coverType: number = -1;
coverUrl: string = '';
cnsTraceId: string = ''
description: string = '';
districtCode: string = '';
endTime: string = '';
... ... @@ -45,6 +50,8 @@ export class ContentDTO implements BaseDTO {
startTime: string = '';
subType: string = '';
subtitle: string = '';
sceneId: string = '';
subSceneId: string = '';
title: string = '';
vImageUrl: string = '';
screenType: string = '';
... ... @@ -94,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;
... ...
... ... @@ -97,4 +97,6 @@ export { PageRepository } from './src/main/ets/repository/PageRepository';
export { MultiPictureDetailViewModel } from './src/main/ets/viewmodel/MultiPictureDetailViewModel';
export { viewBlogItemInsightIntentShare } from './src/main/ets/utils/InsightIntentShare';
\ No newline at end of file
export { viewBlogItemInsightIntentShare } from './src/main/ets/utils/InsightIntentShare';
export { CommentListDialogView } from './src/main/ets/components/comment/view/CommentListDialog';
... ...
... ... @@ -23,6 +23,8 @@ import { SearchContentComponent } from './cardview/SearchContentComponent';
*/
@Component
export struct CardParser {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
... ... @@ -34,39 +36,39 @@ export struct CardParser {
contentBuilder(contentDTO: ContentDTO) {
// Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
if (!!contentDTO.contentText) {
SearchContentComponent({ contentDTO })
SearchContentComponent({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else {
if (contentDTO.appStyle === CompStyle.Card_02) {
Card2Component({ compDTO: this.compDTO, contentDTO })
Card2Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_03) {
Card3Component({ compDTO: this.compDTO, contentDTO })
Card3Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_04) {
Card4Component({ compDTO: this.compDTO, contentDTO })
Card4Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_05) {
Card5Component({ contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy})
Card5Component({ compDTO: this.compDTO, contentDTO, titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName})
} else if (contentDTO.appStyle === CompStyle.Card_06 || contentDTO.appStyle === CompStyle
.Card_13) {
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO })
Card6Component({ compDTO: this.compDTO, contentDTO: this.contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_10) {
Card10Component({ compDTO: this.compDTO, contentDTO })
Card10Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_11) {
Card11Component({ compDTO: this.compDTO, contentDTO })
Card11Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_12) {
Card12Component({ contentDTO })
Card12Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_14) {
Card14Component({ contentDTO })
Card14Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_15) {
Card15Component({ contentDTO })
Card15Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_16) {
Card16Component({ contentDTO })
Card16Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_17) {
Card17Component({ compDTO: this.compDTO, contentDTO })
Card17Component({ compDTO: this.compDTO, contentDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_19) {
Card19Component({ contentDTO })
Card19Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_20) {
Card20Component({ contentDTO })
Card20Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else if (contentDTO.appStyle === CompStyle.Card_21) {
Card21Component({ contentDTO })
Card21Component({ contentDTO, compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else {
// todo:组件未实现 / Component Not Implemented
// Text(contentDTO.appStyle)
... ...
... ... @@ -33,6 +33,8 @@ import { LiveHorizontalCardComponent } from './view/LiveHorizontalCardComponent'
*/
@Component
export struct CompParser {
@State pageId: string = '';
@State pageName: string = '';
@ObjectLink compDTO: CompDTO
@State compIndex: number = 0;
@State private pageModel: PageModel = new PageModel();
... ... @@ -71,26 +73,26 @@ export struct CompParser {
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
if (this.compDTO.operDataList.length > this.audioItems.length) {
ZhCarouselLayout01({ compDTO: this.compDTO })
ZhCarouselLayout01({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
}
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 &&
this.compDTO.imageScale === 2) { // && compDTO.name ==="横划卡"
LiveHorizontalCardComponent({ compDTO: this.compDTO })
LiveHorizontalCardComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_01 && this.compDTO.imageScale === 3) {
if (this.compDTO.operDataList.length > 1) {
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO })
HorizontalStrokeCardThreeTwoRadioForMoreComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
} else {
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO })
HorizontalStrokeCardThreeTwoRadioForOneComponent({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
}
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_02) {
ZhSingleRow02({ compDTO: this.compDTO })
ZhSingleRow02({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_03) {
ZhSingleRow03({ compDTO: this.compDTO })
ZhSingleRow03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_02) { //双列流小视频,一行两图卡 ->标题
//ZhGridLayout02({ compDTO: this.compDTO })
... ... @@ -98,34 +100,34 @@ export struct CompParser {
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Zh_Grid_Layout_02) { //双列流小视频,一行两图卡
ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList })
ZhGridLayout02NewsContent({ compDTO: this.compDTO, operDataList: this.compDTO.operDataList, pageId: this.pageId, pageName: this.pageName })
} else if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
ZhGridLayout03({ compDTO: this.compDTO })
ZhGridLayout03({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_04) {
ZhSingleRow04({ compDTO: this.compDTO })
ZhSingleRow04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_05) {
// ZhSingleRow05({ compDTO })
// Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Row_06) {
ZhSingleRow06({ compDTO: this.compDTO })
ZhSingleRow06({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_02) {
//头图卡 和comStyle 2相同,
Card5Component({ contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy })
Card5Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], titleShowPolicy: this.compDTO.titleShowPolicy, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_03) {
// 大图卡
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0] })
Card2Component({ compDTO: this.compDTO, contentDTO: this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Card_09) {
//时间链卡
Card9Component({ contentDTO:this.compDTO.operDataList[0] })
Card9Component({ compDTO: this.compDTO, contentDTO:this.compDTO.operDataList[0], pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_04) {
ZhSingleColumn04({ compDTO: this.compDTO })
ZhSingleColumn04({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_05) {
// ZhSingleColumn05({ compDTO: compDTO })
... ... @@ -133,14 +135,14 @@ export struct CompParser {
} else if (this.compDTO.compStyle === CompStyle.Zh_Single_Column_09) {
Divider().strokeWidth(3).color('#ffffff').padding({ left: 0, right: 0 }).margin({ top: -3 })
Divider().strokeWidth(6).color('#f5f5f5')
ZhSingleColumn09({ compDTO: this.compDTO })
ZhSingleColumn09({ compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName })
Divider().strokeWidth(6).color('#f5f5f5')
} else if (this.compDTO.compStyle === CompStyle.Card_Comp_Adv) { // 广告
AdvCardParser({ pageModel: this.pageModel, compDTO: this.compDTO })
//Text(`compIndex = ${compIndex}`).width('100%').fontSize('12fp').fontColor(Color.Red).padding({ left: 0, right: 0 })
Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
} else if (!Number.isNaN(Number(this.compDTO.compStyle))) {
CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO });
CardParser({ contentDTO: this.compDTO.operDataList[0], compDTO: this.compDTO, pageId: this.pageId, pageName: this.pageName });
Divider().strokeWidth(1).color('#f5f5f5').padding({ left: 16, right: 16 })
} else {
// Text(this.compDTO.compStyle)
... ...
... ... @@ -109,7 +109,7 @@ export struct DynamicDetailComponent {
//分割线
Image($r('app.media.ic_news_detail_division'))
.width('100%')
.height($r('app.float.margin_12'))
.height($r('app.float.margin_6'))
.padding({ left: $r('app.float.margin_16'), right: $r('app.float.margin_16') })
Stack({ alignContent: Alignment.Bottom }) {
if (!this.isNetConnected) {
... ...
import { Action, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean';
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO';
import { ContentDTO, NewspaperListItemBean, NewspaperPositionItemBean, Params } from 'wdBean';
import { StringUtils } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
import { ProcessUtils } from 'wdRouter';
import { newsSkeleton } from './skeleton/newsSkeleton';
@Component
... ... @@ -62,21 +61,15 @@ export struct ENewspaperItemComponent {
}
if (event.type === TouchType.Up) {
this.context.clearRect(0, 0, this.context.width, this.context.height)
if (this.itemBeanClicked && this.itemBeanClicked.newsId) {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
contentID: '' + this.itemBeanClicked.newsId,
pageID: 'IMAGE_TEXT_DETAIL',
extra: {
relType: this.itemBeanClicked.relType ?? '',
relId: '' + this.itemBeanClicked.relId,
sourcePage: '5'
} as ExtraDTO
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
if (this.itemBeanClicked != null && this.itemBeanClicked.newsId != 0) {
//公共跳转
let content: ContentDTO = {
objectId:this.itemBeanClicked.newsId+'',
objectType:this.itemBeanClicked.newsType+'',
relId:this.itemBeanClicked.relId+'',
relType:this.itemBeanClicked.relType ?? '0'
} as ContentDTO
ProcessUtils.processPage(content)
this.itemBeanClicked = {} as NewspaperPositionItemBean
}
}
... ... @@ -139,7 +132,6 @@ export struct ENewspaperItemComponent {
}
}
if (vp2px(x) > minX && vp2px(x) < maxX && vp2px(y) > minY && vp2px(y) < maxY) {
this.itemBeanClicked = itemBean;
return xys;
... ...
... ... @@ -108,15 +108,15 @@ export struct FeedBackActivity {
GridCol({
}) {
if(1 == feedbackImageItem.itemType){
Image($r('app.media.feekback_add'))
.width(60)
.height(60)
.onClick(async (event: ClickEvent) => {
if(await FastClickUtil.isMinDelayTime()){
return
}
this.callFilePickerSelectImage();
})
// Image($r('app.media.feekback_add'))
// .width(60)
// .height(60)
// .onClick(async (event: ClickEvent) => {
// if(await FastClickUtil.isMinDelayTime()){
// return
// }
// this.callFilePickerSelectImage();
// })
}else{
Stack({alignContent: Alignment.TopEnd}) {
Image(feedbackImageItem.picPath)
... ...
... ... @@ -12,13 +12,18 @@ import font from '@ohos.font';
*/
@Component
export struct CardMediaInfo {
@State livePeopleNum :boolean = true
@State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中
@State joinPeopleNum: number = 0;
// objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,
// 14动态图文,15动态视频16问政;100人民号,101标签
aboutToAppear(): void {
this.getJoinPeopleNum();
if(this.livePeopleNum){
this.getJoinPeopleNum();
}
font.registerFont({
familyName: 'BebasNeue',
... ... @@ -79,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(' | ')
... ...
... ... @@ -49,7 +49,7 @@ export struct CardAdvVideoComponent {
.borderColor($r('app.color.color_0D000000'))
//播放状态+时长
CardMediaInfo({
contentDTO: this.contentDTO
contentDTO: this.contentDTO, livePeopleNum:false,
})
}
.alignContent(Alignment.BottomEnd)
... ...
... ... @@ -5,6 +5,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 大专题卡--CompStyle: 10
... ... @@ -14,6 +15,8 @@ const TAG: string = 'Card10Component';
@Preview
@Component
export struct Card10Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@ObjectLink compDTO: CompDTO
... ... @@ -57,6 +60,7 @@ export struct Card10Component {
.textOverflow({ overflow: TextOverflow.Ellipsis })
.margin({ bottom: 19 })
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
}
... ... @@ -70,6 +74,7 @@ export struct Card10Component {
topRight: $r('app.float.image_border_radius')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
if (this.contentDTO.objectType == '5') {
... ... @@ -102,6 +107,7 @@ export struct Card10Component {
.justifyContent(FlexAlign.Center)
.margin({ top: 5 })
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
ProcessUtils.processPage(this.contentDTO)
})
}
... ...
... ... @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card11Component';
... ... @@ -14,6 +15,8 @@ const TAG = 'Card11Component';
*/
@Component
export struct Card11Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@ObjectLink compDTO: CompDTO
... ... @@ -78,6 +81,7 @@ export struct Card11Component {
})
.backgroundColor($r("app.color.white"))
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
import { ContentDTO } from 'wdBean';
import { ContentDTO, CompDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card12Component';
... ... @@ -13,6 +14,9 @@ const TAG = 'Card12Component';
*/
@Component
export struct Card12Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@State titleMarked: boolean = false;
... ... @@ -70,6 +74,7 @@ export struct Card12Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
import { ContentDTO } from 'wdBean';
import { ContentDTO, CompDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
... ... @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card14Component';
... ... @@ -14,6 +15,9 @@ const TAG = 'Card14Component';
*/
@Component
export struct Card14Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -89,6 +93,7 @@ export struct Card14Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
import { ContentDTO } from 'wdBean';
import { ContentDTO, CompDTO } from 'wdBean';
import { ProcessUtils } from 'wdRouter';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
... ... @@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card15Component';
... ... @@ -18,6 +19,9 @@ const TAG: string = 'Card15Component';
*/
@Component
export struct Card15Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -87,6 +91,7 @@ export struct Card15Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
import { ContentDTO } from 'wdBean';
import { ContentDTO, CompDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
... ... @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card16Component';
... ... @@ -19,6 +20,9 @@ interface fullColumnImgUrlItem {
*/
@Component
export struct Card16Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -88,6 +92,7 @@ export struct Card16Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -6,6 +6,7 @@ import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card17Component';
... ... @@ -14,6 +15,8 @@ const TAG = 'Card17Component';
*/
@Component
export struct Card17Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -106,6 +109,7 @@ export struct Card17Component {
}
.width(CommonConstants.FULL_WIDTH)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
let taskAction: Action = {
... ...
import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean } from 'wdBean';
import { ContentDTO, FullColumnImgUrlDTO, PhotoListBean, CompDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { ProcessUtils } from 'wdRouter';
import { CommonConstants } from 'wdConstant/Index';
import { CarderInteraction } from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card19Component';
... ... @@ -13,6 +14,9 @@ const TAG = 'Card19Component';
*/
@Component
export struct Card19Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO()
@State clicked: boolean = false;
@State titleMarked: boolean = false;
... ... @@ -48,7 +52,7 @@ export struct Card19Component {
.fontColor(0xED2800)
Span(this.str03)
} else {
Span(this.contentDTO.newsTitle)
Span(this.contentDTO.newsTitle=='null'?"":this.contentDTO.newsTitle)
}
}
.fontSize($r('app.float.font_size_18'))
... ... @@ -58,6 +62,7 @@ export struct Card19Component {
.width(CommonConstants.FULL_WIDTH)
.lineHeight(25)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
ProcessUtils.processPage(this.contentDTO)
})
... ... @@ -75,6 +80,7 @@ export struct Card19Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
import { ContentDTO } from 'wdBean';
import { ContentDTO, CompDTO } from 'wdBean';
import { RmhTitle } from '../cardCommon/RmhTitle'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { CommonConstants } from 'wdConstant/Index';
... ... @@ -6,6 +6,7 @@ import { ProcessUtils } from 'wdRouter';
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Card20Component';
... ... @@ -14,6 +15,9 @@ const TAG = 'Card20Component';
*/
@Component
export struct Card20Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@State titleMarked: boolean = false;
... ... @@ -72,6 +76,7 @@ export struct Card20Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ... @@ -98,7 +103,7 @@ struct createImg {
build() {
GridRow() {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1) {
if (this.contentDTO.fullColumnImgUrls[0].landscape === 1 || this.contentDTO.fullColumnImgUrls[0].weight > this.contentDTO.fullColumnImgUrls[0].height) {
// 横屏
GridCol({
span: { xs: 12 }
... ...
import { ContentDTO } from 'wdBean';
import { ContentDTO, CompDTO } from 'wdBean';
import { CommonConstants, CompStyle } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { RmhTitle } from '../cardCommon/RmhTitle'
... ... @@ -6,6 +6,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import {CarderInteraction} from '../CarderInteraction'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card6Component-Card13Component';
... ... @@ -14,6 +15,9 @@ const TAG: string = 'Card6Component-Card13Component';
*/
@Component
export struct Card21Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -80,6 +84,7 @@ export struct Card21Component {
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -6,8 +6,9 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick';
const TAG: string = 'Card2Component';
/**
... ... @@ -19,6 +20,8 @@ const TAG: string = 'Card2Component';
*/
@Component
export struct Card2Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -55,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)
... ... @@ -111,6 +113,7 @@ export struct Card2Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 卡片样式:"appStyle":"3"
... ... @@ -11,6 +13,8 @@ import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
*/
@Component
export struct Card3Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State clicked: boolean = false;
@ObjectLink compDTO: CompDTO
... ... @@ -71,6 +75,7 @@ export struct Card3Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -6,6 +6,8 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card4Component';
/**
... ... @@ -17,6 +19,8 @@ const TAG: string = 'Card4Component';
*/
@Component
export struct Card4Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -106,6 +110,7 @@ export struct Card4Component {
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from './notes';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card5Component';
... ... @@ -12,7 +14,10 @@ const TAG: string = 'Card5Component';
*/
@Component
export struct Card5Component {
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@ObjectLink compDTO: CompDTO
@Prop titleShowPolicy: number | string
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -96,6 +101,7 @@ export struct Card5Component {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -7,6 +7,7 @@ import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Logger } from 'wdKit/Index';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card6Component-Card13Component';
... ... @@ -15,6 +16,8 @@ const TAG: string = 'Card6Component-Card13Component';
*/
@Component
export struct Card6Component {
@State pageId: string = '';
@State pageName: string = '';
@State loadImg: boolean = false;
@State clicked: boolean = false;
@State titleMarked: boolean = false;
... ... @@ -104,6 +107,7 @@ export struct Card6Component {
}
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
import { ContentDTO, slideShows } from 'wdBean';
import { ContentDTO, slideShows, CompDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { Notes } from './notes';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { persistentStorage, hasClicked } from '../../utils/persistentStorage';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 时间链卡--CompStyle: 09
... ... @@ -13,6 +14,9 @@ const TAG: string = 'Card9Component';
@Component
export struct Card9Component {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
// @State loadImg: boolean = true;
@State clicked: boolean = false;
... ... @@ -22,6 +26,7 @@ export struct Card9Component {
@State str03: string = '';
async aboutToAppear(): Promise<void> {
console.log('Card9Component', JSON.stringify(this.contentDTO))
this.titleInit();
// this.loadImg = await onlyWifiLoadImg();
this.clicked = hasClicked(this.contentDTO.objectId)
... ... @@ -112,6 +117,7 @@ export struct Card9Component {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
persistentStorage(this.contentDTO.objectId);
ProcessUtils.processPage(this.contentDTO)
... ...
... ... @@ -3,7 +3,7 @@
*/
import { ContentDTO } from 'wdBean/Index';
const TAG: string = 'Card9Component';
const TAG: string = 'More_Comp';
@Entry
@Component
... ...
... ... @@ -4,6 +4,8 @@ import { ProcessUtils } from 'wdRouter';
import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG: string = 'Card4Component';
/**
... ... @@ -11,6 +13,9 @@ const TAG: string = 'Card4Component';
*/
@Component
export struct SearchContentComponent {
@ObjectLink compDTO: CompDTO
@State pageId: string = '';
@State pageName: string = '';
@State contentDTO: ContentDTO = new ContentDTO();
@State loadImg: boolean = false;
@State clicked: boolean = false;
... ... @@ -57,6 +62,7 @@ export struct SearchContentComponent {
.justifyContent(FlexAlign.Start)
.alignItems(HorizontalAlign.Start)
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
this.clicked = true;
ProcessUtils.processPage(this.contentDTO)
})
... ...
... ... @@ -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())
... ...
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource, StringUtils } from 'wdKit/Index';
import { DateTimeUtils, EmitterEventId, EmitterUtils, LazyDataSource,
PublicDialogManager,
StringUtils } from 'wdKit/Index';
import { commentItemModel, WDPublicUserType } from '../model/CommentModel';
import commentViewModel from '../viewmodel/CommentViewModel';
import { CommentText } from './CommentText';
... ... @@ -21,6 +23,7 @@ const testString = '因为读书的人\n是低着头向上看的人\n身处一
export struct CommentComponent {
private onCloseClick = () => {
}
showTitleComponent: boolean = true
@Prop showCloseIcon?: boolean = false
@State hasMore: boolean = true;
@State currentPage: number = 1;
... ... @@ -40,6 +43,9 @@ export struct CommentComponent {
@Prop @Watch("parentOnReachEnd") reachEndIncreament: number = 0
reachEndLoadMoreFinish?: () => void
// 是否在弹框中
@Provide inDialog: boolean = false
// 在自定义组件即将析构销毁时将dialogControlle置空
aboutToDisappear() {
this.dialogController = null // 将dialogController置空
... ... @@ -163,7 +169,9 @@ export struct CommentComponent {
build() {
Column() {
List({ scroller: this.listScroller }) {
ListItemGroup({ header: this.titleHeader() })
if (this.showTitleComponent) {
ListItemGroup({ header: this.titleHeader() })
}
if (!this.isComments) {
EmptyComponent({ emptyType: 17 })
... ... @@ -259,7 +267,7 @@ export struct CommentComponent {
this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + ''
}
if (commentListModel.list.length === 0) {
if (commentListModel.list.length === 0 && this.allDatas.totalCount() == 0) {
this.isComments = false
}
... ... @@ -299,6 +307,8 @@ struct ChildCommentItem {
@ObjectLink item: commentItemModel
@Consume contentDetailData: ContentDetailDTO
@Consume inDialog: boolean
build() {
Column() {
Row() {
... ... @@ -406,7 +416,12 @@ struct ChildCommentItem {
.margin({ left: 47 })
.alignContent(Alignment.Center)
.onClick(() => {
commentViewModel.jumpToAccountPage(this.item)
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
}
})
})
}
... ... @@ -514,6 +529,8 @@ struct commentHeaderView {
@Link dialogController: CustomDialogController | null
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
build() {
Column() {
Row() {
... ... @@ -607,7 +624,12 @@ struct commentHeaderView {
.margin({ left: 8 })
.alignContent(Alignment.Center)
.onClick(() => {
commentViewModel.jumpToAccountPage(this.item)
commentViewModel.jumpToAccountPage(this.item, () => {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
}
})
})
}
... ... @@ -640,6 +662,8 @@ struct commentFooterView {
@Link dialogController: CustomDialogController | null
@ObjectLink item: commentItemModel
@Consume inDialog: boolean
build() {
Row() {
... ... @@ -710,6 +734,9 @@ struct commentFooterView {
// 未登录,跳转登录
const user_id = HttpUtils.getUserId()
if (!user_id) {
if (this.inDialog) {
PublicDialogManager.shareInstance().closeLastDialog()
}
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
... ...
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { PublicDialogManager } from 'wdKit/Index'
import { TrackConstants } from 'wdTracking/Index'
import { OperRowListView } from '../../view/OperRowListView'
import { publishCommentModel } from '../model/PublishCommentModel'
import { CommentComponent } from './CommentComponent'
/// 评论列表弹框
@Component
export struct CommentListDialogView {
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link contentDetailData: ContentDetailDTO // 详情页传
@Link pageInfo: PageInfoDTO // 专题页传
onClose?: () => void
// @Consume pageId: TrackConstants.PageName
// @Consume pageName: TrackConstants.PageName
private dialogController: CustomDialogController = new CustomDialogController({
builder: CommentListDialog({
contentDetailData: this.contentDetailData,
pageInfo: this.pageInfo,
onClose: this.onClose
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.Bottom,
})
showCommentListChange(val: boolean) {
if (this.showCommentList) {
PublicDialogManager.shareInstance().openDialog(this.dialogController, this.closeAction.bind(this))
} else {
PublicDialogManager.shareInstance().closeDialog(this.dialogController)
}
}
closeAction() {
this.showCommentList = false
}
build() {
}
}
@CustomDialog
export struct CommentListDialog {
struct CommentListDialog {
/// 内部使用
@State private publishCommentModel: publishCommentModel = new publishCommentModel()
... ... @@ -15,12 +54,12 @@ export struct CommentListDialog {
@State windowHeight: number = AppStorage.get<number>('windowHeight') || 0
/// 外部初始化
@Consume contentDetailData: ContentDetailDTO // 详情页传
@Consume pageInfo: PageInfoDTO // 专题页传
@Link contentDetailData: ContentDetailDTO // 详情页传
@Link pageInfo: PageInfoDTO // 专题页传
onClose?: () => void
aboutToAppear(): void {
if (this.contentDetailData) {
if (this.contentDetailData.newsId) {
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
... ... @@ -33,40 +72,76 @@ export struct CommentListDialog {
this.operationButtonList.push('comment')
}
if (this.contentDetailData?.openLikes && this.contentDetailData?.likesStyle != 4) {
this.operationButtonList.push('like')
}
this.operationButtonList.push('collect')
this.operationButtonList.push('share')
}
if (this.pageInfo) {
//TODO: 专题的逻辑判断
}
}
build() {
Column() {
this.titleHeaderView()
CommentComponent({
publishCommentModel: this.publishCommentModel,
showCloseIcon: true,
fixedHeightMode: true,
onCloseClick: () => {
this.controller!.close()
if (this.onClose) {
this.onClose()
}
}
inDialog: true,
showTitleComponent: false
}).layoutWeight(1)
OperRowListView({
componentType: 1,
componentType: 4,
pageComponentType: 8,
showBackIcon: false,
operationButtonList: this.operationButtonList,
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: true,
styleType: 1,
inDialog: true,
dialogBeforeJumpOtherPageAction: () => {
PublicDialogManager.shareInstance().closeLastDialog()
}
})
}
.height(this.windowHeight - this.windowWidth * 9 / 16 + 'px')
.zIndex(1000)
.backgroundColor(Color.White)
}
@Builder titleHeaderView() {
Row() {
Row() {
Image($r('app.media.redLine'))
.height(16)
.width(3)
Text('全部评论')
.fontSize(18)// .fontColor('#222222')
.fontColor($r('app.color.color_222222'))
.fontWeight(FontWeight.Medium)
.margin({ left: 5 })
}
.margin({ left: 16 })
Image($r('app.media.close_button'))
.height(16)
.width(16)
.margin({ right: 16 })// .visibility(this.showCloseIcon ? Visibility.Visible : Visibility.Hidden)
.onClick(() => {
if (this.onClose) {
this.onClose()
}
})
}
.height(44)
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
}
}
\ No newline at end of file
... ...
... ... @@ -483,7 +483,7 @@ class CommentViewModel {
return false
}
jumpToAccountPage(commentItem: commentItemModel) {
jumpToAccountPage(commentItem: commentItemModel, beforeJump: () => void = () => {}) {
let url = HttpUrlUtils.getOtherUserDetailDataUrl()
let item : Record<string, string >= {}
... ... @@ -504,6 +504,7 @@ class CommentViewModel {
return
}
beforeJump()
if (result.data.userType === "1") { // 普通用户
let params: Record<string, string> = {'userId': result.data.userId};
WDRouterRule.jumpWithPage(WDRouterPage.otherNormalUserHomePagePage,params)
... ...
... ... @@ -7,6 +7,7 @@ import { EmptyComponent } from '../view/EmptyComponent';
import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Notes } from '../cardview/notes';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Carousel_Layout-01';
... ... @@ -41,6 +42,8 @@ class MyDataSource implements IDataSource {
@Component
export struct ZhCarouselLayout01 {
@State pageId: string = '';
@State pageName: string = '';
@StorageLink('currentBreakpoint') @Watch('watchCurrentBreakpoint') currentBreakpoint: string =
BreakpointConstants.BREAKPOINT_XS;
@State compDTO: CompDTO = {} as CompDTO
... ... @@ -149,6 +152,7 @@ export struct ZhCarouselLayout01 {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[this.swiperIndex], this.pageId, this.pageName)
Logger.info(TAG, `ZhCarouselLayout01 onClick event index: ${this.swiperIndex}`);
ProcessUtils.processPage(this.compDTO.operDataList[this.swiperIndex])
})
... ... @@ -196,7 +200,7 @@ struct CarouselLayout01CardView {
Column() {
// 这里用于展示轮播图右上角信息,这里只对直播类型的展示
if (this.item.objectType === '2' || this.item.objectType === '4') {
CardMediaInfo({ contentDTO: this.item })
CardMediaInfo({ contentDTO: this.item,livePeopleNum:false })
.width(CommonConstants.FULL_PARENT)
}
Blank()
... ...
... ... @@ -4,6 +4,7 @@ import { Logger } from 'wdKit/Index';
import { ProcessUtils } from 'wdRouter';
import PageViewModel from '../../viewmodel/PageViewModel';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
let listSize: number = 2;
... ... @@ -13,6 +14,8 @@ let listSize: number = 2;
*/
@Component
export struct ZhGridLayout02NewsContent {
@State pageId: string = '';
@State pageName: string = '';
@ObjectLink compDTO: CompDTO
@State operDataList: ContentDTO[] = []
@State loadImg: boolean = false;
... ... @@ -42,7 +45,7 @@ export struct ZhGridLayout02NewsContent {
buildItemCard(item: ContentDTO, index: number) {
Column() {
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.loadImg ? item.fullColumnImgUrls[0].url : '')
Image(this.loadImg ? item == undefined ? '' : item.fullColumnImgUrls[0].url : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.height(95)
... ... @@ -55,7 +58,12 @@ export struct ZhGridLayout02NewsContent {
.fontSize(12)
.fontWeight(400)
.fontColor(Color.White)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.textShadow({
radius: 2,
color: 'rgba(0,0,0,0.3)',
offsetX: 0,
offsetY: 2
})
.margin({
right: '5vp',
bottom: '5vp'
... ... @@ -74,6 +82,7 @@ export struct ZhGridLayout02NewsContent {
}
.width('100%')
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
... ...
... ... @@ -4,6 +4,7 @@ import { Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Grid_Layout-03';
const FULL_PARENT: string = '100%';
... ... @@ -18,6 +19,8 @@ let listSize: number = 4;
@Preview
@Component
export struct ZhGridLayout03 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
... ... @@ -73,6 +76,7 @@ export struct ZhGridLayout03 {
}
.width('100%')
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType === '11') {
ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle)
} else {
... ...
import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { ProcessUtils } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Single_Column-04';
... ... @@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-04';
*/
@Component
export struct ZhSingleColumn04 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
operDataList: ContentDTO[] = [
// {newsTitle: "民检普法课堂:正当防卫是什么正当防卫是什么正当防卫是什么正当防卫是什么?", tagWord: 1} as ContentDTO,
... ... @@ -83,6 +86,7 @@ export struct ZhSingleColumn04 {
.backgroundImage($r('app.media.rmh_theme_bg'))
.backgroundImageSize({ width: CommonConstants.FULL_WIDTH, height: CommonConstants.FULL_WIDTH })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
... ...
import { CommonConstants } from 'wdConstant';
import { Action, CompDTO, Params } from 'wdBean';
import { WDRouterRule } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick'
const TAG = 'Zh_Single_Column-05';
... ... @@ -10,6 +11,8 @@ const TAG = 'Zh_Single_Column-05';
*/
@Component
export struct ZhSingleColumn05 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
build() {
... ... @@ -29,6 +32,7 @@ export struct ZhSingleColumn05 {
.justifyContent(FlexAlign.Center)
.borderRadius($r('app.float.button_border_radius'))
.onClick(() => {
// InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName)
let taskAction: Action = {
type: 'JUMP_H5_BY_WEB_VIEW',
params: {
... ...
... ... @@ -5,6 +5,8 @@ import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { CommonConstants } from 'wdConstant/Index';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { Tracking, TrackingContent, TrackConstants, ParamType } from 'wdTracking';
import { TrackingUtils } from 'wdTracking/src/main/ets/common/TrackingUtils'
/**
* 兴趣卡
* Zh_Single_Column-09
... ... @@ -14,6 +16,8 @@ const TAG = 'Zh_Single_Column-09'
@Entry
@Component
export struct ZhSingleColumn09 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State activeIndexs: Array<number> = []
@State operDataList: ContentDTO[] = this.compDTO?.operDataList || []
... ... @@ -25,6 +29,43 @@ export struct ZhSingleColumn09 {
this.operDataList = this.shuffleArray(this.compDTO?.operDataList)
}
trackClick(type: 'close_interest_card_click' | 'interest_card_selecting_click') {
try {
const contentDTO = this.compDTO.operDataList[0];
const extParams: ParamType = {
'value': type === 'close_interest_card_click' ? 'closeInterestCard' : 'selectInterestCard',
'duration': 0,
'action': 'detailPageShow',
'shareChannel': '',
'contentName': '兴趣选项卡',
'contentType': this.compDTO.objectType || '',
'contentId': this.compDTO.objectId,
// 'channelSourceId': this.compDTO.channelId,
// 'contentShowChannelId': this.compDTO.channelId,
'regionName': 2, // 信息流:2
'componentType': this.compDTO.compStyle,
'sceneId': contentDTO.sceneId,
'subSceneId': contentDTO.subSceneId,
'cnsTraceId': contentDTO.cnsTraceId,
'cardItemId': this.compDTO.cardItemId,
'itemId': this.compDTO.itemId || contentDTO.itemId,
'expIds': this.compDTO.expIds || contentDTO.expIds,
}
if (type === 'interest_card_selecting_click') {
// extParams['interestOptions'] = this.operDataList.map(item => {
// return item.
// })
}
let params = TrackingUtils.generateParams(extParams);
params['pageId'] = this.pageId;
params['pageName'] = this.pageName;
TrackingUtils.fillPositionWith(params)
Tracking.event(type, params)
} catch (e) {
console.log('Zh_Single_Column-09', JSON.stringify(e))
}
}
getItemWidth(index: number) {
if (index % 4 === 0 || index % 4 === 3) {
return 80
... ... @@ -73,6 +114,7 @@ export struct ZhSingleColumn09 {
.margin({top: -10})
.padding({top: 0, bottom: 0, left: 0, right: 0})
.onClick(() => {
this.trackClick('interest_card_selecting_click')
if (this.activeIndexs.length > 0) {
this.selfClosed = true;
}
... ... @@ -142,6 +184,7 @@ export struct ZhSingleColumn09 {
.width(14)
.height(14)
.onClick(() => {
this.trackClick('close_interest_card_click')
this.selfClosed = true;
})
}
... ...
... ... @@ -6,6 +6,7 @@ import { CommonConstants } from 'wdConstant/Index';
import { ProcessUtils } from 'wdRouter';
import { HttpUtils } from 'wdNetwork/Index';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick'
/**
* 小视频横划卡
... ... @@ -15,6 +16,8 @@ const TAG = 'Zh_Single_Row-02'
@Component
export struct ZhSingleRow02 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
build() {
... ... @@ -26,7 +29,11 @@ export struct ZhSingleRow02 {
List() {
ForEach(this.compDTO.operDataList, (item: ContentDTO, index: number) => {
CreatorItem({
item
item,
index,
compDTO: this.compDTO,
pageId: this.pageId,
pageName: this.pageName
})
.margin({right: index === this.compDTO.operDataList.length - 1 ? $r('app.float.card_comp_pagePadding_lf') : 0})
})
... ... @@ -69,11 +76,6 @@ export struct ZhSingleRow02 {
Image($r("app.media.more"))
.width(14)
.height(14)
.onClick(() => {
// TODO 跳转的页面,定义的入参可能不合理。推荐id: 41
let params = {'index': "1"} as Record<string, string>
WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
})
}
.padding({
right: $r('app.float.card_comp_pagePadding_lf'),
... ... @@ -103,7 +105,11 @@ function textOverflowStyle(maxLine: number) {
@Component
struct CreatorItem {
@Prop pageId: string = '';
@Prop pageName: string = '';
@Prop compDTO: CompDTO
@Prop item: ContentDTO
@Prop index: number
@State rmhIsAttention: number = 0
@State loadImg: boolean = false;
... ... @@ -143,6 +149,7 @@ struct CreatorItem {
.borderRadius($r('app.float.image_border_radius'))
}
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.item, this.pageId, this.pageName)
ProcessUtils.processPage(this.item)
})
}
... ...
... ... @@ -9,6 +9,7 @@ import { LiveModel } from '../../viewmodel/LiveModel'
import { Logger, ToastUtils } from 'wdKit';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { SpConstants } from 'wdConstant/Index'
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 直播预约卡
... ... @@ -25,6 +26,8 @@ interface reserveReqItem {
@Entry
@Component
export struct ZhSingleRow03 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State isEndEdge: boolean = false;
// @State reserveStatus: reserveItem[] = []
... ... @@ -197,6 +200,7 @@ export struct ZhSingleRow03 {
.backgroundColor(0xf9f9f9)
.margin({right: 8})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
... ...
... ... @@ -2,6 +2,7 @@ import { CompDTO, ContentDTO } from 'wdBean';
import { CommonConstants } from 'wdConstant';
import { DateTimeUtils } from 'wdKit';
import { ProcessUtils } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 本地精选卡
... ... @@ -10,6 +11,8 @@ import { ProcessUtils } from 'wdRouter';
@Component
export struct ZhSingleRow04 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
build() {
... ... @@ -71,6 +74,7 @@ export struct ZhSingleRow04 {
top: 6
})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
}
... ...
... ... @@ -4,6 +4,7 @@ import { postInteractAccentionOperateParams } from 'wdBean';
import { PageRepository } from '../../repository/PageRepository';
import { CommonConstants } from 'wdConstant/Index';
import { HttpUtils } from 'wdNetwork/Index';
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 人民号横划卡
... ... @@ -14,6 +15,8 @@ const TAG = 'Zh_Single_Row-05'
@Entry
@Component
export struct ZhSingleRow05 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {
// objectTitle: '创作者推荐',
// operDataList: [
... ... @@ -83,8 +86,8 @@ export struct ZhSingleRow05 {
.height(14)
.onClick(() => {
// TODO 跳转的页面,定义的入参可能不合理。推荐id: 41
let params = {'index': "1"} as Record<string, string>;
WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
// let params = {'index': "1"} as Record<string, string>;
// WDRouterRule.jumpWithPage(WDRouterPage.followListPage, params)
})
}
.padding({
... ...
... ... @@ -10,6 +10,7 @@ import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailV
import commentViewModel from '../../components/comment/viewmodel/CommentViewModel';
import { commentItemModel } from '../../components/comment/model/CommentModel'
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick';
/**
* 精选评论卡
... ... @@ -19,6 +20,8 @@ const TAG = 'Zh_Single_Row-06'
@Entry
@Component
export struct ZhSingleRow06 {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State newsStatusOfUser: batchLikeAndCollectResult = {
likeStatus: '0'
... ... @@ -143,8 +146,6 @@ export struct ZhSingleRow06 {
Text(Number(this.newsStatusOfUser?.likeStatus) == 1 ? '已赞' : '点赞')
.fontSize(15)
.fontColor(0x999999)
.onClick(() => {
})
}
.onClick(() => {
this.toggleLikeStatus()
... ... @@ -160,6 +161,9 @@ export struct ZhSingleRow06 {
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor($r('app.color.white'))
.onClick(() => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
})
}
@Builder
... ...
import MinePageMoreFunctionModel from '../../viewmodel/MinePageMoreFunctionModel'
import { WDRouterRule, WDRouterPage, ProcessUtils } from 'wdRouter'
import { Params } from 'wdBean';
import { ToastUtils } from 'wdKit/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
@Component
... ...
import { TrackConstants, TrackingButton } from 'wdTracking/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { onlyWifiLoadImg } from '../../../utils/lazyloadImg'
import { AppointmentOperationRequestItem } from '../../../viewmodel/AppointmentOperationRequestItem'
... ... @@ -200,6 +201,10 @@ export struct AppointmentListChildComponent {
if (value != null) {
if (value.code === 0 || value.code.toString() === "0") {
this.item.isAppointment = !this.item.isAppointment
if(!this.item.isAppointment){
TrackingButton.click("mySavedLivePageUnSubscribe",TrackConstants.PageName.My_Saved_Live,TrackConstants.PageName.My_Saved_Live)
}
}
}
})
... ...
... ... @@ -2,6 +2,7 @@ import { SpConstants } from 'wdConstant/Index'
import { SPHelper, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { TrackConstants, TrackingContent } from 'wdTracking/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListDetailItem } from '../../../viewmodel/FollowListDetailItem'
import { FollowOperationRequestItem } from '../../../viewmodel/FollowOperationRequestItem'
... ... @@ -266,6 +267,12 @@ export struct FollowChildComponent{
this.data.status = this.data.status ==="0"?"1":"0"
UserDataLocal.setUserFollowOperation(this.data.creatorId+","+this.data.status)
if(this.data.status == "1"){//关注
TrackingContent.follow(true,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow)
}else {//取消关注
TrackingContent.follow(false,this.data.cnUserName,this.data.cnUserId,TrackConstants.PageName.My_Follow,TrackConstants.PageName.My_Follow)
}
}
}
})
... ...
import { EmitterUtils, EmitterEventId, Logger, NetworkUtil } from 'wdKit/Index'
import { ParamType, TrackConstants, Tracking } from 'wdTracking/Index'
import MinePageDatasModel from '../../../model/MinePageDatasModel'
import { FollowListItem } from '../../../viewmodel/FollowListItem'
import { CustomTitleUI } from '../../reusable/CustomTitleUI'
... ... @@ -70,6 +71,7 @@ export struct FollowFirstTabsComponent{
}.onClick(()=>{
this.currentIndex = index
this.controller.changeIndex(this.currentIndex)
trackTabFirstClick(item.directoryName)
})
.height('100%')
.margin({right:'9lpx'})
... ... @@ -103,6 +105,7 @@ export struct FollowFirstTabsComponent{
.animationDuration(0)
.onChange((index: number) => {
this.currentIndex = index
trackTabFirstClick(this.data[index].directoryName)
})
.width('100%')
.layoutWeight(1)
... ... @@ -117,4 +120,13 @@ export struct FollowFirstTabsComponent{
this.isConnectNetwork = c
}
}
}
\ No newline at end of file
}
function trackTabFirstClick(firstLevelTabName: string){
let params: ParamType = {}
params["firstLevelTabName"] = firstLevelTabName
params["pageName"] = TrackConstants.PageName.My_Follow
params["pageId"] = TrackConstants.PageName.My_Follow
Tracking.event("my_follow_page_tab_click", params)
}
\ No newline at end of file
... ...
... ... @@ -265,19 +265,24 @@ struct LiveMorePage {
.fontSize('12vp')
.fontWeight(400)
.fontColor(Color.White)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.margin({
right: '5vp'
})
Divider()
.vertical(true)
.strokeWidth(1)
.height('12vp')
.margin({ top: 2, bottom: 2 })
.color(Color.White)
// Divider()
// .vertical(true)
// .strokeWidth(1)
// .height('12vp')
// .margin({ top: 2, bottom: 2 })
// .color(Color.White)
Image($r('app.media.icon_comp_line_live')).height('11vp').width('1.5vp')
if (this.getLiveRoomNumber(item).length > 0) {
Text(this.getLiveRoomNumber(item))
.fontSize('12vp')
.fontWeight(400)
.textShadow({ radius: 2, color: 'rgba(0,0,0,0.3)', offsetX: 0, offsetY: 2 })
.fontColor(Color.White)
.margin({
left: '5vp'
... ...
... ... @@ -2,7 +2,7 @@ import { CommonConstants, ViewType } from 'wdConstant';
import { Logger } from 'wdKit';
import { EmptyComponent } from '../view/EmptyComponent';
import PageModel from '../../viewmodel/PageModel';
import { autoRefresh, listTouchEvent } from '../../utils/PullDownRefresh';
import { autoRefresh, onActionEnd, onActionStart, onActionUpdate } from '../../utils/PullDownRefresh';
import LoadMoreLayout from './LoadMoreLayout';
import { CompParser } from '../CompParser';
import { CompDTO } from 'wdBean';
... ... @@ -14,9 +14,6 @@ import PageNoMoreLayout from './PageNoMoreLayout';
import { NoMoreBean } from './NoMoreBean';
import { RefreshLayoutBean } from '../refresh/RefreshLayoutBean';
import RefreshLayout from '../refresh/RefreshLayout';
import json from '@ohos.util.json';
import { viewBlogInsightIntentShare, ActionMode } from '../../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
const TAG = 'PageComponent';
@Component
... ... @@ -31,6 +28,7 @@ export struct PageComponent {
// 自动刷新通知
@Prop @Watch('onAutoRefresh') autoRefresh: number = 0
private listScroller: Scroller = new Scroller();
private panOption: PanGestureOptions = new PanGestureOptions({ direction: PanDirection.Up | PanDirection.Down })
needload: boolean = true;
build() {
Column() {
... ... @@ -51,13 +49,26 @@ export struct PageComponent {
}
.width(CommonConstants.FULL_PARENT)
.height(CommonConstants.FULL_PARENT)
.onTouch((event: TouchEvent | undefined) => {
if (event) {
if (this.pageModel.viewType === ViewType.LOADED) {
listTouchEvent(this.pageModel, this.pageAdvModel, event);
}
}
})
// .onTouch((event: TouchEvent | undefined) => {
// if (event) {
// if (this.pageModel.viewType === ViewType.LOADED) {
// listTouchEvent(this.pageModel, this.pageAdvModel, event);
// }
// }
// })
// 对接新的下拉刷新手势,替换touch事件
.parallelGesture(
PanGesture(this.panOption)
.onActionStart((event?: GestureEvent) => {
onActionStart(this.pageModel, this.pageAdvModel, event)
})
.onActionUpdate((event?: GestureEvent) => {
onActionUpdate(this.pageModel, this.pageAdvModel, event)
})
.onActionEnd(() => {
onActionEnd(this.pageModel, this.pageAdvModel)
})
)
}
... ...
... ... @@ -546,45 +546,45 @@ export struct TopNavigationComponent {
return null
}
private getTextInfo(index: number): Record<string, number> {
let strJson = getInspectorByKey(index.toString())
try {
let obj: Record<string, string> = JSON.parse(strJson)
let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')
return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }
} catch (error) {
return { 'left': 0, 'width': 0 }
}
}
private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {
let nextIndex = index
if (index > 0 && event.currentOffset > 0) {
nextIndex--
} else if (index < 3 && event.currentOffset < 0) {
nextIndex++
}
let indexInfo = this.getTextInfo(index)
let nextIndexInfo = this.getTextInfo(nextIndex)
let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)
let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。
let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio
let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio
return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }
}
private startAnimateTo(duration: number, leftMargin: number, width: number) {
animateTo({
duration: duration, // 动画时长
curve: Curve.Linear, // 动画曲线
iterations: 1, // 播放次数
playMode: PlayMode.Normal, // 动画模式
onFinish: () => {
console.info('play end')
}
}, () => {
this.indicatorLeftMargin = leftMargin
this.indicatorWidth = width
})
}
// private getTextInfo(index: number): Record<string, number> {
// let strJson = getInspectorByKey(index.toString())
// try {
// let obj: Record<string, string> = JSON.parse(strJson)
// let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')
// return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }
// } catch (error) {
// return { 'left': 0, 'width': 0 }
// }
// }
//
// private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {
// let nextIndex = index
// if (index > 0 && event.currentOffset > 0) {
// nextIndex--
// } else if (index < 3 && event.currentOffset < 0) {
// nextIndex++
// }
// let indexInfo = this.getTextInfo(index)
// let nextIndexInfo = this.getTextInfo(nextIndex)
// let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)
// let currentIndex = swipeRatio > 0.5 ? nextIndex : index // 页面滑动超过一半,tabBar切换到下一页。
// let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatio
// let currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatio
// return { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }
// }
// private startAnimateTo(duration: number, leftMargin: number, width: number) {
// animateTo({
// duration: duration, // 动画时长
// curve: Curve.Linear, // 动画曲线
// iterations: 1, // 播放次数
// playMode: PlayMode.Normal, // 动画模式
// onFinish: () => {
// console.info('play end')
// }
// }, () => {
// this.indicatorLeftMargin = leftMargin
// this.indicatorWidth = width
// })
// }
}
\ No newline at end of file
... ...
... ... @@ -84,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 {
... ...
... ... @@ -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 = ""
... ...
import { CommonConstants } from 'wdConstant'
import { ContentDTO, CompDTO, Action, Params } from 'wdBean'
import { ProcessUtils, WDRouterRule, WDRouterPage } from 'wdRouter';
import { InfomationCardClick } from '../../utils/infomationCardClick';
@Component
export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
@State compDTO: CompDTO = {} as CompDTO
@State pageId: string = '';
@State pageName: string = '';
build() {
Column() {
... ... @@ -76,6 +79,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForMoreComponent {
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
// .offset({x:16})
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
ProcessUtils.processPage(item)
})
})
... ...
... ... @@ -3,9 +3,12 @@ import { WDRouterRule } from 'wdRouter/Index'
import { Logger } from 'wdKit/Index'
import { ExtraDTO } from 'wdBean/src/main/ets/bean/component/extra/ExtraDTO'
import { LiveModel } from '../../viewmodel/LiveModel'
import { InfomationCardClick } from '../../utils/infomationCardClick';
@Component
export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State clicked: boolean = false;
... ... @@ -64,6 +67,7 @@ export struct HorizontalStrokeCardThreeTwoRadioForOneComponent {
.backgroundColor($r("app.color.white"))
.margin({ bottom: 8 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
this.clicked = true;
this.gotoLive(this.compDTO?.operDataList[0])
})
... ...
... ... @@ -9,10 +9,13 @@ import { LiveModel } from '../../viewmodel/LiveModel'
import { ContentConstants } from '../../constants/ContentConstants'
import { ProcessUtils } from 'wdRouter';
import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
import { InfomationCardClick } from '../../utils/infomationCardClick';
@Component
export struct LiveHorizontalCardComponent {
@State pageId: string = '';
@State pageName: string = '';
@State compDTO: CompDTO = {} as CompDTO
@State loadImg: boolean = false;
... ... @@ -78,6 +81,7 @@ export struct LiveHorizontalCardComponent {
.borderRadius(4)
.objectFit(ImageFit.Cover)
CardMediaInfo({
livePeopleNum:false,
contentDTO: item
})
}
... ... @@ -95,6 +99,7 @@ export struct LiveHorizontalCardComponent {
}
.padding({ left: (index == 0) ? 16 : 0, right: (index == this.compDTO.operDataList.length - 1) ? 16 : 0 })
.onClick(() => {
InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
if (item.objectType != '0') {
console.log(item.objectId)
this.gotoLive(item)
... ...
... ... @@ -15,7 +15,7 @@ export struct LiveHorizontalCardForOneComponent {
.borderRadius(4)
.objectFit(ImageFit.Cover)
CardMediaInfo({
contentDTO: this.contentDTO
contentDTO: this.contentDTO, livePeopleNum:false,
})
}
... ...
... ... @@ -57,7 +57,7 @@ export struct LiveHorizontalReservationComponent {
.borderRadius(4)
.objectFit(ImageFit.Cover)
CardMediaInfo({
contentDTO: item
contentDTO: item, livePeopleNum:false,
})
}
... ...
... ... @@ -50,6 +50,10 @@ export struct OperRowListView {
}
private onCommentIconClick: () => void = () => {
}
@Provide inDialog: boolean = false
private dialogBeforeJumpOtherPageAction: () => void = () => {}
@Prop @Watch('onDetailUpdated') contentDetailData: ContentDetailDTO // 稿件详情
/**
* 组件样式类型,根据详情页类型传值,组件内部根据样式展现类型做判断
... ... @@ -88,8 +92,7 @@ export struct OperRowListView {
@State dialogController: CustomDialogController | null = null;
async aboutToAppear() {
console.info(TAG, '22222----', this.styleType)
console.info(TAG, '3333----', this.needLike)
console.info(TAG, 'this.needLike', this.needLike)
this.handleStyle()
this.onDetailUpdated()
EmitterUtils.receiveEvent(EmitterEventId.AUDIO_CHANGE_STATUS, (val: number | string | undefined) => {
... ... @@ -108,7 +111,7 @@ export struct OperRowListView {
}
async onDetailUpdated() {
console.info(TAG, '111111----', this.styleType)
console.info(TAG, 'this.styleType', this.styleType)
this.handleStyle()
if (!this.contentDetailData) {
return
... ... @@ -234,23 +237,23 @@ export struct OperRowListView {
left: 16
})
if (this.showCommentIcon) {
if (this.showCommentIcon // 页面控制开关,直播传false
&& this.contentDetailData.openComment == 1 // 内容开关
&& this.publishCommentModel?.targetId) {
Column() {
if (this.publishCommentModel?.targetId) {
CommentIconComponent({
publishCommentModel: this.publishCommentModel,
styleType: this.styleType,
contentDetail: this.contentDetailData
})
.onClick(() => {
this.onCommentIconClick()
CommentIconComponent({
publishCommentModel: this.publishCommentModel,
styleType: this.styleType,
contentDetail: this.contentDetailData
})
.onClick(() => {
this.onCommentIconClick()
console.log(JSON.stringify(this.dialogController?.open))
console.log(JSON.stringify(this.dialogController?.open))
// 评论弹框内部嵌入
!this.showBackIcon && this.dialogController?.open()
})
}
// 评论弹框内部嵌入
!this.showBackIcon && this.dialogController?.open()
})
}
.width(48)
}
... ... @@ -380,7 +383,7 @@ export struct OperRowListView {
{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
}
]
}
... ... @@ -397,7 +400,6 @@ export struct OperRowListView {
* 收藏、取消收藏
*/
async toggleCollectStatus() {
console.log(TAG, '收藏点击')
// 未登录,跳转登录
const user_id = await SPHelper.default.get(SpConstants.USER_ID, '')
console.log(TAG, '收藏点击,登录', user_id)
... ... @@ -411,15 +413,13 @@ export struct OperRowListView {
contentList: [{
contentId: this.contentDetailData?.newsId + '',
contentType: this.contentDetailData?.newsType + '',
relType: this.contentDetailData?.reLInfo?.relType + '',
contentRelId: this.contentDetailData?.reLInfo?.relId + '',
relType: this.contentDetailData?.reLInfo?.relType || '' + '',
contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
}],
}
// console.log(TAG, '收藏点击', JSON.stringify(params))
console.log(TAG, '收藏点击', JSON.stringify(params))
PageRepository.postExecuteCollectRecord(params).then(res => {
console.log(TAG, '收藏点击 res', JSON.stringify(res))
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
if (this.newsStatusOfUser) {
this.newsStatusOfUser.collectStatus = this.newsStatusOfUser?.collectStatus === 1 ? 0 : 1
if (this.newsStatusOfUser.collectStatus === 1) {
... ... @@ -427,6 +427,7 @@ export struct OperRowListView {
}
this.queryContentInteractCount()
}
console.log(TAG, '收藏点击 this.newsStatusOfUser', JSON.stringify(this.newsStatusOfUser))
})
}
... ...
... ... @@ -31,6 +31,7 @@ export struct PermissionDesComponent {
.border({ radius: 5 })
.margin({ top: 12 })
.padding(12)
.zIndex(20)
}
startDismiss() {
... ...
... ... @@ -96,7 +96,7 @@ class MinePageDatasModel{
* 包含名字和图标
*/
getMoreFunctionsData():MinePageCreatorFunctionsItem[]{
if(this.moreData.length === 5){
if(this.moreData.length === 3){
return this.moreData
}
// this.moreData.push(new MinePageMoreFunctionModel("扫一扫",$r('app.media.mine_scan')))
... ...
... ... @@ -4,7 +4,88 @@ import PageModel from '../viewmodel/PageModel';
import PageHelper from '../viewmodel/PageHelper';
import PageAdModel from '../viewmodel/PageAdvModel';
import { LoadStatus } from '../components/refresh/RefreshLayoutBean';
import { Logger } from 'wdKit/Index';
const TAG = 'PullDownRefresh'
/***********新的下拉、上拉手势 start **********/
export function onActionStart(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) {
if (event === undefined) {
return
}
pageModel.downY = event.offsetY;
pageModel.lastMoveY = event.offsetY;
}
export function onActionUpdate(pageModel: PageModel, pageAdvModel: PageAdModel, event?: GestureEvent) {
if (event === undefined) {
return
}
if ((pageModel.isRefreshing === true) || (pageModel.isLoading === true)) {
return;
}
let isDownPull = event.offsetY - pageModel.lastMoveY > 0;
if (((isDownPull === true) || (pageModel.isPullRefreshOperation === true)) &&
(pageModel.isCanLoadMore === false)) {
actionUpdatePullRefresh(pageModel, event);
} else {
actionUpdateLoadMore(pageModel, event);
}
pageModel.lastMoveY = event.offsetY;
}
export function onActionEnd(pageModel: PageModel, pageAdvModel: PageAdModel) {
if ((pageModel.isRefreshing === true) || (pageModel.isLoading === true)) {
return;
}
if ((pageModel.isPullRefreshOperation === true)) {
touchUpPullRefresh(pageModel, pageAdvModel);
} else {
// touchUpLoadMore(pageModel);
}
}
export function actionUpdatePullRefresh(pageModel: PageModel, event: GestureEvent) {
if (pageModel.startIndex === 0) {
pageModel.isPullRefreshOperation = true;
let height = vp2px(Const.CUSTOM_REFRESH_DECIDE_HEIGHT);
pageModel.offsetY = event.offsetY - pageModel.downY;
if (pageModel.offsetY >= height) {
pullRefreshState(pageModel, RefreshState.Release);
pageModel.offsetY = height + pageModel.offsetY * Const.Y_OFF_SET_COEFFICIENT;
} else {
pullRefreshState(pageModel, RefreshState.DropDown);
}
if (pageModel.offsetY < 0) {
pageModel.offsetY = 0;
pageModel.isPullRefreshOperation = false;
}
}
}
export function actionUpdateLoadMore(model: PageModel, event: GestureEvent) {
// list size +1
if (model.endIndex >= model.compList.totalCount() - 3 && model.endIndex <= model.compList.totalCount()) {
// model.offsetY = event.touches[0].y - model.downY;
// if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) {
// model.isCanLoadMore = true;
// model.isVisiblePullUpLoad = true;
// model.offsetY = -vp2px(model.pullUpLoadHeight) + model.offsetY * Const.Y_OFF_SET_COEFFICIENT;
// }
// 不用分页动画,直接预加载
model.isCanLoadMore = true;
model.isVisiblePullUpLoad = true;
touchUpLoadMore(model);
}
}
/***********新的下拉、上拉手势 end **********/
//下拉刷新上拉加载更多组件
/**
* @deprecated
*/
export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel, event: TouchEvent) {
switch (event.type) {
case TouchType.Down:
... ... @@ -16,7 +97,8 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel,
return;
}
let isDownPull = event.touches[0].y - pageModel.lastMoveY > 0;
if (((isDownPull === true) || (pageModel.isPullRefreshOperation === true)) && (pageModel.isCanLoadMore === false)) {
if (((isDownPull === true) || (pageModel.isPullRefreshOperation === true)) &&
(pageModel.isCanLoadMore === false)) {
// Finger movement, processing pull-down refresh.
touchMovePullRefresh(pageModel, event);
} else {
... ... @@ -44,6 +126,9 @@ export function listTouchEvent(pageModel: PageModel, pageAdvModel: PageAdModel,
}
}
/**
* @deprecated
*/
export function touchMovePullRefresh(pageModel: PageModel, event: TouchEvent) {
if (pageModel.startIndex === 0) {
pageModel.isPullRefreshOperation = true;
... ... @@ -73,11 +158,22 @@ export function touchUpPullRefresh(pageModel: PageModel, pageAdvModel: PageAdMod
let advSelf: PageAdModel = pageAdvModel;
PageHelper.refreshUI(self, advSelf)
}, Const.DELAY_TIME);
setRefreshTimeoutTimer(pageModel)
} else {
closeRefresh(pageModel, false);
}
}
export function setRefreshTimeoutTimer(pageModel: PageModel) {
let timeoutId = setTimeout(() => {
closeRefresh(pageModel, false);
Logger.error(TAG, 'closeRefresh by timeout')
}, Const.REFRESH_TIMEOUT__TIME);
// 取消超时关闭定时器
clearTimeout(pageModel.refreshTimeoutTimerId)
pageModel.refreshTimeoutTimerId = timeoutId
}
/**
* 自动刷新接口,如首页底导,双击按钮自动刷新
* @param pageModel 页面数据
... ... @@ -93,6 +189,7 @@ export function autoRefresh(pageModel: PageModel, pageAdvModel: PageAdModel) {
pullRefreshState(pageModel, RefreshState.Refreshing);
pageModel.currentPage = 1;
PageHelper.refreshUI(pageModel, pageAdvModel)
setRefreshTimeoutTimer(pageModel)
}
export function pullRefreshState(pageModel: PageModel, state: number) {
... ... @@ -141,6 +238,8 @@ export function pullRefreshState(pageModel: PageModel, state: number) {
export function closeRefresh(pageModel: PageModel, isRefreshSuccess: boolean) {
let self = pageModel;
// 取消超时关闭定时器
clearTimeout(self.refreshTimeoutTimerId)
setTimeout(() => {
let delay = Const.RefreshConstant_DELAY_PULL_DOWN_REFRESH;
if (self.isCanRefresh === true) {
... ...
import PageModel from '../viewmodel/PageModel';
import { RefreshConstants as Const } from './RefreshConstants';
import PageHelper from '../viewmodel/PageHelper';
import { Logger } from 'wdKit/Index';
const TAG = 'PullUpLoadMore'
export function touchMoveLoadMore(model: PageModel, event: TouchEvent) {
// list size +1
if (model.endIndex >= model.compList.totalCount()-3 && model.endIndex <= model.compList.totalCount()) {
if (model.endIndex >= model.compList.totalCount() - 3 && model.endIndex <= model.compList.totalCount()) {
// model.offsetY = event.touches[0].y - model.downY;
// if (Math.abs(model.offsetY) > vp2px(model.pullUpLoadHeight) / 2) {
// model.isCanLoadMore = true;
... ... @@ -32,6 +35,7 @@ export function touchUpLoadMore(model: PageModel) {
// closeLoadMore(model);
PageHelper.loadMore(self)
}, Const.DELAY_TIME);
setLoadMoreTimeoutTimer(self)
} else {
closeLoadMore(self);
}
... ... @@ -41,4 +45,14 @@ export function closeLoadMore(model: PageModel) {
model.isCanLoadMore = false;
model.isLoading = false;
model.isVisiblePullUpLoad = false;
}
export function setLoadMoreTimeoutTimer(pageModel: PageModel) {
let timeoutId = setTimeout(() => {
closeLoadMore(pageModel);
Logger.error(TAG, 'closeLoadMore by timeout')
}, Const.REFRESH_TIMEOUT__TIME);
// 取消超时关闭定时器
clearTimeout(pageModel.loadMoreTimeoutTimerId)
pageModel.loadMoreTimeoutTimerId = timeoutId
}
\ No newline at end of file
... ...
... ... @@ -14,7 +14,7 @@ export class RefreshConstants {
* The delay time.
*/
static readonly DELAY_TIME: number = 50;
static readonly REFRESH_TIMEOUT__TIME: number = 10000;
/**
* The animation duration.
*/
... ... @@ -25,12 +25,10 @@ export class RefreshConstants {
static readonly RefreshConstant_DELAY_PULL_DOWN_REFRESH: number = 50;
static readonly RefreshConstant_CLOSE_PULL_DOWN_REFRESH_TIME: number = 150;
static readonly RefreshConstant_DELAY_SHRINK_ANIMATION_TIME: number = 1500;
/**
* The page size.
*/
static readonly PAGE_SIZE: number = 20;
/**
* The refresh and load height.
*/
... ... @@ -59,6 +57,7 @@ export class RefreshConstants {
static readonly RefreshLayout_IMAGE_WIDTH: number = 18;
static readonly RefreshLayout_IMAGE_HEIGHT: number = 18;
}
/**
* The refresh state enum.
*/
... ...
import { TrackingContent, TrackConstants, ParamType } from 'wdTracking';
import { CompDTO, ContentDTO } from 'wdBean';
export class InfomationCardClick {
private static getLiveState(contentDTO: ContentDTO) {
if (contentDTO?.liveInfo?.liveState === 'wait') {
return 'liveSubscribe'
} else if (contentDTO?.liveInfo?.liveState === 'running') {
return 'livePlaying'
} else if (contentDTO?.liveInfo?.liveState === 'end') {
return 'liveEnd'
} else {
return ''
}
}
private static getSummaryType(objectType: string) {
let summaryType: string = ''
switch(objectType) {
case '2':
summaryType = 'liveTopic';
break;
case '8':
summaryType = 'articleTopic';
break;
case '13':
summaryType = 'audioTopic';
break;
// case '':
// summaryType = 'talkTopic';
// break;
// case '':
// summaryType = 'morningAndEveningNewsTopic';
// break;
// case '':
// summaryType = 'timeAxisTopic';
// break;
default:
summaryType = '';
break;
}
return summaryType;
}
public static track(compDTO: CompDTO, contentDTO: ContentDTO, pageId: string, pageName: string): void {
try {
const extParams: ParamType = {
'action': 'detailPageShow',
'shareChannel': '',
'duration': 0,
'contentName': contentDTO.newsTitle,
'contentType': contentDTO.objectType,
// 'contentClassify': '' // 废除
'contentId': contentDTO.objectId,
// 'compId': contentDTO.relId,
'contentStyle': contentDTO.appStyle,
'liveType': InfomationCardClick.getLiveState(contentDTO),
'channelSourceId': contentDTO.channelId,
'contentShowChannelId': contentDTO.channelId,
// 'contentShowChannelName': '',
'linkUrl': contentDTO.linkUrl,
'regionName': 2, // 信息流:2
'componentType': compDTO.compStyle,
'sceneId': contentDTO.sceneId,
'subSceneId': contentDTO.subSceneId,
'cnsTraceId': contentDTO.cnsTraceId,
'cardItemId': compDTO.cardItemId,
'itemId': compDTO.itemId || contentDTO.itemId,
'expIds': compDTO.expIds || contentDTO.expIds
}
if (contentDTO.objectType === '5') {
extParams['summaryId'] = contentDTO.objectId;
extParams['summaryType'] = InfomationCardClick.getSummaryType(contentDTO.objectType);
extParams['specialLink'] = contentDTO.linkUrl;
}
if (contentDTO.objectType === '2') {
extParams['liveStreamType'] = contentDTO?.liveInfo.vrType === 0 ? 1 : 2;
extParams['vliveId'] = contentDTO.objectId;
extParams['vliveName'] = contentDTO.newsTitle;
extParams['liveMode'] = 1;
}
if (contentDTO.rmhPlatform === 1) {
extParams['saAuthorName'] = contentDTO.rmhInfo?.rmhName;
extParams['saAuthorId'] = contentDTO.rmhInfo?.rmhId;
} else if (contentDTO.source) {
extParams['saAuthorName'] = contentDTO.source;
}
console.log('InfomationCardClick-params:', JSON.stringify(extParams))
TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams)
} catch (err) {
console.log('InfomationCardClick-err', JSON.stringify(err))
}
}
}
\ No newline at end of file
... ...
... ... @@ -49,6 +49,9 @@ export class PageHelper {
}
private refreshUIEnd(pageModel: PageModel, isRefreshSuccess: boolean) {
if (pageModel.loadStrategy != 2) {
return
}
closeRefresh(pageModel, isRefreshSuccess)
}
... ... @@ -119,6 +122,7 @@ export class PageHelper {
}
}).catch((err: string | Resource) => {
promptAction.showToast({ message: err });
this.refreshUIEnd(pageModel, false)
})
} else {
Logger.debug(TAG, 'getPageInfo')
... ... @@ -127,6 +131,7 @@ export class PageHelper {
if (pageInfo == null) {
pageModel.viewType = ViewType.EMPTY;
pageModel.emptyType = WDViewDefaultType.WDViewDefaultType_NoContent1;
this.refreshUIEnd(pageModel, false)
return;
}
pageModel.pageInfo = pageInfo;
... ... @@ -146,6 +151,7 @@ export class PageHelper {
Logger.debug(TAG, 'getPageInfo go on')
this.parseGroup(pageModel, false)
}).catch(() => {
this.refreshUIEnd(pageModel, false)
if (this.isPageLoaded(pageModel)) {
return
}
... ... @@ -406,7 +412,7 @@ export class PageHelper {
/**
* 竖直方向list,将数据拆出来,组装成comp
*/
private createSpecialComp(compList: CompDTO[]): CompDTO[]{
private createSpecialComp(compList: CompDTO[]): CompDTO[] {
if (!compList) {
return compList
}
... ... @@ -458,7 +464,6 @@ export class PageHelper {
// 批查直播观看人数
this.getLiveRoomDataInfo(compList)
//
... ...
... ... @@ -28,13 +28,28 @@ export default class PageModel {
loadStrategy: number = 1;
currentPage: number = 1;
pageSize: number = Const.PAGE_SIZE;
/**
* @deprecated
*/
pullDownRefreshText: Resource = $r('app.string.pull_down_refresh_text');
/**
* @deprecated
*/
pullDownRefreshImage: Resource = $r('app.media.ic_pull_down_refresh');
pullDownRefreshHeight: number = Const.CUSTOM_LAYOUT_HEIGHT;
isVisiblePullDown: boolean = false;
load: LoadStatus = LoadStatus.IDLE;
/**
* @deprecated
*/
pullUpLoadText: Resource = $r('app.string.pull_up_load_text');
/**
* @deprecated
*/
pullUpLoadImage: Resource = $r('app.media.ic_pull_up_load');
/**
* @deprecated
*/
pullUpLoadHeight: number = Const.CUSTOM_LAYOUT_HEIGHT;
isVisiblePullUpLoad: boolean = false;
offsetY: number = 0;
... ... @@ -50,6 +65,8 @@ export default class PageModel {
isPullRefreshOperation = false;
isLoading: boolean = false;
isCanLoadMore: boolean = false;
refreshTimeoutTimerId: number = 0;
loadMoreTimeoutTimerId: number = 0;
// keyGenerator相关字符串,用于刷新list布局
timestamp: String = '1';
... ...
... ... @@ -83,23 +83,29 @@ export struct DetailPlayLiveCommon {
* 获取直播信息,可区分横竖屏直播
*/
getLiveDetails() {
this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
.then(
(data) => {
if (data.length > 0) {
this.liveDetailsBean = data[0]
this.liveState = this.liveDetailsBean.liveInfo?.liveState
this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
//todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行
setTimeout(() => {
this.liveDetailsBean = data[0]
}, 10)
this.liveState = data[0].liveInfo?.liveState
this.liveStyle = data[0].liveInfo.liveStyle
if (data[0].fullColumnImgUrls && data[0].fullColumnImgUrls.length > 0) {
this.imgUrl = data[0].fullColumnImgUrls[0].url
}
if (this.liveDetailsBean.liveInfo.liveState == 'end') {
this.playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri
if (data[0].liveInfo.liveState == 'end') {
this.playUrl = data[0].liveInfo.vlive[0].replayUri
}
console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean)))
// console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean)))
}
},
() => {
... ...
... ... @@ -36,6 +36,7 @@ export struct DetailPlayVLivePage {
aboutToAppear(): void {
this.openFullScreen()
this.getLiveRoomData()
}
aboutToDisappear(): void {
... ...
... ... @@ -21,6 +21,7 @@ export struct PlayerComponent {
@State playUrl: string = ''
@State isCanplay: boolean = false
pageShowChange() {
this.playerController?.play()
}
... ... @@ -30,15 +31,10 @@ export struct PlayerComponent {
}
aboutToAppear(): void {
console.log(TAG, 'aboutToAppear')
this.playerController.onCanplay = () => {
console.log('可以播放了')
this.playerController?.play()
this.isCanplay = true
}
}
async aboutToDisappear(): Promise<void> {
await this.playerController?.pause()
await this.playerController?.stop()
await this.playerController?.release()
... ... @@ -63,7 +59,6 @@ export struct PlayerComponent {
this.liveStreamType = liveStreamType
this.playUrl = playUrl
}
}
... ... @@ -75,6 +70,7 @@ export struct PlayerComponent {
WDPlayerRenderVLiveView({
playerController: this.playerController,
onLoad: () => {
this.isCanplay = true
this.playerController?.firstPlay(this.playUrl);
}
})
... ... @@ -82,12 +78,14 @@ export struct PlayerComponent {
AliPlayerRenderView({
playerController: this.playerController,
onLoad: () => {
this.isCanplay = true
this.playerController?.firstPlay(this.playUrl);
}
}).margin({ top: 195 }).height(211)
}
PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible)
}
.height('100%')
.width('100%')
... ... @@ -98,8 +96,11 @@ export struct PlayerComponent {
this.isShowControl = !this.isShowControl
}
})
}
.height('100%')
.width('100%')
}
}
\ No newline at end of file
... ...
... ... @@ -185,7 +185,7 @@ export struct DetailPlayShortVideoPage {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
// publishCommentModel: $publishCommentModel
})
this.playerViewBuilder()
... ...
import { ContentDetailDTO } from 'wdBean/Index'
import { WindowModel } from 'wdKit/Index'
import {
publishCommentModel
} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { CommentComponent } from '../../../../../wdComponent/src/main/ets/components/comment/view/CommentComponent'
import { OperRowListView } from '../../../../../wdComponent/src/main/ets/components/view/OperRowListView'
import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index'
import { CommentListDialogView } from 'wdComponent/Index'
@Component
export struct CommentDialogView {
@Link publishCommentModel: publishCommentModel
@Link @Watch('showCommentListChange') showCommentList: boolean
@Link index: number
@Link currentIndex: number
@Consume windowWidth: number
@Consume windowHeight: number
@Consume bottomSafeHeight: number
@Consume topSafeHeight: number
@Consume contentDetailData: ContentDetailDTO
@State fakePageInfo: PageInfoDTO = {} as PageInfoDTO
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
// @State modifier: DrawModifier = new DrawModifier();
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
publishCommentModel: $publishCommentModel,
contentDetailData: $contentDetailData,
dialogOffsetY: $dialogOffsetY,
showCommentList: $showCommentList,
windowWidth: this.windowWidth,
windowHeight: this.windowHeight
}),
autoCancel: false,
customStyle: true,
alignment: DialogAlignment.Bottom,
// onWillDismiss: (dismissDialogAction: DismissDialogAction) => {
// this.showCommentList = false
// dismissDialogAction.dismiss()
// },
// openAnimation: { duration: 0 },
// closeAnimation: { duration: 0 },
})
/**
* 问题:弹窗从底部到上动画无法添加
*/
@State @Watch("innerShowCommentChange") innerShowComment: boolean = false
showCommentListChange(val: boolean) {
if (this.showCommentList && this.index === this.currentIndex) {
this.dialogController.open()
console.log('open')
// animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => {
// this.dialogOffsetY = 500
// this.modifier.invalidate()
// })
this.innerShowComment = true
} else {
this.dialogController.close()
console.log('close')
this.innerShowComment = false
}
}
build() {
innerShowCommentChange() {
this.showCommentList = this.innerShowComment
}
}
@CustomDialog
export struct DetailDialog {
controller: CustomDialogController
@Link publishCommentModel: publishCommentModel
@Link dialogOffsetY: number
@Link contentDetailData: ContentDetailDTO
@Link showCommentList: boolean
@Prop windowWidth: number
@Prop windowHeight: number
build() {
Column() {
CommentComponent({
publishCommentModel: this.publishCommentModel,
showCloseIcon: true,
fixedHeightMode: true,
onCloseClick: () => {
console.log('onCloseClick')
this.showCommentList = false
this.controller.close()
// setTimeout(() => {
//
// }, 1000)
}
}).layoutWeight(1)
OperRowListView({
componentType: 4,
pageComponentType: 8,
showBackIcon: false,
operationButtonList: ['comment', 'like', 'collect', 'share'],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
showCommentIcon: true,
styleType: 1,
onBack: () => {
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
})
}
.height(this.windowHeight - this.windowWidth * 9 / 16 + 'px')
// .margin({ top: this.dialogOffsetY + 'px' })
.zIndex(1000)
.backgroundColor(Color.White)
CommentListDialogView({
showCommentList: this.innerShowComment,
contentDetailData: this.contentDetailData,
pageInfo: this.fakePageInfo,
onClose: () => {
this.showCommentList = false
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -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,
}
}
}
... ...
... ... @@ -2,15 +2,11 @@ import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils,CustomToast, String
import router from '@ohos.router'
import { LoginViewModel } from './LoginViewModel'
import { LoginInputComponent } from './LoginInputComponent'
import { ErrorToastUtils, SPHelper } from 'wdKit'
import { WDRouterPage } from 'wdRouter/src/main/ets/router/WDRouterPage';
import { WDRouterRule } from 'wdRouter/src/main/ets/router/WDRouterRule';
import { Params } from '../../../../../../../commons/wdRouter/oh_modules/wdBean/src/main/ets/bean/content/Params'
import {InterestsHobbiesModel} from '../../../../../../../products/phone/src/main/ets/pages/viewModel/InterestsHobbiesModel'
import HuaweiAuth from '../../utils/HuaweiAuth'
import { loginComponentManager, LoginWithHuaweiIDButton } from '@hms.core.account.LoginComponent'
import { BusinessError } from '@ohos.base'
import { TrackingPageBrowse, TrackConstants } from 'wdTracking/Index'
import { TrackingPageBrowse, TrackConstants, TrackingButton, ParamType, Tracking } from 'wdTracking/Index'
@Extend(Row)
function otherStyle() {
... ... @@ -43,7 +39,6 @@ struct LoginPage {
@State isSubmit: boolean = false
@State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录
@State passwordSwitch: boolean = true //密码显示
// @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录
lastTime: number = 0
@State codeStateSuccess:boolean=false
@State toastText:string = ""
... ... @@ -64,6 +59,7 @@ struct LoginPage {
onCodeSend() {
Logger.debug(TAG, "isCodeSend:" + this.isCodeSend + "")
if (this.isCodeSend) {
TrackingButton.click("loginPageGetVerificationCode",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
this.sendVerifyCode()
}
}
... ... @@ -81,7 +77,12 @@ struct LoginPage {
this.pageHideTime = DateTimeUtils.getTimeStamp()
let duration = 0
duration = Math.floor((this.pageHideTime - this.pageShowTime)/1000)
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
if(this.checkCodePage){
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page,duration)
}else{
TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page,duration)
}
}
build() {
... ... @@ -96,20 +97,16 @@ struct LoginPage {
.margin({ top: 78 })
.align(Alignment.Center)
if (this.checkCodePage) {
LoginInputComponent({
phoneContent: $phoneContent,
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend,
codeStateSuccess:$codeStateSuccess,
protocolState:this.protocolState,
isNeedProtocol:true
})
} else {
this.addPassword()
}
LoginInputComponent({
phoneContent: $phoneContent,
codeContent: $codeContent,
isSubmit: $isSubmit,
isCodeSend: $isCodeSend,
codeStateSuccess:$codeStateSuccess,
protocolState:this.protocolState,
isNeedProtocol:true
}).visibility(this.checkCodePage ? Visibility.Visible : Visibility.None)
this.addPassword()
Row() {
Image(this.protocolState ? $r('app.media.login_checkbox_select') : $r('app.media.login_checkbox_unselected'))
... ... @@ -122,11 +119,21 @@ struct LoginPage {
Text() {
Span("我已阅读并同意").fontColor("#999999").fontSize(12)
Span("《用户协议》").fontColor("#ED2800").fontSize(12).onClick(() => {
if(this.checkCodePage){
TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
}else{
TrackingButton.click("loginPageUserAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
}
let bean = { contentID: "1", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
Span("及").fontColor("#999999").fontSize(12)
Span("《隐私政策》").fontColor("#ED2800").fontSize(12).onClick(() => {
if(this.checkCodePage){
TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
}else{
TrackingButton.click("loginPagePrivacyAgreement",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
}
let bean = { contentID: "2", pageID: "" } as Params
WDRouterRule.jumpWithPage(WDRouterPage.loginProtocolPage, bean)
})
... ... @@ -137,10 +144,11 @@ struct LoginPage {
Text("登录")
.borderRadius(4)
.fontColor(this.isSubmit ? "#FFFFFFFF" : "#66FFFFFF")
.fontSize(18)
.fontWeight(FontWeight.Medium)
.fontSize("31lpx")
.fontWeight(400)
.margin({ top: 20 })
.height(44)
.lineHeight("50lpx")
.height(44)
.textAlign(TextAlign.Center)
.width("100%")
.backgroundColor(this.isSubmit ? "#FFED2800" : "#99ED2800")
... ... @@ -160,9 +168,14 @@ struct LoginPage {
if (!this.checkCodePage) {
Text('忘记密码').fontColor('#666666').fontSize(14).margin({ top: 16 })
Text('忘记密码')
.fontColor('#666666')
.fontSize("31lpx")
.fontWeight(400)
.lineHeight("38lpx")
.margin({ top: 16 })
.onClick(() => {
// router.pushUrl({ url: 'pages/login/ForgetPasswordPage' })
TrackingButton.click("loginPageForgotPassword",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
if(StringUtils.isNotEmpty(this.accountContent) && StringUtils.photoMatch(this.accountContent)){
let pageType = { 'pageType': 0, 'phone': Number(this.accountContent) } as Record<string, number>;
WDRouterRule.jumpWithPage(WDRouterPage.forgetPasswordPage, pageType)
... ... @@ -228,11 +241,7 @@ struct LoginPage {
})
RelativeContainer() {
// if (this.passwordSwitch) {
this.addPasswordInputLayout()
// } else {
// this.addPasswordInputLayout()
// }
Image(this.passwordSwitch ? $r('app.media.login_password_off') : $r('app.media.login_password_on'))
.onClick(() => {
... ... @@ -251,6 +260,7 @@ struct LoginPage {
.height(48)
.width('100%')
}.padding({ left: 25, right: 25 }).width('100%').margin({ top: 36 })
.visibility(this.checkCodePage ? Visibility.None : Visibility.Visible)
}
... ... @@ -289,24 +299,6 @@ struct LoginPage {
}.width('100%')
Row() {
/*Row() {
Image($r('app.media.login_wx'))
.width(20).height(20).onClick(()=>{
ErrorToastUtils.ErrorToast.showToast(ErrorToastUtils.ErrorType.NET_CORE_NO_NETWORK)
})
}.backgroundImage($r('app.media.login_other_left'), ImageRepeat.NoRepeat)
.otherStyle()
Row() {
Image($r('app.media.login_qq')).size({ width: 20, height: 20 })
}.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)
.otherStyle()
Row() {
Image($r('app.media.login_wb')).size({ width: 20, height: 20 })
}.backgroundImage($r('app.media.login_other_middle'), ImageRepeat.NoRepeat)
.otherStyle()*/
Row() {
Image(this.checkCodePage ? $r('app.media.login_qt') : $r('app.media.login_other_password'))
.size({ width: "35lpx", height: "35lpx" })
... ... @@ -320,10 +312,19 @@ struct LoginPage {
.lineHeight("38lpx")
}
.onClick(() => {
this.onPageHide()
if(this.checkCodePage){
trackTypeClick(0,TrackConstants.PageName.Phone_Login_Page)
}else{
trackTypeClick(6,TrackConstants.PageName.Login_Page)
}
this.updateAccount()
this.checkCodePage = !this.checkCodePage;
this.checkCodePage = !this.checkCodePage
this.passwordSwitch = true
this.isSubmit = false
this.pageShowTime = DateTimeUtils.getTimeStamp()
}).width('100%')
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
... ... @@ -374,6 +375,7 @@ struct LoginPage {
requestLogin() {
Logger.debug('LoginViewModel', "requestLogin")
if (this.checkCodePage) {
TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Phone_Login_Page,TrackConstants.PageName.Phone_Login_Page)
this.loginViewModel.appLogin(this.phoneContent, 2, this.codeContent).then((data) => {
Logger.debug(TAG, "requestLogin: " + data.jwtToken)
///同步兴趣tag
... ... @@ -385,6 +387,7 @@ struct LoginPage {
this.showToastTip(error)
})
} else {
TrackingButton.click("loginPageLoginButton",TrackConstants.PageName.Login_Page,TrackConstants.PageName.Login_Page)
this.loginViewModel.appLoginByPassword(this.accountContent, 0, this.passwordContent, "").then((data) => {
Logger.debug(TAG, "requestLogin: " + data.jwtToken)
this.showToastTip('登录成功')
... ... @@ -588,3 +591,12 @@ struct ProtocolComponent {
}
}
function trackTypeClick(typeValue: number,pageId: string){
let params: ParamType = {}
params["loginType"] = typeValue
params["pageName"] = pageId
params["pageId"] = pageId
Tracking.event("login_type_click", params)
}
... ...
... ... @@ -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() {
... ...
... ... @@ -137,7 +137,6 @@ export class WDAliPlayerController {
onStateChanged: (status: number) => {
this.avPlayerStatus = status
Logger.debug(TAG, "status update:" + `${this.getStatusStringWith(status)}`)
switch (status) {
case initalized: {
//this.avPlayer?.prepare();
... ...
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()
}
... ...
... ... @@ -99,7 +99,7 @@ export struct MultiPictureDetailPageComponent {
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
// publishCommentModel: $publishCommentModel
})
}
... ...