生命周期函数onLoad:在IOS上不执行怎么办?
IOS版本:11.2.1微信版本:6.6.0调试基础库:1.7.2
我想让他点了这个页面以后就拉起导航,在拉起失败的时候也可以通过 click 来导航,在开发工具上测试是能正常拉起的,在手机上预览的时候就不行了,android设备可以,IOS就不行,测试了iphone6和7,求解决方法。
WXML:
< map id = "map" longitude = "102.617047" latitude = "24.987896" markers = "{{markers}}" scale = "10" style = "width: 100%; height: 680rpx;" bindtap = "click" > </ map > < view bindtap = "click" > < view class = "page-body-form" > < view class = "page-body-form-item" > < text class = "page-body-form-key" >热线电话</ text > < input class = "page-body-form-value" type = "text" value = "0871-68211888" name = "tel" ></ input > </ view > < view class = "page-body-form-item" > < text class = "page-body-form-key" >地铁线</ text > < input class = "page-body-form-value" type = "text" value = "地铁3号线-西山公园站下" name = "address" ></ input > </ view > < view class = "page-body-form-item" style = "border-bottom: none;" > < text class = "page-body-form-key" >详细位置</ text > < input class = "page-body-form-value" type = "text" value = "昆明市西山区碧鸡关碧源路6号" name = "address" ></ input > </ view > </ view > < view class = "page-body-buttons" > < button class = "page-body-button" type = "primary" >点此导航到学校</ button > </ view > </ view > |
JS:
Page({ data: { scale: 13, latitude: 24.987896, longitude: 102.617047, markers: [{ id: "1" , latitude: 24.987687, longitude: 102.617047, width: 28, height: 47, title: "云南新华电脑学院" , iconPath: "../image/location.png" }], }, onLoad: function () { wx.openLocation({ latitude: 24.988032, longitude: 102.616618, scale: 18, name: '云南新华电脑学院' , address: '地址:云南省昆明市西山区碧鸡关 电话:0871-68211888' }) }, click: function (e) { wx.openLocation({ latitude: 24.986670, longitude: 102.616810, scale: 18, name: '云南新华电脑学院' , address: '地址:云南省昆明市西山区碧鸡关 电话:0871-68211888' }) }, onShareAppMessage: function () { return { title: '查看到云南新华电脑学院的导航路线' , path: '/pages/map/map' } } }) |