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-09-26 18:04:58 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
aeef8ebae5952b9a5d26edb371ce92531dad2e54
aeef8eba
2 parents
f9a9daf6
7799d734
Merge branch 'main' of
http://192.168.1.42/developOne/harmonyPool
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
33 deletions
sight_harmony/features/wdComponent/src/main/ets/components/H5NewsWebPageComponent.ets
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/reusable/CustomTitleUI.ets
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
sight_harmony/products/phone/src/main/ets/dailynewspaperwidget/pages/DailyNewspaperWidgetCard.ets
sight_harmony/features/wdComponent/src/main/ets/components/H5NewsWebPageComponent.ets
View file @
aeef8eb
...
...
@@ -42,7 +42,7 @@ export struct H5NewsWebPageComponent {
action: Action = {} as Action
@State webUrl: string = '';
@Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State recommendList: ContentDTO[] = []
//
@State recommendList: ContentDTO[] = []
@State newsStatusOfUser: batchLikeAndCollectResult | undefined = undefined // 点赞、收藏状态
@State interactData: InteractDataDTO = {} as InteractDataDTO
@State isPageEnd: boolean = false
...
...
@@ -58,7 +58,7 @@ export struct H5NewsWebPageComponent {
@State showCommentList: boolean = false
@State index: number = 0
@State currentIndex: number = 0
private navTitle = '人民日报';
@State navTitle: string = ""
build() {
Stack({ alignContent: Alignment.Top }){
...
...
@@ -137,13 +137,14 @@ export struct H5NewsWebPageComponent {
console.log(TAG, "dl1111111111", JSON.stringify(detailBeans[0]))
if (detailBeans && detailBeans.length > 0) {
this.contentDetailData = detailBeans[0];
this.navTitle = this.contentDetailData.newsTitle
let dateTime =
DateTimeUtils.parseDate(this.contentDetailData?.publishTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN);
// let _publishTime = DateTimeUtils.formatDate(dateTime, PATTERN_DATE_CN_RN)
// this.publishTime = DateTimeUtils.removeTrailingZeros(_publishTime)
if (this.contentDetailData?.recommendShow === 1) {
this.getRecommend()
}
// if (this.contentDetailData?.recommendShow === 1) {
// this.getRecommend()
// }
if (this.contentDetailData?.openLikes === 1) {
console.log(TAG, '点赞this.getInteractDataStatus()')
this.getInteractDataStatus()
...
...
@@ -167,10 +168,10 @@ export struct H5NewsWebPageComponent {
if (this.contentDetailData.openLikes === 1) {
this.operationButtonList.push('like')
}
if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length &&
this.contentDetailData?.audioList[0].audioUrl) {
this.operationButtonList.push('listen')
}
// if (this.contentDetailData?.openAudio && this.contentDetailData?.audioList?.length &&
// this.contentDetailData?.audioList[0].audioUrl) {
// this.operationButtonList.push('listen')
// }
this.operationButtonList.push('collect')
if (this.contentDetailData.shareInfo?.shareOpen === 1) {
this.operationButtonList.push('share')
...
...
@@ -179,23 +180,23 @@ export struct H5NewsWebPageComponent {
}
}
private async getRecommend() {
let params: postRecommendListParams = {
imei: HttpUtils.getImei(),
userId: HttpUtils.getUserId(),
contentId: String(this.contentDetailData?.newsId),
recType: 1,
contentType: this.contentDetailData?.newsType,
relId: this.contentDetailData?.reLInfo?.relId,
// channelId: String(this.contentDetailData?.reLInfo?.channelId)
}
let recommendList = await DetailViewModel.postRecommendList(params)
if (recommendList.length > 0) {
//推荐列表过滤音频和活动入口
this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13');
}
}
// private async getRecommend() {
// let params: postRecommendListParams = {
// imei: HttpUtils.getImei(),
// userId: HttpUtils.getUserId(),
// contentId: String(this.contentDetailData?.newsId),
// recType: 1,
// contentType: this.contentDetailData?.newsType,
// relId: this.contentDetailData?.reLInfo?.relId,
// // channelId: String(this.contentDetailData?.reLInfo?.channelId)
// }
// let recommendList = await DetailViewModel.postRecommendList(params)
// if (recommendList.length > 0) {
// //推荐列表过滤音频和活动入口
// this.recommendList = recommendList.filter(item => item.objectType !== '3' && item.objectType !== '13');
// }
//
// }
// 已登录->查询用户对作品点赞、收藏状态
private async getInteractDataStatus() {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentComponent.ets
View file @
aeef8eb
...
...
@@ -87,7 +87,7 @@ export struct CommentComponent {
dx: 0,
dy: -20
},
background
Color: "#50000000",
mask
Color: "#50000000",
})
this.getData();
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/CommentTabComponent.ets
View file @
aeef8eb
...
...
@@ -48,7 +48,7 @@ export struct CommentTabComponent {
dx: 0,
dy: -20
},
background
Color: "#50000000",
mask
Color: "#50000000",
})
this.onLoad(this.dialogController)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/comment/view/QualityCommentsComponent.ets
View file @
aeef8eb
...
...
@@ -75,7 +75,7 @@ export struct QualityCommentsComponent {
dx: 0,
dy: -20
},
background
Color: "#50000000",
mask
Color: "#50000000",
})
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reusable/CustomTitleUI.ets
View file @
aeef8eb
...
...
@@ -3,7 +3,7 @@ import router from '@ohos.router'
@Component
export struct CustomTitleUI {
imgBack:boolean = true
titleName:ResourceStr = "默认标题
"
@Prop titleName: ResourceStr = "
"
@Prop percent:number = 1
isShowBottomLine:boolean = false
...
...
sight_harmony/features/wdComponent/src/main/ets/components/view/LiveOperRowListView.ets
View file @
aeef8eb
...
...
@@ -377,7 +377,7 @@ export struct LiveOperRowListView {
dx: 0,
dy: -20
},
background
Color: "#50000000",
mask
Color: "#50000000",
})
this.publishCommentModel.rootCommentId = '-1';
this.publishCommentModel.parentId = '-1';
...
...
sight_harmony/products/phone/src/main/ets/dailynewspaperwidget/pages/DailyNewspaperWidgetCard.ets
View file @
aeef8eb
...
...
@@ -12,7 +12,19 @@ const DAILY_NEWSPAPER_DEEP_LINK = "rmrbapp://rmrb.app/openwith?type=topic&subTyp
struct DailyNewspaperWidgetCard {
@LocalStorageProp('paperType') paperType: FormNewspaperPaperType = FormNewspaperPaperType.unknown;
@LocalStorageProp('paperInfo') paperInfo: FormNewspaperPaperInfo = {} as FormNewspaperPaperInfo;
@LocalStorageProp('paperContents') paperContents: FormNewspaperPaperContent[] = [];
@LocalStorageProp('paperContents') @Watch("paperContentsUpdates") paperContents: FormNewspaperPaperContent[] = [];
@State needShowNumber: boolean = false
aboutToAppear(): void {
}
paperContentsUpdates() {
const hasAnyRightImages = this.paperContents.filter((content) => {
return content.coverUrl && content.coverUrl.length > 0
}).length > 0
this.needShowNumber = !this.paperInfo.showLeftImage && !hasAnyRightImages
}
build() {
...
...
@@ -73,7 +85,12 @@ struct DailyNewspaperWidgetCard {
List() {
ForEach(this.paperContents, (item: FormNewspaperPaperContent, index: number) => {
ListItem() {
ContentCellView({content: item, index: index, hasImage: (item.coverUrl && item.coverUrl.length > 0 ? true : false)})
ContentCellView({
content: item,
index: index,
needShowNumber: this.needShowNumber,
hasImage: (item.coverUrl && item.coverUrl.length > 0 ? true : false)
})
}
}, (item: FormNewspaperPaperContent, index) => index + JSON.stringify(item))
}
...
...
@@ -90,11 +107,17 @@ struct DailyNewspaperWidgetCard {
@Component
struct ContentCellView {
@Prop needShowNumber: boolean = false
@Prop content: FormNewspaperPaperContent
private index : number = 0
private hasImage: boolean = false
build() {
Row() {
if (this.needShowNumber) {
Text((this.index + 1) + "")
.fontColor("#ED2800")
.margin({left: 4, right: 4})
}
Text(this.content.title)
.maxLines((this.content.coverUrl && this.content.coverUrl.length > 0 ? 2 : 1))
.textOverflow({ overflow: TextOverflow.Ellipsis })
...
...
Please
register
or
login
to post a comment