王士厅
... ... @@ -24,6 +24,7 @@ import { SpConstants } from 'wdConstant/Index';
import { router } from '@kit.ArkUI';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { CommentDialogView } from 'wdDetailPlayShortVideo/Index';
const TAG = 'MultiPictureDetailPageComponent';
... ... @@ -37,20 +38,24 @@ export struct MultiPictureDetailPageComponent {
private picWidth: number = 0
@State picHeight: number = 0
@State titleHeight: number = 0
@State index: number = 0
@State currentIndex: number = 0
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0
@Provide windowHeight: number = AppStorage.get<number>('windowHeight') || 0
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@Provide @Watch('onCurrentPageNumUpdated') currentPageNum: string = '01'
private swiperController: SwiperController = new SwiperController()
private swiperControllerItem: SwiperController = new SwiperController()
@State swiperIndex: number = 0;
@Provide followStatus: string | undefined = undefined // 关注状态
@Provide showCommentList: boolean = false
private scroller: Scroller = new Scroller()
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State showDownload: Boolean = false // 控制是否显示下载默认隐藏
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State operationButtonList: string[] = ['comment', 'like', 'collect', 'share']
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') as number;
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') as number;
@State windowHeight: number = AppStorage.get<number>('windowHeight') as number;
@State currentOffset: number = 0
@State duration: number = 0
... ... @@ -92,6 +97,13 @@ export struct MultiPictureDetailPageComponent {
build() {
RelativeContainer() {
this.init()
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
})
}
.width('100%')
.height('100%')
... ... @@ -369,8 +381,12 @@ export struct MultiPictureDetailPageComponent {
operationButtonList: this.operationButtonList,
styleType: 2,
componentType: 5,
pageComponentType: 3
pageComponentType: 3,
onCommentIconClick: () => {
this.showCommentList = true
}
})
}
.transition(TransitionEffect.OPACITY.animation({ duration: this.duration, curve: Curve.Ease }).combine(
TransitionEffect.translate({ x: 0, y: `-${this.bottomSafeHeight}px` })
... ... @@ -551,8 +567,8 @@ export struct MultiPictureDetailPageComponent {
/**
* 意图上报
*/
private viewBlogInsightIntentShare(){
private viewBlogInsightIntentShare() {
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData)
viewBlogItemInsightIntentShare(context, this.contentDetailData)
}
}
\ No newline at end of file
... ...
... ... @@ -82,7 +82,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent
}
}
//ViewBlog意图共享-节目详情 目前单独在详情页上报
//ViewBlog意图共享-节目详情 详情页上报
export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, item: ContentDetailDTO,
interactData?: InteractDataDTO) {
let identifier = generateUUID()
... ...
... ... @@ -5,3 +5,5 @@ export { DetailVideoListPage } from './src/main/ets/pages/DetailVideoListPage'
export { VideoChannelDetail } from './src/main/ets/pages/VideoChannelDetail'
export { LottieViewDemo } from './src/main/ets/pages/LottieViewDemo'
export { CommentDialogView } from './src/main/ets/view/CommentDialogView'
\ No newline at end of file
... ...
... ... @@ -15,8 +15,8 @@ import { HttpUtils } from 'wdNetwork/Index';
import { DateTimeUtils, WindowModel } from 'wdKit/Index';
import { PlayerBottomView } from '../view/PlayerBottomView';
import { PlayerRightView } from '../view/PlayerRightView';
import { CommentDialogView } from '../view/CommentDialogView';
import { DisplayDirection } from 'wdConstant/Index';
import { CommentDialogView } from '../view/CommentDialogView';
const TAG = 'DetailPlayShortVideoPage';
... ... @@ -28,6 +28,7 @@ const TAG = 'DetailPlayShortVideoPage';
export struct DetailPlayShortVideoPage {
@Prop index: number = 0
@Prop @Watch('currentIndexChange') currentIndex: number = 0
@Provide publishCommentModel: publishCommentModel = new publishCommentModel()
@State playerController: WDPlayerController = new WDPlayerController();
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@Provide interactData: InteractDataDTO = {} as InteractDataDTO
... ... @@ -47,7 +48,6 @@ export struct DetailPlayShortVideoPage {
@Consume topSafeHeight: number
@Consume showComment: boolean // 是否显示底部评论,首页视频频道传false
@State imageVisible: boolean = true
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State ratio: number = 16 / 9
/**
... ... @@ -164,15 +164,6 @@ export struct DetailPlayShortVideoPage {
}
this.queryNewsInfoOfUser()
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
}
... ... @@ -186,7 +177,12 @@ export struct DetailPlayShortVideoPage {
Stack({ alignContent: Alignment.Top }) {
Column() {
Stack() {
CommentDialogView({
index: $index,
currentIndex: $currentIndex,
showCommentList: $showCommentList,
publishCommentModel: $publishCommentModel
})
this.playerViewBuilder()
PlayerBottomView({
... ... @@ -224,7 +220,6 @@ export struct DetailPlayShortVideoPage {
.height('100%')
.width('100%')
CommentDialogView({ publishCommentModel: this.publishCommentModel })
}
.height('100%')
.width('100%')
... ...
... ... @@ -9,19 +9,25 @@ import { OperRowListView } from '../../../../../wdComponent/src/main/ets/compone
@Component
export struct CommentDialogView {
@Prop publishCommentModel: publishCommentModel
@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
@Consume @Watch('showCommentListChange') showCommentList: boolean
@State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16)
@State modifier: DrawModifier = new DrawModifier();
private dialogController: CustomDialogController = new CustomDialogController({
// @State modifier: DrawModifier = new DrawModifier();
dialogController: CustomDialogController = new CustomDialogController({
builder: DetailDialog({
publishCommentModel: this.publishCommentModel,
dialogOffsetY: $dialogOffsetY
publishCommentModel: $publishCommentModel,
contentDetailData: $contentDetailData,
dialogOffsetY: $dialogOffsetY,
showCommentList: $showCommentList,
windowWidth: this.windowWidth,
windowHeight: this.windowHeight
}),
autoCancel: false,
customStyle: true,
... ... @@ -30,8 +36,8 @@ export struct CommentDialogView {
// this.showCommentList = false
// dismissDialogAction.dismiss()
// },
openAnimation: { duration: 0 },
closeAnimation: { duration: 0 },
// openAnimation: { duration: 0 },
// closeAnimation: { duration: 0 },
})
/**
... ... @@ -39,7 +45,7 @@ export struct CommentDialogView {
*/
showCommentListChange(val: boolean) {
if (this.showCommentList) {
if (this.showCommentList && this.index === this.currentIndex) {
this.dialogController.open()
console.log('open')
// animateTo({ duration: 10000, expectedFrameRateRange: { min: 60, max: 60, expected: 60 } }, () => {
... ... @@ -59,15 +65,16 @@ export struct CommentDialogView {
@CustomDialog
export struct DetailDialog {
controller: CustomDialogController
@Prop publishCommentModel: publishCommentModel
@Link publishCommentModel: publishCommentModel
@Link dialogOffsetY: number
@Consume contentDetailData: ContentDetailDTO
@Consume showCommentList: boolean
@Consume windowWidth: number
@Consume windowHeight: number
@Link contentDetailData: ContentDetailDTO
@Link showCommentList: boolean
@Prop windowWidth: number
@Prop windowHeight: number
build() {
Column() {
Scroll() {
CommentComponent({
publishCommentModel: this.publishCommentModel,
showCloseIcon: true,
... ... @@ -75,9 +82,15 @@ export struct DetailDialog {
console.log('onCloseClick')
this.showCommentList = false
this.controller.close()
// setTimeout(() => {
//
// }, 1000)
}
}).height('100%')
}
})
.layoutWeight(1)
OperRowListView({
componentType: 1,
showBackIcon: false,
... ...
... ... @@ -69,7 +69,6 @@ export struct PlayerProgressView {
})
}
.margin({ top: 40 })
.visibility(this.isOpenDetail ? Visibility.None : Visibility.Visible)
}
}
\ No newline at end of file
... ...
... ... @@ -7,6 +7,9 @@ import {
postExecuteLikeParams,
postInteractAccentionOperateParams
} from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest';
import {
publishCommentModel
} from '../../../../../wdComponent/src/main/ets/components/comment/model/PublishCommentModel'
import { SPHelper, ToastUtils, NumberFormatterUtils } from 'wdKit';
import { WDPlayerController } from 'wdPlayer/Index';
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index';
... ... @@ -34,6 +37,7 @@ export struct PlayerRightView {
@Consume showComment?: boolean
@Consume showCommentList: boolean
@Consume displayDirection: DisplayDirection
@Consume publishCommentModel: publishCommentModel
@State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
aboutToAppear() {
... ... @@ -346,6 +350,16 @@ export struct PlayerRightView {
}
.margin({ bottom: 20 })
.onClick((event: ClickEvent) => {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '')
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '')
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '')
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '')
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '')
this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
// ToastUtils.showToast('评论为公共方法,待开发', 1000);
this.showCommentList = true
})
... ...
... ... @@ -45,10 +45,10 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
console.log('yzl jumpToView',JSON.stringify(param))
return new Promise((resolve, reject) => {
// TODO 实现意图调用,loadContent的入参为歌曲落地页路径,例如:pages/SongPage
// TODO 热启动是否切到主页
pageLoader.loadContent('pages/MainPage')
.then(() => {
let entityGroupId: string = (param.items as Array<object>)?.[0]?.['entityGroupId'];
ProcessUtils.jumpChannelTab(entityGroupId,'')
resolve({
code: 0,
result: {
... ... @@ -68,7 +68,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
}
/**
* 实现事件推荐功能
* 实现事件推荐功能-打开早晚报
* @param param 意图参数
* @param pageLoader 窗口
*/
... ... @@ -77,7 +77,7 @@ export default class InsightIntentExecutorImpl extends InsightIntentExecutor {
return new Promise((resolve, reject) => {
pageLoader.loadContent('pages/MainPage')
.then(() => {
// TODO 事件推荐调用
ProcessUtils.gotoMorningEveningPaper()
resolve({
code: 0,
result: {
... ...