|
|
@@ -1,6 +1,10 @@
|
|
|
-import { RouterPage } from 'basic';
|
|
|
+import { RouterPage, YTHeader } from 'basic';
|
|
|
+import { DeerSearch } from '../components/DeerSearch';
|
|
|
+import { CustomTextStyle } from '../style/CustomTextStyle';
|
|
|
import { RootColumnStyle } from '../style/RootColumnStyle';
|
|
|
import { BookListViewModel } from './viewModel/BookListViewModel';
|
|
|
+import { ReadPageComponent } from '@hms.core.readerservice.readerComponent';
|
|
|
+import { bookItemComp } from '../components/BuilderIndex';
|
|
|
|
|
|
// 精选书单
|
|
|
@ComponentV2
|
|
|
@@ -11,12 +15,88 @@ struct BookListPage {
|
|
|
build() {
|
|
|
NavDestination() {
|
|
|
Column() {
|
|
|
+ YTHeader({
|
|
|
+ centerComp: () => { this.SearchComp() },
|
|
|
+ bgc: Color.White
|
|
|
+ })
|
|
|
|
|
|
+ Column(){
|
|
|
+ List({space: 22}){
|
|
|
+ ForEach(this.vm.categoryList, (item: string, index) => {
|
|
|
+ ListItem(){
|
|
|
+ Column(){
|
|
|
+ Text(item)
|
|
|
+ .zIndex(99)
|
|
|
+ .onClick(() => { this.vm.changeCategory(index) })
|
|
|
+ .attributeModifier(new CustomTextStyle({size: 16, weight: 600, color: this.vm.categoryIndex == index ? '#FF111111' : '#FF777777'}))
|
|
|
+
|
|
|
+ if(this.vm.categoryIndex == index){
|
|
|
+ Image($r('[basic].media.icon_SelectBg'))
|
|
|
+ .width(45)
|
|
|
+ .height(16)
|
|
|
+ .margin({top:-10})
|
|
|
+ .transition(TransitionEffect.asymmetric(TransitionEffect.move(TransitionEdge.TOP), TransitionEffect.move(TransitionEdge.TOP)).animation({ duration: 100, curve: Curve.Smooth }))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .alignItems(HorizontalAlign.Center)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .height(40)
|
|
|
+ .width("100%")
|
|
|
+ .scrollBar(BarState.Off)
|
|
|
+ .listDirection(Axis.Horizontal)
|
|
|
+
|
|
|
+ Row(){
|
|
|
+ ForEach(['最新', '最热'], (item: string, index: number) => {
|
|
|
+ Text(item)
|
|
|
+ .borderRadius(15)
|
|
|
+ .padding({left: 12, top: 5, right: 12, bottom: 5})
|
|
|
+ .attributeModifier(new CustomTextStyle({size: 14, weight: 600}))
|
|
|
+ .border({width: 2, color: this.vm.sortType == index ? '#FF000000' : Color.Transparent})
|
|
|
+ .backgroundColor(this.vm.sortType == index ? '#FFFECF2F' : Color.Transparent)
|
|
|
+ .onClick(() => { this.vm.changeSortType(index) })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .margin({top: 10})
|
|
|
+ .justifyContent(FlexAlign.Start)
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .backgroundColor(Color.White)
|
|
|
+ .borderRadius({bottomLeft: 20, bottomRight: 20})
|
|
|
+ .padding({left: 16, right: 16, top: 20, bottom: 18})
|
|
|
+
|
|
|
+ Column(){
|
|
|
+ List({space: 12}){
|
|
|
+ ListItem()
|
|
|
+
|
|
|
+ Repeat(this.vm.bookList)
|
|
|
+ .each((item) => {
|
|
|
+ bookItemComp(item.item)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .height("100%")
|
|
|
+ .scrollBar(BarState.Off)
|
|
|
+ }
|
|
|
+ .width("100%")
|
|
|
+ .layoutWeight(1)
|
|
|
+ .padding({left: 16, right: 16})
|
|
|
+ .backgroundColor(Color.Transparent)
|
|
|
}
|
|
|
- .attributeModifier(new RootColumnStyle())
|
|
|
+ .backgroundColor('#FFF7F9FA')
|
|
|
}
|
|
|
.hideTitleBar(true)
|
|
|
}
|
|
|
+
|
|
|
+ @Builder
|
|
|
+ SearchComp(){
|
|
|
+ Row(){
|
|
|
+ DeerSearch({enable: false})
|
|
|
+ }
|
|
|
+ .margin({left: 50})
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Builder
|