预览功能样式修改

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. 23
      src/pages/preview/profession/profession.tsx

@ -51,7 +51,7 @@
.box {
box-sizing: border-box;
padding: 15rpx;
padding: 20rpx;
.title {
width: 100%;
@ -61,6 +61,10 @@
display: -webkit-box;
-webkit-line-clamp: 2;
-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 (
<>
{
data.length > 0 && <View className='mt-8'>
data.length > 0 && <View>
<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
thumb={c.thumb}

@ -20,7 +20,7 @@ const Feature: FC = () => {
}
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)}>
<Image src={d.image} style={{width: '48px', height: '48px'}}/>

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

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

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

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

Loading…
Cancel
Save