收藏
回答

wx-open-launch-weapp标签不显示按钮的问题?

请教各位大佬,wx-open-launch-weapp标签不显示按钮咋解决,微信的config也返回了ok, 公众号也是认证的服务,也配置了js安全域名和接口白名单,但是标签里的按钮怎么也不展示,手机和浏览器都不行,发到生产上也不行

回答关注问题邀请回答
收藏

4 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    2020-12-24

    你好,提供下公众号帐号和复现链接

    2020-12-24
    有用
    回复 6
    查看更多(1)
  • Mikasa
    Mikasa
    2021-06-15

    我这不显示,还报了这样一个错

    2021-06-15
    有用
    回复
  • 天上月
    天上月
    2021-05-19

    请问企业微信呢。

    在微信下也有h5链接,想打开其他的小程序,我这边也是wx-open-launch-weapp标签不显示。

    2021-05-19
    有用
    回复
  • 雨、
    雨、
    2020-12-24
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js "></script>
        <script src="https://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
    </head>
    <body>
    
    
    <div id="weChatApp" style="width:3rem;">
        <div>1111111</div>
        <wx-open-launch-weapp id='wxbutton' username='gh_37dd9c33de04' path='/pages/index/index.html'>
            <template>
                <button >跳转小程序</button>
            </template>
        </wx-open-launch-weapp>
    </div>
    
    <div id="weApC" style="width:3rem">
        <div>2222</div>
        <wx-open-launch-weapp id="launch-btn" username="gh_7c2bc00a6bf8" path="/pages/index/index.html">
            <script type="text/wxtag-template">
                <style>
                    .btn {
                        width: 375px;
                        height: 50px;
                        font-size: 16px;
                    }
                </style>
                <button class="btn">打开小程序</button>
            </script>
        </wx-open-launch-weapp>
    </div>
    
    </body>
    
    <script>
        $(document).ready(function() {
    
    
    
            $.ajax({
                //请求方式
                type: "POST",
                //请求的媒体类型
                contentType: "application/json",
                //请求地址
                //https://wxxapp.chinaunicom.cn/touch-qrcode_gray/secondVerify/initWxConfig
                url: 'initWxConfig',
                data: JSON.stringify({url: window.location.href.split('#')[0]}),
                dataType:"html",
                global: true,
                success:function (data) {
                    data = JSON.parse(data);
                    if(data.respCode == "0000"){
                        console.log("---11--"+JSON.stringify(res));
                        var res = data.respData;
                        wx.config({
                            debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
                            appId: res.appId, // 必填,公众号的唯一标识
                            timestamp: res.timestamp, // 必填,生成签名的时间戳
                            nonceStr:  res.nonceStr, // 必填,生成签名的随机串
                            signature: res.signature,// 必填,签名
                            // /
                            jsApiList: ['checkJsApi',
                                'onMenuShareTimeline',
                                'onMenuShareAppMessage',
                                'onMenuShareQQ',
                                'onMenuShareWeibo',
                                'hideMenuItems',
                                'showMenuItems',
                                'hideAllNonBaseMenuItem',
                                'showAllNonBaseMenuItem',
                                'translateVoice',
                                'startRecord',
                                'stopRecord',
                                'onRecordEnd',
                                'playVoice',
                                'pauseVoice',
                                'stopVoice',
                                'uploadVoice',
                                'downloadVoice',
                                'chooseImage',
                                'previewImage',
                                'uploadImage',
                                'downloadImage',
                                'getNetworkType',
                                'openLocation',
                                'getLocation',
                                'hideOptionMenu',
                                'showOptionMenu',
                                'closeWindow',
                                'scanQRCode',
                                'chooseWXPay',
                                'openProductSpecificView',
                                'addCard',
                                'chooseCard',
                                'openCard'
                            ], // 必填,需要使用的JS接口列表
                            openTagList: ['wx-open-launch-weapp','wx-open-launch-app'] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
                        });
                    }else{
                        alert(data.respMsg)
                    }
    
    
                    wx.error(function (res) {
                        alert("wx.error----"+JSON.stringify(res));
                    })
    
                    //初始化配置之后调用
                    wx.ready(function () {
                        $.walk.tip("launch")
                        alert("launch");
                    });
    
                },
                error: function(e) {
                    alert("eeeee"+e.status + "--------" + e.responseText)
                }
            })
    
        })
    
    </script>
    </body>
    </html>
    


    2020-12-24
    有用
    回复
登录 后发表内容
问题标签