Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
ydl-group-course
Overview
Overview
Details
Activity
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
黄志
ydl-group-course
Commits
2dc30ad6
Commit
2dc30ad6
authored
Apr 08, 2023
by
huangzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化支付成功页面 后退两步
parent
0dfe5870
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
pay.vue
src/pages/pay/pay.vue
+1
-1
web.vue
src/pages/web/web.vue
+9
-0
No files found.
src/pages/pay/pay.vue
View file @
2dc30ad6
...
...
@@ -210,7 +210,7 @@ export default {
pagePath
=
'pay/groupSuccess'
}
const
url
=
`
${
hostPrefix
}
/h5-course/
${
pagePath
}
?
${
urlStr
}
`
uni
.
redirect
To
({
uni
.
navigate
To
({
url
:
`/pages/web/web?title=
${
'支付成功'
}
&loadUrl=
${
encodeURIComponent
(
url
)}
`
,
})
},
...
...
src/pages/web/web.vue
View file @
2dc30ad6
...
...
@@ -38,6 +38,15 @@ export default {
// 移除登录成功事件
onUnload
()
{
uni
.
$off
(
'loginSuccess'
,
this
.
handleLoginSuccess
)
// eslint-disable-next-line no-undef
const
pages
=
getCurrentPages
()
const
beforePage
=
pages
[
pages
.
length
-
2
]
// 如果当前页是支付成功页,后退的页面是 原生支付页面,那么直接后退两步,略过支付原生页面,直接跳入,比如 课程详情页面
if
(
this
.
loadUrl
.
includes
(
'pay/'
)
&&
beforePage
.
route
.
includes
(
'pages/pay/pay'
))
{
uni
.
navigateBack
({
delta
:
2
,
})
}
},
// 主要用于返回上一页,刷新当前页面
onShow
()
{
...
...
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