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-08-13 14:01:23 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
78327276ce6c7e9e78c80a5cd5ea2c6276730eb4
78327276
1 parent
db81744a
fix: 【生产】搜索页面,点击热门搜索词后,搜索结果页,缺少评论和点赞按钮。
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
26 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/CardParser.ets
View file @
7832727
...
...
@@ -54,8 +54,12 @@ export struct CardParser {
}
build() {
Column() {
// Text('CardParser')
// Text(JSON.stringify(this.contentDTO.appStyle))
this.contentBuilder(this.contentDTO);
}
}
@Builder
contentBuilder(contentDTO: ContentDTO) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
View file @
7832727
...
...
@@ -23,6 +23,8 @@ export struct CarderInteraction {
@State likeBean: Record<string, string> = {}
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
@State isShowComment: boolean = false // 是否显示评论
@State isShowLike: boolean = false // 是否显示点赞
@Provide pageName: string = TrackConstants.PageName.DynamicDetail
@Provide pageId: string = TrackConstants.PageName.DynamicDetail
...
...
@@ -35,13 +37,19 @@ export struct CarderInteraction {
this.likeBean['title'] = this.contentDetailData.newsTitle + ''
this.likeBean['userHeaderUrl'] = this.contentDetailData.userInfo?.headPhotoUrl + ''
this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
this.contentDTO.shareFlag = this.contentDTO.shareFlag
?this.contentDTO.shareFlag:
'1'
this.contentDTO.shareFlag = this.contentDTO.shareFlag
? this.contentDTO.shareFlag :
'1'
console.log('是否显示分享',this.contentDTO.shareFlag)
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
this.isShowComment = this.buildDisplayComment()
this.isShowLike = this.buildDisplayLike()
// console.log(TAG, 'this.isShowComment', this.isShowComment)
// console.log(TAG, 'this.isShowLike', this.isShowLike)
// console.log(TAG, 'router.getState().name', router.getState().name)
}
build() {
Row() {
if(this.contentDetailData?.shareInfo?.shareOpen === 1){
...
...
@@ -61,10 +69,14 @@ export struct CarderInteraction {
}
if(this.contentDetailData?.openComment == 1 || router.getState().name === 'PeopleShipHomePage'){
if (this.buildDisplayComment()) this.commentLayout()
if (this.isShowComment) {
this.commentLayout()
}
}
if(this.buildDisplayLike()) this.builderLike()
if(this.isShowLike) {
this.builderLike()
}
}
.width('100%')
.margin({ top: 11 })
...
...
@@ -99,13 +111,11 @@ export struct CarderInteraction {
@Builder
builderLike() {
Row() {
if (this.likeBean?.contentId) {
LikeComponent({
data: this.likeBean,
componentType: 3
})
}
}
.visibility(this.likesStyle == 4 || !this.openLikes ? Visibility.None : Visibility.Visible)
}
...
...
@@ -117,7 +127,8 @@ export struct CarderInteraction {
let data = await MultiPictureDetailViewModel.getDetailData(this.contentDTO.relId, this.contentDTO.objectId,
this.contentDTO.relType)
this.contentDetailData = data[0];
console.log('动态详情', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'this.contentDetailData.rmhInfo', JSON.stringify(this.contentDetailData.rmhInfo))
} catch (exception) {
console.log('请求失败', JSON.stringify(exception))
}
...
...
@@ -125,32 +136,27 @@ export struct CarderInteraction {
///是否展示评论
buildDisplayComment(): boolean {
let isDisplay = false
if (this.contentDTO.rmhInfo) {
if (this.contentDTO.rmhInfo.cnIsComment === 1 && this.contentDTO.openComment === 1) {
isDisplay = true
}
}else {
if (this.contentDTO.openComment === 1) {
isDisplay = true
}
// console.log(TAG, 'buildDisplayComment this.contentDetailData', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'buildDisplayComment this.contentDetailData.rmhInfo', JSON.stringify(this.contentDetailData.rmhInfo))
const hasRmhInfo = this.contentDetailData && this.contentDetailData.rmhInfo;
if (hasRmhInfo) {
return this.contentDetailData?.rmhInfo!.cnlsComment === 1 && this.contentDetailData.openComment === 1;
}
return isDisplay
return this.contentDetailData?.openComment === 1;
}
///是否展示点赞
buildDisplayLike(): boolean {
let isDisplay = false
if (this.contentDTO.rmhInfo) {
if (this.contentDTO.rmhInfo.cnIsLike === 1 && this.contentDTO.openLikes === 1) {
isDisplay = true
}
}else {
if (this.contentDTO.openLikes === 1) {
isDisplay = true
}
// console.log(TAG, 'buildDisplayLike this.contentDetailData', JSON.stringify(this.contentDetailData))
// console.log(TAG, 'buildDisplayLike this.contentDetailData.rmhInfo', JSON.stringify(this.contentDetailData.rmhInfo))
const hasRmhInfo = this.contentDetailData && this.contentDetailData.rmhInfo;
if (hasRmhInfo) {
return this.contentDetailData?.rmhInfo!.cnlsLike === 1 && this.contentDetailData.openLikes === 1;
}
return
isDisplay
return
this.contentDetailData?.openLikes === 1;
}
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
7832727
...
...
@@ -72,6 +72,7 @@ export struct CompParser {
build() {
Column() {
// Text('CompParser')
// Text(JSON.stringify(this.compDTO.compStyle))
this.componentBuilder();
}
...
...
Please
register
or
login
to post a comment