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
4026b27a
Commit
4026b27a
authored
Aug 02, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 【ID1001459】【小程序-首页-试题搜索】:搜索结果中题干中的关键字未高亮显示
parent
845e474d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
7 deletions
+19
-7
index.vue
src/components/search-item/index.vue
+16
-6
detail.vue
src/pages/search/detail.vue
+1
-0
my-section.vue
src/pages/search/my-section.vue
+2
-1
No files found.
src/components/search-item/index.vue
View file @
4026b27a
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
<view
@
click
.
stop=
"itemChange(item.id)"
class=
"list-item"
>
<view
@
click
.
stop=
"itemChange(item.id)"
class=
"list-item"
>
<view
:class=
"['u-flex', 'head',
{ selected: item.id === arrIndex }]">
<view
:class=
"['u-flex', 'head',
{ selected: item.id === arrIndex }]">
<view
class=
"titles"
>
<view
class=
"titles"
>
<
text>
{{
item
.
type
}}
</text
<
view
class=
"type"
>
{{
item
.
type
}}
</view>
>
{{
item
.
title
}}
<u-parse
:html=
"keyword, item.title | toRed"
></u-parse>
</view>
</view>
<view
class=
"u-flex arrow"
v-show=
"item.id !== arrIndex"
>
<view
class=
"u-flex arrow"
v-show=
"item.id !== arrIndex"
>
<text>
展开
</text>
<text>
展开
</text>
...
@@ -56,7 +56,7 @@ export default {
...
@@ -56,7 +56,7 @@ export default {
answerSheet
,
answerSheet
,
answerExplanation
,
answerExplanation
,
},
},
props
:
[
'item'
,
'arrIndex'
],
props
:
[
'item'
,
'arrIndex'
,
'keyword'
],
computed
:
{
computed
:
{
collectImg
()
{
collectImg
()
{
const
name
=
this
.
item
?.
collectionFlag
?
'collected.png'
:
'collect.png'
const
name
=
this
.
item
?.
collectionFlag
?
'collected.png'
:
'collect.png'
...
@@ -66,6 +66,12 @@ export default {
...
@@ -66,6 +66,12 @@ export default {
return
this
.
item
?.
collectionFlag
||
false
return
this
.
item
?.
collectionFlag
||
false
},
},
},
},
filters
:{
toRed
:
function
(
content
,
keyword
)
{
const
reslut
=
keyword
.
replace
(
''
+
content
+
''
,
"<text style='color:red'>"
+
content
+
"</text>"
)
return
reslut
},
},
methods
:
{
methods
:
{
itemChange
(
id
)
{
itemChange
(
id
)
{
this
.
$emit
(
'arrowDown'
,
id
)
this
.
$emit
(
'arrowDown'
,
id
)
...
@@ -98,13 +104,17 @@ export default {
...
@@ -98,13 +104,17 @@ export default {
flex
:
1
;
flex
:
1
;
height
:
60rpx
;
height
:
60rpx
;
overflow
:
hidden
;
overflow
:
hidden
;
text
{
.type
{
background
:
#9ea5bb
;
background
:
#9ea5bb
;
color
:
#fff
;
color
:
#fff
;
padding
:
8rpx
20rpx
;
margin
:
10rpx
10rpx
0
0
;
margin-right
:
10rpx
;
font-size
:
20rpx
;
font-size
:
20rpx
;
border-radius
:
50rpx
0
50rpx
50rpx
;
border-radius
:
50rpx
0
50rpx
50rpx
;
float
:
left
;
height
:
45rpx
;
line-height
:
45rpx
;
width
:
100rpx
;
text-align
:
center
;
}
}
}
}
.arrow
{
.arrow
{
...
...
src/pages/search/detail.vue
View file @
4026b27a
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
:begin=
"item.begin"
:begin=
"item.begin"
:arrId
.
sync=
"arrId"
:arrId
.
sync=
"arrId"
:end=
"item.end"
:end=
"item.end"
:keyword=
"keyword"
></my-section>
></my-section>
<u-loadmore
:status=
"loadStatus"
:margin-bottom=
"40"
/>
<u-loadmore
:status=
"loadStatus"
:margin-bottom=
"40"
/>
</view>
</view>
...
...
src/pages/search/my-section.vue
View file @
4026b27a
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
:key=
"index"
:key=
"index"
:item=
"item"
:item=
"item"
:arrIndex
.
sync=
"arrIndex"
:arrIndex
.
sync=
"arrIndex"
:keyword
.
sync=
"keyword"
@
arrowDown=
"arrowDown"
@
arrowDown=
"arrowDown"
@
arrowUp=
"arrowUp"
@
arrowUp=
"arrowUp"
@
collection=
"collection($event, index)"
@
collection=
"collection($event, index)"
...
@@ -20,7 +21,7 @@ export default {
...
@@ -20,7 +21,7 @@ export default {
components
:
{
components
:
{
searchItem
,
searchItem
,
},
},
props
:
[
'begin'
,
'end'
,
'arrId'
],
props
:
[
'begin'
,
'end'
,
'arrId'
,
'keyword'
],
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
...
...
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