Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mall-webview
Project
Project
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
frontend
mall-webview
Commits
2792a20a
Commit
2792a20a
authored
May 18, 2026
by
zengqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 确认收款按钮调用原生requestMerchantTransfer方法
- 导入requestMerchantTransfer方法 - appId固定为wxce3ddfea994471b9 - 添加参数校验和错误处理 - 确认后跳转到处理状态页面
parent
822877e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
12 deletions
+31
-12
ConfirmReceipt.vue
src/views/withdraw/ConfirmReceipt.vue
+31
-12
No files found.
src/views/withdraw/ConfirmReceipt.vue
View file @
2792a20a
...
@@ -31,6 +31,10 @@
...
@@ -31,6 +31,10 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'vue'
import
{
defineComponent
}
from
'vue'
import
{
getWithdrawPackageInfo
}
from
'@/server/api/withdrawService'
import
{
getWithdrawPackageInfo
}
from
'@/server/api/withdrawService'
import
{
requestMerchantTransfer
}
from
'@/util/use-native-bridge'
// 微信开放平台移动应用 appId
const
WECHAT_APP_ID
=
'wxce3ddfea994471b9'
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'ConfirmReceipt'
,
name
:
'ConfirmReceipt'
,
...
@@ -84,18 +88,33 @@ export default defineComponent({
...
@@ -84,18 +88,33 @@ export default defineComponent({
}
}
},
},
async
handleConfirm
()
{
async
handleConfirm
()
{
// H5 唤起用户确认收款弹窗 - 使用 alert 模拟
if
(
!
this
.
packageInfo
||
!
this
.
mchId
)
{
alert
(
'H5确认收款功能:packageInfo='
+
this
.
packageInfo
+
', mchId='
+
this
.
mchId
)
console
.
error
(
'Missing params:'
,
{
packageInfo
:
this
.
packageInfo
,
mchId
:
this
.
mchId
})
alert
(
'缺少必要参数,无法确认收款'
)
// 模拟确认成功,跳转到处理状态页面
return
this
.
$router
.
replace
({
}
path
:
'/withdraw/processing-status'
,
query
:
{
try
{
status
:
'WAIT_CONFIRM'
,
// 调用原生方法唤起微信确认收款
withdrawNo
:
this
.
withdrawNo
,
await
requestMerchantTransfer
({
amount
:
this
.
amount
mchId
:
this
.
mchId
,
}
appId
:
WECHAT_APP_ID
,
})
package
:
this
.
packageInfo
})
// 跳转到处理状态页面
this
.
$router
.
replace
({
path
:
'/withdraw/processing-status'
,
query
:
{
status
:
'TRANSFERING'
,
withdrawNo
:
this
.
withdrawNo
,
amount
:
this
.
amount
}
})
}
catch
(
error
)
{
console
.
error
(
'requestMerchantTransfer error:'
,
error
)
alert
(
'确认收款失败: '
+
error
)
}
},
},
handleBack
()
{
handleBack
()
{
this
.
$router
.
replace
({
path
:
'/'
})
this
.
$router
.
replace
({
path
:
'/'
})
...
...
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