Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
d02e5b5c
Commit
d02e5b5c
authored
Nov 02, 2022
by
kyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程列表
parent
e6d1d1d5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
129 additions
and
11 deletions
+129
-11
api/api.ts
+4
-0
components/courselist/courselist.vue
+117
-3
pages.json
+7
-7
util/interceptor.ts
+1
-1
No files found.
api/api.ts
View file @
d02e5b5c
...
@@ -28,6 +28,10 @@ export default {
...
@@ -28,6 +28,10 @@ export default {
//注册接口
//注册接口
register
(
params
){
register
(
params
){
return
request
(
`
${
cffpURL
}
/user/register`
,
"POST"
,
params
)
return
request
(
`
${
cffpURL
}
/user/register`
,
"POST"
,
params
)
},
// 课程查询列表接口
courseList
(
params
){
return
request
(
`
${
cffpURL
}
/course/list`
,
'POST'
,
params
)
}
}
}
}
components/courselist/courselist.vue
View file @
d02e5b5c
<
template
>
<
template
>
<view>
<view>
课程列表
<h4
v-if=
"cffpCourseInfos.length
<
=
0
"
class=
"noLists"
>
暂无课程列表
</h4>
<ul
v-if=
"cffpCourseInfos.length>0"
>
<li
v-for=
"item in cffpCourseInfos"
:key=
"item.fileId"
>
<view
class=
"thumbnailBox"
>
<img
src=
""
alt=
""
>
</view>
<view
class=
"courseDetailBox"
>
<h4>
{{
item
.
fileTitle
}}
</h4>
<view
class=
"summaryBox"
>
<text>
{{
item
.
fileSynopsis
}}
</text>
</view>
<view
class=
"dataBox"
>
<strong>
¥
{{
item
.
coursePrice
}}
</strong>
<text>
{{
item
.
salesNumber
}}
人购买
</text>
</view>
<view
class=
"tagListBox"
>
<view
class=
"tagItem"
>
{{
item
.
fileLecturerName
}}
</view>
<view
class=
"tagItem"
>
{{
item
.
fileLecturerRanks
}}
</view>
</view>
</view>
</li>
</ul>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
api
from
"../../api/api"
;
export
default
{
export
default
{
data
(){
data
(){
return
;
return
{
cffpCourseInfos
:[]
}
},
},
name
:
'courselist'
,
name
:
'courselist'
,
components
:{
},
onLoad
(){
},
methods
:{
courseList
(){
api
.
courseList
().
then
(
res
=>
{
if
(
res
[
'success'
]){
this
.
cffpCourseInfos
=
res
[
'data'
][
'cffpCourseInfos'
];
}
else
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
,
icon
:
'none'
})
}
})
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
lang=
"scss"
>
ul
,
li
{
list-style
:
none
;
margin
:
0
;
padding
:
0
;
display
:
flex
;
}
ul
{
flex-direction
:
column
;
}
li
{
background-color
:
#fff
;
border-radius
:
20
rpx
;
margin-bottom
:
10
rpx
;
padding
:
10
rpx
;
}
.noLists
{
position
:
absolute
;
left
:
50%
;
top
:
50%
;
transform
:
translateX
(
-50%
);
}
.thumbnailBox
{
width
:
200
rpx
;
height
:
200
rpx
;
background-color
:
#888
;
margin-right
:
26
rpx
;
img{
max-width
:
100%
;
height
:
auto
;
}
}
.courseDetailBox
{
width
:
100%
;
color
:
#333
;
h4{
font-size
:
32
rpx
;
}
.summaryBox
{
font-size
:
24
rpx
;
margin
:
10
rpx
0
;
text{
margin-right
:
20
rpx
;
}
}
.dataBox
{
strong{
color
:
#F15A1F
;
font-size
:
30
rpx
;
margin-right
:
20
rpx
;
}
text
{
font-size
:
28
rpx
;
}
}
.tagListBox
{
display
:
flex
;
.tagItem{
color
:
#20279B
;
font-size
:
28
rpx
;
border-radius
:
20
rpx
;
border-top-left-radius
:
0
;
border-bottom-right-radius
:
0
;
padding
:
10
rpx
18
rpx
;
border
:
1px
solid
#20279B
;
margin-right
:
20
rpx
;
}
}
}
</
style
>
</
style
>
\ No newline at end of file
pages.json
View file @
d02e5b5c
...
@@ -14,13 +14,13 @@
...
@@ -14,13 +14,13 @@
"navigationBarTitleText"
:
"CFFP"
"navigationBarTitleText"
:
"CFFP"
}
}
},
},
//
{
{
//
"path"
:
"pages/index/index
"
,
"path"
:
"components/courselist/courselist
"
,
//
"style"
:
{
"style"
:
{
//
"topWindow"
:
false
,
"topWindow"
:
false
,
//
"navigationBarTitleText"
:
"CFFP"
"navigationBarTitleText"
:
"CFFP"
//
}
}
//
},
}
],
],
//
"tabBar"
:
{
//
"tabBar"
:
{
//
"color"
:
"#7A7E83"
,
//
tab
上的文字默认颜色
//
"color"
:
"#7A7E83"
,
//
tab
上的文字默认颜色
...
...
util/interceptor.ts
View file @
d02e5b5c
import
api
from
"../api/api"
;
import
api
from
"../api/api"
;
import
{
baseURL
,
apiURL
,
s
fpURL
}
from
"../environments/environment"
;
// import {baseURL,apiURL,cf
fpURL} from "../environments/environment";
// 白名单,不需要携带token就允许被访问的接口
// 白名单,不需要携带token就允许被访问的接口
const
whiteApiList
=
[
`/api/authorize/obtainToken`
,
`/api/authorize/checkToken`
]
const
whiteApiList
=
[
`/api/authorize/obtainToken`
,
`/api/authorize/checkToken`
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment