Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
educationStu
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
向伟
educationStu
Commits
a3b48279
Commit
a3b48279
authored
Jan 12, 2022
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
65780cf2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
168 additions
and
2 deletions
+168
-2
pages.json
src/pages.json
+6
-0
courseList.vue
src/pages/study/courseList.vue
+15
-2
wordStudy.vue
src/pages/word/wordStudy.vue
+147
-0
No files found.
src/pages.json
View file @
a3b48279
...
...
@@ -114,6 +114,12 @@
}
},{
"path"
:
"test"
},{
"path"
:
"wordStudy"
,
"style"
:
{
"backgroundColor"
:
"#f5f5f5"
,
"navigationBarBackgroundColor"
:
"#f5f5f5"
}
}]
}
],
...
...
src/pages/study/courseList.vue
View file @
a3b48279
...
...
@@ -49,6 +49,11 @@
color
:
#111111
;
font-weight
:
bold
;
font-size
:
30
rpx
;
display
:
-webkit-box
;
-webkit-box-orient
:
vertical
;
-webkit-line-clamp
:
2
;
overflow
:
hidden
;
word-break
:
break-all
;
}
.Course_Index
{
...
...
@@ -115,7 +120,7 @@
</view>
<view>
<van-rate
:value=
"item.Score"
:size=
"20"
readonly
color=
"#FAC217"
void-color=
"#
b2b2b2
"
void-icon=
"star"
icon=
"star"
:count=
"3"
/>
void-color=
"#
EBEBEB
"
void-icon=
"star"
icon=
"star"
:count=
"3"
/>
</view>
</view>
<view
class=
"Course_Two"
v-if=
"item.isShow"
>
...
...
@@ -125,7 +130,7 @@
</view>
<view
class=
"Course_Opera"
>
课程回顾
</view>
</view>
<view>
<view
@
click=
"goWordStudy(item)"
>
<view>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/fuxi.png"
alt=
""
/>
</view>
...
...
@@ -224,6 +229,14 @@
url
:
url
,
});
},
goWordStudy
(
obj
){
if
(
obj
){
let
url
=
`/pages/word/wordStudy?CourseId=
${
obj
.
ChapterTree
.
CourseId
}
&&ChapterId=
${
obj
.
ChapterTree
.
ChapterId
}
&&ReviewChapterId=0}`
uni
.
navigateTo
({
url
:
url
});
}
}
}
onMounted
(()
=>
{
})
...
...
src/pages/word/wordStudy.vue
0 → 100644
View file @
a3b48279
<
template
>
<view
class=
"word"
>
<swiper
class=
"swiper"
next-margin=
"60rpx"
@
change=
"swiperChange"
:current=
"current"
>
<swiper-item
v-for=
"(item,index) in StudyList"
:key=
"index"
class=
"swiper-item"
>
<Pronunciation
:item=
"item"
:cur=
"index+1"
:total=
"StudyList.length"
></Pronunciation>
</swiper-item>
<swiper-item
v-for=
"(item,index) in ReviewList"
:key=
"index"
class=
"swiper-item"
>
<Pronunciation
:item=
"item"
:cur=
"index+1"
:total=
"ReviewList.length"
:type=
"1"
></Pronunciation>
</swiper-item>
<swiper-item></swiper-item>
</swiper>
</view>
</
template
>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
provide
,
}
from
"vue"
;
import
Pronunciation
from
'../../components/word/Pronunciation.vue'
export
default
{
components
:
{
Pronunciation
},
setup
(
props
)
{
let
{
proxy
}
=
getCurrentInstance
();
let
data
=
reactive
({
msg
:
{
ChapterId
:
0
,
//当前章节编号
CourseId
:
0
,
ReviewChapterId
:
0
,
//复习章节编号
},
StudyList
:
[],
ReviewList
:
[],
//当前学习索引
current
:
0
,
readMsg
:
{
Id
:
0
,
ClassId
:
0
,
CourseId
:
0
,
Stu_Account_Id
:
0
,
ChapterId
:
0
,
ReviewCourseChapterId
:
0
,
//复习章节编号
PrepNum
:
0
,
//预习数量
ReviewNum
:
0
,
//复习单词数量
StudyNum
:
0
,
//学习总单词数量
StudyType
:
1
,
//1-预习,2-复习
},
})
let
methods
=
{
getData
()
{
proxy
.
$request
(
'/AppletWords/GetStudyWords'
,
data
.
msg
).
then
(
res
=>
{
data
.
StudyList
=
res
.
Data
.
StudyList
data
.
ReviewList
=
res
.
Data
.
ReviewList
;
const
total
=
data
.
StudyList
.
length
+
data
.
ReviewList
.
length
;
if
(
res
.
Data
.
StartIndex
>
total
||
res
.
Data
.
StartIndex
==
total
){
data
.
current
=
0
}
else
{
data
.
current
=
res
.
Data
.
StartIndex
;
}
})
},
swiperChange
(
val
)
{
data
.
current
=
val
.
detail
.
current
if
(
data
.
current
<=
data
.
StudyList
.
length
)
{
methods
.
completeRead
(
val
.
detail
.
current
,
1
)
}
else
if
(
data
.
current
<=
(
data
.
ReviewList
.
length
+
data
.
StudyList
.
length
))
{
methods
.
completeRead
(
val
.
detail
.
current
,
2
)
}
const
total
=
data
.
StudyList
.
length
+
data
.
ReviewList
.
length
+
1
if
(
val
.
detail
.
current
+
1
==
total
&&
total
>
1
)
{
}
},
completeRead
(
n
,
type
)
{
if
(
type
==
1
)
{
data
.
readMsg
.
PrepNum
=
n
}
else
{
data
.
readMsg
.
ReviewNum
=
n
-
data
.
StudyList
.
length
;
}
data
.
readMsg
.
StudyType
=
type
;
proxy
.
$request
(
'/AppletWords/SetStuWordsPrep'
,
data
.
readMsg
).
then
(
res
=>
{
if
(
res
.
Data
.
StudyNum
==
res
.
Data
.
TotalNum
){
uni
.
navigateTo
({
url
:
"/pages/word/studyComplete?CourseId="
+
data
.
readMsg
.
CourseId
+
'&&ChapterId='
+
data
.
readMsg
.
ChapterId
+
'&&NextChapterId='
+
'0'
})
}
})
}
}
onMounted
(()
=>
{
})
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
,
};
},
onLoad
(
options
)
{
console
.
log
(
"options"
,
options
);
uni
.
setNavigationBarTitle
({
title
:
'单词学习'
});
this
.
msg
.
ChapterId
=
options
.
ChapterId
??
0
;
this
.
msg
.
CourseId
=
options
.
CourseId
??
0
;
this
.
msg
.
ReviewChapterId
=
options
.
ReviewChapterId
??
0
;
if
(
options
.
ChapterId
&&
options
.
CourseId
&&
options
.
ReviewChapterId
)
{
this
.
getData
();
}
const
userInfo
=
uni
.
getStorageSync
(
'userInfo'
);
this
.
readMsg
.
Stu_Account_Id
=
userInfo
.
Id
??
0
;
this
.
readMsg
.
CourseId
=
options
.
CourseId
??
0
;
this
.
readMsg
.
ReviewCourseChapterId
=
options
.
ReviewChapterId
??
0
;
this
.
readMsg
.
ChapterId
=
options
.
ChapterId
??
0
;
},
}
</
script
>
<
style
scoped
>
.word
{
min-height
:
100vh
;
background-color
:
#F5F5F5
;
}
.word
.swiper
{
min-height
:
100vh
;
background-color
:
#F5F5F5
;
}
.word
.swiper-item
{
min-height
:
100vh
;
background-color
:
#F5F5F5
;
/* padding-left: 55rpx; */
}
</
style
>
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