使用wx.miniProgram.navigateTo从web-view里面的网页打开小程序的一个页面/pages/locat/locat时没有响应。在开发工具上能正常跳转的,但是在小程序真机上就没有响应了。请求指导帮助!


网页:

 <script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js" charset="utf-8"></script>

<script>

    $(".dizhi_img").on("click",function () {

        var mappoint = $(this).attr("data-mappoint").split(",");

        var latitude = mappoint[1];

        var longitude = mappoint[0];


        var url = '/pages/location/location?latitude='+encodeURIComponent(latitude)+'&longitude='+encodeURIComponent(longitude)+

            '&name='+encodeURIComponent($(this).attr("data-name"))+'&address='+encodeURIComponent($(this).attr("data-address"));

        wx.miniProgram.navigateTo({

            url:url,

            success: function(){

                console.log('success')

            },

            fail: function(){

                console.log('fail');

            },

            complete:function(){

                console.log('complete');

            }


        });

    });

</script>



小程序:

new Promise((resolve, reject) => {

// 位置授权

wx.getSetting({

success(res) {

if (!res.authSetting['scope.userLocation']) {

wx.authorize({

scope: 'scope.userLocation',

success(){

// 用户已经同意位置权限

    resolve(true);

},

fail(){

    resolve(false);

}

});

} else {

//用户原来已经授予过权限

    resolve(true);

}

},

fail() {

    resolve(false);

}

});

// resolve(localtiontag);

}).then((relc) => {

console.log(relc);

if(relc == true){

     

展开全部
收起
1回答
提交回答
  • 至过去的我

    2044人对此回答表示赞同

    我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多>
    发布于
  • 钱可为

    1人对此回答表示赞同

    跳转地址不能是tabbar地址,官方的帮助文档很粗糙,很多细节很坑!

    展开
    1
    0回复
    发布于 6年前

    评论(0)

    收起评论

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
咨询热线

13312967497

扫码添加业务即可随时咨询 还可领取小程序推广攻略

业务咨询: 13312967497
扫码咨询

扫码咨询套餐

回到顶部