|
@@ -1,11 +1,14 @@
|
|
|
-import { RouterPage, YTHeader } from 'basic';
|
|
|
|
|
|
|
+import { BookItem, RouterPage, YTHeader } from 'basic';
|
|
|
|
|
+import { BookItemComp } from '../../components/BookItemComp';
|
|
|
|
|
+import { SchoolBag } from '../../components/SchoolBag';
|
|
|
|
|
+import { BookListItem } from '../../model/BookModelIndex';
|
|
|
import { CustomTextStyle } from '../../style/CustomTextStyle';
|
|
import { CustomTextStyle } from '../../style/CustomTextStyle';
|
|
|
import { BookListDetailViewModel } from '../viewModel/BookListDetailViewModel';
|
|
import { BookListDetailViewModel } from '../viewModel/BookListDetailViewModel';
|
|
|
|
|
|
|
|
@ComponentV2
|
|
@ComponentV2
|
|
|
@RouterPage
|
|
@RouterPage
|
|
|
struct BookListDetailPage {
|
|
struct BookListDetailPage {
|
|
|
- vm: BookListDetailViewModel = new BookListDetailViewModel();
|
|
|
|
|
|
|
+ @Param @Require vm: BookListDetailViewModel;
|
|
|
|
|
|
|
|
build() {
|
|
build() {
|
|
|
NavDestination() {
|
|
NavDestination() {
|
|
@@ -20,16 +23,16 @@ struct BookListDetailPage {
|
|
|
List(){
|
|
List(){
|
|
|
ListItem(){
|
|
ListItem(){
|
|
|
Column(){
|
|
Column(){
|
|
|
- Text('10月书单推荐')
|
|
|
|
|
|
|
+ Text(this.vm.item.bookListName)
|
|
|
.attributeModifier(new CustomTextStyle({size: 18, weight: 600, color: '#FF111111'}))
|
|
.attributeModifier(new CustomTextStyle({size: 18, weight: 600, color: '#FF111111'}))
|
|
|
|
|
|
|
|
Row(){
|
|
Row(){
|
|
|
- Text('鹿学长绘本')
|
|
|
|
|
|
|
+ Text(this.vm.item.author)
|
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 400, color: '#FF555555'}))
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 400, color: '#FF555555'}))
|
|
|
|
|
|
|
|
Row(){
|
|
Row(){
|
|
|
- Text('2028人')
|
|
|
|
|
- .attributeModifier(new CustomTextStyle({size: 14, weight: 600, color: '#FF111111'}))
|
|
|
|
|
|
|
+ // Text('2028人')
|
|
|
|
|
+ // .attributeModifier(new CustomTextStyle({size: 14, weight: 600, color: '#FF111111'}))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
@@ -37,13 +40,13 @@ struct BookListDetailPage {
|
|
|
.justifyContent(FlexAlign.SpaceBetween)
|
|
.justifyContent(FlexAlign.SpaceBetween)
|
|
|
|
|
|
|
|
Column(){
|
|
Column(){
|
|
|
- Text('拾起落叶的信笺,共读一个暖哄哄的通话')
|
|
|
|
|
|
|
+ Text(this.vm.item.synopsis)
|
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 400, color: '#FF555555'}))
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 400, color: '#FF555555'}))
|
|
|
}
|
|
}
|
|
|
.height(100)
|
|
.height(100)
|
|
|
.width('100%')
|
|
.width('100%')
|
|
|
.margin({top: 5})
|
|
.margin({top: 5})
|
|
|
- .padding({top: 20, left: 5})
|
|
|
|
|
|
|
+ .padding({top: 23, left: 5})
|
|
|
.alignItems(HorizontalAlign.Start)
|
|
.alignItems(HorizontalAlign.Start)
|
|
|
.backgroundImageSize({width: '100%', height: '100%'})
|
|
.backgroundImageSize({width: '100%', height: '100%'})
|
|
|
.backgroundImage($r('[basic].media.png_ListDetailBg'))
|
|
.backgroundImage($r('[basic].media.png_ListDetailBg'))
|
|
@@ -58,7 +61,7 @@ struct BookListDetailPage {
|
|
|
ListItem(){
|
|
ListItem(){
|
|
|
Row(){
|
|
Row(){
|
|
|
Column(){
|
|
Column(){
|
|
|
- Text(`共95册`)
|
|
|
|
|
|
|
+ Text(`共${this.vm.item.bookCount}册`)
|
|
|
.zIndex(99)
|
|
.zIndex(99)
|
|
|
.attributeModifier(new CustomTextStyle({size: 18, weight: 600}))
|
|
.attributeModifier(new CustomTextStyle({size: 18, weight: 600}))
|
|
|
|
|
|
|
@@ -68,7 +71,7 @@ struct BookListDetailPage {
|
|
|
.margin({top:-10})
|
|
.margin({top:-10})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Text(`已读4本`)
|
|
|
|
|
|
|
+ Text(``) // 已读xx本
|
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 500, color: '#FF7C7D7D'}))
|
|
.attributeModifier(new CustomTextStyle({size: 14, weight: 500, color: '#FF7C7D7D'}))
|
|
|
}
|
|
}
|
|
|
.width('100%')
|
|
.width('100%')
|
|
@@ -77,11 +80,10 @@ struct BookListDetailPage {
|
|
|
.margin({top: 12})
|
|
.margin({top: 12})
|
|
|
.padding({left: 16, right: 16})
|
|
.padding({left: 16, right: 16})
|
|
|
|
|
|
|
|
- ForEach(new Array(10).fill('0'), (item: string, index) => {
|
|
|
|
|
|
|
+ ForEach(this.vm.bookList, (item: BookItem, index) => {
|
|
|
ListItem(){
|
|
ListItem(){
|
|
|
Column(){
|
|
Column(){
|
|
|
- // todo 完善书籍组件
|
|
|
|
|
- // bookItemComp('我不愿嫉妒', () => { this.vm.increaseIndex = index })
|
|
|
|
|
|
|
+ BookItemComp({ item: item })
|
|
|
}.alignItems(HorizontalAlign.End).justifyContent(FlexAlign.End)
|
|
}.alignItems(HorizontalAlign.End).justifyContent(FlexAlign.End)
|
|
|
}
|
|
}
|
|
|
.margin({top: 8})
|
|
.margin({top: 8})
|
|
@@ -101,23 +103,21 @@ struct BookListDetailPage {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Column({space: 3}){
|
|
Column({space: 3}){
|
|
|
- ForEach(['一键\n添加', '书包'], (item: string, index) => {
|
|
|
|
|
- Column({space: 3}){
|
|
|
|
|
- Image(index == 0 ?
|
|
|
|
|
- $r('[basic].media.icon_deerIncrease') :
|
|
|
|
|
- $r('[basic].media.icon_schoolbag_'))
|
|
|
|
|
- .width(24)
|
|
|
|
|
- .aspectRatio(1)
|
|
|
|
|
-
|
|
|
|
|
- Text(item)
|
|
|
|
|
- .attributeModifier(new CustomTextStyle({size: 12, weight: 400}))
|
|
|
|
|
- }
|
|
|
|
|
- .width(42)
|
|
|
|
|
- .padding(9)
|
|
|
|
|
- .borderRadius(8)
|
|
|
|
|
- .backgroundColor(Color.White)
|
|
|
|
|
- .shadow({ color: '#40000000', radius: 8 })
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ Column({space: 3}){
|
|
|
|
|
+ Image($r('[basic].media.icon_deerIncrease'))
|
|
|
|
|
+ .width(24)
|
|
|
|
|
+ .aspectRatio(1)
|
|
|
|
|
+
|
|
|
|
|
+ Text('一键\n添加')
|
|
|
|
|
+ .attributeModifier(new CustomTextStyle({size: 12, weight: 400}))
|
|
|
|
|
+ }
|
|
|
|
|
+ .width(42)
|
|
|
|
|
+ .padding(9)
|
|
|
|
|
+ .borderRadius(8)
|
|
|
|
|
+ .backgroundColor(Color.White)
|
|
|
|
|
+ .shadow({ color: '#40000000', radius: 8 })
|
|
|
|
|
+
|
|
|
|
|
+ SchoolBag({compMode: true})
|
|
|
}
|
|
}
|
|
|
.margin({ bottom: 53, right: 31})
|
|
.margin({ bottom: 53, right: 31})
|
|
|
.backgroundColor(Color.Transparent)
|
|
.backgroundColor(Color.Transparent)
|
|
@@ -133,6 +133,6 @@ struct BookListDetailPage {
|
|
|
|
|
|
|
|
|
|
|
|
|
@Builder
|
|
@Builder
|
|
|
-function BookListDetailBuilder() {
|
|
|
|
|
- BookListDetailPage()
|
|
|
|
|
|
|
+function BookListDetailBuilder(_: string, item: BookListItem) {
|
|
|
|
|
+ BookListDetailPage({ vm: new BookListDetailViewModel(item) })
|
|
|
}
|
|
}
|