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
03e34e09
Commit
03e34e09
authored
Aug 02, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 【ID1001458】【小程序-首页-试题搜索】:搜索结果页面未默认显示第1个搜索结果的试题的题干、答案、解析
parent
22d2771b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
detail.vue
src/pages/search/detail.vue
+8
-2
list.js
src/pages/search/list.js
+7
-1
my-section.vue
src/pages/search/my-section.vue
+4
-2
No files found.
src/pages/search/detail.vue
View file @
03e34e09
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
v-for=
"(item, index) in section"
v-for=
"(item, index) in section"
:key=
"index"
:key=
"index"
:begin=
"item.begin"
:begin=
"item.begin"
:arrId
.
sync=
"arrId"
:end=
"item.end"
:end=
"item.end"
></my-section>
></my-section>
<u-loadmore
:status=
"loadStatus"
:margin-bottom=
"40"
/>
<u-loadmore
:status=
"loadStatus"
:margin-bottom=
"40"
/>
...
@@ -49,7 +50,7 @@
...
@@ -49,7 +50,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
l
ist
}
from
'./list.js'
import
{
getList
,
setL
ist
}
from
'./list.js'
import
mySection
from
'./my-section.vue'
import
mySection
from
'./my-section.vue'
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -66,11 +67,13 @@ export default {
...
@@ -66,11 +67,13 @@ export default {
isLoadMore
:
false
,
//是否加载中
isLoadMore
:
false
,
//是否加载中
total
:
0
,
total
:
0
,
section
:
[],
section
:
[],
arrId
:
''
}
}
},
},
onLoad
(
e
)
{
onLoad
(
e
)
{
this
.
keyword
=
e
?
decodeURIComponent
(
e
.
keyword
)
:
''
this
.
keyword
=
e
?
decodeURIComponent
(
e
.
keyword
)
:
''
this
.
lists
=
list
setList
([])
this
.
lists
=
getList
()
},
},
onReady
()
{
onReady
()
{
this
.
init
()
this
.
init
()
...
@@ -137,6 +140,7 @@ export default {
...
@@ -137,6 +140,7 @@ export default {
begin
:
this
.
lists
.
length
-
records
.
length
,
begin
:
this
.
lists
.
length
-
records
.
length
,
end
:
this
.
lists
.
length
,
end
:
this
.
lists
.
length
,
})
})
this
.
arrId
=
this
.
lists
[
0
].
id
if
(
records
.
length
<
this
.
pageSize
)
{
if
(
records
.
length
<
this
.
pageSize
)
{
//判断接口返回数据量小于请求数据量,则表示此为最后一页
//判断接口返回数据量小于请求数据量,则表示此为最后一页
...
@@ -159,7 +163,9 @@ export default {
...
@@ -159,7 +163,9 @@ export default {
this
.
$u
.
vuex
(
'searchHistory'
,
history
)
this
.
$u
.
vuex
(
'searchHistory'
,
history
)
this
.
currentPage
=
1
this
.
currentPage
=
1
this
.
lists
=
[]
this
.
lists
=
[]
setList
([])
this
.
section
=
[]
this
.
section
=
[]
this
.
arrId
=
''
this
.
init
()
this
.
init
()
}
}
}
}
...
...
src/pages/search/list.js
View file @
03e34e09
export
const
list
=
[]
let
list
=
[]
\ No newline at end of file
export
function
setList
(
lists
)
{
list
=
lists
}
export
function
getList
()
{
return
list
}
\ No newline at end of file
src/pages/search/my-section.vue
View file @
03e34e09
...
@@ -13,14 +13,14 @@
...
@@ -13,14 +13,14 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
l
ist
}
from
'./list.js'
import
{
getL
ist
}
from
'./list.js'
import
searchItem
from
'@/components/search-item/index.vue'
import
searchItem
from
'@/components/search-item/index.vue'
export
default
{
export
default
{
components
:
{
components
:
{
searchItem
,
searchItem
,
},
},
props
:
[
'begin'
,
'end'
],
props
:
[
'begin'
,
'end'
,
'arrId'
],
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
...
@@ -28,7 +28,9 @@ export default {
...
@@ -28,7 +28,9 @@ export default {
}
}
},
},
created
()
{
created
()
{
const
list
=
getList
()
this
.
list
=
list
.
slice
(
this
.
begin
,
this
.
end
)
this
.
list
=
list
.
slice
(
this
.
begin
,
this
.
end
)
if
(
this
.
arrId
)
this
.
arrIndex
=
this
.
arrId
},
},
methods
:
{
methods
:
{
arrowDown
(
e
)
{
arrowDown
(
e
)
{
...
...
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