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
b13c07c4
Commit
b13c07c4
authored
Jul 26, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 选题库的时候,题库可能些只到二级、三级
parent
5425fedc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
17 deletions
+34
-17
examSetting.vue
src/pages/learn/examSetting.vue
+2
-2
selectCategory.vue
src/pages/learn/selectCategory.vue
+32
-15
No files found.
src/pages/learn/examSetting.vue
View file @
b13c07c4
...
...
@@ -135,7 +135,7 @@ export default {
},
computed
:
{
category
()
{
return
this
.
selected
[
key3
]
return
this
.
selected
[
key3
]
||
this
.
selected
[
key2
]
||
this
.
selected
[
key1
]
},
params
()
{
return
{
...
...
@@ -171,7 +171,7 @@ export default {
return
false
},
thirdKey
()
{
return
key3
return
key3
||
key2
||
key1
},
selectedTypeId
()
{
for
(
var
item
of
this
.
types
)
{
...
...
src/pages/learn/selectCategory.vue
View file @
b13c07c4
...
...
@@ -99,27 +99,45 @@ export default {
if
(
key
==
key1
)
{
// 选中一级标签
this
.
scrollId
=
''
this
.
selected
[
key2
]
=
{}
const
query
=
uni
.
createSelectorQuery
().
in
(
this
)
query
.
select
(
'.select-category-content'
)
.
boundingClientRect
((
data
)
=>
{
this
.
minHeight
=
data
.
height
-
22
// 去掉margin、padding
this
.
$nextTick
(()
=>
{
this
.
scrollId
=
key2
+
ind
console
.
log
(
this
.
scrollId
)
if
(
this
.
labels
[
key2
]
&&
this
.
labels
[
key2
][
index
]
&&
this
.
labels
[
key2
][
index
].
length
>
0
)
{
this
.
selected
[
key2
]
=
{}
const
query
=
uni
.
createSelectorQuery
().
in
(
this
)
query
.
select
(
'.select-category-content'
)
.
boundingClientRect
((
data
)
=>
{
this
.
minHeight
=
data
.
height
-
22
// 去掉margin、padding
this
.
$nextTick
(()
=>
{
this
.
scrollId
=
key2
+
ind
console
.
log
(
this
.
scrollId
)
})
})
.
exec
()
}
else
{
this
.
selected
[
key2
]
=
null
this
.
setPageInfo
(
this
.
selected
)
this
.
$u
.
route
({
url
:
'pages/learn/examSetting'
,
})
.
exec
()
}
}
else
{
// 选中二级标签
this
.
selected
[
key1
]
=
this
.
labels
[
key1
][
0
][
index
]
this
.
selected
[
key2
].
list
=
this
.
result
.
filter
((
item
)
=>
{
return
item
.
parentId
==
label
.
id
})
this
.
selected
[
key2
].
list
=
this
.
result
.
filter
((
item
)
=>
{
return
item
.
parentId
==
label
.
id
})
||
[]
this
.
selected
[
key2
].
list
=
[]
var
path
=
'addExam'
if
(
this
.
selected
[
key2
].
list
.
length
<=
0
)
{
path
=
'examSetting'
}
this
.
setPageInfo
(
this
.
selected
)
this
.
$u
.
route
({
url
:
'pages/learn/
addExam'
,
url
:
'pages/learn/
'
+
path
,
})
}
},
...
...
@@ -131,7 +149,6 @@ export default {
let
res
=
await
this
.
$u
.
api
.
subjectList
(
param
)
this
.
tapLoading
=
false
this
.
result
=
res
console
.
log
(
'-----------res-------------'
,
res
)
var
filterItems
=
res
.
filter
((
item
)
=>
{
return
item
.
parentId
==
0
})
...
...
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