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
7faaaa7a
Commit
7faaaa7a
authored
Jul 24, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 绑卡
parent
08c6a60b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
114 additions
and
34 deletions
+114
-34
.env.dev.js
.env.dev.js
+2
-2
learn.js
src/api/learn.js
+4
-0
index.vue
src/pages/index/index.vue
+3
-1
boundQuestions.vue
src/pages/learn/boundQuestions.vue
+8
-4
boundTest.vue
src/pages/learn/boundTest.vue
+57
-19
detail.vue
src/pages/learn/detail.vue
+3
-3
manualBinding.vue
src/pages/learn/manualBinding.vue
+35
-3
selectedList.vue
src/pages/learn/selectedList.vue
+2
-2
No files found.
.env.dev.js
View file @
7faaaa7a
const
UNI_APP
=
{
apiUrl
:
'http://192.168.0.20
4
:8760'
,
apiUrl
:
'http://192.168.0.20
8
:8760'
,
qn_base_url
:
'https://qn-static.banshouhui.com/study/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
uCenterUrl
:
'http://192.168.0.5:8093/'
,
//'http://rest-u.yunya.com/'
uCenterUrl
:
'http://192.168.0.5:8093/'
,
//'http://rest-u.yunya.com/'
argoDebugMode
:
1
,
version
:
'v1.0.0'
,
}
...
...
src/api/learn.js
View file @
7faaaa7a
...
...
@@ -78,6 +78,9 @@ let learnApiFun = function(vm) {
// 学员获取自己的题库
let
getMyQuestionWarehouseList
=
async
(
params
=
{})
=>
await
vm
.
$u
.
get
(
'/rest/question/query/getMyQuestionWarehouseList'
,
params
)
let
bindCard
=
async
(
params
=
{})
=>
await
vm
.
$u
.
post
(
'/rest/card/bind'
,
params
)
const
learnApi
=
{
getQuestion
,
getQuestionTotal
,
...
...
@@ -97,6 +100,7 @@ let learnApiFun = function(vm) {
queryExamRecord
,
queryExamRecordOne
,
getMyQuestionWarehouseList
,
bindCard
,
}
return
learnApi
}
...
...
src/pages/index/index.vue
View file @
7faaaa7a
...
...
@@ -152,7 +152,9 @@ export default {
this
.
detail
.
questionWarehouse
&&
this
.
detail
.
questionWarehouse
.
cardId
,
provinceName
:
this
.
provinceName
,
experience
:
this
.
selected
.
state
&&
!
this
.
detail
.
questionWarehouse
.
cardId
this
.
selected
.
state
&&
(
!
this
.
detail
.
questionWarehouse
||
!
this
.
detail
.
questionWarehouse
.
cardId
)
?
true
:
false
,
pass
:
this
.
$u
.
random
(
95
,
99
)
+
'%'
,
...
...
src/pages/learn/boundQuestions.vue
View file @
7faaaa7a
...
...
@@ -74,7 +74,7 @@ export default {
}
},
},
onLoad
()
{},
onLoad
(
e
)
{},
methods
:
{
handleClick
()
{
wx
.
scanCode
({
...
...
@@ -83,7 +83,7 @@ export default {
console
.
log
(
res
)
if
(
res
.
result
)
{
this
.
$u
.
route
({
url
:
'pages/learn/
manualBinding
'
,
url
:
'pages/learn/
boundTest
'
,
params
:
{
code
:
res
.
result
,
},
...
...
@@ -93,7 +93,11 @@ export default {
})
},
handleClickBuy
()
{},
handleChange
()
{},
handleChange
()
{
this
.
$u
.
route
({
url
:
'pages/learn/manualBinding'
,
})
},
},
}
</
script
>
...
...
@@ -132,7 +136,7 @@ export default {
.first-line
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
5
6
rpx
;
margin-bottom
:
5
0
rpx
;
.blue-text
{
color
:
#2953ff
;
...
...
src/pages/learn/boundTest.vue
View file @
7faaaa7a
...
...
@@ -9,27 +9,34 @@
title-bold
></u-navbar>
<view
class=
"body-view"
>
<
image
class=
"image-view"
:src=
"successImage"
></image
>
<view
class=
"content-view"
>
学习卡已绑定成功
</view>
<view
class=
"tip-view"
>
可以前往首页进行答题或模拟考试学习
</view>
<
!--
<image
class=
"image-view"
:src=
"successImage"
></image>
--
>
<view
class=
"content-view"
>
是否绑定该学习卡
</view>
<view
class=
"tip-view"
>
学习卡完成绑定后,不支持解绑操作
</view>
<view
class=
"bottom-view"
>
<u-button
:customStyle=
"buttonStyle"
@
click=
"handleClick"
type=
"primary"
shape=
"circle"
:loading=
"loading"
>
去首页
绑定
</u-button>
</view>
</view>
<view>
<u-toast
ref=
"uToast"
/>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{}
return
{
loading
:
false
,
param
:
{
cardNumber
:
''
,
cardSecret
:
''
},
}
},
computed
:
{
...
...
@@ -41,9 +48,9 @@ export default {
guize
:
'出题规则'
,
}
},
successImage
()
{
return
process
.
uniEnv
.
qn_base_url
+
'shenqingtijiaochenggong.png'
},
//
successImage() {
//
return process.uniEnv.qn_base_url + 'shenqingtijiaochenggong.png'
//
},
buttonStyle
()
{
return
{
height
:
'104rpx'
,
...
...
@@ -55,12 +62,43 @@ export default {
}
},
},
onLoad
()
{},
onLoad
(
e
)
{
e
=
{}
e
.
code
=
'621001500006600c7m1dp8z2'
if
(
e
&&
e
.
code
)
{
var
code
=
e
.
code
this
.
param
.
cardNumber
=
code
.
slice
(
0
,
15
)
this
.
param
.
cardSecret
=
code
.
slice
(
15
)
}
this
.
param
.
questionWarehouseId
=
this
.
questionWarehouseId
},
methods
:
{
handleClick
()
{
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
// 获取题库列表
this
.
loading
=
true
this
.
$u
.
api
.
bindCard
(
this
.
param
)
.
then
((
res
)
=>
{
console
.
log
(
'--------res--------'
,
res
)
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
})
.
catch
((
err
)
=>
{
this
.
loading
=
false
console
.
log
(
err
)
this
.
$refs
.
uToast
.
show
({
title
:
err
.
msg
,
type
:
'error'
,
})
})
},
setPageInfo
(
info
)
{
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
2
)
{
var
page
=
pages
[
pages
.
length
-
2
]
page
.
info
=
info
}
},
},
}
...
...
@@ -84,13 +122,13 @@ export default {
.body-view
{
height
:
100%
;
overflow
:
auto
;
padding-top
:
1
00rpx
;
padding-top
:
2
00rpx
;
text-align
:
center
;
.image-view
{
margin-top
:
100rpx
;
width
:
224rpx
;
height
:
224rpx
;
}
//
.image-view {
//
margin-top: 100rpx;
//
width: 224rpx;
//
height: 224rpx;
//
}
.content-view
{
font-size
:
40rpx
;
color
:
#2953ff
;
...
...
@@ -99,7 +137,7 @@ export default {
.tip-view
{
font-size
:
26rpx
;
color
:
#9ea5bb
;
margin-top
:
1
0
rpx
;
margin-top
:
1
4
rpx
;
}
.bottom-view
{
margin-top
:
180rpx
;
...
...
src/pages/learn/detail.vue
View file @
7faaaa7a
...
...
@@ -180,7 +180,7 @@ export default {
]
},
},
onLoad
()
{},
onLoad
(
e
)
{},
methods
:
{
handleClick
()
{
this
.
$u
.
route
({
...
...
@@ -194,7 +194,7 @@ export default {
openId
:
this
.
openId
,
}
uni
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
,
})
this
.
$u
.
api
.
payOrder
(
data
).
then
((
res
)
=>
{
uni
.
hideLoading
()
...
...
@@ -228,7 +228,7 @@ export default {
outTradeNo
:
no
,
}
uni
.
showLoading
({
title
:
'支付中'
title
:
'支付中'
,
})
this
.
$u
.
api
.
payQuery
(
params
).
then
((
res
)
=>
{
uni
.
hideLoading
()
...
...
src/pages/learn/manualBinding.vue
View file @
7faaaa7a
...
...
@@ -17,7 +17,7 @@
<view
class=
"field-view"
>
<input
type=
"number"
class=
"input-
code
"
class=
"input-
view
"
:value=
"code"
placeholder=
"请输入卡号"
:placeholder-style=
"placeplaceholderStyle"
...
...
@@ -29,7 +29,7 @@
<view
class=
"field-title"
>
学习卡密码
</view>
<view
class=
"field-view"
>
<input
class=
"input-
password
"
class=
"input-
view
"
password
:value=
"password"
placeholder=
"请输入密码"
...
...
@@ -54,6 +54,9 @@
>
</view>
</view>
<view>
<u-toast
ref=
"uToast"
/>
</view>
</view>
</
template
>
...
...
@@ -95,7 +98,32 @@ export default {
},
onLoad
(
e
)
{},
methods
:
{
handleClick
()
{},
handleClick
()
{
// 获取题库列表
this
.
loading
=
true
this
.
$u
.
api
.
bindCard
(
this
.
param
)
.
then
((
res
)
=>
{
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
})
.
catch
((
err
)
=>
{
this
.
loading
=
false
console
.
log
(
err
)
this
.
$refs
.
uToast
.
show
({
title
:
err
.
msg
,
type
:
'error'
,
})
})
},
setPageInfo
(
info
)
{
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
2
)
{
var
page
=
pages
[
pages
.
length
-
2
]
page
.
info
=
info
}
},
},
}
</
script
>
...
...
@@ -146,6 +174,10 @@ export default {
justify-content
:
center
;
border-right
:
12rpx
;
padding
:
0
24rpx
;
.input-view
{
width
:
100%
;
text-align
:
center
;
}
}
}
...
...
src/pages/learn/selectedList.vue
View file @
7faaaa7a
...
...
@@ -84,10 +84,10 @@ export default {
})
},
// 获取题库列表
async
loadList
()
{
loadList
()
{
this
.
loading
=
true
let
param
=
{}
let
res
=
await
this
.
$u
.
api
this
.
$u
.
api
.
getMyQuestionWarehouseList
(
param
)
.
then
((
res
)
=>
{
this
.
loading
=
false
...
...
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