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
d0bc0751
Commit
d0bc0751
authored
Jul 16, 2021
by
Damon
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-v1.0.0' of git.banshouhui.com:wuzhenzhe/study into dev-v1.0.0
parents
3227703d
9c0ca31f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
5 deletions
+29
-5
selectCategory.vue
src/pages/learn/selectCategory.vue
+29
-5
No files found.
src/pages/learn/selectCategory.vue
View file @
d0bc0751
...
@@ -15,7 +15,17 @@
...
@@ -15,7 +15,17 @@
:scroll-into-view=
"scrollId"
:scroll-into-view=
"scrollId"
>
>
<view
v-for=
"(items, key) in labels"
:key=
"key"
class=
"label-list"
>
<view
v-for=
"(items, key) in labels"
:key=
"key"
class=
"label-list"
>
<view
v-for=
"(list, index) in items"
:key=
"index"
class=
"label-list"
>
<view
v-for=
"(list, index) in items"
:key=
"index"
class=
"label-list"
:style=
"
{
'min-height':
key == secondKey
&&
index + 1 == list.length
? minHeight + 'px'
: 0,
}"
>
<view
class=
"label-title"
:id=
"key + index"
>
<view
class=
"label-title"
:id=
"key + index"
>
<!-- 品类title -->
<!-- 品类title -->
<view>
{{
<view>
{{
...
@@ -33,7 +43,7 @@
...
@@ -33,7 +43,7 @@
wide: key == secondKey,
wide: key == secondKey,
},
},
]"
]"
@click="handleClick(key, ind, label)"
@click="handleClick(key, ind
ex, ind
, label)"
>
>
<text
class=
"label-text"
>
{{
label
.
name
}}
</text>
<text
class=
"label-text"
>
{{
label
.
name
}}
</text>
</view>
</view>
...
@@ -67,6 +77,7 @@ export default {
...
@@ -67,6 +77,7 @@ export default {
},
},
tapLoading
:
true
,
tapLoading
:
true
,
scrollId
:
''
,
scrollId
:
''
,
minHeight
:
0
,
}
}
},
},
computed
:
{
computed
:
{
...
@@ -82,13 +93,26 @@ export default {
...
@@ -82,13 +93,26 @@ export default {
},
},
methods
:
{
methods
:
{
// 选中标签
// 选中标签
handleClick
(
key
,
ind
,
label
)
{
handleClick
(
key
,
ind
ex
,
ind
,
label
)
{
this
.
selected
[
key
]
=
label
this
.
selected
[
key
]
=
label
if
(
key
==
key1
)
{
if
(
key
==
key1
)
{
// 选中一级标签
// 选中一级标签
this
.
scrollId
=
key2
+
ind
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
)
})
})
.
exec
()
}
else
{
}
else
{
// 选中二级标签
// 选中二级标签
this
.
selected
[
key1
]
=
this
.
labels
[
key1
][
0
][
index
]
this
.
setPageInfo
(
this
.
selected
)
this
.
setPageInfo
(
this
.
selected
)
this
.
$u
.
route
({
this
.
$u
.
route
({
url
:
'pages/learn/addExam'
,
url
:
'pages/learn/addExam'
,
...
@@ -200,7 +224,7 @@ export default {
...
@@ -200,7 +224,7 @@ export default {
background-size
:
100%
520rpx
;
background-size
:
100%
520rpx
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
.select-category-content
{
.select-category-content
{
padding
:
0
0
30
rpx
24rpx
;
padding
:
0
0
24
rpx
24rpx
;
height
:
100%
;
height
:
100%
;
overflow
:
auto
;
overflow
:
auto
;
position
:
relative
;
position
:
relative
;
...
...
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