12345678910111213141516171819202122232425262728293031323334353637383940414243 |
-
- import { useMemo } from 'react'
- import Taro from '@tarojs/taro'
- import useSave from "@/utils/hooks/useSave"
- import { compressImage, random } from '@/utils'
- import msTip from '@/assets/icons/housemantj/foodtip.png'
- import mjTip from '@/assets/icons/housemantj/mjtip.png'
- import location from '@/assets/icons/housemantj/location.png'
- import onlove from '@/assets/icons/housemantj/onlove.png'
- import love from '@/assets/icons/housemantj/bheart.png'
- import './style.less'
-
- export default (props) => {
-
- const { className, item, style, } = props
-
- const uqClass = useMemo(() => random('f'), [])
-
- // const cls = useMemo(() => [className, 'contentCard', uqClass].filter(Boolean).join(' '), [className, uqClass])
-
- const [isSaved, toggleSave] = useSave(item.isSaved, item.targetType, item.targetId)
- const Detail = () => {
-
- Taro.navigateTo({ url: `/pages/details/NoteDetails/index?id=${item.noteId}` });
-
-
- }
- return (
- <view className={uqClass} style={{ overflow: 'hidden' }}>
- <view className='contentCard' style={style}>
- <view className='cardTop'>
- <image mode='widthFix' onClick={Detail} src={compressImage(item.poster)} className='cCardimg' />
- {/* <image className='lefttips' src={item.targetType === 'tourist' ? mjTip : msTip} /> */}
- <image onClick={toggleSave} src={isSaved > 0 ? onlove : love} className='loveharde'></image>
- </view>
- <view className='bContent' onClick={Detail}>
- <view className='cCword'>{(item.summary).toString().length > 35 ? (item.summary).substring(0, 35) + '...' : (item.summary)}</view>
- </view>
- </view>
- </view>
- )
-
- }
|