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
54c6c03c
Commit
54c6c03c
authored
Jan 11, 2022
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
c94f70da
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
76 deletions
+108
-76
choiceQuestion.vue
src/components/word/choiceQuestion.vue
+81
-52
explain.vue
src/components/word/explain.vue
+5
-5
fillInTheBlanks.vue
src/components/word/fillInTheBlanks.vue
+14
-10
test.vue
src/pages/word/test.vue
+1
-4
word.vue
src/pages/word/word.vue
+7
-5
No files found.
src/components/word/choiceQuestion.vue
View file @
54c6c03c
<
style
scoped
>
.choiceQuestion
{
.choiceQuestion
{
width
:
100vw
;
height
:
100vh
;
background
:
#F5F5F5
;
box-sizing
:
border-box
;
}
.box
{
.box
{
width
:
100%
;
box-sizing
:
border-box
;
padding
:
0
20px
;
...
...
@@ -13,105 +14,134 @@
flex-direction
:
column
;
align-items
:
center
;
}
.dc
{
font-size
:
30px
;
.dc
{
font-size
:
60
rpx
;
color
:
#111111
;
font-weight
:
bold
;
margin-top
:
160
rpx
;
}
.dclx
{
padding
:
4px
6px
;
.dc2
{
font-size
:
30
rpx
;
color
:
#111111
;
font-weight
:
500
;
margin-top
:
160
rpx
;
}
.dclx
{
padding
:
4px
6px
;
border-radius
:
3px
;
background
:
#E8E9EA
;
font-size
:
14px
;
color
:
#666666
;
margin-top
:
18px
;
}
.choicelist
{
.choicelist
{
margin-top
:
100px
;
width
:
100%
;
}
.choice-item
{
.choice-item
{
height
:
106
rpx
;
border-radius
:
54
rpx
;
background
:
#FFFFFF
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
font-size
:
16
px
;
font-size
:
32
r
px
;
color
:
#111111
;
margin-bottom
:
19px
;
position
:
relative
;
}
.correct
{
.correct
{
background
:
#4C50E7
;
color
:
#FFFFFF
;
}
.sign
{
.sign
{
position
:
absolute
;
right
:
33px
;
top
:
36
rpx
;
}
.error
{
.error
{
background
:
#F66633
;
color
:
#FFFFFF
;
}
</
style
>
<
template
>
<view
class=
"choiceQuestion"
>
<view
class=
"box"
>
<view
class=
"dc"
>
火曜日
</view>
<view
class=
"dclx"
>
名词
</view>
<view
class=
"box"
v-if=
"!isShowExplain"
>
<!--
<view
class=
"dc"
>
{{
item
.
Title
}}
</view>
-->
<view
class=
"dc2"
>
{{
item
.
Title
}}
</view>
<view
class=
"dclx"
>
{{
item
.
WordType
}}
<text
@
click=
"isShowExplain=true"
>
查看解析
</text></view>
<view
class=
"choicelist"
>
<view
class=
"choice-item"
:class=
"
{'correct':(current ==answer
&&
current!=0
&&
x.Id == current) || (x.Id==answer
&&
current!=answer
&&
current!=0),
'error':current!=0
&&
x.Id ==current
&&
current!=answer
}"
v-for="(x,y) in list" :key='y' @click="choice(x)">
{{
x
.
Name
}}
<view
class=
"sign"
v-if=
"(current ==answer && current!=0 && x.Id == current) || (x.Id==answer && current!=answer && current!=0)"
>
<van-icon
name=
"success"
color=
"#5DE3A6"
size=
'40rpx'
/>
<view
class=
"choice-item"
:class=
"
{'correct':item.Answer==x.Name
&&
current==item.Answer,
'error':current==x.Name
&&
current!==item.Answer}" v-for="(x,y) in item.QuestionContent" :key='y' @click="choice(x)">
{{
x
.
Content
}}
<view
class=
"sign"
v-if=
"item.Answer==x.Name&¤t==item.Answer"
>
<van-icon
name=
"success"
color=
"#5DE3A6"
size=
'40rpx'
/>
</view>
<view
class=
"sign"
v-if=
"current
!=0 && x.Id ==current && current!=answer
"
>
<view
class=
"sign"
v-if=
"current
==x.Name&¤t!==item.Answer
"
>
<van-icon
name=
"cross"
color=
"#FFF"
size=
'40rpx'
/>
</view>
</view>
</view>
</view>
<Explain
v-if=
"isShowExplain"
></Explain>
</view>
</
template
>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
provide
}
from
"vue"
;
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
provide
}
from
"vue"
;
import
Explain
from
'../../components/word/explain.vue'
export
default
{
props
:
[
'current'
,
'answer'
],
setup
(
props
,{
attrs
,
slots
,
emit
})
{
components
:{
Explain
},
props
:
{
current
:
{
type
:
String
,
default
:
''
},
item
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
}
},
setup
(
props
,
{
attrs
,
slots
,
emit
})
{
let
data
=
reactive
({
list
:[
//选择列表
{
Id
:
1
,
Name
:
'ないこと'
},
{
Id
:
2
,
Name
:
'ざってい'
},
{
Id
:
3
,
Name
:
'ないこと'
},
{
Id
:
4
,
Name
:
'ないこと'
},
],
current
:
props
.
current
!=
''
?
props
.
current
:
0
,
//用户选择
answer
:
props
.
answer
,
//答案
current
:
''
,
//用户选择
isShowExplain
:
false
,
})
let
methods
=
{
choice
(
x
){
if
(
data
.
current
==
0
){
data
.
current
=
x
.
Id
;
//调取页面
emit
(
'choice'
,
data
.
current
)
}
choice
(
x
)
{
data
.
current
=
x
.
Name
;
}
}
onMounted
(()
=>
{
onMounted
(()
=>
{
console
.
log
(
136
,
props
.
item
)
})
let
that
=
methods
;
return
{
...
...
@@ -121,4 +151,3 @@
}
}
</
script
>
src/components/word/explain.vue
View file @
54c6c03c
...
...
@@ -4,29 +4,29 @@
height
:
100vh
;
background
:
#F5F5F5
;
box-sizing
:
border-box
;
padding
:
18
px
;
padding
:
36
r
px
;
}
.box
{
width
:
100%
;
box-sizing
:
border-box
;
padding
:
20
px
;
padding
:
40
r
px
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
border-radius
:
12
px
;
border-radius
:
24
r
px
;
background
:
#FFF
;
}
.box-top
{
height
:
calc
(
100vh
-
90
rpx
-
36px
);
overflow-y
:
auto
;
width
:
100%
;
}
.box-b
{
width
:
292
rpx
;
height
:
90
rpx
;
height
:
calc
(
100vh
-
166
rpx
)
;
background
:
#E4E5FB
;
display
:
flex
;
align-items
:
center
;
...
...
src/components/word/fillInTheBlanks.vue
View file @
54c6c03c
...
...
@@ -74,9 +74,9 @@
<view
class=
"fillInTheBlanks"
>
<view
class=
"box"
>
<view
class=
"dc
row
"
>
<view
style=
"font-size:26rpx;width:100%"
>
{{
item
.
Title
}}
</view>
<mypone
:maxlength=
"getNum(item)"
v-model=
"test"
style=
"display: inline-block;"
></mypone>
<view
class=
"dc "
>
<view
style=
"font-size:26rpx;width:100%
;font-weight: 600;
"
>
{{
item
.
Title
}}
</view>
<mypone
:maxlength=
"getNum(item)"
v-model=
"test"
style=
"display: inline-block;"
@
input=
"input"
></mypone>
</view>
<view
class=
"dclx"
>
{{
item
.
WordType
}}
</view>
<view
class=
"dclx2"
>
{{
item
.
ChineseMean
}}
</view>
...
...
@@ -121,9 +121,9 @@
let
methods
=
{
getNum
(
item
){
const
answer
=
item
.
Answer
const
index
=
answer
.
indexOf
(
"("
)
const
index
=
answer
.
indexOf
(
"
("
)
||
answer
.
indexOf
(
"
("
)
if
(
index
>-
1
){
return
index
+
1
return
index
}
else
{
return
answer
.
length
}
...
...
@@ -138,14 +138,18 @@
return
}
//去掉接口
if
(
data
.
test
==
props
.
item
.
Answer
||
props
.
item
.
Answer
.
indexOf
(
data
.
test
)
>-
1
){
data
.
type
=
1
}
else
{
data
.
type
=
2
}
},
input
(){
data
.
type
=
0
}
}
onMounted
(()
=>
{
console
.
log
(
137
,
props
.
item
)
//
console.log(137,props.item)
})
let
that
=
methods
;
return
{
...
...
src/pages/word/test.vue
View file @
54c6c03c
...
...
@@ -2,8 +2,7 @@
<view
class=
"wordTest"
>
<swiper
class=
"swiper"
>
<swiper-item
v-for=
"(item,index) in reviewGroupList"
:key=
"index"
class=
"swiper-item"
>
<Choice
v-if=
"item.QuestionTypeId==1"
></Choice>
<!--
<Explain
v-if=
"item.QuestionTypeId==3"
></Explain>
-->
<Choice
v-if=
"item.QuestionTypeId==1"
:item=
"item"
></Choice>
<FillIn
v-if=
"item.QuestionTypeId==3"
:item=
"item"
></FillIn>
</swiper-item>
<swiper-item
v-for=
"(item,index) in prepGroupList"
:key=
"index"
class=
"swiper-item"
>
...
...
@@ -23,12 +22,10 @@
onMounted
,
}
from
"vue"
;
import
Choice
from
'../../components/word/choiceQuestion.vue'
import
Explain
from
'../../components/word/explain.vue'
import
FillIn
from
'../../components/word/fillInTheBlanks.vue'
export
default
{
components
:
{
Choice
,
Explain
,
FillIn
},
setup
(
props
)
{
...
...
src/pages/word/word.vue
View file @
54c6c03c
...
...
@@ -74,10 +74,7 @@
}
const
total
=
data
.
StudyList
.
length
+
data
.
ReviewList
.
length
+
1
if
(
val
.
detail
.
current
+
1
==
total
&&
total
>
1
)
{
uni
.
navigateTo
({
url
:
"/pages/word/studyComplete?CourseId="
+
data
.
readMsg
.
CourseId
+
'&&ChapterId='
+
data
.
readMsg
.
ChapterId
+
'&&NextChapterId='
+
'0'
})
}
},
completeRead
(
n
,
type
)
{
...
...
@@ -88,7 +85,12 @@
}
data
.
readMsg
.
StudyType
=
type
;
proxy
.
$request
(
'/AppletWords/SetStuWordsPrep'
,
data
.
readMsg
).
then
(
res
=>
{
console
.
log
(
74
,
res
)
if
(
res
.
Data
.
StudyNum
==
res
.
Data
.
TotalNum
){
uni
.
navigateTo
({
url
:
"/pages/word/studyComplete?CourseId="
+
data
.
readMsg
.
CourseId
+
'&&ChapterId='
+
data
.
readMsg
.
ChapterId
+
'&&NextChapterId='
+
'0'
})
}
})
}
}
...
...
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