Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhenghy
2024-05-20 16:18:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8b1b8ada3e82478082322db5229e33847e0f9e11
8b1b8ada
1 parent
f768ac30
图文详情评论定位(未完成)
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
16 deletions
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/CommentDialogView.ets
sight_harmony/features/wdComponent/src/main/ets/components/ImageAndTextPageComponent.ets
View file @
8b1b8ad
...
...
@@ -5,7 +5,6 @@ import {
EmitterUtils,
EmitterEventId,
NetworkUtil,
DisplayUtils
} from 'wdKit';
import {
Action,
...
...
@@ -33,6 +32,7 @@ import { CommentComponent } from '../components/comment/view/CommentComponent'
import { HttpUtils } from 'wdNetwork/Index';
import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare'
import { common } from '@kit.AbilityKit';
import { componentUtils, window } from '@kit.ArkUI';
const PATTERN_DATE_CN_RN: string = 'yyyy年MM月dd日 HH:mm';
...
...
@@ -58,6 +58,9 @@ export struct ImageAndTextPageComponent {
@State likeNum: number = 0
@State reachEndIncreament: number = 0
@State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State isScrollTop: boolean = true
@State offsetY: number = 0
build() {
Stack({ alignContent: Alignment.Top }) {
Stack({ alignContent: Alignment.Bottom }) {
...
...
@@ -125,16 +128,19 @@ export struct ImageAndTextPageComponent {
fixedHeightMode: false,
reachEndIncreament: this.reachEndIncreament,
reachEndLoadMoreFinish: () => {
}
}).onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
})
}).id('comment')
.onAreaChange((oldValue: Area, newValue: Area) => {
this.info = newValue
})
// .onMeasureSize()
}
}
}
.id('imgTextContainer')
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
...
...
@@ -163,8 +169,27 @@ export struct ImageAndTextPageComponent {
publishCommentModel: this.publishCommentModel,
operationButtonList: this.operationButtonList,
styleType: 1,
onCommentIconClick: () => {
const info = componentUtils.getRectangleById('comment');
console.log(JSON.stringify(info))
if (!this.offsetY) {
this.offsetY = componentUtils.getRectangleById('comment').windowOffset.y
}
// 定位到评论区域
if (this.isScrollTop) {
this.scroller.scrollTo({
xOffset: 0,
yOffset: this.offsetY,
animation: true
})
} else {
this.scroller.scrollEdge(Edge.Top)
}
this.isScrollTop = !this.isScrollTop
}
})
.position({
y: '100%'
})
.position({
y: '100%'
})
}
.width(CommonConstants.FULL_WIDTH)
.height(CommonConstants.FULL_HEIGHT)
...
...
@@ -174,7 +199,7 @@ export struct ImageAndTextPageComponent {
// 发布时间
Column() {
Row() {
if(this.isNetConnected && !this.detailContentEmpty) {
if
(this.isNetConnected && !this.detailContentEmpty) {
Image(this.contentDetailData?.rmhInfo ? $r('app.media.logo_rmh') : $r('app.media.logo_rmrb'))
.width(80)
.height(28)
...
...
@@ -207,7 +232,7 @@ export struct ImageAndTextPageComponent {
private async getDetail() {
this.isNetConnected = NetworkUtil.isNetConnected()
if(!this.isNetConnected) {
if
(!this.isNetConnected) {
this.emptyType = 1
}
let contentId: string = ''
...
...
@@ -229,7 +254,7 @@ export struct ImageAndTextPageComponent {
let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType)
// 判断内容是否已下线,空数组表示下线
this.detailContentEmpty = detailBeans.length === 0 ? true : false
if(this.detailContentEmpty) {
if
(this.detailContentEmpty) {
this.emptyType = 18
}
console.log(TAG, JSON.stringify(detailBeans))
...
...
@@ -270,12 +295,11 @@ export struct ImageAndTextPageComponent {
}
//意图上报
private viewBlogInsightIntentShare(){
private viewBlogInsightIntentShare()
{
let context = getContext(this) as common.UIAbilityContext;
viewBlogItemInsightIntentShare(context,this.contentDetailData, this.interactData)
viewBlogItemInsightIntentShare(context,
this.contentDetailData, this.interactData)
}
private async getRecommend() {
let params: postRecommendListParams = {
imei: HttpUtils.getImei(),
...
...
@@ -289,7 +313,7 @@ export struct ImageAndTextPageComponent {
let recommendList = await DetailViewModel.postRecommendList(params)
if (recommendList.length > 0) {
//推荐列表过滤音频和活动入口
this.recommendList = recommendList.filter(item => item.objectType !== '3' &&
item.objectType !== '13');
this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13');
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
View file @
8b1b8ad
...
...
@@ -9,7 +9,7 @@ import { ContentDetailDTO } from 'wdBean/Index'
export struct CommentTabComponent {
private onCommentFocus: () => void = () => {
}
private onLoad: (dialogController: CustomDialogController) => void = () => {
private onLoad: (dialogController: CustomDialogController
| null
) => void = () => {
}
@ObjectLink publishCommentModel: publishCommentModel
@Prop contentDetail: ContentDetailDTO
...
...
@@ -42,7 +42,7 @@ export struct CommentTabComponent {
},
backgroundColor: "#50000000",
})
this.onLoad(this.dialogController)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
8b1b8ad
...
...
@@ -64,6 +64,7 @@ export struct OperRowListView {
/**
* 用于区分页面类型,在哪个页面嵌套就传相应的值
* 1:视频详情页 2:竖屏直播页 3:图集 4:横屏直播页
* 8: 评论弹框内
*/
@Prop pageComponentType?: number = -1
@Prop showBackIcon?: boolean = true
...
...
@@ -208,7 +209,7 @@ export struct OperRowListView {
contentDetail: this.contentDetailData,
onCommentFocus: this.onCommentFocus,
pageComponentType: this.pageComponentType,
onLoad: (dialogController: CustomDialogController) => {
onLoad: (dialogController: CustomDialogController
| null
) => {
this.dialogController = dialogController
}
})
...
...
sight_harmony/features/wdDetailPlayShortVideo/src/main/ets/view/CommentDialogView.ets
View file @
8b1b8ad
...
...
@@ -91,6 +91,7 @@ export struct DetailDialog {
OperRowListView({
componentType: 1,
pageComponentType: 8,
showBackIcon: false,
operationButtonList: ['comment', 'like', 'collect', 'share'],
contentDetailData: this.contentDetailData,
...
...
Please
register
or
login
to post a comment