|
|
|
@ -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,9 +60,9 @@ const Profession = () => { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Taro.useDidShow(useCallback(() => { |
|
|
|
|
if(categoryId){ |
|
|
|
|
if (categoryId) { |
|
|
|
|
let tempMap = new Map() |
|
|
|
|
tempMap.set(categoryId, { |
|
|
|
|
tempMap.set(categoryId, { |
|
|
|
|
data: [], |
|
|
|
|
total: undefined, |
|
|
|
|
page: 1 |
|
|
|
@ -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> |
|
|
|
@ -159,15 +162,14 @@ const Profession = () => { |
|
|
|
|
<Img width={192} height={138} src={d.course.thumb} mode='aspectFill' className={styles.image}/> |
|
|
|
|
<View className={styles.courseRightBox}> |
|
|
|
|
<View className='font-weight mb-2 font-28 lh-40'>{d.course.title}</View> |
|
|
|
|
<View className={styles.desc}>课时:{d.course.class_hour}节 销量:{d.course.charge}</View> |
|
|
|
|
<View className={styles.desc}>课时:{d.course.class_hour}节 销量:{d.course.charge}</View> |
|
|
|
|
</View> |
|
|
|
|
</> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</View> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
<View className='text-center font-24 text-dark mt-2'>暂无更多</View> |
|
|
|
|
<PageScript/> |
|
|
|
|
</ScrollView> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|