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
张善主
2024-05-24 17:37:32 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
55973920bc5cf3aff5078e4e2d08e3b7d2603cdf
55973920
2 parents
8742823e
98876584
Merge remote-tracking branch 'origin/main'
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
17 deletions
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
5597392
...
...
@@ -279,6 +279,7 @@ export struct CommentComponent {
if (commentListModel && commentListModel.list && commentListModel.list.length > 0) {
this.allDatas.clearAllData() // 防止数据重复问题
commentListModel.list.forEach(element => {
element.hasMore = Number.parseInt(element.childCommentNum) ? true : false
let newModel = commentViewModel.deepCopyCommentItemModel(element)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
View file @
5597392
import { DisplayUtils, EmitterEventId, EmitterUtils } from 'wdKit/Index'
import { DisplayUtils, EmitterEventId, EmitterUtils
, ToastUtils
} from 'wdKit/Index'
import { publishCommentModel } from '../model/PublishCommentModel'
import { CommentCustomDialog } from './CommentCustomDialog'
import measure from '@ohos.measure'
import { ContentDetailDTO } from 'wdBean/Index'
import { HttpUtils } from 'wdNetwork/Index'
import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'
@Preview
@Component
...
...
@@ -120,6 +122,21 @@ export struct CommentTabComponent {
if(this.contentDetail.appstyle === 9) return
this.onCommentFocus && this.onCommentFocus()
// 未登录,游客评论未打开 则先登录
if (!HttpUtils.isLogin()) {
if (this.contentDetail.visitorComment != 1) {
WDRouterRule.jumpWithPage(WDRouterPage.loginPage)
return
}
}
if (this.contentDetail.openComment != 1 && this.contentDetail.commentDisplay != 1) {
ToastUtils.showToast("暂时无法评论", 3000)
return
}
//TODO: 用户被禁言 也不能评论
this.publishCommentModel.rootCommentId = '-1';
this.publishCommentModel.parentId = '-1';
this.publishCommentModel.placeHolderText = "说两句..."
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
View file @
5597392
import { ViewType } from 'wdConstant/Index'
import { DateTimeUtils, LazyDataSource, ToastUtils, WindowModel } from 'wdKit/Index'
import { DateTimeUtils, LazyDataSource,
Logger,
ToastUtils, WindowModel } from 'wdKit/Index'
import { commentItemModel } from '../model/CommentModel'
import commentViewModel from '../viewmodel/CommentViewModel'
import { router, window } from '@kit.ArkUI'
...
...
@@ -106,8 +106,13 @@ export struct QualityCommentsComponent {
// .aspectRatio(375 / 283);
}
.onAreaChange((oldValue: Area, newValue: Area) => {
let persent = Math.abs(Number(newValue.globalPosition.y)) / 150
if (Number(oldValue.globalPosition.y) == 0 && Number(newValue.globalPosition.y) > 30) {
this.firstPositionY = Number(newValue.globalPosition.y)
return
}
Logger.debug(TAG, "oldValue.globalPosition.y : " + oldValue.globalPosition.y)
Logger.debug(TAG, "newValue.globalPosition.y : " + newValue.globalPosition.y + `,this.topSafeHeight : ` + this.topSafeHeight)
let persent = Math.abs(Number(newValue.globalPosition.y) - this.firstPositionY ) / 150 //- this.topSafeHeight) / 283
if (persent > 1) {
persent = 1
}
...
...
@@ -130,16 +135,17 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
})
}
.visibility(this.tileOpacity > 0 ? 1 : 0)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.color_transparent'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
...
...
@@ -159,9 +165,9 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
left: { anchor: "__container__", align: HorizontalAlign.Start }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
.margin({ left: 16 })
.onClick(() => {
router.back()
...
...
@@ -178,16 +184,17 @@ export struct QualityCommentsComponent {
center: { anchor: "__container__", align: VerticalAlign.Center },
middle: { anchor: "__container__", align: HorizontalAlign.Center }
})
.offset({
y: (this.topSafeHeight / 2) + 'px'
})
// .offset({
// y: (this.topSafeHeight / 2) + 'px'
// })
}
.visibility(this.tileOpacity > 0 ? 0 : 1)
.opacity(this.tileOpacity)
.height(this.topSafeHeight + vp2px(44) + 'px')
// .height(this.topSafeHeight + vp2px(44) + 'px')
.height(44)
.width('100%')
.backgroundColor($r('app.color.white'))
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
//
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
build() {
...
...
@@ -212,7 +219,7 @@ export struct QualityCommentsComponent {
.friction(0.6)
.scrollBar(BarState.Off)
.edgeEffect(EdgeEffect.None)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
//
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
this.TabbarTransparent()
this.TabbarNormal()
...
...
Please
register
or
login
to post a comment