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-27 16:14:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5c0cc9901350718d3954d0cd6d7fde6f224bd1a9
5c0cc990
1 parent
9002e6ae
【穿越测试】后台未设置支持语音播报,客户端展示语音播报按钮
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
13 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
sight_harmony/features/wdComponent/src/main/ets/components/CarderInteraction.ets
View file @
5c0cc99
...
...
@@ -20,6 +20,8 @@ export struct CarderInteraction {
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State newsStatusOfUser: batchLikeAndCollectResult = {} as batchLikeAndCollectResult // 点赞、收藏状态
@State likeBean: Record<string, string> = {}
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
async aboutToAppear() {
await this.getContentDetailData()
...
...
@@ -32,6 +34,9 @@ export struct CarderInteraction {
this.likeBean['channelId'] = this.contentDetailData.reLInfo?.channelId + ''
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
}
build() {
...
...
@@ -92,7 +97,7 @@ export struct CarderInteraction {
})
}
}
.
width(42
)
.
visibility(this.likesStyle == 4 || !this.openLikes ? Visibility.None : Visibility.Visible
)
}
/**
...
...
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
5c0cc99
...
...
@@ -78,9 +78,14 @@ export struct DynamicDetailComponent {
@State publishCommentModel: publishCommentModel = new publishCommentModel()
@State reachEndIncreament: number = 0
@State operationButtonList: string[] = []
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
async aboutToAppear() {
await this.getContentDetailData()
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
}
onPageHide() {
...
...
@@ -537,6 +542,7 @@ export struct DynamicDetailComponent {
//内容点赞/取消点赞埋点
})
.visibility(this.likesStyle == 4 || !this.openLikes ? Visibility.None : Visibility.Visible)
// 评论
if (this.contentDetailData?.openComment) {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LikeComponent.ets
View file @
5c0cc99
...
...
@@ -25,6 +25,7 @@ export struct LikeComponent {
@Prop pageComponentType: number
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State likeStatus: boolean = false
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
viewModel: LikeViewModel = new LikeViewModel()
@Prop @Watch('onDataUpdated') data: Record<string, string>
enableBtn = true
...
...
@@ -41,17 +42,23 @@ export struct LikeComponent {
// this.data['title'] = '开创两校交流先河!克罗地亚教育代表团访问同济大学'
// this.data['userHeaderUrl'] = ""
// this.data['channelId'] = "2059" //必须
// this.data['status'] = "1"
// this.data['status'] = "1"
// 内容用 是否开启点赞 1是 0否;
// this.contentDetailData.openLikes == 1
aboutToAppear() {
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
// 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle
this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false
} else {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
}
console.log(TAG, 'this.contentDetailData', JSON.stringify(this.contentDetailData))
console.log(TAG, 'this.likesStyle', this.likesStyle)
console.log(TAG, 'this.openLikes', this.openLikes)
this.onDataUpdated()
this.contentTrackingDict()
}
...
...
@@ -176,7 +183,7 @@ export struct LikeComponent {
}
.width(154)
.height(40)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty'
|| !this.openLikes
? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -194,7 +201,7 @@ export struct LikeComponent {
.onClick(() => {
this.clickButtonEvent()
})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty'
|| !this.openLikes
? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -211,7 +218,7 @@ export struct LikeComponent {
}
.width(24)
.height(24)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty'
|| !this.openLikes
? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -286,7 +293,7 @@ export struct LikeComponent {
}.width(24).height(24).onClick(() => {
this.clickButtonEvent()
})
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty'
|| !this.openLikes
? Visibility.None : Visibility.Visible)
}
@Builder
...
...
@@ -323,7 +330,7 @@ export struct LikeComponent {
}
.width(36)
.height(42)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty' ? Visibility.None : Visibility.Visible)
.visibility(this.likesStyle == 4 || this.likesStyle == 'empty'
|| !this.openLikes
? Visibility.None : Visibility.Visible)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/OperRowListView.ets
View file @
5c0cc99
...
...
@@ -75,7 +75,6 @@ export struct OperRowListView {
*/
@Prop pageComponentType?: number = -1
@Prop showBackIcon?: boolean = true
@State likesStyle: number = this.contentDetailData.likesStyle // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@Prop operationButtonList?: string[] = ['comment', 'collect', 'share'] // 组件展示条件
@State needLike: boolean = true
@ObjectLink publishCommentModel: publishCommentModel
...
...
@@ -94,6 +93,8 @@ export struct OperRowListView {
@State dialogController: CustomDialogController | null = null;
pageParam: ParamType = {}
PageName: string = ''
@State likesStyle: number | string = 1 // 赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
@State openLikes: boolean = false // 是否可以点赞 1:可以 0:不可以
async aboutToAppear() {
console.info(TAG, 'this.needLike', this.needLike)
...
...
@@ -113,6 +114,17 @@ export struct OperRowListView {
}
})
this.contentTrackingDict()
// 2:竖屏直播页 3:图集 4:横屏直播页
if(this.pageComponentType == 2 || this.pageComponentType == 4) {
// 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福
this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle
this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false
} else {
// 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空
this.likesStyle = this.contentDetailData.likesStyle
this.openLikes = this.contentDetailData.openLikes == 1 ? true : false
}
}
contentTrackingDict(){
...
...
@@ -170,6 +182,7 @@ export struct OperRowListView {
}
console.info(TAG, 'contentDetailData----', JSON.stringify(this.contentDetailData))
console.info(TAG, 'likeBean----', JSON.stringify(this.likeBean))
console.info(TAG, 'this.operationButtonList', JSON.stringify(this.operationButtonList))
// 评论需要数据
/* this.publishCommentModel.targetId = this.contentDetailData.newsId + ''
this.publishCommentModel.targetRelId = this.contentDetailData.reLInfo?.relId + ''
...
...
@@ -305,19 +318,16 @@ export struct OperRowListView {
*/
@Builder
builderLike() {
// 点赞根据字段判断是否显示待添加
Column() {
// if (this.likeBean?.contentId) {
LikeComponent({
data: this.likeBean,
styleType: this.styleType,
componentType: this.componentType,
pageComponentType: this.pageComponentType
})
// }
}
.width(48)
.visibility(this.likesStyle
!== 4 ? Visibility.Visible : Visibility.Non
e)
.visibility(this.likesStyle
== 4 || this.likesStyle == 'empty' || !this.openLikes ? Visibility.None : Visibility.Visibl
e)
}
/**
...
...
Please
register
or
login
to post a comment