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
e2e85b81
Commit
e2e85b81
authored
Jul 24, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 首页加载中
parent
b10d50fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
22 deletions
+82
-22
index.vue
src/pages/index/index.vue
+51
-16
boundQuestions.vue
src/pages/learn/boundQuestions.vue
+12
-2
boundTest.vue
src/pages/learn/boundTest.vue
+3
-1
detail.vue
src/pages/learn/detail.vue
+9
-1
manualBinding.vue
src/pages/learn/manualBinding.vue
+7
-2
No files found.
src/pages/index/index.vue
View file @
e2e85b81
...
...
@@ -17,7 +17,10 @@
></u-navbar>
<view
class=
"content"
>
<view
class=
"exam-title-view"
@
click=
"$u.throttle(handleSelect, 500)"
>
<text>
{{
title
}}
</text>
<view
class=
"title-loading"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<text
v-else
>
{{
title
}}
</text>
<u-icon
class=
"icon-view"
name=
"arrow-up-fill"
></u-icon>
</view>
<view
v-if=
"noExam"
class=
"tip-view"
>
...
...
@@ -108,6 +111,8 @@ export default {
detail
:
{
questionWarehouse
:
{}
},
selected
:
{},
data
:
{},
relationId
:
0
,
// 绑卡用
loading
:
false
,
}
},
computed
:
{
...
...
@@ -131,7 +136,7 @@ export default {
{
name
:
'全部试题'
,
label
:
this
.
examText
,
leftLabel
:
this
.
selected
.
count
,
// 已做题目数
leftLabel
:
String
(
this
.
finishCount
)
,
// 已做题目数
image
:
process
.
uniEnv
.
qn_base_url
+
'quanbushiti.png'
,
},
{
...
...
@@ -141,9 +146,14 @@ export default {
},
]
},
finishCount
()
{
return
this
.
questionList
.
reduce
((
accumulator
,
currentValue
)
=>
{
if
(
currentValue
.
id
)
accumulator
++
return
accumulator
},
0
)
},
examText
()
{
return
this
.
info
.
cardId
?
'/'
+
this
.
selected
.
totalExam
:
'题库进阶练习'
return
this
.
info
.
cardId
?
'/'
+
this
.
info
.
totalExam
:
'题库进阶练习'
},
info
()
{
return
{
...
...
@@ -250,14 +260,19 @@ export default {
},
methods
:
{
// 题库详情
async
queryQuestionWarehouseById
(
id
)
{
let
res
=
await
this
.
$u
.
api
queryQuestionWarehouseById
(
id
)
{
this
.
$u
.
api
.
queryQuestionWarehouseById
(
id
)
.
then
((
res
)
=>
{
this
.
loading
=
false
this
.
data
=
res
||
{
questionWarehouse
:
{}
}
this
.
selected
=
this
.
data
.
questionWarehouse
})
.
catch
((
err
)
=>
{
this
.
loading
=
false
console
.
log
(
err
)
})
this
.
data
=
res
||
{
questionWarehouse
:
{}
}
this
.
selected
=
this
.
data
.
questionWarehouse
// this.$u.vuex(
// 'experience',
// this.selected.state && !this.detail.questionWarehouse.cardId
...
...
@@ -266,14 +281,20 @@ export default {
// )
},
// 学生查询题库首页
async
queryMyQuestionWarehouseDetail
(
id
)
{
let
res
=
await
this
.
$u
.
api
queryMyQuestionWarehouseDetail
(
id
)
{
this
.
loading
=
true
this
.
$u
.
api
.
queryMyQuestionWarehouseDetail
(
id
)
.
then
((
res
)
=>
{
this
.
detail
=
res
||
{
questionWarehouse
:
{}
}
this
.
relationId
=
res
.
questionWarehouse
.
id
this
.
queryQuestionWarehouseById
(
res
.
questionWarehouse
.
questionWarehouseId
)
})
.
catch
((
err
)
=>
{
console
.
log
(
err
)
})
this
.
detail
=
res
||
{
questionWarehouse
:
{}
}
this
.
queryQuestionWarehouseById
(
res
.
questionWarehouse
.
questionWarehouseId
)
},
handleSelect
()
{
...
...
@@ -308,6 +329,9 @@ export default {
// this.show = true
this
.
$u
.
route
({
url
:
'pages/learn/detail'
,
params
:
{
relationId
:
this
.
relationId
,
},
})
}
}
else
{
...
...
@@ -326,6 +350,9 @@ export default {
this
.
$u
.
route
({
url
:
'pages/learn/'
+
str
,
params
:
{
relationId
:
this
.
relationId
,
},
})
},
handleClickItem
(
key
)
{
...
...
@@ -382,6 +409,9 @@ export default {
// this.show = true
this
.
$u
.
route
({
url
:
'pages/learn/detail'
,
params
:
{
relationId
:
this
.
relationId
,
},
})
}
else
{
// 未选题库
...
...
@@ -406,6 +436,9 @@ export default {
// this.show = true
this
.
$u
.
route
({
url
:
'pages/learn/detail'
,
params
:
{
relationId
:
this
.
relationId
,
},
})
}
else
{
this
.
$u
.
route
({
...
...
@@ -473,10 +506,12 @@ export default {
font-size
:
40rpx
;
display
:
flex
;
align-items
:
center
;
.titleImage
{
width
:
40rpx
;
height
:
40rpx
;
margin-right
:
14rpx
;
.title-loading
{
width
:
240rpx
;
height
:
56rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.icon-view
{
font-size
:
24rpx
;
...
...
src/pages/learn/boundQuestions.vue
View file @
e2e85b81
...
...
@@ -50,7 +50,9 @@
<
script
>
export
default
{
data
()
{
return
{}
return
{
relationId
:
0
,
// 绑卡用
}
},
computed
:
{
...
...
@@ -74,7 +76,11 @@ export default {
}
},
},
onLoad
(
e
)
{},
onLoad
(
e
)
{
if
(
e
&&
e
.
relationId
)
{
this
.
relationId
=
e
.
relationId
}
},
methods
:
{
handleClick
()
{
wx
.
scanCode
({
...
...
@@ -86,6 +92,7 @@ export default {
url
:
'pages/learn/boundTest'
,
params
:
{
code
:
res
.
result
,
relationId
:
this
.
relationId
,
},
})
}
...
...
@@ -96,6 +103,9 @@ export default {
handleChange
()
{
this
.
$u
.
route
({
url
:
'pages/learn/manualBinding'
,
params
:
{
relationId
:
this
.
relationId
,
},
})
},
},
...
...
src/pages/learn/boundTest.vue
View file @
e2e85b81
...
...
@@ -68,7 +68,9 @@ export default {
this
.
param
.
cardNumber
=
code
.
slice
(
0
,
15
)
this
.
param
.
cardSecret
=
code
.
slice
(
15
)
}
this
.
param
.
questionWarehouseId
=
this
.
questionWarehouseId
if
(
e
&&
e
.
relationId
)
{
this
.
param
.
questionWarehouseId
=
e
.
relationId
}
},
methods
:
{
handleClick
()
{
...
...
src/pages/learn/detail.vue
View file @
e2e85b81
...
...
@@ -91,6 +91,7 @@ import md5 from '@/common/md5.js'
export
default
{
data
()
{
return
{
relationId
:
0
,
// 绑卡用
info
:
{
title
:
'高处安装、维护、拆除作业人员题库'
,
money
:
80.0
,
...
...
@@ -180,11 +181,18 @@ export default {
]
},
},
onLoad
(
e
)
{},
onLoad
(
e
)
{
if
(
e
&&
e
.
relationId
)
{
this
.
relationId
=
e
.
relationId
}
},
methods
:
{
handleClick
()
{
this
.
$u
.
route
({
url
:
'pages/learn/boundQuestions'
,
params
:
{
relationId
:
this
.
relationId
,
},
})
},
handleClickBuy
()
{
...
...
src/pages/learn/manualBinding.vue
View file @
e2e85b81
...
...
@@ -71,6 +71,7 @@ export default {
password
:
''
,
focus
:
true
,
loading
:
false
,
relationId
:
0
,
}
},
...
...
@@ -98,7 +99,11 @@ export default {
return
'color:#9EA5BB;font-size:28rpx'
},
},
onLoad
(
e
)
{},
onLoad
(
e
)
{
if
(
e
&&
e
.
relationId
)
{
this
.
relationId
=
e
.
relationId
}
},
methods
:
{
handleClick
()
{
this
.
loading
=
true
...
...
@@ -106,7 +111,7 @@ export default {
.
bindCard
({
cardNumber
:
this
.
code
,
cardSecret
:
this
.
password
,
questionWarehouseId
:
this
.
questionWarehouse
Id
,
questionWarehouseId
:
this
.
relation
Id
,
})
.
then
((
res
)
=>
{
this
.
$refs
.
uToast
.
show
({
...
...
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