H5页面跳转小程序,按钮不显示,可能是由于小程序是体验版的导致的吗?
[图片] 微信版本,jssdk版本,标签初始化授权,都ok且真机环境 <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="telephone=no" name="format-detection">
<meta content="email=no" name="format-detection">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<title>小程序跳转测试</title>
</head>
<body style="text-align:center;">
<label></label>
<!--<wx-open-launch-weapp id="launch-btn" username="gh_1174ef7ddf81">
<template>
<style>.btn { padding: 12px;width:200px;height:50px; }</style>
<button class="btn">打开小程序</button>
</template>
</wx-open-launch-weapp>-->
<div id="wxOpenInAPP" class="wexin-launch-btn">
</div>
<script src="../js/jquery-1.9.1.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="resource/js/angular.min.js"></script>
<script type="text/javascript" src="resource/js/angular-ui-router.min.js"></script>
<script type="text/javascript" src="main.js"></script>
<script type="text/javascript">
wx.ready(function () {
alert('config 成功!');
var dom = document.getElementById('wxOpenInAPP');
dom.innerHTML = '<wx-open-launch-weapp id="launch-btn" username="gh_1174ef7ddf81">' +
'<template>' +
'<style> .wx-btn { color: #666; width: 200px; height:50px; display: block; text-aligin:center; }</style>' +
'<button class="wx-btn">跳转小程序</button>' +
'</template>' +
'</wx-open-launch-weapp>';
var btn = document.getElementById('launch-btn'); console.log('btn',btn);
btn.addEventListener('launch', function (e) {
console.log('success');
});
btn.addEventListener('error', function (e) {
console.log('fail', e.detail);
});
});
wx.error(function (res) {
alert(res.errMsg);
});
</script>
</body>
</html>