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-06-21 09:33:18 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
80e8502b16e8c27468ad62633ef07a4e98eb4521
80e8502b
1 parent
9e257f19
图集代码优化
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
36 deletions
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/MultiPictureDetailPageComponent.ets
View file @
80e8502
...
...
@@ -36,6 +36,7 @@ export struct MultiPictureDetailPageComponent {
private contentId: string = ''
private relType: string = ''
private displayTool = display.getDefaultDisplaySync()
@State nShowDownloadTitleHeight: number = 0
@State titleHeight: number = 0
@State index: number = 0
@State currentIndex: number = 0
...
...
@@ -50,6 +51,7 @@ export struct MultiPictureDetailPageComponent {
@State swiperIndex: number = 0;
@Provide followStatus: string | undefined = undefined // 关注状态
@Provide showCommentList: boolean = false
private subScroller: Scroller = new Scroller()
private scroller: Scroller = new Scroller()
@State netStatus: number | undefined = undefined // 存储网络状态用来展示缺省图
@State isOffLine: boolean = false // 存储视频下线状态用来展示缺省图
...
...
@@ -63,6 +65,7 @@ export struct MultiPictureDetailPageComponent {
followUserId: string = ''
followUserName: string = ''
@State isEnableSwipe: boolean = true;
@State isScrollerTop: boolean = false;
//watch监听页码回调
onCurrentPageNumUpdated(): void {
...
...
@@ -74,7 +77,8 @@ export struct MultiPictureDetailPageComponent {
async aboutToAppear() {
//获取宽高尺寸
this.titleHeight = this.displayTool.width * 178 / 375
this.titleHeight = this.displayTool.width * 227 / 375
this.nShowDownloadTitleHeight = this.displayTool.width * 311 / 375
//注册字体
// font.registerFont({
// familyName: 'BebasNeueBold',
...
...
@@ -353,34 +357,34 @@ export struct MultiPictureDetailPageComponent {
@Builder
NShowDownload() {
Column() {
Row() {
Scroll(this.scroller) {
Row() {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
if (this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 4
})
}
Scroll(this.scroller) {
Flex({
direction: FlexDirection.Column,
justifyContent: FlexAlign.Start
}) {
if (this.contentDetailData?.photoList?.length) {
Text() {
Span(`${this.swiperIndex + 1}`)
.fontSize(24)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(28)
Span(`/${this.contentDetailData?.photoList?.length}`)
.fontSize(14)
.fontFamily('PingFang SC-Medium')
.fontWeight(500)
.lineHeight(19)
}
.fontColor(Color.White)
.margin({
top: 4,
left: 18,
bottom: 4,
right: 4
})
}
List() {
ListItem(){
if (this.contentDetailData.newsTitle) {
Text(`${this.contentDetailData.newsTitle}`)
.fontColor(Color.White)
...
...
@@ -396,6 +400,8 @@ export struct MultiPictureDetailPageComponent {
})
.width('92%')
}
}
ListItem(){
if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
.fontColor(Color.White)
...
...
@@ -415,15 +421,30 @@ export struct MultiPictureDetailPageComponent {
}
}
}
.width('100%')
.nestedScroll(
{
scrollForward: NestedScrollMode.PARENT_FIRST,
scrollBackward: NestedScrollMode.SELF_FIRST
}
)
.constraintSize (
{
maxHeight: px2vp(this.titleHeight)
}
)
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.constraintSize({
maxHeight: px2vp(this.titleHeight)
})
.align(Alignment.Bottom)
.width('100%')
}
.scrollable(ScrollDirection.Vertical)
.scrollBarWidth(0)
.constraintSize (
{
maxHeight: px2vp(this.nShowDownloadTitleHeight)
}
)
// .initialOffset({
// yOffset: px2vp(this.titleHeight)/2
// })
OperRowListView({
contentDetailData: this.contentDetailData,
...
...
Please
register
or
login
to post a comment