BookboxRowSmall.tsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**书架中书籍的box容器横小 */
  2. import { Text, View, Image, Button, Navigator } from "@tarojs/components";
  3. import React from 'react'
  4. import './index.less'
  5. export interface BookboxRowSmallProps {
  6. book_id: number, // 书ID
  7. book_name: string, // 书名
  8. category: string, //书类型
  9. cover: string, //封面
  10. intro: string,
  11. penname: string, // 作者
  12. sign: string, //阅读人数
  13. section: string,//章节
  14. chapter_name?: string,
  15. chapter_id?: number
  16. }
  17. function BookboxRowSmall(props: BookboxRowSmallProps) {
  18. const { book_id, book_name, category, cover, penname, chapter_name, section, chapter_id } = props
  19. return <View className='book_box_row_small'>
  20. <Navigator url={`/pages/book/bookArticle/index?book_id=${book_id}&chapter_id=${chapter_id || ''}`} hoverClass="none">
  21. <Image src={cover} className='img'></Image>
  22. <View className='right'>
  23. <Text className='title'>{book_name}</Text>
  24. <View className='content'>
  25. <View className='left'>
  26. <Text className='author'>{penname}</Text>
  27. <View className='bottom'>
  28. {
  29. chapter_name ? <>
  30. {/* <Text className='time'>{time}</Text> */}
  31. <Text className='section'>{chapter_name}</Text>
  32. </>:<Text className='null'>未读</Text>
  33. }
  34. </View>
  35. </View>
  36. <Button className='btn' plain={true}>继续阅读</Button>
  37. </View>
  38. </View>
  39. </Navigator>
  40. </View>
  41. }
  42. export default React.memo(BookboxRowSmall)