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
8de0ea8d
Commit
8de0ea8d
authored
Nov 12, 2022
by
kyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的分享对接
parent
a8753ed2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
30 deletions
+75
-30
api/api.ts
+4
-0
pages/myLearning/myLearning.vue
+18
-13
pages/orderDetail/orderDetail.vue
+43
-17
util/dataHandling.ts
+10
-0
No files found.
api/api.ts
View file @
8de0ea8d
...
...
@@ -100,5 +100,9 @@ export default {
// 我的分享
userShareQuery
(
params
){
return
request
(
`
${
cffpURL
}
/share/userShareQuery`
,
"POST"
,
params
)
},
// 订单详情
userCourseInfo
(
params
){
return
request
(
`
${
cffpURL
}
/course/userCourseInfo`
,
"POST"
,
params
)
}
}
pages/myLearning/myLearning.vue
View file @
8de0ea8d
...
...
@@ -8,8 +8,8 @@
<!-- tab内容 -->
<view
class=
"tabContent"
>
<view
class=
"learningRecordContainer"
v-if=
"tabType===1"
>
<h3
class=
"noListTip"
>
暂无学习记录!
</h3>
<view
class=
"learningRecordItem"
v-for=
"item in userStudyList"
>
<h3
class=
"noListTip"
v-if=
"!userStudyLists"
>
暂无学习记录!
</h3>
<view
class=
"learningRecordItem"
v-for=
"item in userStudyList
s
"
>
<view
class=
"dateBox"
>
{{
item
.
studyTime
}}
</view>
<!-- 课程详情 -->
<view
class=
"courseInfoContent"
v-for=
"subItem in item.userStudyInfos"
:key=
"subItem.fileId"
>
...
...
@@ -28,7 +28,7 @@
<view>
%
</view>
</view>
<view
class=
"dataBox"
>
<text>
可观看截至:
{{
subItem
.
effectiveEndDate
}}
</text>
<text>
可观看截至:
{{
dateFormat
(
subItem
.
effectiveEndDate
)
}}
</text>
</view>
</view>
</view>
...
...
@@ -44,35 +44,40 @@
<
script
>
import
api
from
"@/api/api"
;
import
dataHandling
from
"@/util/dataHandling"
;
export
default
{
data
()
{
return
{
tabType
:
1
,
userStudyList
:[],
userId
:
null
userStudyList
s
:[],
userId
:
'1'
}
},
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'
];
this
.
userStudyList
s
=
res
[
'data'
][
'userStudyTimeInfos'
];
}
console
.
log
(
res
)
})
},
switchTab
(
type
){
this
.
tabType
=
type
;
if
(
type
===
1
){
this
.
userStudyList
()
}
else
{
}
},
dateFormat
(
val
){
return
dataHandling
.
dateFormat
(
val
);
}
},
onLoad
()
{
},
mounted
()
{
this
.
switchTab
(
1
)
}
}
</
script
>
...
...
pages/orderDetail/orderDetail.vue
View file @
8de0ea8d
...
...
@@ -2,13 +2,13 @@
<view
class=
"container"
>
<view
class=
"orderInfoContent"
>
<ul>
<li
v-for=
"item in orderInfoList"
:key=
"item.id"
>
<li
v-for=
"item in orderInfoList
.filter(item=>item.pageArea===1)
"
:key=
"item.id"
>
<text>
{{
item
.
name
}}
:
</text>
<text
:style=
"
{color:item.color ? item.color : '#666'}">
{{
item
.
value
}}
</text>
</li>
</ul>
<ul>
<li
v-for=
"item in order
StatusInfoList
"
:key=
"item.id"
>
<li
v-for=
"item in order
InfoList.filter(item=>item.pageArea===2)
"
:key=
"item.id"
>
<text>
{{
item
.
name
}}
:
</text>
<text
:style=
"
{color:item.color ? item.color : '#666'}">
{{
item
.
value
}}
</text>
</li>
...
...
@@ -18,28 +18,54 @@
</
template
>
<
script
>
import
api
from
"@/api/api"
;
export
default
{
data
()
{
return
{
userId
:
'1'
,
orderId
:
'1'
,
orderInfoList
:[
{
id
:
1
,
name
:
'订单编号'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
2
,
name
:
'购买时间'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
3
,
name
:
'课程类型'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
4
,
name
:
'课程名称'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
5
,
name
:
'购买人'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
6
,
name
:
'课程讲师'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
7
,
name
:
'课程现价'
,
value
:
'111111'
,
type
:
'currency'
},
{
id
:
8
,
name
:
'积分抵扣'
,
value
:
'111111'
,
color
:
'#FA6900'
,
type
:
'currency'
},
{
id
:
9
,
name
:
'实际支付'
,
value
:
'111111'
,
type
:
'currency'
}
],
orderStatusInfoList
:[
{
id
:
1
,
name
:
'获得积分'
,
value
:
'111111'
,
type
:
'currency'
,
color
:
'#F15A1F'
},
{
id
:
2
,
name
:
'积分来源'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
3
,
name
:
'课程状态'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
4
,
name
:
'观看截至'
,
value
:
'111111'
,
type
:
'string'
},
{
id
:
1
,
name
:
'订单编号'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'orderNo'
,
pageArea
:
1
},
{
id
:
2
,
name
:
'购买时间'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'orderConfirmDate'
,
pageArea
:
1
},
{
id
:
3
,
name
:
'课程类型'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'courseClassify'
,
pageArea
:
1
},
{
id
:
4
,
name
:
'课程名称'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'fileTitle'
,
pageArea
:
1
},
{
id
:
5
,
name
:
'购买人'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'userName'
,
pageArea
:
1
},
{
id
:
6
,
name
:
'课程讲师'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'lecturerName'
,
pageArea
:
1
},
{
id
:
7
,
name
:
'课程现价'
,
value
:
'111111'
,
type
:
'currency'
,
alias
:
'orderPrice'
,
pageArea
:
1
},
{
id
:
8
,
name
:
'积分抵扣'
,
value
:
'111111'
,
color
:
'#FA6900'
,
type
:
'currency'
,
alias
:
'integralExchange'
,
pageArea
:
1
},
{
id
:
9
,
name
:
'实际支付'
,
value
:
'111111'
,
type
:
'currency'
,
alias
:
'paymentAmount'
,
pageArea
:
1
},
{
id
:
10
,
name
:
'获得积分'
,
value
:
'111111'
,
type
:
'currency'
,
color
:
'#F15A1F'
,
alias
:
'salesCommission'
,
pageArea
:
2
},
{
id
:
11
,
name
:
'积分来源'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'commissionSource'
,
pageArea
:
2
},
{
id
:
12
,
name
:
'课程状态'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'courseStatus'
,
pageArea
:
2
},
{
id
:
13
,
name
:
'观看截至'
,
value
:
'111111'
,
type
:
'string'
,
alias
:
'effectiveEndDate'
,
pageArea
:
2
}
]
};
},
methods
:{
userCourseInfo
(){
const
param
=
{
userId
:
this
.
userId
,
orderId
:
this
.
orderId
}
api
.
userCourseInfo
(
param
).
then
(
res
=>
{
if
(
res
[
'success'
]){
const
data
=
res
[
'data'
][
'orderDetail'
];
Object
.
keys
(
data
).
map
((
key
,
item
)
=>
{
this
.
orderInfoList
.
forEach
(
val
=>
{
if
(
val
.
alias
==
key
){
val
.
value
=
data
[
key
];
}
})
})
}
})
}
},
mounted
()
{
this
.
userCourseInfo
()
}
}
</
script
>
...
...
util/dataHandling.ts
View file @
8de0ea8d
...
...
@@ -32,4 +32,13 @@ export default{
const
s
=
Math
.
floor
(
value
%
60
)
>
0
?
Math
.
floor
(
value
%
60
)
:
'00'
;
return
h
+
':'
+
m
+
':'
+
s
;
},
// 日期格式化
dateFormat
(
val
:
number
){
if
(
val
){
const
date
=
new
Date
(
val
);
return
date
.
getFullYear
()
+
'-'
+
(
date
.
getMonth
()
+
1
)
+
'-'
+
date
.
getDate
()
+
' '
+
date
.
getHours
()
+
':'
+
date
.
getMinutes
()
+
':'
+
date
.
getSeconds
()
}
else
{
return
val
;
}
}
}
\ No newline at end of file
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