在h5頁面中調(diào)用小程序支付頁面的方法
1.H5頁面代碼
<body >
<div class="container">
<button onclick="testPay()">支付</button>
</div>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script language="javascript">
function testPay() {
var mini=false;
wx.miniProgram.getEnv(function(res){
if (res.miniprogram){
//發(fā)起小程序支付
wx.miniProgram.navigateTo({url: "/pages/wxpay/wxpay"});
mini=true;
}
});
}
</script>
</body>
2.H5頁面跳轉(zhuǎn)到小程序支付代碼
Page({
data: {
},
onLoad: function (options) {
var that = this;
console.log("回到小程序")
console.log(options)
//業(yè)務(wù)流程
},