Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
b4c15d2b
Commit
b4c15d2b
authored
Jun 12, 2025
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 在搜索页面添加视频播放功能,优化卡片点击事件,更新图片路径
parent
7393e457
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
7 deletions
+50
-7
search.vue
pages/search/search.vue
+50
-7
No files found.
pages/search/search.vue
View file @
b4c15d2b
...
@@ -41,8 +41,8 @@
...
@@ -41,8 +41,8 @@
</view>
</view>
<view
v-if=
"step !== 1 && tabIndex === 'content'"
class=
"bgbox"
>
<view
v-if=
"step !== 1 && tabIndex === 'content'"
class=
"bgbox"
>
<view
class=
"cardbox"
>
<view
class=
"cardbox"
>
<view
@
tap=
"jumpLink(item.link)"
class=
"card"
v-for=
"(item, index) in resultList[tabIndex]"
:key=
"index"
>
<view
@
tap=
"jumpLink(item.link
,item.videoUrl
)"
class=
"card"
v-for=
"(item, index) in resultList[tabIndex]"
:key=
"index"
>
<image
mode=
"aspectFill"
class=
"pic"
:src=
"$baseUrl + item.
img
"
></image>
<image
mode=
"aspectFill"
class=
"pic"
:src=
"$baseUrl + item.
bgUrl
"
></image>
<view
class=
"desc"
>
<view
class=
"desc"
>
{{
item
.
desc
}}
{{
item
.
desc
}}
</view>
</view>
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
</view>
</view>
<view
v-if=
"step !== 1 && tabIndex === 'tool'"
class=
"bgbox"
>
<view
v-if=
"step !== 1 && tabIndex === 'tool'"
class=
"bgbox"
>
<view
class=
"cardboxtool"
>
<view
class=
"cardboxtool"
>
<view
@
tap=
"jumpLink(item.link)"
class=
"card"
v-for=
"(item, index) in resultList[tabIndex]"
:key=
"index"
>
<view
@
tap=
"jumpLink(item.link
,item.videoUrl
)"
class=
"card"
v-for=
"(item, index) in resultList[tabIndex]"
:key=
"index"
>
<image
class=
"pic"
:src=
"$baseUrl + item.bgUrl"
></image>
<image
class=
"pic"
:src=
"$baseUrl + item.bgUrl"
></image>
<!--
<view
class=
"desc"
>
<!--
<view
class=
"desc"
>
{{
item
.
desc
}}
{{
item
.
desc
}}
...
@@ -60,11 +60,13 @@
...
@@ -60,11 +60,13 @@
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view
v-if=
"showVideo"
class=
"video-popup"
>
<video
:src=
"currentVideoUrl"
controls
autoplay
style=
"width: 100vw; height: 56vw;"
></video>
<view
class=
"close-btn-bottom"
@
tap=
"closeVideo"
>
×
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -85,7 +87,9 @@ export default {
...
@@ -85,7 +87,9 @@ export default {
step
:
1
,
step
:
1
,
resultList
:
{
'tool'
:
[],
'content'
:
[],
'product'
:
[]
},
resultList
:
{
'tool'
:
[],
'content'
:
[],
'product'
:
[]
},
tabIndex
:
'content'
,
tabIndex
:
'content'
,
searchValue
:
''
searchValue
:
''
,
currentVideoUrl
:
''
,
showVideo
:
false
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -135,7 +139,13 @@ export default {
...
@@ -135,7 +139,13 @@ export default {
});
});
},
},
jumpLink
(
link
){
jumpLink
(
link
,
videoUrl
){
if
(
videoUrl
){
this
.
currentVideoUrl
=
videoUrl
;
this
.
showVideo
=
true
;
return
;
}
if
(
!
link
||
link
===
''
){
if
(
!
link
||
link
===
''
){
return
;
return
;
}
}
...
@@ -144,7 +154,12 @@ export default {
...
@@ -144,7 +154,12 @@ export default {
}
else
{
}
else
{
jump
(
link
);
jump
(
link
);
}
}
},
closeVideo
(){
this
.
showVideo
=
false
;
this
.
currentVideoUrl
=
''
;
}
}
}
}
}
}
</
script
>
</
script
>
...
@@ -162,7 +177,35 @@ export default {
...
@@ -162,7 +177,35 @@ export default {
.container {
.container {
background-color: @color-gray-light;
background-color: @color-gray-light;
min-height: 100vh;
min-height: 100vh;
.video-popup {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.7);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 9999;
}
.close-btn-bottom {
margin: 32rpx auto 0 auto;
width: 64rpx;
height: 64rpx;
border-radius: 50%;
background: rgba(0, 0, 0, 0.5);
color: #fff;
font-size: 44rpx;
line-height: 64rpx;
text-align: center;
z-index: 10001;
display: flex;
align-items: center;
justify-content: center;
}
.tabbox {
.tabbox {
width: 600rpx;
width: 600rpx;
margin: 0 auto;
margin: 0 auto;
...
...
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