Skip to content

Commit

Permalink
Merge pull request mgz0227#67 from mgz0227/dev_2008
Browse files Browse the repository at this point in the history
书架可以滑动
  • Loading branch information
MaoXiaoone committed May 18, 2024
2 parents 4900b41 + 28f851d commit 1388785
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 17 deletions.
2 changes: 1 addition & 1 deletion entry/src/main/ets/componets/group/groupTypePanel.ets
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default struct groupTypePanel{
.selectedColor("#F60").hoverEffect(HoverEffect.None)
.onChange(()=>{
updateAppData(this.APP_INDEX_SCROLLABLE)
showMessage(this.APP_INDEX_SCROLLABLE?'开启标签锁':'关闭标签锁')
showMessage(this.APP_INDEX_SCROLLABLE?'标签栏锁已开启':'标签栏已解锁')
})
}.alignItems(VerticalAlign.Bottom).justifyContent(FlexAlign.End)
}
Expand Down
2 changes: 1 addition & 1 deletion entry/src/main/ets/pages/Index.ets
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct Main {
console.log('onAction' + event.repeat)
if (event.repeat) {
updateAppData(!this.APP_INDEX_SCROLLABLE)
showMessage(this.APP_INDEX_SCROLLABLE?'开启标签锁':'关闭标签锁')}}))
showMessage(this.APP_INDEX_SCROLLABLE?'标签栏锁已开启':'标签栏已解锁')}}))
.width('100%')
.margin({top:4})
.height("100%")
Expand Down
55 changes: 41 additions & 14 deletions entry/src/main/ets/pages/view/bookShelf/IndexShelf.ets
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,58 @@ export default struct IndexShelf {
@State isRefreshing: boolean = false
@State counter: number = 0
@State RefreshingTitle:string = '松开刷新'
@State groupCoverShow:boolean = true

@State groupCoverShow:boolean = false
@StorageProp('APP_INDEX_SCROLLABLE') APP_INDEX_SCROLLABLE: boolean = false
build() {
Column() {
Blank(20)
Tabs({
barPosition:BarPosition.Start
}){
TabContent(){
this.book()
}

TabContent(){
this.book()
}

TabContent(){
this.book()
}
}
.barHeight(0)
.onChange((index) => {
console.log('index:' + index)
this.currentIndex = index
})
.scrollable(this.APP_INDEX_SCROLLABLE)
}
.padding({bottom:10})
.borderRadius({ bottomRight:5 ,bottomLeft:5})
.backgroundImage($r('app.media.backgroundimage'))
.backgroundImageSize({width:'100%',height:'10%'})
.width('100%')
}

@Builder book(){
Column(){
Flex({
justifyContent: FlexAlign.SpaceBetween,
alignItems: ItemAlign.End
}) {
}){
Row({ space: 20 }) {
BookMark({ title: '小说', index: 0, currentIndex: this.currentIndex }).onClick(() => {
this.currentIndex = 0
console.log(this.currentIndex + '')
})
BookMark({ title: '漫画', index: 1, currentIndex: this.currentIndex }).onClick(() => {
this.currentIndex = 1
console.log(this.currentIndex + '')
})
BookMark({ title: '有声书', index: 2, currentIndex: this.currentIndex }).onClick(() => {
this.currentIndex = 2
console.log(this.currentIndex + '')
})
}
.padding({ left: 15 })
Expand Down Expand Up @@ -111,15 +146,7 @@ export default struct IndexShelf {
}
])
}.margin({right:20 })

}
.padding({bottom:10})
.borderRadius({ bottomRight:5 ,bottomLeft:5})
.backgroundImage($r('app.media.backgroundimage'))
.backgroundImageSize({width:'100%'})
.height('10%')
.width('100%')

Flex(
{
alignItems: ItemAlign.Center,
Expand Down Expand Up @@ -207,8 +234,8 @@ export default struct IndexShelf {
}
.padding({left:10,right:10})
}
.height('85%')
.align(Alignment.TopStart)
.height('83%')
// .height(this.searchValue==='浏览历史'?'83%':'78%')
.scrollBar(BarState.Off)
}
Expand All @@ -227,8 +254,8 @@ export default struct IndexShelf {
}, 1000)

})
}.alignContent(Alignment.Top)

}
.alignContent(Alignment.Top)
}
}

Expand Down
1 change: 1 addition & 0 deletions entry/src/main/ets/pages/view/bookShelf/novelPage.ets
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default struct novelPage{
@Link @Watch('onIsClearChange') isClear:boolean
@Prop currentIndex:number
@State lastIndex:string = '9999'
@Prop bookType:string
@Prop @Watch('onIsEXHIBITChange') EXHIBIT:string
@StorageProp(CommonConstants.KEY_NOVEL_BOOK_DATA)
bookList:BookList[] = []
Expand Down
5 changes: 4 additions & 1 deletion entry/src/main/ets/storage/bookListData.ets
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ const novelListData:BookList[] = [
,new BookList('7','仙人消失之后','会说话的肘子·未读过7','更新至·第340章 镇压',$r('app.media.cover_list'),'玄幻')
,new BookList('8','仙人消失之后','会说话的肘子·未读过8','更新至·第340章 镇压',$r('app.media.cover_list'),'玄幻')
,new BookList('9','仙人消失之后','会说话的肘子·未读过9','更新至·第340章 镇压',$r('app.media.cover_list'),'玄幻')
,new BookList('10','仙人消失之后','会说话的肘子·未读过10','更新至·第340章 镇压',$r('app.media.cover_list'),'玄幻')]
,new BookList('10','仙人消失之后','会说话的肘子·未读过10','更新至·第340章 镇压',$r('app.media.cover_list'),'玄幻')
,new BookList('11','仙人消失之后','会说话的肘子·未读过10','更新至·第340章 镇压',$r('app.media.cover_list'),'玄幻')

]

const soundListData:BookList[] = [
new BookList('1','三体广播据','729声工厂 · 第一季 第五集 红岸基地','共101集 · 最终季 最终集 回归大宇宙',$r('app.media.cover_list2'),'玄幻'),
Expand Down

0 comments on commit 1388785

Please sign in to comment.