BookboxRowMiddle.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**分类书籍的box容器 横大*/
  2. import { Text, View, Image, Navigator } from "@tarojs/components";
  3. import React from 'react'
  4. import './index.less'
  5. export interface BookboxRowMiddleProps {
  6. bookId: number,//书ID
  7. authorName: string,//作者
  8. bookName: string,//书名称
  9. bookDesc: string,//描述
  10. picUrl: string,//封面
  11. bookStatus: number,//完本|连载状态
  12. wordCount: number,//字数
  13. labelInfoList: { name: string }[],//标签
  14. }
  15. function BookboxRowMiddle(props: BookboxRowMiddleProps) {
  16. const { bookName, picUrl, bookDesc, labelInfoList, authorName, bookId, wordCount, bookStatus } = props
  17. const click = () => {
  18. // BookStore.setData({ openBookData: props })
  19. }
  20. return <View className='book_box_row_middle' onClick={click}>
  21. <Navigator url={'/pages/book/bookDetails/index?bookId=' + bookId} hoverClass="none">
  22. <Image src={picUrl || ''} className='img'></Image>
  23. <View className='right'>
  24. <Text className='title'>{bookName}</Text>
  25. <View className='content'>
  26. <View className='left'>
  27. <Text className='details'>{bookDesc?.replace(/\s/ig,'')}</Text>
  28. <View className='bottom'>
  29. <Text className='describe'>{authorName}</Text>
  30. <Text className='label'>{labelInfoList?.[0].name}</Text>
  31. </View>
  32. </View>
  33. </View>
  34. </View>
  35. </Navigator>
  36. </View>
  37. }
  38. export default React.memo(BookboxRowMiddle)