ad2写真,mh370被劫持新证据,刘康佳
微信公众号支付
使用的vuex,在mutations中
wechatpay (state, data) { state.payobject = data console.log('微信支付开始请求') if (wechat) { wx.choosewxpay({ timestamp: state.payobject.timestamp, // 支付签名时间戳 noncestr: state.payobject.noncestr, // 支付签名随机串,不长于 32 位 package: state.payobject.package, // 统一支付接口返回的prepay_id参数值 signtype: state.payobject.signtype, // 签名方式使用新版支付需传入'md5' paysign: state.payobject.paysign, // 支付签名 success: function (res) { alert('成功') alert(json.stringify(res)) }, cancel: function (res) { alert('已取消支付') alert(json.stringify(res)) }, fail: function (res) { alert(json.stringify(res)) } }) } }
在支付页面中commit
// 存储微信支付数据data let data = res.body.data console.log('即将跳转微信支付') this.$store.commit({ timestamp: data.timestamp, noncestr: data.noncestr, type: 'wechatpay', package: data.package, signtype: data.signtype, paysign: data.paysign })
这是因为不能在在微信开发者工具上测试,需要真机测试
需要配置正确的支付授权目录,vue的单页应用直接配置为域名就行。 其他需要配置为调用支付的上一级目录,以/结束
需要后台看一下openid配置
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
h5页面唤起app如果没安装就跳转下载(iOS和Android)
浅析数据存储的三种方式 cookie sessionstorage localstorage 的异同
React Native超简单完整示例-tabs、页面导航、热更新、用户行为分析
React componentWillMount、componentDidMount、componentWillUpdate和componentDidUpdate生命周期函数的详解
详解canvas.toDataURL()报错的解决方案全都在这了
网友评论