|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
import {FC, ReactNode, useCallback, useEffect, useState} from "react"; |
|
|
|
|
import {Image, Video, View} from "@tarojs/components"; |
|
|
|
|
import {Text, Video, View} from "@tarojs/components"; |
|
|
|
|
import {brandApi, BrandRecord} from "@/api"; |
|
|
|
|
import Taro, {useReachBottom} from "@tarojs/taro"; |
|
|
|
|
import Empty from "@/components/empty/empty"; |
|
|
|
@ -7,12 +7,13 @@ import Spinner from "@/components/spinner"; |
|
|
|
|
import Img from "@/components/image/image"; |
|
|
|
|
import {beforeTime} from "@/utils/time"; |
|
|
|
|
import styles from './list.module.scss' |
|
|
|
|
import articleLine from "@/static/img/articleLine.png" |
|
|
|
|
import Collect from "@/components/collect/collect"; |
|
|
|
|
// import articleLine from "@/static/img/articleLine.png"
|
|
|
|
|
// import Collect from "@/components/collect/collect";
|
|
|
|
|
import PageScript from "@/components/pageScript/pageScript"; |
|
|
|
|
|
|
|
|
|
const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onClick}) => { |
|
|
|
|
let media: ReactNode |
|
|
|
|
let hasMedia = true |
|
|
|
|
if (data.introductory_video_resource) { |
|
|
|
|
media = <Video |
|
|
|
|
style={{width: '100%'}} |
|
|
|
@ -26,10 +27,12 @@ const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onCl |
|
|
|
|
mode="aspectFill" |
|
|
|
|
style={{background: '#ededed'}} |
|
|
|
|
/> |
|
|
|
|
} else { |
|
|
|
|
hasMedia = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<View className="bg-white flex flex-column justify-stretch mb-2_4 rounded-10 clip"> |
|
|
|
|
<View className="bg-white flex flex-column justify-stretch mb-2 clip"> |
|
|
|
|
<View className="p-3"> |
|
|
|
|
<View onClick={onClick}> |
|
|
|
|
<View className='mb-2 font-32 flex'> |
|
|
|
@ -39,31 +42,29 @@ const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onCl |
|
|
|
|
src={data.logo} |
|
|
|
|
mode='aspectFill' |
|
|
|
|
errorType='brand' |
|
|
|
|
className="rounded-10 clip" |
|
|
|
|
className="rounded clip" |
|
|
|
|
style={{background: '#ededed'}} |
|
|
|
|
/> |
|
|
|
|
<View className="ml-2 flex-1"> |
|
|
|
|
<View className="text-row1 font-28">{data.name}</View> |
|
|
|
|
<View className='font-24 mt-2 text-muted'>{beforeTime(data.created_at)}·加入</View> |
|
|
|
|
<View className='font-24 mt-2 text-muted'> |
|
|
|
|
<Text>{beforeTime(data.created_at)}</Text> |
|
|
|
|
<Text className='ml-2'>文章 {data.article_count || 0}</Text> |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<View className={styles.previewImag}> |
|
|
|
|
{media} |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<View className="font-24 text-muted mb-4 text-row3 mt-2" style={{lineHeight: 1.4}}> |
|
|
|
|
{hasMedia && <View className={styles.previewImag + ' mb-2'}>{media}</View>} |
|
|
|
|
<View className="font-24 text-muted text-row3" style={{lineHeight: 1.4}}> |
|
|
|
|
{data.graphic_introduction} |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<View className="flex gap20rpx font-24 text-muted justify-around"> |
|
|
|
|
{/*<View className="flex gap20rpx font-24 text-muted justify-around"> |
|
|
|
|
<View className={styles.feature}> |
|
|
|
|
<Image src={articleLine}/> |
|
|
|
|
{data.article_count || 0} |
|
|
|
|
</View> |
|
|
|
|
<Collect owner_id={data.id} owner_type={4} select={data.collect}/> |
|
|
|
|
</View> |
|
|
|
|
</View>*/} |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
@ -125,7 +126,7 @@ const BrandList: FC = () => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<View className='p-2'> |
|
|
|
|
<View className='py-2'> |
|
|
|
|
<Spinner enable={loading} overlay/> |
|
|
|
|
{ |
|
|
|
|
brands.length ? |
|
|
|
|