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
659aab99
Commit
659aab99
authored
Jan 28, 2021
by
和慭琛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考试 接口请求代码
parent
7b240b93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
175 additions
and
0 deletions
+175
-0
index.vue
take-order/pages/exam/index.vue
+175
-0
No files found.
take-order/pages/exam/index.vue
View file @
659aab99
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
examId
:
1
,
isStart
:
false
,
isStart
:
false
,
currentNumber
:
1
,
currentNumber
:
1
,
currentItem
:
null
,
currentItem
:
null
,
...
@@ -57,8 +58,122 @@
...
@@ -57,8 +58,122 @@
startClick
:
function
()
{
startClick
:
function
()
{
this
.
isStart
=
true
this
.
isStart
=
true
this
.
getData
()
this
.
getData
()
this
.
applyExam
()
this
.
getUserExamInfo
()
},
},
//申请考试
applyExam
:
function
()
{
uni
.
showLoading
({
title
:
'请稍候'
})
let
that
=
this
uni
.
request
({
url
:
getApp
().
globalData
.
domain_Name
+
'/wxh-support-rest/rest/exam/'
+
getApp
().
globalData
.
token
+
'/serviceRule'
,
method
:
'POST'
,
data
:
{
examId
:
this
.
examId
,
},
success
:
(
res
)
=>
{
uni
.
hideLoading
()
console
.
log
(
'申请考试 成功'
)
console
.
log
(
res
)
if
(
res
.
statusCode
==
401
){
uni
.
navigateTo
({
url
:
'/pages/login/wxlogin'
})
return
}
if
(
res
.
data
.
code
==
200
){
// console.log('code=200')
//this.handleList(res)
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
res
.
data
.
message
})
}
},
fail
:
(
e
)
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
icon
:
'none'
,
title
:
'申请考试 失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
},
//获取考试信息
getUserExamInfo
:
function
()
{
uni
.
showLoading
({
title
:
'请稍候'
})
let
that
=
this
uni
.
request
({
url
:
getApp
().
globalData
.
domain_Name
+
'/wxh-support-rest/rest/exam/'
+
getApp
().
globalData
.
token
+
'/serviceRule/userExamInfo/'
,
method
:
'GET'
,
data
:
{
examId
:
this
.
examId
,
},
success
:
(
res
)
=>
{
uni
.
hideLoading
()
console
.
log
(
'获取考试信息 成功'
)
console
.
log
(
res
)
if
(
res
.
statusCode
==
401
){
uni
.
navigateTo
({
url
:
'/pages/login/wxlogin'
})
return
}
if
(
res
.
data
.
code
==
200
){
// console.log('code=200')
//this.handleList(res)
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
res
.
data
.
message
})
}
},
fail
:
(
e
)
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
icon
:
'none'
,
title
:
'获取考试信息失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
},
getData
:
function
()
{
getData
:
function
()
{
this
.
currentItem
=
{
this
.
currentItem
=
{
'topic'
:
'这是第一道题的题目这是第一道题的题目'
,
'topic'
:
'这是第一道题的题目这是第一道题的题目'
,
...
@@ -137,7 +252,67 @@
...
@@ -137,7 +252,67 @@
nextClick
:
function
()
{
nextClick
:
function
()
{
this
.
currentNumber
=
this
.
currentNumber
+
1
this
.
currentNumber
=
this
.
currentNumber
+
1
this
.
getData
()
this
.
getData
()
this
.
getNext
()
},
//获取下一题
getNext
:
function
()
{
uni
.
showLoading
({
title
:
'请稍候'
})
let
that
=
this
uni
.
request
({
url
:
getApp
().
globalData
.
domain_Name
+
'/wxh-support-rest/rest/exam/'
+
getApp
().
globalData
.
token
+
'/serviceRule/next'
,
method
:
'POST'
,
data
:
{
examId
:
this
.
examId
,
},
success
:
(
res
)
=>
{
uni
.
hideLoading
()
console
.
log
(
'获取下一题 成功'
)
console
.
log
(
res
)
if
(
res
.
statusCode
==
401
){
uni
.
navigateTo
({
url
:
'/pages/login/wxlogin'
})
return
}
if
(
res
.
data
.
code
==
200
){
// console.log('code=200')
//this.handleList(res)
}
else
{
uni
.
showToast
({
icon
:
'none'
,
title
:
res
.
data
.
message
})
}
},
},
fail
:
(
e
)
=>
{
uni
.
hideLoading
()
uni
.
showToast
({
icon
:
'none'
,
title
:
'获取下一题 失败'
})
// console.log('获取下单列表 失败')
// console.log(e)
}
})
},
}
}
...
...
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