阅读量:131

在h5页面中调用小程序支付页面的方法
1.H5页面代码
<body >
<button onclick="testPay()">支付</button>
[removed][removed]
[removed]
function testPay() {
var mini=false;
wx.miniProgram.getEnv(function(res){
if (res.miniprogram){
//发起小程序支付
wx.miniProgram.navigateTo({url: "/pages/wxpay/wxpay"});
mini=true;
}
});
}
[removed]
</body>
2.H5页面跳转到小程序支付代码
Page({
data: {
},
onLoad: function (options) {
var that = this;
console.log("回到小程序")
console.log(options)
//业务流程
},