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
2f22d8ed
Commit
2f22d8ed
authored
Jun 17, 2025
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化 Home.vue 中的弹窗逻辑,使用 qrObj 替代原有的 qrInfoList 访问方式,确保弹窗内容的安全渲染,并增加对 qrInfoList 的默认值处理。
parent
ed5e4b08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
Home.vue
views/Home.vue
+17
-9
No files found.
views/Home.vue
View file @
2f22d8ed
...
...
@@ -111,14 +111,14 @@
<!-- 普通弹窗 -->
<uni-popup
:is-mask-click=
"false"
:safe-area=
"false"
ref=
"popup"
background-color=
"#fff"
border-radius=
"48rpx"
>
<view
v-if=
"
this.popupIndex !== 3 && this.qrInfoList && this.qrInfoList[this.popupIndex]
"
class=
"popup-content"
>
<view
v-if=
"
qrObj !== null
"
class=
"popup-content"
>
<image
class=
"btnclose"
@
tap=
"closePop"
:src=
"$baseUrl + 'homepage/btnclose.png'"
></image>
<view
class=
"title"
>
{{
this
.
qrInfoList
[
this
.
popupIndex
]?
.
title
||
''
}}
{{
qrObj
.
title
||
''
}}
</view>
<rich-text
class=
"desc"
:nodes=
"
this.qrInfoList[this.popupIndex]?
.desc || ''"
></rich-text>
<image
:show-menu-by-longpress=
"true"
class=
"qrcode"
:src=
"$baseUrl + (
this.qrInfoList[this.popupIndex]?
.qrUrl || '')"
></image>
<image
@
tap=
"downloadHandler($baseUrl + (
this.qrInfoList[this.popupIndex]?
.qrUrl || ''))"
class=
"btndownload"
<rich-text
class=
"desc"
:nodes=
"
qrObj
.desc || ''"
></rich-text>
<image
:show-menu-by-longpress=
"true"
class=
"qrcode"
:src=
"$baseUrl + (
qrObj
.qrUrl || '')"
></image>
<image
@
tap=
"downloadHandler($baseUrl + (
qrObj
.qrUrl || ''))"
class=
"btndownload"
:src=
"$baseUrl + 'homepage/btn_download.png'"
></image>
</view>
<view
v-else
class=
"popup-content"
style=
"height: 977rpx;"
>
...
...
@@ -173,7 +173,8 @@ export default {
bottomLinkList
:
[],
qrInfoObj
:
undefined
,
popupIndex
:
0
,
qrInfoList
:
[{
title
:
''
,
desc
:
''
,
qrUrl
:
''
}],
qrInfoList
:
[{
title
:
''
,
desc
:
''
,
qrUrl
:
''
},{
title
:
''
,
desc
:
''
,
qrUrl
:
''
},{
title
:
''
,
desc
:
''
,
qrUrl
:
''
},{
title
:
''
,
desc
:
''
,
qrUrl
:
''
}],
qrObj
:{
title
:
''
,
desc
:
''
,
qrUrl
:
''
},
showVideo
:
false
,
currentVideoUrl
:
''
,
isClickPhoneAuth
:
false
,
...
...
@@ -215,7 +216,6 @@ export default {
const
{
data
}
=
await
fetchHomeJSON
();
console
.
log
(
'111111111111'
,
data
);
if
(
data
)
{
this
.
swiperList
=
data
.
swiperList
;
this
.
vipConfigList
=
data
.
vipConfigList
;
...
...
@@ -225,7 +225,7 @@ export default {
this
.
changelInfoList
=
data
.
changelInfoList
;
this
.
childrenInfoList
=
data
.
childrenInfoList
[
0
]
||
[];
this
.
bottomLinkList
=
data
.
bottomLinkList
;
this
.
qrInfoList
=
data
.
qrInfoList
;
this
.
qrInfoList
=
data
.
qrInfoList
||
[]
;
this
.
vipCardList
=
data
.
vipCardList
;
this
.
voiceStory
=
data
.
voiceStory
;
this
.
suggest
=
data
.
suggest
;
...
...
@@ -311,7 +311,15 @@ export default {
this
.
channelTabIndex
=
_index
;
},
showPopup
(
_index
)
{
this
.
popupIndex
=
_index
;
// this.popupIndex = Math.max(0, Math.min(_index, this.qrInfoList.length - 1));
if
(
_index
===
3
){
this
.
qrObj
=
null
;
}
else
{
_index
=
Math
.
max
(
0
,
Math
.
min
(
_index
,
this
.
qrInfoList
.
length
-
1
));
this
.
qrObj
=
this
.
qrInfoList
[
_index
];
}
this
.
$refs
.
popup
.
open
(
this
.
popType
);
},
closePop
()
{
...
...
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