Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
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
和慭琛
take_order
Commits
1a4811e1
Commit
1a4811e1
authored
Jan 28, 2021
by
和慭琛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考试 启用真实数据字段
parent
cda8946c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
33 deletions
+121
-33
pages.json
take-order/pages.json
+6
-4
index.vue
take-order/pages/exam/index.vue
+115
-29
No files found.
take-order/pages.json
View file @
1a4811e1
...
@@ -8,21 +8,23 @@
...
@@ -8,21 +8,23 @@
{
{
"path"
:
"pages/
video
/index"
,
"path"
:
"pages/
exam
/index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"
培训&
考试"
"navigationBarTitleText"
:
"
入驻
考试"
}
}
},
},
{
{
"path"
:
"pages/
exam
/index"
,
"path"
:
"pages/
video
/index"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"
入驻
考试"
"navigationBarTitleText"
:
"
培训&
考试"
}
}
},
},
{
{
"path"
:
"pages/index/index"
,
"path"
:
"pages/index/index"
,
"style"
:
{
"style"
:
{
...
...
take-order/pages/exam/index.vue
View file @
1a4811e1
...
@@ -18,9 +18,9 @@
...
@@ -18,9 +18,9 @@
<view
class=
"topicView"
>
<view
class=
"topicView"
>
<text
class=
"topicText"
>
{{
currentItem
.
topic
}}
</text>
<text
class=
"topicText"
>
{{
currentItem
.
topic
}}
</text>
</view>
</view>
<view
class=
"itemView"
v-for=
"(item,ikey) in currentItem.
l
ist"
:key=
"ikey"
>
<view
class=
"itemView"
v-for=
"(item,ikey) in currentItem.
answerL
ist"
:key=
"ikey"
>
<text
:class=
"item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' "
<text
:class=
"item.isSelect ? 'itemText selectedColor' : 'itemText defaultColor' "
@
click=
"itemClick(item,ikey)"
>
{{
item
.
answer
}}
</text>
@
click=
"itemClick(item,ikey)"
>
{{
item
.
content
}}
</text>
</view>
</view>
<view
class=
"answerBottomView"
>
<view
class=
"answerBottomView"
>
<image
class=
"timeIcon"
src=
""
mode=
""
></image>
<image
class=
"timeIcon"
src=
""
mode=
""
></image>
...
@@ -39,6 +39,8 @@
...
@@ -39,6 +39,8 @@
data
()
{
data
()
{
return
{
return
{
examId
:
1
,
examId
:
1
,
userExamId
:
1
,
userAnswerIds
:
''
,
isStart
:
false
,
isStart
:
false
,
currentNumber
:
1
,
currentNumber
:
1
,
currentItem
:
null
,
currentItem
:
null
,
...
@@ -175,32 +177,70 @@
...
@@ -175,32 +177,70 @@
getData
:
function
()
{
getData
:
function
()
{
this
.
currentItem
=
{
this
.
currentItem
=
{
'topic'
:
'这是第一道题的题目这是第一道题的题目'
,
"isQuestion"
:
true
,
'list'
:[
"answerResult"
:
false
,
"examScore"
:
0
,
"examLevelDisc"
:
""
,
"examLevelResult"
:
""
,
"progress"
:
"1/3"
,
"question"
:
{
"id"
:
3
,
"content"
:
"题目3"
,
"score"
:
100
,
"orderNumber"
:
3
,
"rightAnswerIds"
:
""
,
"answerType"
:
1
,
"excamId"
:
1
},
"answerList"
:
[
{
{
'answer'
:
'这是选项一这是选项一这是选项一这是选项一'
,
"id"
:
1
,
'isSelect'
:
false
,
"content"
:
"答案A"
,
"type"
:
1
,
"orderNumber"
:
1
,
"questionId"
:
3
,
"isRight"
:
false
},
},
{
{
'answer'
:
'这是选项二这是选项二这是选项二这是选项二'
,
"id"
:
2
,
'isSelect'
:
false
,
"content"
:
"答案B"
,
"type"
:
1
,
"orderNumber"
:
1
,
"questionId"
:
3
,
"isRight"
:
false
},
},
{
{
'answer'
:
'这是选项三这是选项三这是选项三这是选项三'
,
"id"
:
3
,
'isSelect'
:
false
,
"content"
:
"答案C"
,
"type"
:
1
,
"orderNumber"
:
1
,
"questionId"
:
3
,
"isRight"
:
false
}
]
},
],
'isMulti'
:
true
,
}
}
this
.
handleData
()
this
.
startCounting
()
this
.
startCounting
()
},
},
handleData
:
function
()
{
this
.
currentItem
.
answerList
.
forEach
(
item
=>
{
item
.
isSelect
=
false
})
console
.
log
(
this
.
currentItem
)
},
startCounting
:
function
()
{
startCounting
:
function
()
{
this
.
currentTime
=
this
.
currentTime
-
1
this
.
currentTime
=
this
.
currentTime
-
1
...
@@ -218,15 +258,16 @@
...
@@ -218,15 +258,16 @@
itemClick
:
function
(
currentItem
,
ikey
)
{
itemClick
:
function
(
currentItem
,
ikey
)
{
this
.
isSelect
=
true
this
.
isSelect
=
true
//answerType 题目类型,1单选,2多选,3简答,
for
(
let
i
=
0
;
i
<
this
.
currentItem
.
l
ist
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
currentItem
.
answerL
ist
.
length
;
i
++
)
{
var
item
=
this
.
currentItem
.
l
ist
[
i
]
var
item
=
this
.
currentItem
.
answerL
ist
[
i
]
if
(
this
.
currentItem
.
isMulti
){
if
(
this
.
currentItem
.
answerType
==
2
){
//多选
if
(
ikey
==
i
){
if
(
ikey
==
i
){
item
.
isSelect
=
!
item
.
isSelect
item
.
isSelect
=
!
item
.
isSelect
}
}
}
else
{
}
else
{
//单选/简答
if
(
ikey
==
i
){
if
(
ikey
==
i
){
item
.
isSelect
=
!
item
.
isSelect
item
.
isSelect
=
!
item
.
isSelect
}
else
{
}
else
{
...
@@ -237,12 +278,13 @@
...
@@ -237,12 +278,13 @@
}
}
var
isSelect
=
false
var
isSelect
=
false
this
.
currentItem
.
l
ist
.
forEach
(
item
=>
{
this
.
currentItem
.
answerL
ist
.
forEach
(
item
=>
{
if
(
item
.
isSelect
){
if
(
item
.
isSelect
){
isSelect
=
true
isSelect
=
true
}
}
})
})
//有选答案
this
.
isSelect
=
isSelect
this
.
isSelect
=
isSelect
...
@@ -251,8 +293,50 @@
...
@@ -251,8 +293,50 @@
//下一题
//下一题
nextClick
:
function
()
{
nextClick
:
function
()
{
this
.
currentNumber
=
this
.
currentNumber
+
1
this
.
currentNumber
=
this
.
currentNumber
+
1
this
.
getData
()
//this.getData()
this
.
handleAnswer
()
//this.getNext()
},
//所选答案
handleAnswer
:
function
()
{
/*
userAnswerIds
本题回答。
多选题时id按从小到大排序,并英文逗号,分隔;
简答题时直接存问题答案。
如果是第一次答题,不需要传。
*/
// var idList = []
// idList.push(item.id)
this
.
currentItem
.
answerList
.
forEach
(
item
=>
{
// if(this.currentItem.answerType == 2){//多选}
if
(
item
.
isSelect
){
//this.userAnswerIds = item.id + ',' + this.userAnswerIds
///*
if
(
this
.
userAnswerIds
.
length
==
0
){
this
.
userAnswerIds
=
item
.
id
}
else
{
// if(this.userAnswerIds.length == 1)
this
.
userAnswerIds
=
item
.
id
+
','
+
this
.
userAnswerIds
}
//*/
}
})
console
.
log
(
'所选答案:'
)
console
.
log
(
this
.
userAnswerIds
)
this
.
getNext
()
this
.
getNext
()
},
},
//获取下一题
//获取下一题
...
@@ -269,7 +353,9 @@
...
@@ -269,7 +353,9 @@
+
getApp
().
globalData
.
token
+
'/serviceRule/next'
,
+
getApp
().
globalData
.
token
+
'/serviceRule/next'
,
method
:
'POST'
,
method
:
'POST'
,
data
:
{
data
:
{
examId
:
this
.
examId
,
userExamId
:
this
.
userExamId
,
questionId
:
this
.
currentItem
.
question
.
id
,
userAnswerIds
:
this
.
userAnswerIds
,
},
},
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
uni
.
hideLoading
()
uni
.
hideLoading
()
...
...
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