预览功能样式修改

main
king 1 year ago
parent 2190944d21
commit 34ffb6ed62
  1. 6
      src/components/videoCover/videoCover.scss
  2. 4
      src/pages/home/components/curRecommended.tsx
  3. 2
      src/pages/home/components/feature.tsx
  4. 10
      src/pages/home/home.module.scss
  5. 2
      src/pages/home/home.tsx
  6. 4
      src/pages/preview/profession/profession.module.scss
  7. 9
      src/pages/preview/profession/profession.tsx

@ -51,7 +51,7 @@
.box { .box {
box-sizing: border-box; box-sizing: border-box;
padding: 15rpx; padding: 20rpx;
.title { .title {
width: 100%; width: 100%;
@ -61,6 +61,10 @@
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
font-size: 28rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #323635;
} }
} }

@ -37,9 +37,9 @@ const CurRecommended: FC = () => {
return ( return (
<> <>
{ {
data.length > 0 && <View className='mt-8'> data.length > 0 && <View>
<Image src={courseTag} mode='widthFix' className={styles.courseTag}/> <Image src={courseTag} mode='widthFix' className={styles.courseTag}/>
<View className={'py-2 flex justify-between flex-wrap ' + styles.videoListBox}> <View className={'pb-2 flex justify-between flex-wrap ' + styles.videoListBox}>
{ {
data.map(c => <VideoCover data.map(c => <VideoCover
thumb={c.thumb} thumb={c.thumb}

@ -20,7 +20,7 @@ const Feature: FC = () => {
} }
return ( return (
<View className='flex justify-around' style={{marginBottom: '20px'}}> <View className='flex justify-around' style={{marginBottom: '25px'}}>
{ {
list.map(d => <View className='text-center' onClick={() => jump(d.url)}> list.map(d => <View className='text-center' onClick={() => jump(d.url)}>
<Image src={d.image} style={{width: '48px', height: '48px'}}/> <Image src={d.image} style={{width: '48px', height: '48px'}}/>

@ -71,8 +71,8 @@
.courseTag { .courseTag {
width: 200px; width: 162px;
margin: auto; margin: 0 auto 30rpx;
display: block; display: block;
} }
@ -80,7 +80,7 @@
color: #323635; color: #323635;
background: #fff; background: #fff;
padding: 30rpx 0 30rpx 30rpx; padding: 30rpx 0 30rpx 30rpx;
margin-bottom: 40rpx; margin-bottom: 50rpx;
border-radius: 30rpx; border-radius: 30rpx;
} }
@ -119,8 +119,8 @@
.ranking { .ranking {
position: absolute; position: absolute;
left: 24rpx; left: 24rpx;
width: 40px; width: 30px;
height: 40px; height: 30px;
} }
.featureImage { .featureImage {

@ -28,7 +28,7 @@ const Home: FC = () => {
}, []) }, [])
return ( return (
<View className={styles.content} style={{paddingTop: '20px'}}> <View className={styles.content}>
{/*<Search/>*/} {/*<Search/>*/}
<Adware data={data?.adverts || []} only_flag='routine_home_top_banner' width={710}/> <Adware data={data?.adverts || []} only_flag='routine_home_top_banner' width={710}/>
<Feature/> <Feature/>

@ -13,8 +13,10 @@
Image, Image,
image { image {
width: 200rpx; width: 320rpx;
max-height: 180rpx;
margin-right: 20rpx; margin-right: 20rpx;
border-radius: 10rpx; border-radius: 10rpx;
background: #eee;
} }
} }

@ -21,7 +21,7 @@ const Profession = () => {
* more * more
*/ */
async function getData(more = false) { async function getData(more = false) {
if (categoryId) { if (!categoryId) return;
const oldData = new Map<number, KillData>(data) const oldData = new Map<number, KillData>(data)
const categoryData = oldData.get(categoryId) const categoryData = oldData.get(categoryId)
const page = more ? (categoryData?.page || 0) + 1 : categoryData?.page || 1 const page = more ? (categoryData?.page || 0) + 1 : categoryData?.page || 1
@ -31,6 +31,10 @@ const Profession = () => {
return return
} }
try {
if (!data.has(categoryId)) {
Taro.showLoading()
}
const res = await HomeApi.skillList(categoryId!, page, 10) const res = await HomeApi.skillList(categoryId!, page, 10)
const dataList = res.data.reduce((pre, cur) => { const dataList = res.data.reduce((pre, cur) => {
const index = pre.findIndex(d => d.id === cur.id) const index = pre.findIndex(d => d.id === cur.id)
@ -42,14 +46,15 @@ const Profession = () => {
return pre return pre
}, categoryData?.data || []) }, categoryData?.data || [])
oldData.delete(categoryId) oldData.delete(categoryId)
oldData.set(categoryId, { oldData.set(categoryId, {
data: dataList, data: dataList,
total: res.total, total: res.total,
page: page page: page
}) })
setData(oldData) setData(oldData)
} catch (e) {
} }
Taro.hideLoading()
} }
useEffect(() => { useEffect(() => {

Loading…
Cancel
Save