wx-open-launch-app 按钮内容不显示?
发布于 6 年前 作者 byang 5564 次浏览 来自 官方Issues

测试地址:https://dict.eudic.net/Courses/index/?appkey=eusoft_ting_en_iphone&courseId=f108a92f-f050-48b2-8f59-f3cc05fac17a&sourcefrom=share

微信版本:8.0.2

设备:iphone11

运行结果:wx.ready运行成功,wx.error也没有报错。但是打开按钮就是不显示

公众号appid:wxcde3c24f7569ba13

移动应用appid:wx3d9bc15510620bf2

这些条件都是满足的

但是debug显示为false

代码:

  
       <wx-open-launch-app id="launch-btn" appid="wx3d9bc15510620bf2" extinfo="">
            <template>
                <style>
                  .btn {
                    width70px;
                    height30px;
                    line-height30px;
                    text-align: center;
                    font-size15px;
                    colorrgb(49149252);
                    border-radius:50px;
                    border2px solid rgba(49,149,252,0.50);
                         }
                   </style>
                   <button class="btn">打开</button>
           </template>
      </wx-open-launch-app>
    
       
          $.ajax({
                url"/ting/WeChatSignatureUrl?url=" +encodeURIComponent(window.location.href),
                type"GET",
                dataType'json',
                successfunction (data{
                    var param=data;
                    configParam(param);
                },
                errorfunction (err{
                    console.log("err: " + err)
                }
            });
           
            function configParam(param{
                console.log(param)
                wx.config({
                    debugtrue,
                    appId: param.AppId, 
                    timestamp: param.Timestamp,
                    nonceStr: param.Noncestr, 
                    signature: param.Signature,
                    jsApiList: ['checkJsApi'], 
                    openTagList: ['wx-open-launch-app'] 
                });
          
                wx.ready(function () {
                    wx.checkJsApi({
                        jsApiList: ['wx-open-launch-app'],
                        successfunction (res{
                            console.log('可用')
                        },
                        fail(err) => {
                            console.log(err, '不可用')
                        }
                    })
                });
                wx.error(function (res{
                    console.log(res)
                });

            }

            var launchBtn = document.getElementById('launch-btn');
            if (launchBtn) {
                launchBtn.addEventListener('launch'function (e{
                    console.log('success');
                });
                launchBtn.addEventListener('error'function (e{
                    console.log('fail', e.detail);
                });
            }
      
 
        
    
   

    
2 回复

把debug打开看看

请问问题有答案了吗,我这边也遇到的同样的问题

回到顶部