|
@@ -58,15 +58,46 @@ export function bookListItemComp(item: RepeatItem<BookListItem>){
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+// 书籍Item - 封面模式
|
|
|
|
|
+@Builder
|
|
|
|
|
+export function bookItemCompCover(item: RepeatItem<BookItem>, onClick: () => void){
|
|
|
|
|
+ Row(){
|
|
|
|
|
+ RelativeContainer(){
|
|
|
|
|
+ Image(item.item.coverUrl)
|
|
|
|
|
+ .width(200)
|
|
|
|
|
+ .aspectRatio(1)
|
|
|
|
|
+ .alt($r('[basic].media.png_TopRecommend'))
|
|
|
|
|
+ .alignRules({
|
|
|
|
|
+ middle: { anchor: '__container__', align: HorizontalAlign.Center },
|
|
|
|
|
+ top: { anchor: '__container__', align: VerticalAlign.Top }
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ Image(true ? $r('[basic].media.icon_deerIncrease') : $r('[basic].media.icon_reduce'))
|
|
|
|
|
+ .width(24)
|
|
|
|
|
+ .aspectRatio(1)
|
|
|
|
|
+ .alignRules({
|
|
|
|
|
+ right: { anchor: '__container__', align: HorizontalAlign.End },
|
|
|
|
|
+ bottom: { anchor: '__container__', align: VerticalAlign.Bottom }
|
|
|
|
|
+ })
|
|
|
|
|
+ }.width('100%').height('100%')
|
|
|
|
|
+ }
|
|
|
|
|
+ .width('100%').height(214)
|
|
|
|
|
+ .padding({right: 19, bottom: 15, top: 2})
|
|
|
|
|
+ .backgroundImageSize({width: '100%', height: '100%'})
|
|
|
|
|
+ .backgroundImage($r('[basic].media.png_book_CompCover'))
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 书籍Item
|
|
// 书籍Item
|
|
|
@Builder
|
|
@Builder
|
|
|
export function bookItemComp(item: RepeatItem<BookItem>, onClick: () => void){
|
|
export function bookItemComp(item: RepeatItem<BookItem>, onClick: () => void){
|
|
|
Row({space: 11}){
|
|
Row({space: 11}){
|
|
|
- Image($r('[basic].media.png_TopRecommend'))
|
|
|
|
|
|
|
+ Image(item.item.coverUrl)
|
|
|
.width(86)
|
|
.width(86)
|
|
|
.aspectRatio(1)
|
|
.aspectRatio(1)
|
|
|
.borderRadius(12)
|
|
.borderRadius(12)
|
|
|
|
|
+ .alt($r('[basic].media.png_TopRecommend'))
|
|
|
|
|
|
|
|
Column({space: 3}){
|
|
Column({space: 3}){
|
|
|
Text(item.item?.bookTitle)
|
|
Text(item.item?.bookTitle)
|