H5跳转微信小程序
发表时间:2020-10-19
发布人:葵宇科技
浏览次数:48
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta content="yes" name="apple-touch-fullscreen">
<script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
</head>
<body>
<wx-open-launch-weapp
id="launch-btn"
username="gh_66666666666"
path="/pages/index/index.html">
<template>
<center><button class="btn">跳转</button></center>
</template>
</wx-open-launch-weapp>
<script type="text/javascript">
wx.config({
debug:false,
appId:'<%=wjs.getAppid()%>',
timestamp:'<%=wjs.getTimestamp()%>',
nonceStr:'<%=wjs.getNoncestr()%>',
signature:'<%=wjs.getSignature()%>',
jsApiList:['openLocation'],
openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
});
wx.error(function(res){
});
wx.ready(function(){
});
var btn = document.getElementById('launch-btn');
btn.addEventListener('launch', function (e) {
});
btn.addEventListener('error', function (e) {
});
</script>
</body>
</html>