小程序
小游戏
企业微信
微信支付
扫描小程序码分享
h5wx.chooseWXPa支付后回调函数之前可以正常执行。然后今天在手机上就突然不能正常执行了,但是在开发者工具上可以执行回调。
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
有没有报错之类的,提供下错误信息和代码片段。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
没有任何报错,能正常支付。就是在手机上不执行回调。开发者工具上可以执行回调,地址是 : http://h5.glodog.cn/
wxconfig文件:
export async
function
wxConfig(share, payment) {
const config = store.state.wxConfig
const storeInfo = store.state.customData
const shareTitle = share.title || storeInfo.title
const shareDesc = share.desc || storeInfo.description
const shareLink = share.link || window.location.href.split(
'#'
)[0] +
'#/main?storeId='
+ getStoreId()
const shareImg = share.imgUrl || window.location.origin +
'/share.png'
wx.config({
debug:
false
,
appId: config.appid,
timestamp: config.timestamp,
nonceStr: config.nonceStr,
signature: config.signature,
jsApiList: [
'updateAppMessageShareData'
'updateTimelineShareData'
'onMenuShareTimeline'
'onMenuShareAppMessage'
'chooseWXPay'
]
})
const d = {
title: shareTitle,
// 分享标题
desc: shareDesc,
// 分享描述
link: shareLink,
// 分享链接
imgUrl: shareImg
}
wx.ready(() => {
// 分享给朋友圈
wx.updateTimelineShareData(d)
wx.onMenuShareTimeline(d)
// 分享给朋友
wx.updateAppMessageShareData(d)
wx.onMenuShareAppMessage(d)
if
(payment) {
wx.chooseWXPay({
timestamp: payment.timestamp,
nonceStr: payment.nonceStr,
package: payment.package,
signType: payment.signType,
paySign: payment.paySign,
success: payment.success,
fail: payment.fail,
cancel: payment.fail
wx.error(() => {})
功能页调用wxconfig进行h5支付:
wxConfig(
{},
{
timestamp: result.data.timeStamp,
nonceStr: result.data.nonceStr,
package: result.data.package,
signType: result.data.signType,
paySign: result.data.sign,
success: message => {
Toast(message.errMsg)
Toast(
'支付成功'
)
setTimeout(() => {
this
.$router.push({
path:
'/myOrder'
query: {
status: 2
}, 1000)
},
fail: error => {
Toast(error.errMsg)
.paymentError()
cancel: message => {
是否有修改
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
有没有报错之类的,提供下错误信息和代码片段。
没有任何报错,能正常支付。就是在手机上不执行回调。开发者工具上可以执行回调,地址是 : http://h5.glodog.cn/
wxconfig文件:
export async
function
wxConfig(share, payment) {
const config = store.state.wxConfig
const storeInfo = store.state.customData
const shareTitle = share.title || storeInfo.title
const shareDesc = share.desc || storeInfo.description
const shareLink = share.link || window.location.href.split(
'#'
)[0] +
'#/main?storeId='
+ getStoreId()
const shareImg = share.imgUrl || window.location.origin +
'/share.png'
wx.config({
debug:
false
,
appId: config.appid,
timestamp: config.timestamp,
nonceStr: config.nonceStr,
signature: config.signature,
jsApiList: [
'updateAppMessageShareData'
,
'updateTimelineShareData'
,
'onMenuShareTimeline'
,
'onMenuShareAppMessage'
,
'chooseWXPay'
]
})
const d = {
title: shareTitle,
// 分享标题
desc: shareDesc,
// 分享描述
link: shareLink,
// 分享链接
imgUrl: shareImg
}
wx.ready(() => {
// 分享给朋友圈
wx.updateTimelineShareData(d)
wx.onMenuShareTimeline(d)
// 分享给朋友
wx.updateAppMessageShareData(d)
wx.onMenuShareAppMessage(d)
if
(payment) {
wx.chooseWXPay({
timestamp: payment.timestamp,
nonceStr: payment.nonceStr,
package: payment.package,
signType: payment.signType,
paySign: payment.paySign,
success: payment.success,
fail: payment.fail,
cancel: payment.fail
})
}
})
wx.error(() => {})
}
功能页调用wxconfig进行h5支付:
wxConfig(
{},
{
timestamp: result.data.timeStamp,
nonceStr: result.data.nonceStr,
package: result.data.package,
signType: result.data.signType,
paySign: result.data.sign,
success: message => {
Toast(message.errMsg)
Toast(
'支付成功'
)
setTimeout(() => {
this
.$router.push({
path:
'/myOrder'
,
query: {
status: 2
}
})
}, 1000)
},
fail: error => {
Toast(error.errMsg)
this
.paymentError()
},
cancel: message => {
Toast(message.errMsg)
this
.paymentError()
}
}
)
是否有修改