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
3655df5e
Commit
3655df5e
authored
Nov 11, 2022
by
sunchao
Browse files
Options
Browse Files
Download
Plain Diff
合并冲突
parents
911e578b
9e990c87
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
441 additions
and
18 deletions
+441
-18
App.vue
+15
-0
api/api.ts
+4
-0
components/login/login.vue
+19
-2
manifest.json
+1
-2
pages.json
+10
-1
pages/index/index.vue
+1
-1
pages/myLearning/myLearning.vue
+151
-0
pages/orderConfirm/orderConfirm.vue
+235
-7
pages/personalCenter/personalCenter.vue
+1
-1
util/interceptor.ts
+3
-3
util/request.ts
+1
-1
No files found.
App.vue
View file @
3655df5e
...
...
@@ -53,4 +53,19 @@
.richTextContent
img
{
width
:
100%
!important
;
}
.popupContainer
.uni-popup
.uni-popup__wrapper
{
width
:
80%
;
border-radius
:
20
rpx
;
}
.container
uni-slider
{
margin
:
0
;
}
.container
uni-slider
.uni-slider-value
{
text-align
:
right
;
}
.noListTip
{
text-align
:
center
;
margin-top
:
10%
;
color
:
#999
;
}
</
style
>
api/api.ts
View file @
3655df5e
...
...
@@ -92,5 +92,9 @@ export default {
//学习认证结果
userCertificateResult
(
params
){
return
request
(
`
${
cffpURL
}
/certificate/userCertificateList`
,
"POST"
,
params
)
},
// 我的学习,学习记录
userStudyList
(
params
){
return
request
(
`
${
cffpURL
}
/study/userStudyList`
,
"POST"
,
params
)
}
}
components/login/login.vue
View file @
3655df5e
<
template
>
<view
class=
"wrapper"
>
<view
class=
"logo"
>
<img
src=
"/static/cffp_logo.jpg
"
alt=
"logo"
srcset=
""
>
<img
:src=
"imgSrc
"
alt=
"logo"
srcset=
""
>
<view>
欢迎登录使用CFFP
</view>
</view>
<view
class=
"content"
>
...
...
@@ -97,7 +97,8 @@
account
:
null
,
doublePassword
:
null
,
agreeFlag
:
false
,
userId
:
null
userId
:
null
,
imgSrc
:
'static/cffp_logo.jpg'
}
},
methods
:
{
...
...
@@ -303,10 +304,26 @@
password
:
null
,
}
},
checkToken
(){
api
.
checkToken
().
then
(
res
=>
{
if
(
res
[
'success'
]){}
else
{
api
.
obtainToken
().
then
(
res
=>
{
if
(
res
.
success
){
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'token'
]);
}
})
}
})
},
},
mounted
()
{
<<<<<<<
HEAD
this
.
checkToken
();
=======
this
.
checkToken
()
>>>>>>>
9
e990c8792924f087e76b52a4e61cccfbae779c9
}
}
</
script
>
...
...
manifest.json
View file @
3655df5e
...
...
@@ -88,8 +88,7 @@
"router"
:
{
"base"
:
"/cffp/"
,
"mode"
:
"history"
}
,
},
"devServer"
:
{
"proxy"
:
{
"/api"
:
{
...
...
pages.json
View file @
3655df5e
...
...
@@ -131,7 +131,16 @@
"navigationBarTitleText"
:
"认证详情"
,
"enablePullDownRefresh"
:
false
}
}
},
{
"path"
:
"pages/myLearning/myLearning"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
"enablePullDownRefresh"
:
false
}
}
],
//
"tabBar"
:
{
//
"color"
:
"#7A7E83"
,
//
tab
上的文字默认颜色
...
...
pages/index/index.vue
View file @
3655df5e
...
...
@@ -71,7 +71,7 @@
{
key
:
'01'
,
name
:
'我的积分'
,
icon
:
'integral'
,
link
:
''
,
isOpen
:
false
},
{
key
:
'02'
,
name
:
'申请加盟'
,
icon
:
'applyJoin'
,
link
:
'../application-process/basic-info'
,
isOpen
:
true
},
{
key
:
'03'
,
name
:
'学习认证'
,
icon
:
'learningCertify'
,
link
:
'../learnCertify/learnCertify'
,
isOpen
:
true
},
{
key
:
'04'
,
name
:
'邀请加盟'
,
icon
:
'shareJoin'
,
link
:
'../inviteJoin/inviteJoin'
,
isOpen
:
fals
e
},
{
key
:
'04'
,
name
:
'邀请加盟'
,
icon
:
'shareJoin'
,
link
:
'../inviteJoin/inviteJoin'
,
isOpen
:
tru
e
},
{
key
:
'05'
,
name
:
'我的分享'
,
icon
:
'share'
,
link
:
''
,
isOpen
:
false
},
{
key
:
'06'
,
name
:
'我的团队'
,
icon
:
'team'
,
link
:
''
,
isOpen
:
false
},
{
key
:
'07'
,
name
:
'更多功能'
,
icon
:
'more'
,
link
:
'../personalCenter/personalCenter'
,
isOpen
:
true
}
...
...
pages/myLearning/myLearning.vue
0 → 100644
View file @
3655df5e
<
template
>
<view
class=
"container"
>
<!-- tab选项 -->
<view
class=
"tabTitle"
>
<text
:class=
"
{'actived': tabType===1}" @click="switchTab(1)">学习记录
</text>
<text
:class=
"
{'actived': tabType===2}" @click="switchTab(2)">学习统计
</text>
</view>
<!-- tab内容 -->
<view
class=
"tabContent"
>
<view
class=
"learningRecordContainer"
v-if=
"tabType===1"
>
<h3
class=
"noListTip"
>
暂无学习记录!
</h3>
<view
class=
"learningRecordItem"
v-for=
"item in userStudyList"
>
<view
class=
"dateBox"
>
{{
item
.
studyTime
}}
</view>
<!-- 课程详情 -->
<view
class=
"courseInfoContent"
v-for=
"subItem in item.userStudyInfos"
:key=
"subItem.fileId"
>
<view
class=
"thumbnailBox"
>
<img
:src=
"subItem.displayImage"
alt=
""
>
</view>
<view
class=
"courseDetailBox"
>
<h4>
{{
subItem
.
fileTitle
}}
</h4>
<view
class=
"summaryBox"
>
<text>
学习时长:
{{
subItem
.
studyDuration
}}
分钟
</text>
</view>
<view
class=
"processBox"
>
<view
class=
"sliderBox"
>
<slider
:value=
"subItem.progressBar"
show-value
block-size=
"14"
disabled
activeColor=
"#20269B"
/>
</view>
<view>
%
</view>
</view>
<view
class=
"dataBox"
>
<text>
可观看截至:
{{
subItem
.
effectiveEndDate
}}
</text>
</view>
</view>
</view>
</view>
</view>
<view
class=
"learningStatisticsContainer"
v-if=
"tabType===2"
>
</view>
</view>
</view>
</
template
>
<
script
>
import
api
from
"@/api/api"
;
export
default
{
data
()
{
return
{
tabType
:
1
,
userStudyList
:[],
userId
:
null
}
},
methods
:
{
switchTab
(
type
){
this
.
tabType
=
type
;
if
(
type
===
1
){
}
else
{
}
},
userStudyList
(){
api
.
userStudyList
({
userId
:
this
.
userId
}).
then
(
res
=>
{
if
(
res
[
'success'
]){
this
.
userStudyList
=
res
[
'data'
][
'userStudyTimeInfos'
];
}
console
.
log
(
res
)
})
}
},
onLoad
()
{
},
mounted
()
{
}
}
</
script
>
<
style
lang=
"scss"
>
.container
{
position
:
relative
;
height
:
100%
;
.tabTitle{
color
:
#666666
;
background-color
:
#fff
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-around
;
padding
:
30
rpx
60
rpx
0
;
text{
&.actived{
color
:
#333
;
border-bottom
:
4
rpx
solid
#20269B
;
}
}
}
.learningRecordContainer
{
padding
:
20
rpx
30
rpx
;
.dateBox{
padding-left
:
16
rpx
;
}
.courseInfoContent
{
display
:
flex
;
align-items
:
center
;
background-color
:
#fff
;
border-radius
:
20
rpx
;
margin-bottom
:
10
rpx
;
padding
:
5
rpx
10
rpx
;
.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
;
}
}
.processBox
{
display
:
flex
;
justify-content
:
flex-start
;
font-size
:
28
rpx
;
color
:
#888
;
.sliderBox{
width
:
100%
;
}
}
.dataBox
{
text{
font-size
:
28
rpx
;
}
}
}
}
}
}
</
style
>
pages/orderConfirm/orderConfirm.vue
View file @
3655df5e
...
...
@@ -25,30 +25,30 @@
<h4>
价格明细
</h4>
<view><text>
现价
</text><text>
¥
{{
courseInfoItem
.
coursePrice
}}
</text></view>
<view>
<text>
积分抵扣
<i
class=
"iconfont icon-31tishi"
></i></text>
<text
class=
"integralBox"
>
未选积分,可抵扣XXX
<i
class=
"iconfont icon-youjiantou"
></i></text>
<text
@
click=
"toggle(1,'bottom')"
>
积分抵扣
<i
class=
"iconfont icon-31tishi"
></i></text>
<text
class=
"integralBox"
@
click=
"toggle(2,'bottom')"
>
未选积分,可抵扣XXX
<i
class=
"iconfont icon-youjiantou"
></i></text>
</view>
<view><text>
合计
</text><text>
¥
{{
courseInfoItem
.
coursePrice
}}
</text></view>
</view>
<!-- 支付方式 -->
<view
class=
"paymentMethodContent"
>
<h4>
选择支付方式
</h4>
<view
class=
"paymentItem"
>
<view
class=
"paymentItem"
@
click=
"selectPaymentMethod(1)"
>
<view>
<i
class=
"iconfont icon-zhifubao"
></i>
<text>
支付宝支付
</text>
</view>
<view
class=
"selectRadio
actived
"
>
<view
class=
"selectRadio
"
:class=
"
{'actived':paymentMethod===1}
">
<i
class=
"iconfont icon-duihao"
></i>
</view>
</view>
<view
class=
"paymentItem"
>
<view
class=
"paymentItem"
@
click=
"selectPaymentMethod(2)"
>
<view>
<i
class=
"iconfont icon-py_weixinzhifu"
></i>
<text>
微信支付
</text>
</view>
<view
class=
"selectRadio"
>
<view
class=
"selectRadio"
:class=
"
{'actived':paymentMethod===2}"
>
<i
class=
"iconfont icon-duihao"
></i>
</view>
</view>
...
...
@@ -61,6 +61,70 @@
</view>
<view
class=
"confirmOrder"
>
提交订单
</view>
</view>
<!-- 普通弹窗 -->
<uni-popup
ref=
"popup"
background-color=
"#fff"
>
<view
class=
"popup-content"
>
<view
class=
"title"
>
<text></text>
<h3>
{{
popupTitle
}}
</h3>
<i
class=
"iconfont icon-guanbi"
@
click=
"closePopup(1)"
></i>
</view>
<view
v-if=
"popupType===1"
><text>
1积分=1元,积分抵扣如同现金,所有课程均可使用.
</text></view>
<view
v-if=
"popupType===2"
>
<view
class=
"deductionInfoItem"
:class=
"
{'actived':isDeduction}" @click="selectDeduction(true)">
<view
style=
"display: flex;"
>
<text>
可抵扣
</text>
<view
class=
"integralInfoBox"
>
<text
class=
"deductionCount"
>
¥500
</text>
<text>
需5000积分兑换
</text>
</view>
</view>
<view
class=
"selectRadio"
>
<i
class=
"iconfont icon-duihao"
></i>
</view>
</view>
<view
class=
"deductionInfoItem"
:class=
"
{'actived':!isDeduction}" @click="selectDeduction(false)">
<view>
<text>
不使用积分抵扣
</text>
</view>
<view
class=
"selectRadio"
>
<i
class=
"iconfont icon-duihao"
></i>
</view>
</view>
<view
class=
"confirmBtn"
@
click=
"closePopup(1);toggle(3,'center')"
>
确认
</view>
</view>
</view>
</uni-popup>
<view
class=
"popupContainer"
>
<uni-popup
ref=
"popup1"
background-color=
"#fff"
>
<view
class=
"popup1-content"
>
<view
class=
"title"
>
<text></text>
<h3>
{{
popupTitle
}}
</h3>
<i
class=
"iconfont icon-guanbi"
@
click=
"closePopup(1)"
></i>
</view>
<view
class=
"integralDeductionContent"
>
<view
class=
"intergralItem"
>
<text>
可兑换积分:
</text>
<text>
XXX积分
</text>
</view>
<view
class=
"intergralItem"
>
<text>
本次兑换消耗积分:
</text>
<text>
XXX积分
</text>
</view>
<view
class=
"intergralItem"
>
<text>
剩余可兑换积分:
</text>
<text>
XXX积分
</text>
</view>
<view
class=
"confirmBtn"
@
click=
"closePopup(2)"
>
确认兑换
</view>
</view>
</view>
</uni-popup>
</view>
</view>
</
template
>
...
...
@@ -70,7 +134,11 @@
data
()
{
return
{
courseInfoItem
:{},
fileId
:
null
fileId
:
null
,
paymentMethod
:
1
,
popupTitle
:
'积分抵扣规则'
,
popupType
:
1
,
isDeduction
:
true
}
},
methods
:
{
...
...
@@ -83,6 +151,44 @@
}
})
},
// 选择支付方式
selectPaymentMethod
(
value
){
this
.
paymentMethod
=
value
;
},
// 从下往上弹出
toggle
(
val
,
type
)
{
// type 1为积分抵扣规则,2为优惠详情
this
.
popupType
=
val
;
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
if
(
this
.
popupType
===
3
){
this
.
$refs
.
popup1
.
open
(
type
);
}
else
{
this
.
$refs
.
popup
.
open
(
type
);
}
if
(
this
.
popupType
===
1
){
this
.
popupTitle
=
'积分抵扣规则'
}
else
if
(
this
.
popupType
===
2
){
this
.
popupTitle
=
'优惠详情'
}
else
if
(
this
.
popupType
===
3
){
this
.
popupTitle
=
'积分兑换'
}
},
// 关闭弹出层
closePopup
(
val
){
if
(
val
===
1
){
this
.
$refs
.
popup
.
close
()
}
else
{
this
.
$refs
.
popup1
.
close
()
}
},
// 选择是否抵扣
selectDeduction
(
type
){
this
.
isDeduction
=
type
;
},
// 确认积分兑换
confirmIntergralDeduction
(){
}
},
onLoad
(
option
){
console
.
log
(
option
)
...
...
@@ -99,6 +205,127 @@
.container
{
position
:
relative
;
height
:
100%
;
.popup-content{
.title{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
baseline
;
h3{
text-align
:
center
;
color
:
#333
;
font-size
:
32
rpx
;
margin-bottom
:
30
rpx
;
}
.iconfont
{
color
:
#999
;
}
}
text
{
color
:
#666
;
font-size
:
30
rpx
;
}
.deductionInfoItem
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
color
:
#333
;
font-size
:
30
rpx
;
padding
:
10
rpx
30
rpx
;
background-color
:
#F5f5f5
;
border-radius
:
20
rpx
;
min-height
:
90
rpx
;
margin-top
:
30
rpx
;
.integralInfoBox{
display
:
flex
;
flex-direction
:
column
;
margin-left
:
10
rpx
;
text{
font-size
:
30
rpx
;
color
:
#333333
;
}
.deductionCount
{
font-size
:
36
rpx
;
color
:
#F15A1F
;
}
}
.selectRadio
{
color
:
transparent
;
width
:
40
rpx
;
height
:
40
rpx
;
border
:
1px
solid
#D8D8D8
;
border-radius
:
50%
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
&
.actived
{
border
:
3
rpx
solid
#20269B
;
background-color
:
#fff
;
.selectRadio{
background-color
:
#20269B
;
color
:
#fff
;
}
}
}
.integralDeductionContent
{
.intergralItem{
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
10
rpx
;
}
}
.confirmBtn
{
border-radius
:
80
rpx
;
height
:
80
rpx
;
width
:
60%
;
background-color
:
#20269B
;
color
:
#fff
;
margin
:
64
rpx
auto
0
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
.popup1-content
{
padding
:
30
rpx
34
rpx
20
rpx
42
rpx
;
border-radius
:
20
rpx
;
.title{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
baseline
;
h3{
text-align
:
center
;
color
:
#333
;
font-size
:
32
rpx
;
margin-bottom
:
30
rpx
;
}
.iconfont
{
color
:
#999
;
}
}
.integralDeductionContent
{
.intergralItem{
display
:
flex
;
justify-content
:
space-between
;
color
:
#333
;
font-size
:
30
rpx
;
margin-bottom
:
10
rpx
;
}
}
.confirmBtn
{
border-radius
:
80
rpx
;
height
:
80
rpx
;
width
:
60%
;
background-color
:
#20269B
;
color
:
#fff
;
margin
:
64
rpx
auto
0
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
}
.courseInfoContent
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -252,6 +479,7 @@
border-radius
:
80
rpx
;
}
}
}
</
style
>
pages/personalCenter/personalCenter.vue
View file @
3655df5e
...
...
@@ -75,7 +75,7 @@
},
{
id
:
'02'
,
categoryName
:
'活动管理'
,
children
:[
{
title
:
'我的学习'
,
icon
:
'myLearning'
,
link
:
''
,
isOpen
:
true
,
isShow
:
true
},
{
title
:
'我的学习'
,
icon
:
'myLearning'
,
link
:
'
/pages/myLearning/myLearning
'
,
isOpen
:
true
,
isShow
:
true
},
{
title
:
'学习认证'
,
icon
:
'learningCertify'
,
link
:
''
,
isOpen
:
true
,
isShow
:
true
},
{
title
:
'我的分享'
,
icon
:
'share'
,
link
:
''
,
isOpen
:
true
,
isShow
:
true
}
],
...
...
util/interceptor.ts
View file @
3655df5e
...
...
@@ -10,14 +10,14 @@ export const interceptor = () => {
// 请求拦截器
invoke
(
args
)
{
//
console.log('请求拦截器',args);
console
.
log
(
'请求拦截器'
,
args
);
// 加载loading
uni
.
showLoading
({
title
:
'加载中...'
})
// 当本地没有token,并且接口地址没在白名单内,需要重新获取token
if
(
!
uni
.
getStorageSync
(
'uni-token'
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
//
console.log('-----------')
console
.
log
(
'-----------'
)
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
url
:
'/api/authorize/obtainToken'
,
...
...
@@ -44,7 +44,7 @@ export const interceptor = () => {
'content-type'
:
args
.
method
===
'POST'
?
'application/json'
:
'application/x-www-form-urlencoded'
,
'X-Authorization'
:
uni
.
getStorageSync
(
'uni-token'
)
}
//
console.log(args.header)
console
.
log
(
args
.
header
)
},
// 响应拦截器,可以对数据进行预处理
...
...
util/request.ts
View file @
3655df5e
import
{
interceptor
}
from
"./interceptor"
;
// 全局请求封装
export
default
(
url
,
method
,
params
)
=>
{
export
default
(
url
:
string
,
method
:
any
,
params
:
any
)
=>
{
interceptor
();
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
...
...
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