import Taro , { Component } from "@tarojs/taro" ; import { Text , View } from "@tarojs/components" ; import BookCover from "./BookCover" ; import './styles/BookRow.scss' ; import FlexView from "./FlexView" ; interface Interface { coverWidth : number ; coverRatio : BookCoverRatio ; coverShadow ? : boolean ; coverBorderRadius ? : number ; image : string ; renderCoverChildren ? : any ; renderMore ? : any ; renderFooter ? : any ; title : string ; desc : string ; titleSize ? : 13 | 15 | 17 ; descSize ? : 11 | 12 | 13 | 15 | 17 ; } class BookRow extends Component < Interface , { } > { render ( ) { const { coverWidth , coverRatio , coverShadow , coverBorderRadius , image , title , desc , titleSize , descSize } = this . props ; return < FlexView > < View className = 'flex-s ' > < BookCover image = { image } width = { coverWidth } ratio = { coverRatio } shadow = { coverShadow } borderRadius = { coverBorderRadius } > { this . props . renderCoverChildren } < /BookCover> < /View> < FlexView className = 'ml-10 flex-1' direction = 'column' justify = 'space-between' > < View > < Text className = { `text-${ titleSize || 15 } text-default bold line-1` } > { title } < /Text> < Text className = { `text-${ descSize || 12 } text-disable line-2 mt-5` } > { desc } < /Text> < /View> < view > < View className = '' > { this . props . renderMore } < /View> < View className = '' > { this . props . renderFooter } < /View> < /view> < /FlexView> < /FlexView>; } } export default BookRow ;