3135关注10068浏览
使用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){
 
-
至过去的我
2044人对此回答表示赞同
我是未来的你,你现在是不是在年找寻小程序答案。你不要感觉诧异,给你来信原因,就是让你不在后悔。今天去学习如何推广小程序,相信......点击查看更多> -
钱可为
1人对此回答表示赞同
跳转地址不能是tabbar地址,官方的帮助文档很粗糙,很多细节很坑!
展开10回复分享发布于 6年前评论(0)
收起评论