|
|
|
@ -9,6 +9,7 @@ import Spin from "@/components/spinner"; |
|
|
|
|
import Img from "@/components/image/image"; |
|
|
|
|
import {rfc33392time} from "@/utils/day"; |
|
|
|
|
import play from "@/static/img/play.png"; |
|
|
|
|
import PageScript from "@/components/pageScript/pageScript"; |
|
|
|
|
|
|
|
|
|
interface KillData { |
|
|
|
|
data: any[] |
|
|
|
@ -59,7 +60,7 @@ const Profession = () => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Taro.useDidShow(useCallback(() => { |
|
|
|
|
if(categoryId){ |
|
|
|
|
if (categoryId) { |
|
|
|
|
let tempMap = new Map() |
|
|
|
|
tempMap.set(categoryId, { |
|
|
|
|
data: [], |
|
|
|
@ -69,7 +70,7 @@ const Profession = () => { |
|
|
|
|
setData(tempMap) |
|
|
|
|
getData() |
|
|
|
|
} |
|
|
|
|
},[data])) |
|
|
|
|
}, [data])) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
categoryId && getData() |
|
|
|
@ -77,7 +78,7 @@ const Profession = () => { |
|
|
|
|
|
|
|
|
|
async function getCategory() { |
|
|
|
|
try { |
|
|
|
|
const res = [{name:'视频',id:2},{name:'文章',id:1},{name:'课程',id:3},{name:'其他',id:4}] |
|
|
|
|
const res = [{name: '视频', id: 2}, {name: '文章', id: 1}, {name: '课程', id: 3}, {name: '其他', id: 4}] |
|
|
|
|
const newTabs = res.map<TabList>(d => ({title: d.name, value: d.id})) |
|
|
|
|
setTabs(newTabs) |
|
|
|
|
setCategoryId(newTabs[0].value as number) |
|
|
|
@ -89,15 +90,16 @@ const Profession = () => { |
|
|
|
|
function tabsChange(tab: OnChangOpt) { |
|
|
|
|
setCategoryId(tab.tab?.value as number) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function jumpInfo(info: any) { |
|
|
|
|
console.log(info,'info') |
|
|
|
|
if(info.article){ |
|
|
|
|
console.log(info, 'info') |
|
|
|
|
if (info.article) { |
|
|
|
|
Taro.navigateTo({url: `/pages/preview/brand/article/article?id=${info.owner_id}`}) |
|
|
|
|
}else if(info.course){ |
|
|
|
|
} else if (info.course) { |
|
|
|
|
Taro.navigateTo({url: `/pages/business/videoInfo/videoInfo?id=${info.owner_id}`}) |
|
|
|
|
}else if(info.video_records){ |
|
|
|
|
} else if (info.video_records) { |
|
|
|
|
Taro.navigateTo({url: `/pages/preview/videoFull/videoFull?id=${info.owner_id}`}) |
|
|
|
|
}else if(info.brand){ |
|
|
|
|
} else if (info.brand) { |
|
|
|
|
Taro.navigateTo({url: `/pages/preview/brand/info/info?id=${info.owner_id}`}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -144,7 +146,8 @@ const Profession = () => { |
|
|
|
|
{ |
|
|
|
|
d.video_records && |
|
|
|
|
<> |
|
|
|
|
<Img width={192} height={192} src={d.video_records.url_path} mode='aspectFill' className={styles.image}/> |
|
|
|
|
<Img width={192} height={192} src={d.video_records.url_path} mode='aspectFill' |
|
|
|
|
className={styles.image}/> |
|
|
|
|
<Image src={play} className={styles.play} mode='aspectFit'/> |
|
|
|
|
<View className={styles.videoRightBox}> |
|
|
|
|
<View className='font-weight mb-2 font-28 lh-40'>{d.video_records.title}</View> |
|
|
|
@ -163,11 +166,10 @@ const Profession = () => { |
|
|
|
|
</View> |
|
|
|
|
</> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
<View className='text-center font-24 text-dark mt-2'>暂无更多</View> |
|
|
|
|
<PageScript/> |
|
|
|
|
</ScrollView> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|