demo连接:https://www.taohuitech.com/share/html/open_app.html
公众号设置:
网页跳转移动应用关联设置:
config代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script type="text/javascript" src="../script/jquery-1.11.3.min.js"></script>
</head>
<body>
<wx-open-launch-app
id="launch-btn"
appid="wx6e050cdcb554f633"
extinfo="your-extinfo"
>
<template>
<style>.btn { padding: 12px }</style>
<button class="btn">App内查看</button>
</template>
</wx-open-launch-app>
<script>
$.getScript("//res2.wx.qq.com/open/js/jweixin-1.2.0.js", function callback() {
var url = location.href.split('#')[0];
$.ajax({
type: "post",
url: "/jssdk",
dataType: 'json',
data: {
url: url
},
success: function (res) {
var data =res;
wx.config({
debug: false,
appId: data.appId,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',
'onMenuShareAppMessage'
],
openTagList: ['wx-open-launch-app']
})
wx.ready(function () {
console.log('ready')
wx.checkJsApi({
jsApiList: ['wx-open-launch-app'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
success: function (res) {
// console.log('可用')
},
fail: (err) => {
// console.log(err, '不可用')
}
})
})
wx.error(function (res) {
// alert(res)
})
},
error: function (xhr, ajaxOptions, thrownError) {
// alert("Http status: " + xhr.status + " " + xhr.statusText + "\najaxOptions: " + ajaxOptions + "\nthrownError:" + thrownError + "\n" + xhr.responseText);
}
})
})
</script>
<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>
问题截图:
安卓版本:
微信版本:
你好,是否符合要求,提供下公众号帐号ID
移动应用id:wx6e050cdcb554f633
时间点:2020-12-22
楼主问题解决了吗?我这里也出现相似问题,APPID都自查了,没发觉哪有问题,使用wx.checkJsApi检测接口返回wx-open-launch-app:false