收藏
回答

wx-open-launch-weapp在安卓下可以正常显示正常跳转到小程序,在IOS下却不显示?

<html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script src="https://www.XXXXX.cn/app/site/statics/js_mini/moo_min.js"></script>

<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js" type="text/javascript"></script>

<script>

    var theRequest = new Object();

    theRequest['type']='ajax';

    // 请求签名等数据

        new Request({

            method: 'post',

            url: "https://www.XXXXX.cn/product-weixinInfo.html",

            data:theRequest,

            async: false,

            evalScripts: true, 

            onSuccess: function (res) {

                console.log('weixinInfo_res',res);

                res=JSON.decode(res);

                // 通过config接口注入权限验证配置并申请所需开放标

                wx.config({

                    debug: true, // 是否开启调试模式  开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印

                    appId:res.appId,// 必填,公众号的唯一标识

                    timestamp:res.timestamp,// 必填,生成签名的时间戳

                    nonceStr: res.nonceStr,

                    signature:res.signature,// 必填,签名

                    jsApiList: [

                        // "onMenuShareTimeline",

                        // "onMenuShareAppMessage",

                        //"onMenuShareQQ",

                        //"onMenuShareWeibo",

                        //"onMenuShareQZone",

                        "openLocation",

                        "chooseWXPay",

                        "chooseImage",

                        "previewImage",

                    ],// 必填,需要使用的JS接口列表

                    openTagList:[

                        'wx-open-launch-weapp',  //跳转小程序

                        //'wx-open-launch-app'      //跳转app

                    ]// 可选,需要使用的开放标签列表,例如['wx-open-launch-app']

                }); 

                wx.error(function (e) {

                    console.log('用户拒绝跳转或跳转异常', e.detail)

                    // alert(JSON.stringify(e));

                    // config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名

                });

                wx.ready(function(){

                    console.log('config成功')

                })

            },

            onFailure: function () {

            },

            onComplete:function(res){

            }

        }).send();

</script>

<wx-open-launch-weapp style="height:43px;width: 330px;" appid="wxXXXXXXX6397" id="pdp-launch-btn" username="gh_XXXXXX" path="/pages/index/index" >

    <template>

        <button class="btn">前往小程序商城购买123</button>

    </template>

</wx-open-launch-weapp>

</html>

<script>

  var btn = document.getElementById('pdp-launch-btn');

  console.log('pdp-launch-btn002',btn);

  btn.addEventListener('ready', function (e) {

    alert('ready');

  });

  btn.addEventListener('launch', function (e) {

    alert('success');

  });

  btn.addEventListener('error', function (e) {

    alert('fail');

    console.log('fail',e.detail);

  });

</script>

安卓下显示:

IOS下显示:

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

2 个回答

  • Demons
    Demons
    2023-05-20

    你好,麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点

    2023-05-20
    有用
    回复 2
    • O0
      O0
      2023-05-22
      微信号:jun1130476729 时间点:2023-05-22 9:00-10:00
      2023-05-22
      回复
    • O0
      O0
      2023-05-24
      请问收到日志信息了吗?有答复吗?
      2023-05-24
      回复
  • O0
    O0
    2023-05-19

    后续补充,IOS13.6版本正常,IOS16.4以上都无法正常显示

    2023-05-19
    有用
    回复 2
    • Shirley C
      Shirley C
      2023-10-09
      后续解决了ios不显示的问题吗?遇到了同样的问题。
      2023-10-09
      回复
    • 随风℡落叶
      随风℡落叶
      2023-11-09
      同问
      2023-11-09
      回复
登录 后发表内容