Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
web
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
web
Commits
1f33eaf5
提交
1f33eaf5
authored
1月 05, 2024
作者:
ZhangLingKun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能:首页热门课程
上级
a9b2899f
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
159 行增加
和
2 行删除
+159
-2
index.ts
src/api/index.ts
+2
-1
flyer.ts
src/api/interface/flyer.ts
+51
-0
flyer.ts
src/api/modules/flyer.ts
+16
-0
index.tsx
src/components/home-comp/home-course/index.tsx
+78
-0
index.tsx
src/components/home-comp/home-service/index.tsx
+1
-1
index.tsx
src/pages/home/index.tsx
+5
-0
tailwind.config.js
tailwind.config.js
+6
-0
没有找到文件。
src/api/index.ts
浏览文件 @
1f33eaf5
import
{
CommonAPI
}
from
'./modules/common'
;
import
{
CommonAPI
}
from
'./modules/common'
;
import
{
FlyerAPI
}
from
'./modules/flyer'
;
import
{
HomeAPI
}
from
'./modules/home'
;
import
{
HomeAPI
}
from
'./modules/home'
;
import
{
UserAPI
}
from
'./modules/user'
;
import
{
UserAPI
}
from
'./modules/user'
;
import
{
WalletAPI
}
from
'./modules/wallet'
;
import
{
WalletAPI
}
from
'./modules/wallet'
;
export
{
CommonAPI
,
HomeAPI
,
UserAPI
,
WalletAPI
};
export
{
CommonAPI
,
HomeAPI
,
UserAPI
,
WalletAPI
,
FlyerAPI
};
src/api/interface/flyer.ts
0 → 100644
浏览文件 @
1f33eaf5
import
{
InterItemFunction
,
InterListFunction
}
from
'@/api/interface'
;
// V1.0.1课程视频列表
// eslint-disable-next-line @typescript-eslint/naming-convention
export
type
queryCurriculumInfoListType
=
InterListFunction
<
{
courseAttribute
?:
number
;
curriculumName
?:
string
;
oneCourseId
?:
number
;
twoCourseId
?:
number
;
isHot
?:
number
;
},
{
id
:
number
;
oneCourseId
:
number
;
twoCourseId
:
number
;
curriculumName
:
string
;
curriculumDesc
:
string
;
surfaceUrl
:
string
;
videoUrl
:
string
;
courseAttribute
:
number
;
requireAmout
:
number
;
requireIntegral
:
number
;
isHot
:
number
;
detailContent
:
string
;
createTime
:
string
;
updateTime
:
string
;
}
>
;
// 课程列表
// eslint-disable-next-line @typescript-eslint/naming-convention
export
type
courseVideoListType
=
InterItemFunction
<
{
flightSkillsId
?:
number
;
licenseId
?:
number
;
regionId
?:
number
;
curriculumName
?:
string
;
},
{
id
:
number
;
videoUrl
:
string
;
supplierName
:
string
;
curriculumDesc
:
string
;
curriculumName
:
string
;
price
:
string
;
free
:
number
;
peopleCount
:
number
;
surfaceUrl
:
string
;
}[]
>
;
src/api/modules/flyer.ts
0 → 100644
浏览文件 @
1f33eaf5
import
{
courseVideoListType
,
queryCurriculumInfoListType
,
}
from
'@/api/interface/flyer'
;
import
request
from
'@/api/request'
;
export
class
FlyerAPI
{
// 课程列表
static
getCourseVideoList
:
courseVideoListType
=
(
data
)
=>
{
return
request
.
post
(
'/release/curriculum/queryCurriculumInfoList'
,
data
);
};
// V1.0.1课程视频列表
static
queryCurriculumInfoList
:
queryCurriculumInfoListType
=
(
params
)
=>
request
.
post
(
'/release/curriculum/queryCurriculumInfoList'
,
params
);
}
src/components/home-comp/home-course/index.tsx
0 → 100644
浏览文件 @
1f33eaf5
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
FlyerAPI
}
from
'@/api'
;
import
{
InterListType
}
from
'@/api/interface'
;
import
{
queryCurriculumInfoListType
}
from
'@/api/interface/flyer'
;
// 列表类型
type
ListType
=
InterListType
<
queryCurriculumInfoListType
>
;
// 课程类型列表
const
courseAttributeList
:
{
label
:
string
;
value
:
number
;
color
:
string
}[]
=
[
{
label
:
'免费'
,
value
:
0
,
color
:
'bg-[#f99a0b]'
},
{
label
:
'积分'
,
value
:
1
,
color
:
'bg-[#00AD53]'
},
{
label
:
'付费'
,
value
:
2
,
color
:
'bg-[#FF4600]'
},
];
const
HomeCourseView
=
()
=>
{
// 课程列表
const
[
courseList
,
setCourseList
]
=
useState
<
ListType
>
([]);
// 获取热门课程
const
getCurriculumInfoList
=
async
()
=>
{
const
res
=
await
FlyerAPI
.
queryCurriculumInfoList
({
pageSize
:
5
,
pageNo
:
1
,
isHot
:
1
,
});
if
(
res
&&
res
.
code
===
'200'
)
{
const
list
=
res
.
result
?.
list
||
[];
setCourseList
(
list
);
}
};
// 获取当前课程属性
const
getCourseAttribute
=
(
item
:
ListType
[
0
])
=>
{
return
courseAttributeList
?.
find
((
i
)
=>
i
.
value
===
item
?.
courseAttribute
);
};
// 组件挂载
useEffect
(()
=>
{
getCurriculumInfoList
().
then
();
},
[]);
return
(
<
div
className=
"mb-3 mt-3 flex w-full flex-nowrap items-center justify-start"
>
{
courseList
?.
map
((
i
,
j
)
=>
(
<
div
className=
"animate__animated animate__fast animate__fadeIn relative mr-3.5 w-1/5 cursor-pointer overflow-hidden rounded [box-shadow:0rem_0.17rem_0.86rem_0rem_rgba(65,65,65,0.08)] last:mr-0 hover:brightness-95 hover:filter"
key=
{
j
}
>
{
!!
i
.
surfaceUrl
&&
(
<
img
src=
{
i
.
surfaceUrl
}
alt=
{
i
.
curriculumName
}
className=
"h-28 w-full object-cover"
/>
)
}
<
div
className=
"box-border min-h-20 w-full bg-white px-2 pt-1"
>
<
div
className=
"mb-1 flex"
>
<
div
className=
"text-333 text-ellipsis font-bold"
>
{
i
.
curriculumName
}
</
div
>
<
div
className=
{
`${getCourseAttribute(i)
?.color} ml-2 min-w-8 rounded px-1 text-center text-xs text-white`
}
>
{
getCourseAttribute
(
i
)?.
label
}
</
div
>
</
div
>
<
div
className=
"text-777 text-ellipsis text-xs"
>
{
i
.
curriculumDesc
}
</
div
>
<
div
className=
"text-aaa absolute bottom-1 right-0 flex w-full justify-between px-2 text-xs"
>
<
div
>
课程供应商
</
div
>
<
div
>
{
i
.
id
*
333
}
人已学习
</
div
>
</
div
>
</
div
>
</
div
>
))
}
</
div
>
);
};
export
default
HomeCourseView
;
src/components/home-comp/home-service/index.tsx
浏览文件 @
1f33eaf5
...
@@ -61,7 +61,7 @@ const HomeServiceView = () => {
...
@@ -61,7 +61,7 @@ const HomeServiceView = () => {
{
refresh
&&
{
refresh
&&
industryList
?.[
currentIndex
]?.
inspectionDTOS
?.
map
((
i
,
j
)
=>
(
industryList
?.[
currentIndex
]?.
inspectionDTOS
?.
map
((
i
,
j
)
=>
(
<
div
<
div
className=
"service-item animate__animated animate__fast animate__fadeIn"
className=
"service-item animate__animated animate__fast animate__fadeIn
overflow-hidden rounded
"
key=
{
j
}
key=
{
j
}
onClick=
{
()
=>
handleDetail
(
i
)
}
onClick=
{
()
=>
handleDetail
(
i
)
}
>
>
...
...
src/pages/home/index.tsx
浏览文件 @
1f33eaf5
import
React
from
'react'
;
import
React
from
'react'
;
import
HomeBottomView
from
'@/components/home-comp/home-bottom'
;
import
HomeBottomView
from
'@/components/home-comp/home-bottom'
;
import
HomeBrandView
from
'@/components/home-comp/home-brand'
;
import
HomeBrandView
from
'@/components/home-comp/home-brand'
;
import
HomeCourseView
from
'@/components/home-comp/home-course'
;
import
HomeMapView
from
'@/components/home-comp/home-map'
;
import
HomeMapView
from
'@/components/home-comp/home-map'
;
import
HomeNewsView
from
'@/components/home-comp/home-news'
;
import
HomeNewsView
from
'@/components/home-comp/home-news'
;
import
HomeProductView
from
'@/components/home-comp/home-product'
;
import
HomeProductView
from
'@/components/home-comp/home-product'
;
...
@@ -45,6 +46,10 @@ const HomeView = () => {
...
@@ -45,6 +46,10 @@ const HomeView = () => {
<
HomeTitleView
title=
"大家都在买"
path=
"/mall"
/>
<
HomeTitleView
title=
"大家都在买"
path=
"/mall"
/>
{
/* 推荐商品 */
}
{
/* 推荐商品 */
}
<
HomeProductView
/>
<
HomeProductView
/>
{
/* 热门课程 */
}
<
HomeTitleView
title=
"热门课程"
path=
"/course"
/>
{
/* 课程列表 */
}
<
HomeCourseView
/>
{
/* 无人机服务 */
}
{
/* 无人机服务 */
}
<
HomeTitleView
title=
"无人机服务"
path=
"/service"
/>
<
HomeTitleView
title=
"无人机服务"
path=
"/service"
/>
{
/* 服务列表 */
}
{
/* 服务列表 */
}
...
...
tailwind.config.js
浏览文件 @
1f33eaf5
...
@@ -16,6 +16,12 @@ module.exports = {
...
@@ -16,6 +16,12 @@ module.exports = {
screens
:
{
screens
:
{
xl
:
'1190px'
,
xl
:
'1190px'
,
},
},
colors
:
{
333
:
'#333'
,
777
:
'#777'
,
999
:
'#999'
,
aaa
:
'#aaa'
,
},
},
},
},
},
plugins
:
[],
plugins
:
[],
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论