yuzhilin

意图上报完成时增加发生时间段

... ... @@ -84,6 +84,7 @@ export struct DynamicDetailComponent {
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@State offsetY: number = 0
@State isScrollTop: boolean = true
@State executedStartTime: number = new Date().getTime()
pageParam: ParamType = {}
commentListAreaInfo?: Area
... ... @@ -118,7 +119,9 @@ export struct DynamicDetailComponent {
})
}
aboutToDisappear() {
this.viewBlogInsightIntentShare()
}
onPageHide() {
}
... ... @@ -675,7 +678,6 @@ export struct DynamicDetailComponent {
this.getInteractDataStatus()
this.makeJumpInfo()
this.interactDataV2()
this.viewBlogInsightIntentShare()
this.pageParam = {
'contentType': `${this.contentDetailData.newsType}`,
... ... @@ -858,7 +860,7 @@ export struct DynamicDetailComponent {
*/
private viewBlogInsightIntentShare(){
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactDataDTO)
viewBlogItemInsightIntentShare(this.executedStartTime, context,this.contentDetailData, this.interactDataDTO)
}
checkToScrollCommentArea() {
... ...
... ... @@ -64,6 +64,7 @@ export struct ImageAndTextPageComponent {
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
@State executedStartTime: number = new Date().getTime()
pageShowTime:number = 0;
pageHideTime:number = 0;
lastTimeoutId?: number
... ... @@ -324,9 +325,6 @@ export struct ImageAndTextPageComponent {
} else {
this.operationButtonList = ['comment', 'collect', 'share']
}
//意图上报
this.viewBlogInsightIntentShare()
}
}
}
... ... @@ -334,7 +332,7 @@ export struct ImageAndTextPageComponent {
//意图上报
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context, this.contentDetailData, this.interactData)
viewBlogItemInsightIntentShare(this.executedStartTime, context, this.contentDetailData, this.interactData)
}
private async getRecommend() {
... ... @@ -463,6 +461,8 @@ export struct ImageAndTextPageComponent {
}
aboutToDisappear() {
//意图上报
this.viewBlogInsightIntentShare()
}
checkToScrollCommentArea() {
... ...
import { Action, H5ReceiveDetailBean, ContentDetailDTO, InteractDataDTO, TopicInfo,TopicDetailData,ShareInfoDTO } from 'wdBean';
import {
Action,
H5ReceiveDetailBean,
ContentDetailDTO,
InteractDataDTO,
TopicInfo,
TopicDetailData,
ShareInfoDTO
} from 'wdBean';
import { WdWebComponent } from 'wdWebComponent';
import { CommonConstants } from 'wdConstant'
import { BridgeWebViewControl } from 'wdJsBridge/Index';
... ... @@ -7,7 +15,7 @@ import { OperRowListView } from './view/OperRowListView';
import DetailViewModel from '../viewmodel/DetailViewModel';
import { publishCommentModel } from '../components/comment/model/PublishCommentModel';
import { EmptyComponent } from '../components/view/EmptyComponent';
import { NetworkUtil, WindowModel,Logger } from 'wdKit';
import { NetworkUtil, WindowModel, Logger } from 'wdKit';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { PageRepository } from '../repository/PageRepository';
... ... @@ -45,6 +53,7 @@ export struct SpacialTopicPageComponent {
@State topicDetail: TopicDetailData = {} as TopicDetailData
@State shareInfo: ShareInfoDTO = {} as ShareInfoDTO
@State showBottomView: boolean = false;
@State executedStartTime: number = new Date().getTime()
private trySendData2H5() {
if (!this.webPrepared) {
... ... @@ -60,24 +69,24 @@ export struct SpacialTopicPageComponent {
}
private sendContentData2H5(h5ReceiveAppData: H5ReceiveDetailBean) {
Logger.debug('SpacialTopicPageComponent', 'jsCall_receiveAppData',JSON.stringify(h5ReceiveAppData));
Logger.debug('SpacialTopicPageComponent', 'jsCall_receiveAppData', JSON.stringify(h5ReceiveAppData));
this.webviewControl.callHandle(NativeCallH5Type.jsCall_receiveAppData,
JSON.stringify(h5ReceiveAppData), (data: string) => {
Logger.debug('SpacialTopicPageComponent', "from js data = " + data);
})
}
private receiveH5SendToNativeData(dataString:string | undefined) {
private receiveH5SendToNativeData(dataString: string | undefined) {
// this.topicDetail = JSON.parse(dataString);
if (dataString == undefined) {
return
}
Logger.debug('SpacialTopicPageComponent111',dataString);
Logger.debug('SpacialTopicPageComponent111', dataString);
this.topicDetail = JSON.parse(dataString);
this.topicInfo = this.topicDetail.topicInfo;
if(this.topicInfo){
if (this.topicInfo) {
// 转换详情数据
this.contentDetailData.openComment = Number(this.topicInfo.commentFlag)
this.contentDetailData.commentDisplay = Number(this.topicInfo.commentShowFlag)
... ... @@ -94,7 +103,7 @@ export struct SpacialTopicPageComponent {
this.shareInfo.shareSummary = this.topicInfo.shareSummary
this.shareInfo.shareTitle = this.topicInfo.shareTitle
this.shareInfo.shareUrl = this.topicInfo.shareUrl
this.contentDetailData.shareInfo = this.shareInfo
this.contentDetailData.shareInfo = this.shareInfo
console.log('contentDetailData111', JSON.stringify(this.contentDetailData))
// if(this.topicInfo.shareOpen === 1){
... ... @@ -121,9 +130,9 @@ export struct SpacialTopicPageComponent {
}
//意图上报
private viewBlogInsightIntentShare(){
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData)
viewBlogItemInsightIntentShare(this.executedStartTime, context, this.contentDetailData)
}
build() {
... ... @@ -158,23 +167,23 @@ export struct SpacialTopicPageComponent {
emptyButton: true,
retry: () => {
// this.getDetail()
this.reload ++
this.reload++
}
}).padding({ bottom: 200 })
} else {
if (!this.isPageEnd) {
channelSkeleton().padding({ top:`${this.topSafeHeight}px`,bottom: this.bottomSafeHeight })
channelSkeleton().padding({ top: `${this.topSafeHeight}px`, bottom: this.bottomSafeHeight })
}
}
//底部交互区
if (this.showBottomView){
if (this.showBottomView) {
OperRowListView({
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
topicInfo: this.topicInfo,
styleType: 1,
onCommentIconClick:()=>{
onCommentIconClick: () => {
this.showCommentList = true
}
})
... ... @@ -185,7 +194,7 @@ export struct SpacialTopicPageComponent {
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel,
interactData: $interactData,
}).visibility(this.showComment?Visibility.Visible:Visibility.Hidden)
}).visibility(this.showComment ? Visibility.Visible : Visibility.Hidden)
}
}
}.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
... ...
... ... @@ -39,11 +39,6 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
identifier,
intentActionInfo: {
actionMode
//目前不考虑发生时段
// executedTimeSlots: {
// executedEndTime: new Date().getTime(),
// executedStartTime: pageModel.executedStartTime
// }
},
intentEntityInfo: {
entityName: 'Blog',
... ... @@ -86,16 +81,21 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
}
//ViewBlog意图共享-节目详情 详情页上报
export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO,
export function viewBlogItemInsightIntentShare(executedStartTime: number ,context: common.UIAbilityContext, item: ContentDetailDTO,
interactData?: InteractDataDTO) {
let identifier = generateUUID()
console.log('zzzz', JSON.stringify(item))
let executedEndTime: number = new Date().getTime()
let viewBlogInsightIntentItem: insightIntent.InsightIntent = {
intentName: 'ViewBlog',
intentVersion: '1.0.1',
identifier,
intentActionInfo: {
actionMode: ActionMode.EXECUTED
actionMode: ActionMode.EXECUTED,
executedTimeSlots: {
executedEndTime: executedEndTime,
executedStartTime: executedStartTime
}
},
intentEntityInfo: {
entityName: 'Blog',
... ... @@ -142,7 +142,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en
intentVersion: '1.0.1',
identifier: generateUUID(),
intentActionInfo: {
actionMode: ActionMode.EXECUTED
actionMode: ActionMode.EXPECTED
},
intentEntityInfo: {
entityName: 'Column',
... ...
... ... @@ -60,6 +60,7 @@ export struct MultiPictureDetailPageComponent {
@State isEnableSwipe: boolean = true;
@State isScrollerTop: boolean = false;
@Provide duration: number = 0
@State executedStartTime: number = new Date().getTime()
//watch监听页码回调
onCurrentPageNumUpdated(): void {
... ... @@ -100,7 +101,7 @@ export struct MultiPictureDetailPageComponent {
}
aboutToDisappear() {
this.viewBlogInsightIntentShare()
}
build() {
... ... @@ -572,7 +573,6 @@ export struct MultiPictureDetailPageComponent {
this.getInteractBrowsOperate()
this.getBatchAttentionStatus()
}
this.viewBlogInsightIntentShare()
})
.catch((err: Error) => {
Logger.info(TAG, `fetchDetailData then,err: ${JSON.stringify(err)}`);
... ... @@ -658,6 +658,6 @@ export struct MultiPictureDetailPageComponent {
*/
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context, this.contentDetailData)
viewBlogItemInsightIntentShare(this.executedStartTime, context, this.contentDetailData)
}
}
\ No newline at end of file
... ...