在浏览器上面唤起微信小程序的代码

11次阅读
没有评论

共计 511 个字符,预计需要花费 2 分钟才能阅读完成。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>标题</title>
</head>
<body>
    <script>
        var openlink = "weixin://dl/business/?t=xxxxx"; // 小程序代码
        if(openlink!=''){
            window.location = openlink
        }else{
            console.log([]);
        }
        // 处理微信浏览器
        window.addEventListener('pageshow', function (e) {
          if(e.persisted || (window.performance && window.performance.navigation.type == 2)){
            window.location.reload()
          }
        });
    </script>
</body>
</html>
正文完
 0
Eric chan
版权声明:本站原创文章,由 Eric chan 于2021-09-29发表,共计511字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。