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
a326fa69
Commit
a326fa69
authored
Aug 04, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 搜索
parent
afbdea00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
22 deletions
+33
-22
pages.json
src/pages.json
+2
-1
detail.vue
src/pages/search/detail.vue
+31
-21
No files found.
src/pages.json
View file @
a326fa69
...
@@ -64,7 +64,8 @@
...
@@ -64,7 +64,8 @@
"name"
:
"searchDetail"
,
"name"
:
"searchDetail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"搜索结果"
,
"navigationBarTitleText"
:
"搜索结果"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
,
"disableScroll"
:
true
}
}
}
}
]
]
...
...
src/pages/search/detail.vue
View file @
a326fa69
...
@@ -26,7 +26,8 @@
...
@@ -26,7 +26,8 @@
>
共找到含有
<text>
“
{{
keyword
}}
”
</text>
相关试题
<text>
{{
total
}}
</text
>
共找到含有
<text>
“
{{
keyword
}}
”
</text>
相关试题
<text>
{{
total
}}
</text
>
道
</view
>
道
</view
>
>
<view
class=
"result"
>
<view
class=
"u-flex result"
>
<scroll-view
:scroll-top=
"scrollTop"
scroll-y
class=
"scroll-Y"
@
scrolltolower=
"scrolltolower"
>
<my-section
<my-section
v-for=
"(item, index) in section"
v-for=
"(item, index) in section"
:key=
"index"
:key=
"index"
...
@@ -35,7 +36,8 @@
...
@@ -35,7 +36,8 @@
:end=
"item.end"
:end=
"item.end"
:keyword=
"keyword"
:keyword=
"keyword"
></my-section>
></my-section>
<u-loadmore
:status=
"loadStatus"
:margin-bottom=
"40"
/>
</scroll-view>
<u-loadmore
class=
"more"
:status=
"loadStatus"
:margin-bottom=
"40"
/>
</view>
</view>
</view>
</view>
...
@@ -84,15 +86,7 @@ export default {
...
@@ -84,15 +86,7 @@ export default {
return
process
.
uniEnv
.
qn_base_url
+
'no-search.png'
return
process
.
uniEnv
.
qn_base_url
+
'no-search.png'
}
}
},
},
onReachBottom
()
{
//上拉触底函数
if
(
!
this
.
isLoadMore
)
{
//此处判断,上锁,防止重复请求
this
.
isLoadMore
=
true
this
.
currentPage
+=
1
this
.
init
()
}
},
methods
:
{
methods
:
{
init
()
{
init
()
{
const
data
=
{
const
data
=
{
...
@@ -142,7 +136,7 @@ export default {
...
@@ -142,7 +136,7 @@ export default {
end
:
this
.
lists
.
length
,
end
:
this
.
lists
.
length
,
})
})
this
.
arrId
=
this
.
lists
[
0
].
id
this
.
arrId
=
this
.
lists
[
0
].
id
if
(
re
cords
.
length
<
this
.
pageSiz
e
)
{
if
(
re
s
.
pages
===
this
.
currentPag
e
)
{
//判断接口返回数据量小于请求数据量,则表示此为最后一页
//判断接口返回数据量小于请求数据量,则表示此为最后一页
this
.
isLoadMore
=
true
this
.
isLoadMore
=
true
this
.
loadStatus
=
'nomore'
this
.
loadStatus
=
'nomore'
...
@@ -168,8 +162,17 @@ export default {
...
@@ -168,8 +162,17 @@ export default {
this
.
arrId
=
''
this
.
arrId
=
''
this
.
init
()
this
.
init
()
}
}
}
},
},
scrolltolower
()
{
//上拉触底函数
if
(
!
this
.
isLoadMore
)
{
//此处判断,上锁,防止重复请求
this
.
isLoadMore
=
true
this
.
currentPage
+=
1
this
.
init
()
}
}
}
}
}
</
script
>
</
script
>
...
@@ -202,6 +205,13 @@ export default {
...
@@ -202,6 +205,13 @@ export default {
.result
{
.result
{
margin-top
:
30rpx
;
margin-top
:
30rpx
;
width
:
100%
;
width
:
100%
;
flex-flow
:
column
;
.scroll-Y
{
height
:
calc
(
100vh
-
230px
);
}
.more
{
margin-top
:
20rpx
;
}
}
}
.default
{
.default
{
flex-flow
:
column
;
flex-flow
:
column
;
...
...
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