Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
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
Damon
study
Commits
b10d50fe
Commit
b10d50fe
authored
Jul 24, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 绑卡
parent
69bdc8cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
25 deletions
+38
-25
http.interceptor.js
src/common/http.interceptor.js
+2
-1
index.vue
src/pages/index/index.vue
+5
-0
boundTest.vue
src/pages/learn/boundTest.vue
+12
-13
manualBinding.vue
src/pages/learn/manualBinding.vue
+19
-11
No files found.
src/common/http.interceptor.js
View file @
b10d50fe
...
@@ -55,7 +55,7 @@ const install = (Vue, vm) => {
...
@@ -55,7 +55,7 @@ const install = (Vue, vm) => {
}
else
{
}
else
{
// 如果返回false,则会调用Promise的reject回调,
// 如果返回false,则会调用Promise的reject回调,
vm
.
$u
.
toast
(
data
.
msg
)
vm
.
$u
.
toast
(
data
.
msg
)
return
data
return
false
}
}
}
else
if
(
res
.
statusCode
===
401
)
{
}
else
if
(
res
.
statusCode
===
401
)
{
// 登录过期
// 登录过期
...
@@ -68,6 +68,7 @@ const install = (Vue, vm) => {
...
@@ -68,6 +68,7 @@ const install = (Vue, vm) => {
}
else
{
}
else
{
// HTTP状态非200
// HTTP状态非200
vm
.
$u
.
toast
(
data
.
msg
||
'服务器错误'
)
vm
.
$u
.
toast
(
data
.
msg
||
'服务器错误'
)
return
false
}
}
}
}
}
}
...
...
src/pages/index/index.vue
View file @
b10d50fe
...
@@ -242,6 +242,11 @@ export default {
...
@@ -242,6 +242,11 @@ export default {
this
.
visible
=
info
.
state
this
.
visible
=
info
.
state
this
.
queryMyQuestionWarehouseDetail
(
this
.
selected
.
id
)
this
.
queryMyQuestionWarehouseDetail
(
this
.
selected
.
id
)
}
}
let
refresh
=
page
.
refresh
if
(
refresh
)
{
page
.
refresh
=
null
this
.
queryMyQuestionWarehouseDetail
(
this
.
info
.
id
)
}
},
},
methods
:
{
methods
:
{
// 题库详情
// 题库详情
...
...
src/pages/learn/boundTest.vue
View file @
b10d50fe
...
@@ -63,8 +63,6 @@ export default {
...
@@ -63,8 +63,6 @@ export default {
},
},
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
e
=
{}
e
.
code
=
'621001500006600c7m1dp8z2'
if
(
e
&&
e
.
code
)
{
if
(
e
&&
e
.
code
)
{
var
code
=
e
.
code
var
code
=
e
.
code
this
.
param
.
cardNumber
=
code
.
slice
(
0
,
15
)
this
.
param
.
cardNumber
=
code
.
slice
(
0
,
15
)
...
@@ -74,30 +72,31 @@ export default {
...
@@ -74,30 +72,31 @@ export default {
},
},
methods
:
{
methods
:
{
handleClick
()
{
handleClick
()
{
// 获取题库列表
this
.
loading
=
true
this
.
loading
=
true
this
.
$u
.
api
this
.
$u
.
api
.
bindCard
(
this
.
param
)
.
bindCard
(
this
.
param
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'--------res--------'
,
res
)
this
.
$refs
.
uToast
.
show
({
uni
.
switchTab
({
title
:
'绑定成功'
,
url
:
'/pages/index/index'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
setPageInfo
()
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
},
})
})
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
this
.
loading
=
false
this
.
loading
=
false
console
.
log
(
err
)
this
.
$refs
.
uToast
.
show
({
title
:
err
.
msg
,
type
:
'error'
,
})
})
})
},
},
setPageInfo
(
info
)
{
setPageInfo
()
{
var
pages
=
getCurrentPages
()
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
2
)
{
if
(
pages
.
length
>=
2
)
{
var
page
=
pages
[
pages
.
length
-
2
]
var
page
=
pages
[
pages
.
length
-
2
]
page
.
info
=
info
page
.
refresh
=
true
}
}
},
},
},
},
...
...
src/pages/learn/manualBinding.vue
View file @
b10d50fe
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
<u-button
<u-button
:customStyle=
"customStyle"
:customStyle=
"customStyle"
@
click=
"handleClick"
@
click=
"handleClick"
:loading=
"loading"
type=
"primary"
type=
"primary"
shape=
"circle"
shape=
"circle"
>
>
...
@@ -69,6 +70,7 @@ export default {
...
@@ -69,6 +70,7 @@ export default {
code
:
''
,
code
:
''
,
password
:
''
,
password
:
''
,
focus
:
true
,
focus
:
true
,
loading
:
false
,
}
}
},
},
...
@@ -99,29 +101,35 @@ export default {
...
@@ -99,29 +101,35 @@ export default {
onLoad
(
e
)
{},
onLoad
(
e
)
{},
methods
:
{
methods
:
{
handleClick
()
{
handleClick
()
{
// 获取题库列表
this
.
loading
=
true
this
.
loading
=
true
this
.
$u
.
api
this
.
$u
.
api
.
bindCard
(
this
.
param
)
.
bindCard
({
cardNumber
:
this
.
code
,
cardSecret
:
this
.
password
,
questionWarehouseId
:
this
.
questionWarehouseId
,
})
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
uni
.
switchTab
({
this
.
$refs
.
uToast
.
show
({
url
:
'/pages/index/index'
,
title
:
'绑定成功'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
setPageInfo
()
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
},
})
})
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
this
.
loading
=
false
this
.
loading
=
false
console
.
log
(
err
)
this
.
$refs
.
uToast
.
show
({
title
:
err
.
msg
,
type
:
'error'
,
})
})
})
},
},
setPageInfo
(
info
)
{
setPageInfo
()
{
var
pages
=
getCurrentPages
()
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
2
)
{
if
(
pages
.
length
>=
2
)
{
var
page
=
pages
[
pages
.
length
-
2
]
var
page
=
pages
[
pages
.
length
-
2
]
page
.
info
=
info
page
.
refresh
=
true
}
}
},
},
},
},
...
...
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