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
1a8f0ca9
Commit
1a8f0ca9
authored
Mar 08, 2022
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
01a77340
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
1510 additions
and
2 deletions
+1510
-2
exam.js
src/api/exam.js
+24
-0
answer.vue
src/components/question/answer.vue
+221
-0
readingCompre.vue
src/components/question/readingCompre.vue
+526
-0
readingCompre.vue
src/components/subject/readingCompre.vue
+5
-2
pages.json
src/pages.json
+6
-0
MyExam.vue
src/pages/exam/MyExam.vue
+358
-0
examGradeList.vue
src/pages/exam/examGradeList.vue
+148
-0
examStart.vue
src/pages/exam/examStart.vue
+215
-0
index.vue
src/pages/index/index.vue
+7
-0
No files found.
src/api/exam.js
View file @
1a8f0ca9
...
...
@@ -47,4 +47,28 @@ export function SetStuExamStartTime(data) {
method
:
'post'
,
data
})
}
/**
* 查询考试数据
* @param {JSON参数} data
*/
export
function
queryQuestionPageList
(
data
)
{
return
request
({
url
:
'/Question/GetQuestionPageList'
,
method
:
'post'
,
data
})
}
/**
* 获取阅读理解
* @param {JSON参数} data
*/
export
function
GetQuestionReading
(
data
)
{
return
request
({
url
:
'/Exam/GetQuestionReading'
,
method
:
'post'
,
data
})
}
\ No newline at end of file
src/components/question/answer.vue
0 → 100644
View file @
1a8f0ca9
<
template
>
<view>
<!--
<van-nav-bar
fixed
>
<template
#
left
>
<van-icon
name=
"cross"
style=
"font-size: 32rpx; color: #111"
@
click=
"back"
/>
</
template
>
<
template
#
title
>
<view
style=
"
font-size: 32rpx;
color: #111;
font-family: PingFang SC;
font-weight: 800;
"
>
答题卡
</view
>
</
template
>
</van-nav-bar>
-->
<view
class=
"answer-sheets"
>
<view
class=
"flex flex_wrap"
>
<view
class=
"flex flex_wrap"
>
<view
v-for=
"(item, index) in questionList"
:key=
"index"
>
<view
class=
"item1"
:class=
"{ isRes: item.IsRes }"
@
click=
"chooseTopic(index)"
>
{{ index + 1 }}
</view
>
</view>
</view>
</view>
</view>
<view
class=
"submitBox"
>
<view
class=
"submit"
@
click=
"savePaper"
>
立即提交
</view>
</view>
<van-toast
id=
"van-toast"
/>
</view>
</template>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
}
from
"vue"
;
import
{
submitPaper
}
from
"../../api/exam"
;
export
default
{
props
:
{
paperData
:
Array
,
ExamStuId
:
Number
,
SubmitTimes
:
Number
,
StartTime
:
String
,
ExamStatus
:
Number
,
},
setup
(
props
,
ctx
)
{
let
data
=
reactive
({
questionList
:
props
.
paperData
});
let
methods
=
{
chooseTopic
(
index
)
{
ctx
.
emit
(
"chooseTopic"
,
{
index
});
},
//隐藏答题卡
back
()
{
ctx
.
emit
(
"hideAnswer"
);
},
getNowTime
()
{
let
dateTime
;
let
yy
=
new
Date
().
getFullYear
();
let
mm
=
new
Date
().
getMonth
()
+
1
;
let
dd
=
new
Date
().
getDate
();
let
hh
=
new
Date
().
getHours
();
let
mf
=
new
Date
().
getMinutes
()
<
10
?
"0"
+
new
Date
().
getMinutes
()
:
new
Date
().
getMinutes
();
let
ss
=
new
Date
().
getSeconds
()
<
10
?
"0"
+
new
Date
().
getSeconds
()
:
new
Date
().
getSeconds
();
dateTime
=
yy
+
"-"
+
mm
+
"-"
+
dd
+
" "
+
hh
+
":"
+
mf
+
":"
+
ss
;
return
dateTime
;
},
//交卷
async
savePaper
()
{
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
props
.
paperData
));
console
.
log
(
props
.
paperData
,
'paper'
);
// let res = await submitPaper(obj);
// if (res) {
// if (res.Code == 1) {
// uni.showToast({
// title: res.Message,
// icon: "none",
// });
// setTimeout(() => {
// uni.switchTab({
// url: "/pages/index/index",
// });
// }, 1000);
// }
// }
},
};
onMounted
(()
=>
{
console
.
log
(
data
.
questionList
,
'question'
);
});
return
{
...
toRefs
(
data
),
...
methods
,
};
},
};
</
script
>
<
style
scoped
>
.answer-sheets
{
box-sizing
:
border-box
;
padding
:
30
rpx
;
height
:
calc
(
100vh
-
300
rpx
);
overflow-y
:
auto
;
}
.name
,
.num
{
font-size
:
28
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
800
;
color
:
#111111
;
}
.num
{
width
:
100
rpx
;
text-align
:
center
;
}
.item
{
margin-bottom
:
20
rpx
;
}
.item1-1
{
width
:
690
rpx
;
margin
:
22
rpx
0
0
0
;
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
600
;
color
:
#111111
;
}
.item1
{
width
:
55
rpx
;
height
:
55
rpx
;
border
:
1px
solid
#e2e2e2
;
border-radius
:
50%
;
margin
:
22
rpx
;
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
600
;
color
:
#111111
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
box-sizing
:
border-box
;
}
.item2
{
width
:
44
rpx
;
height
:
44
rpx
;
border
:
1px
solid
#e2e2e2
;
border-radius
:
50%
;
text-align
:
center
;
line-height
:
44
rpx
;
margin-right
:
55
rpx
;
font-size
:
26
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#111111
;
}
.choose
{
background-color
:
#00acf9
!important
;
color
:
#ffffff
!important
;
}
.submitBox
{
width
:
750
rpx
;
height
:
150
rpx
;
background-color
:
#e2e2e2
;
position
:
fixed
;
left
:
0
;
bottom
:
0
;
box-sizing
:
border-box
;
padding-top
:
40
rpx
;
}
.submit
{
width
:
600
rpx
;
height
:
70
rpx
;
border-radius
:
35
rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
background-color
:
#00acf9
;
font-size
:
28
rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#fff
;
margin
:
0
auto
;
}
.isRes
{
background-color
:
#00acf9
!important
;
color
:
#ffffff
!important
;
border
:
none
!important
;
}
</
style
>
src/components/question/readingCompre.vue
0 → 100644
View file @
1a8f0ca9
This diff is collapsed.
Click to expand it.
src/components/subject/readingCompre.vue
View file @
1a8f0ca9
...
...
@@ -19,8 +19,8 @@
<swiper-item
v-for=
"(item1, index1) in data.DetailsList"
:key=
"index1"
>
<view
class=
"item1"
:style=
"
{height: `calc(100vh - 390rpx - ${statusBarHeight}px)`}">
<view
class=
"flex"
>
<view
class=
"num readTitle"
v-html=
"item1.Title"
></view>
<text
class=
"Exam_Score"
>
(
{{
item1
.
Score
}}
)
</text
>
<view
class=
"num readTitle"
v-html=
"item1.Title"
></view>
<!--
<text
class=
"Exam_Score"
>
(
{{
item1
.
Score
}}
)
</text>
--
>
</view>
<!--
<view
class=
"questionBox"
:style=
"
{ height: `${questionH}rpx` }">
<view
class=
"questionTotal"
@
touchstart=
"touchstart"
@
touchmove=
"touchmove"
...
...
@@ -308,6 +308,9 @@
};
onMounted
(()
=>
{
console
.
log
(
361
,
data
.
data
);
data
.
data
.
DetailsList
.
forEach
(
x
=>
{
x
.
Title
=
x
.
Title
.
replace
(
/\<img/gi
,
'<img style="max-width:100%;height:auto" '
)
})
if
(
props
.
isLast
)
{
if
(
data
.
sortIndex
===
1
)
{
data
.
current
=
props
.
paperData
.
DetailsList
.
length
-
1
;
...
...
src/pages.json
View file @
1a8f0ca9
...
...
@@ -92,6 +92,12 @@
"style"
:
{
"navigationStyle"
:
"custom"
}
},{
"path"
:
"MyExam"
},{
"path"
:
"examStart"
},{
"path"
:
"examGradeList"
}]
},
{
...
...
src/pages/exam/MyExam.vue
0 → 100644
View file @
1a8f0ca9
<
style
scoped
>
.Question_Bank
{
padding
:
0
25
rpx
;
height
:
100vh
;
background-color
:
#F5F5F5
;
}
.Question_Top
{
display
:
flex
;
align-items
:
center
;
padding-top
:
40
rpx
;
}
.Ques_Title
{
font-size
:
28
rpx
;
font-weight
:
bold
;
color
:
#111111
;
margin-right
:
45
rpx
;
}
.Ques_Select
{
padding
:
5
rpx
;
width
:
80
rpx
;
background-color
:
#FFF3F8
;
color
:
#F27573
;
border-radius
:
20
rpx
;
font-size
:
25
rpx
;
position
:
relative
;
padding
:
5
rpx
0
5
rpx
15
rpx
;
}
.Ques_CirContent
{
width
:
100%
;
overflow-x
:
scroll
;
white-space
:
nowrap
;
margin-top
:
40
rpx
;
}
.Ques_Circle
{
width
:
190
rpx
;
height
:
200
rpx
;
text-align
:
center
;
color
:
#fff
;
margin-right
:
25
rpx
;
display
:
inline-block
;
border-radius
:
24
rpx
;
background-color
:
#fff
;
position
:
relative
;
box-sizing
:
border-box
;
}
.Ques_CirContent
::-webkit-scrollbar
{
display
:
none
;
}
.Ques_Top
{
font-weight
:
bold
;
font-size
:
35
rpx
;
margin-top
:
30
rpx
;
color
:
#4C50E7
;
}
.Ques_Num
{
margin-top
:
12
rpx
;
font-size
:
25
rpx
;
color
:
#666666
;
}
.Ques_Join
{
display
:
flex
;
margin-top
:
30
rpx
;
flex-wrap
:
wrap
;
}
.Janpa_Level
{
margin-top
:
40
rpx
;
}
.Ques_Inner
{
width
:
200
rpx
;
height
:
140
rpx
;
background-color
:
#fff
;
text-align
:
center
;
color
:
#111111
;
font-size
:
28
rpx
;
margin
:
0
25
rpx
25
rpx
0
;
border-radius
:
24
rpx
;
position
:
relative
;
}
.Ques_level
{
font-style
:
italic
;
position
:
absolute
;
font-size
:
34
rpx
;
font-weight
:
bold
;
left
:
15
rpx
;
top
:
10
rpx
;
z-index
:
99
;
}
.Ques_Big
{
position
:
absolute
;
font-style
:
italic
;
font-size
:
80
rpx
;
color
:
#F1F1FD
;
left
:
0
;
font-weight
:
bold
;
}
.Ques_Jnber
{
position
:
absolute
;
color
:
#A3A3A3
;
font-size
:
20
rpx
;
bottom
:
16
rpx
;
right
:
20
rpx
;
}
.JanpaTrueTi
{
width
:
100%
;
height
:
250
rpx
;
margin-top
:
40
rpx
;
position
:
relative
;
border-radius
:
20
rpx
;
overflow
:
hidden
;
}
.JanpaTrueTi
img
{
width
:
100%
;
height
:
100%
;
}
.Join_Content
{
color
:
#333E52
;
font-size
:
28
rpx
;
position
:
absolute
;
left
:
55
rpx
;
bottom
:
100
rpx
;
}
.Join_Linian
{
color
:
#333E52
;
font-size
:
36
rpx
;
margin-bottom
:
20
rpx
;
font-weight
:
bold
;
}
.Ques_Circle
img
{
position
:
absolute
;
bottom
:
0
;
width
:
80
rpx
;
height
:
48
rpx
;
left
:
60
rpx
;
}
.triangle_Down
{
width
:
0
;
height
:
0
;
border-left
:
5px
solid
transparent
;
border-right
:
5px
solid
transparent
;
border-top
:
5px
solid
#F27573
;
display
:
inline-block
;
margin-left
:
10
rpx
;
position
:
absolute
;
top
:
17
rpx
;
}
.level_Choice
{
color
:
#000000
;
font-size
:
33
rpx
;
margin-top
:
40
rpx
;
font-weight
:
bold
;
margin-bottom
:
50
rpx
;
}
.level_Content
{
display
:
flex
;
width
:
100%
;
justify-content
:
space-between
;
}
.level_Content
view
{
padding
:
10
rpx
0
;
background-color
:
#F1F1F1
;
font-size
:
26
rpx
;
border-radius
:
30
rpx
;
text-align
:
center
;
margin
:
0
30
rpx
30
rpx
0
;
width
:
180
rpx
;
}
.level_Content
view
:nth-child
(
3n
)
{
margin-right
:
0
;
}
</
style
>
<
template
>
<view
class=
"Question_Bank"
>
<view
class=
"Question_Top"
>
<view
class=
"Ques_Title"
>
日语专项练习
</view>
<view
class=
"Ques_Select"
@
click=
"showExambox()"
>
{{
comNum
}}
<text
class=
"triangle_Down"
></text>
</view>
<view
class=
"Ques_Reset"
>
</view>
</view>
<view
class=
"Ques_CirContent"
>
<view
class=
"Ques_Circle"
@
click=
"goExam()"
>
<view
class=
"Ques_Top"
>
单词
</view>
<view
class=
"Ques_Num"
>
6/89
</view>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word1.png"
alt=
""
/>
</view>
<view
class=
"Ques_Circle"
>
<view
class=
"Ques_Top"
>
语法
</view>
<view
class=
"Ques_Num"
>
6/89
</view>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word2.png"
alt=
""
/>
</view>
<view
class=
"Ques_Circle"
>
<view
class=
"Ques_Top"
>
听力
</view>
<view
class=
"Ques_Num"
>
6/89
</view>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word3.png"
alt=
""
/>
</view>
<view
class=
"Ques_Circle"
style=
"margin-right:0;"
>
<view
class=
"Ques_Top"
>
阅读
</view>
<view
class=
"Ques_Num"
>
6/89
</view>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/word4.png"
alt=
""
/>
</view>
</view>
<view
class=
"Janpa_Level"
>
<view
class=
"Ques_Title"
>
日语等级评测
</view>
<view
class=
"Ques_Join"
>
<view
class=
"Ques_Inner"
@
click=
"goJpGrade()"
>
<text
class=
"Ques_level"
>
N5
</text>
<text
class=
"Ques_Big"
>
N5
</text>
<text
class=
"Ques_Jnber"
>
206人参与
</text>
</view>
<view
class=
"Ques_Inner"
>
<text
class=
"Ques_level"
>
N4
</text>
<text
class=
"Ques_Big"
>
N4
</text>
<view
class=
"Ques_Jnber"
>
206人参与
</view>
</view>
<view
class=
"Ques_Inner"
>
<text
class=
"Ques_level"
>
N3
</text>
<text
class=
"Ques_Big"
>
N3
</text>
<view
class=
"Ques_Jnber"
>
206人参与
</view>
</view>
<view
class=
"Ques_Inner"
>
<text
class=
"Ques_level"
>
N2
</text>
<text
class=
"Ques_Big"
>
N2
</text>
<view
class=
"Ques_Jnber"
>
206人参与
</view>
</view>
<view
class=
"Ques_Inner"
>
<text
class=
"Ques_level"
>
N1
</text>
<text
class=
"Ques_Big"
>
N1
</text>
<view
class=
"Ques_Jnber"
>
206人参与
</view>
</view>
</view>
</view>
<view
class=
"Janpa_Level"
style=
"margin-top:20rpx;"
>
<view
class=
"Ques_Title"
>
日语真题演练
</view>
<view
class=
"JanpaTrueTi"
>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/trueTi.png"
alt=
""
/>
<view
class=
"Join_Content"
>
<view
class=
"Join_Linian"
>
历年真题演练
</view>
<view>
1人参与
</view>
</view>
</view>
<view
class=
"JanpaTrueTi"
style=
"margin:26rpx 0 20rpx 0"
>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/true2.png"
alt=
""
/>
<view
class=
"Join_Content"
>
<view
class=
"Join_Linian"
>
高考真题
</view>
<view>
1人参与
</view>
</view>
</view>
</view>
<van-popup
:show=
"showPop"
@
close=
"showPop=false"
round
>
<view
style=
"
display: flex;
flex-direction: column;
align-items: center;
background: #fff;
width: 500rpx;
height: 400rpx;
padding:20rpx;
"
>
<view
class=
"level_Choice"
>
等级选择
</view>
<view
class=
"level_Content"
>
<view
@
click=
"getLevel('N5')"
>
N5
</view>
<view
@
click=
"getLevel('N4')"
>
N4
</view>
<view
@
click=
"getLevel('N3')"
>
N3
</view>
</view>
<view
class=
"level_Content"
>
<view
@
click=
"getLevel('N2')"
>
N2
</view>
<view
@
click=
"getLevel('N1')"
>
N1
</view>
<view>
高考真题
</view>
</view>
<view
class=
"level_Content"
>
<view>
高考模拟
</view>
</view>
</view>
</van-popup>
</view>
</
template
>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
}
from
"vue"
;
export
default
{
props
:
{},
setup
(
props
,
ctx
)
{
let
data
=
reactive
({
msg
:
{},
showPop
:
false
,
comNum
:
'N3'
});
let
methods
=
{
//返回首页
goExam
()
{
uni
.
navigateTo
({
url
:
'/pages/exam/examStart'
});
},
showExambox
()
{
console
.
log
(
'1111'
);
data
.
showPop
=
true
;
},
onClose
()
{
data
.
showPop
=
false
;
},
//点击选择等级
getLevel
(
num
){
console
.
log
(
num
,
'num'
);
data
.
comNum
=
num
;
data
.
showPop
=
false
;
},
//跳转到日语等级评测列表
goJpGrade
(){
uni
.
navigateTo
({
url
:
'/pages/exam/examGradeList'
});
}
};
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
,
};
},
onLoad
(
options
)
{},
};
</
script
>
<
style
>
</
style
>
src/pages/exam/examGradeList.vue
0 → 100644
View file @
1a8f0ca9
<
style
scoped
>
.GradeContent
{
padding
:
0
35
rpx
;
height
:
100vh
;
background-color
:
#F5F5F5
;
}
.Grade_List
{
height
:
380
rpx
;
background-color
:
#fff
;
border-radius
:
24
rpx
;
position
:
relative
;
padding
:
30
rpx
;
}
.Grade_Title
{
color
:
#111111
;
font-size
:
32
rpx
;
width
:
100%
;
text-align
:
center
;
font-weight
:
bold
;
margin
:
10
rpx
0
40
rpx
0
;
}
.Grade_Join
{
display
:
flex
;
}
.Grade_Join
view
{
flex
:
1
;
}
.Grade_TopNum
{
color
:
#111111
;
font-size
:
24
rpx
;
margin-bottom
:
17
rpx
;
font-weight
:
bold
;
}
.Grade_BtmText
{
color
:
#888888
;
font-size
:
22
rpx
;
}
.Grade_JoinFirst
{
position
:
relative
;
padding-left
:
35
rpx
;
}
.Grade_JoinFirst
:after
{
content
:
""
;
margin-left
:
15px
;
padding-left
:
15px
;
border-left
:
1px
solid
#c0c4cc
;
height
:
40
rpx
;
display
:
inline-block
;
vertical-align
:
middle
;
position
:
absolute
;
right
:
0
;
top
:
20
rpx
;
}
.Grade_JoinSecond
{
text-align
:
center
;
position
:
relative
;
}
.Grade_JoinSecond
:after
{
content
:
""
;
border-left
:
1px
solid
#c0c4cc
;
height
:
40
rpx
;
display
:
inline-block
;
vertical-align
:
middle
;
position
:
absolute
;
right
:
0
;
top
:
20
rpx
;
}
.Grade_GongGu
{
display
:
flex
;
margin-top
:
40
rpx
;
/* justify-content: space-between;
*/
}
.Grade_Left
{
width
:
425
rpx
;
height
:
145
rpx
;
background-color
:
#F6F6FE
;
border-radius
:
24
rpx
;
color
:
#4C50E7
;
}
</
style
>
<
template
>
<view
class=
"GradeContent"
>
<view
class=
"Grade_List"
>
<view
class=
"Grade_Title"
>
N5模拟试题 1
</view>
<view
class=
"Grade_Join"
>
<view
class=
"Grade_JoinFirst"
>
<view
class=
"Grade_TopNum"
>
1523
</view>
<view
class=
"Grade_BtmText"
>
参加人数
</view>
</view>
<view
class=
"Grade_JoinSecond"
>
<view
class=
"Grade_TopNum"
>
05′00″
</view>
<view
class=
"Grade_BtmText"
>
最低用时
</view>
</view>
<view>
<view
style=
"margin-left:60rpx;"
>
<view
class=
"Grade_TopNum"
>
26
</view>
<view
class=
"Grade_BtmText"
>
最高得分
</view>
</view>
</view>
</view>
<view
class=
"Grade_GongGu"
>
<view
class=
"Grade_Left"
>
</view>
<view>
</view>
</view>
</view>
</view>
</
template
>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
}
from
"vue"
;
export
default
{
props
:
{},
setup
(
props
,
ctx
)
{
let
data
=
reactive
({
msg
:
{},
});
let
methods
=
{
};
let
that
=
methods
;
return
{
...
toRefs
(
data
),
...
methods
,
};
},
onLoad
(
options
)
{
uni
.
setNavigationBarTitle
({
title
:
"日语等级测评"
});
},
};
</
script
>
<
style
>
</
style
>
src/pages/exam/examStart.vue
0 → 100644
View file @
1a8f0ca9
<
template
>
<view>
<view
class=
"exam-con"
v-if=
"!isShowAnswer && !isShowNotice"
>
<i
class=
"iconfont icon-caidanzu answerSheet"
style=
"
position: absolute;
right: 30rpx;
z-index: 999;
margin-top: 26rpx;
"
@
click=
"showAnswerSheet"
></i>
<view
v-for=
"(item, index) in dataList"
:key=
"index"
>
<!-- 阅读理解 -->
<readingCompre
:startIndex=
"item.startIndex"
:paperData=
"dataList"
:sort=
"index"
:isOperate=
"isOperate"
:ExamStatus=
"ExamStatus"
@
answerChange=
"getAnswerChange($event, index)"
v-if=
"item.QuestionTypeKey === 'reading-comprehensio' && index === changeIndex"
/>
</view>
</view>
<view
v-if=
"isShowAnswer"
>
<view
class=
"answer-con"
v-if=
"!isShowAnswerSee"
>
<answer
:paperData=
"dataList"
:ExamStuId=
"Exam_Student_Id"
:StartTime=
"StartTime"
:ExamStatus=
"ExamStatus"
:SubmitTimes=
"SubmitTimes"
@
hideAnswer=
"hideAnswerSheet"
@
chooseTopic=
"jumpTopic"
ref=
"answer"
/>
</view>
<!-- 答题卡查看对错 -->
<answerSee
:paperData=
"peaperDetail"
@
hideAnswer=
"hideAnswerSheet"
@
chooseTopic=
"jumpTopic"
v-if=
"isShowAnswerSee"
/>
</view>
<view
class=
"answer-con"
v-if=
"isShowNotice"
>
<examNotice
:msg=
"msg"
:ExamStatus=
"ExamStatus"
@
hideNotice=
"hideNotice"
/>
</view>
<van-toast
id=
"van-toast"
/>
</view>
</
template
>
<
script
>
import
{
ref
,
reactive
,
toRefs
,
toRef
,
getCurrentInstance
,
watch
,
computed
,
onMounted
,
}
from
"vue"
;
import
{
GetQuestionReading
}
from
"../../api/exam"
;
import
{
changeNumToHan
}
from
"../../utils/index"
;
import
{
submitPaper
}
from
"../../api/exam"
;
import
answer
from
"../../components/question/answer.vue"
;
//答题卡
import
readingCompre
from
"../../components/question/readingCompre"
;
export
default
{
components
:
{
readingCompre
,
answer
},
setup
(
props
,
context
)
{
let
{
refs
}
=
getCurrentInstance
();
console
.
log
(
refs
);
let
data
=
reactive
({
statusBarHeight
:
0
,
msg
:
{
pageIndex
:
1
,
pageSize
:
10
},
dataList
:
[],
isShowAnswer
:
false
,
//是否显示答题卡
Exam_Student_Id
:
0
,
changeIndex
:
0
,
//大题序号
isOperate
:
true
,
//考试状态 判断是考试还是查看答案
isAutoTime
:
false
,
ExamStatus
:
-
1
,
SubmitTimes
:
0
,
//后台设置几分钟后可提交
isShowAnswerSee
:
false
,
});
let
methods
=
{
changeNumToHan
,
jumpPage
()
{
uni
.
navigateTo
({
url
:
"/pages/exam/examPaper"
,
});
},
async
GetMyQuestionReading
()
{
let
res
=
await
GetQuestionReading
(
data
.
msg
);
if
(
res
)
{
if
(
res
.
Code
==
1
)
{
console
.
log
(
res
,
'数据'
);
this
.
dataList
=
res
.
Data
.
PageData
;
}
}
},
//显示答题卡
showAnswerSheet
()
{
data
.
isShowAnswer
=
true
;
},
//隐藏答题卡
hideAnswerSheet
()
{
data
.
isShowAnswer
=
false
;
},
//隐藏考前提示
hideNotice
()
{
console
.
log
(
"进入"
);
data
.
isShowNotice
=
false
;
},
//获取答案改变后的数据
getAnswerChange
(
val
,
index
)
{
// data.peaperDetail.Paper.GroupList[index] = val;
},
//跳转到指定题目
jumpTopic
(
val
)
{
console
.
log
(
val
);
this
.
changeIndex
=
val
.
index
;
this
.
dataList
[
val
.
index
].
startIndex
=
val
.
index
+
1
;
data
.
isShowAnswer
=
false
;
},
getNowTime
()
{
let
dateTime
;
let
yy
=
new
Date
().
getFullYear
();
let
mm
=
new
Date
().
getMonth
()
+
1
;
let
dd
=
new
Date
().
getDate
();
let
hh
=
new
Date
().
getHours
();
let
mf
=
new
Date
().
getMinutes
()
<
10
?
"0"
+
new
Date
().
getMinutes
()
:
new
Date
().
getMinutes
();
let
ss
=
new
Date
().
getSeconds
()
<
10
?
"0"
+
new
Date
().
getSeconds
()
:
new
Date
().
getSeconds
();
dateTime
=
yy
+
"-"
+
mm
+
"-"
+
dd
+
" "
+
hh
+
":"
+
mf
+
":"
+
ss
;
return
dateTime
;
},
//交卷
async
savePaper
()
{
let
obj
=
JSON
.
parse
(
JSON
.
stringify
(
data
.
peaperDetail
.
Paper
));
delete
obj
.
Group_Id
;
obj
.
Exam_Student_Id
=
parseInt
(
data
.
Exam_Student_Id
);
let
time1
=
data
.
StartTime
;
let
time2
=
methods
.
getNowTime
();
var
d1
=
new
Date
(
time1
);
var
d2
=
new
Date
(
time2
);
let
TimeDis
=
parseInt
(
d2
-
d1
)
/
1000
/
60
;
if
(
TimeDis
<
data
.
SubmitTimes
)
{
uni
.
showToast
({
title
:
`开考不足
${
data
.
SubmitTimes
}
分钟禁止交卷哦~`
,
icon
:
"none"
,
});
return
;
}
let
res
=
await
submitPaper
(
obj
);
if
(
res
)
{
if
(
res
.
Code
==
1
)
{
uni
.
showToast
({
title
:
res
.
Message
,
icon
:
"none"
,
});
setTimeout
(()
=>
{
uni
.
navigateTo
({
url
:
"/pages/index/index"
,
});
},
1000
);
}
}
},
};
onMounted
(()
=>
{
data
.
statusBarHeight
=
uni
.
getSystemInfoSync
().
statusBarHeight
;
});
return
{
...
toRefs
(
data
),
...
methods
,
};
},
async
onLoad
(
options
)
{
await
this
.
GetMyQuestionReading
();
},
};
</
script
>
<
style
scoped
>
.exam-con
{
box-sizing
:
border-box
;
}
.answerSheet
{
font-size
:
40
rpx
;
margin-left
:
30
rpx
;
color
:
#000
;
}
</
style
>
src/pages/index/index.vue
View file @
1a8f0ca9
...
...
@@ -45,6 +45,8 @@
<view
class=
"wordTitle"
>
单词练习
</view>
<view
@
click=
"goWord()"
>
跳转。。。
</view>
<view
class=
"flex_around_center "
>
<view
class=
"wordItem"
>
<text
class=
"wordItemTitle"
>
今日新词
</text>
...
...
@@ -188,6 +190,11 @@
url
:
url
,
});
},
goWord
(){
uni
.
navigateTo
({
url
:
'/pages/exam/MyExam'
});
},
jumpTimetable
()
{
uni
.
switchTab
({
url
:
'/pages/timetable/timeTable'
,
...
...
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