wx-open-launch-weapp点击无反应?
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
<title>跳转小程序.......</title>
<script type="text/javascript" src="http://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>
<script type="text/javascript" src="http://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="text/javascript">
var timestamp = '<%=request.getAttribute("timestamp") %>';
var nonceStr = '<%=request.getAttribute("nonceStr") %>';
var signature = '<%=request.getAttribute("signature") %>';
var url = location.href.split('#')[0];
console.log(url);
console.log(encodeURIComponent(url));
wx.config({
debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
appId: 'wx05eecfa1533f8262', // 必填,公众号的唯一标识
timestamp: timestamp, // 必填,生成签名的时间戳
nonceStr: nonceStr, // 必填,生成签名的随机串
signature: signature,// 必填,签名
jsApiList: ['onMenuShareTimeline'], // 必填,需要使用的JS接口列表
openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
});
wx.ready(function () {
console.log("ready")
});
wx.error(function (res) {
console.log(res, "error");
});
</script>
</head>
<body>
<wx-open-launch-weapp id="launch-btn" username="gh_c2ece0685a62" path="/singlePay/pages/router/index.html">
<style>.btn {
padding: 12px
}</style>
<button class="btn">打开小程序</button>
</wx-open-launch-weapp>
<script>
var btn = document.getElementById('launch-btn');
btn.addEventListener('launch', function (e) {
console.log('success');
});
btn.addEventListener('error', function (e) {
console.log('fail', e.detail);
});
</script>
</body>
</html>
以上是html代码,点击按钮无反应,不要说什么<template>标签没有,我加了这个标签,按钮就不显示了!!!!!! 地址:http://uat.91eid.com/appserver/applet 手机:小米9 安卓系统:10 微信版本7.0.20