添加遮罩層立镶,禁止下層滾動
// wxml
<view class="shade" wx:if="{{show}}" catchtouchmove='func'>
<view class="content" bindtap="xxx">aaaaa</view>
</view>
// wxss
.shade {
width:100%;
height:100vh;
top:0;
background:rgba(0,0,0,0.5);
overflow: hidden;
z-index: 1;
position: fixed;
}
其中,設置catchtouchmove后类早,在開發(fā)工具上是測試不出來的媚媒,下層仍然滾動,但真機測試可以
wx.request改成同步
https://blog.csdn.net/weixin_44268792/article/details/106988473
微信小程序引用外部json文件
wx.request({
url: ‘xxxxxxxxx’,
success: function (res) {
console.log('json', res)
jsonData = JSON.parse(res.data)
}
})
wx.getLocation提高精度
參數(shù)type
采用gcj02
而非wgs84
莺奔。
gcj02
返回的經緯度欣范,小數(shù)點后保留14位
wgs84
返回的經緯度变泄,小數(shù)點后保留6位
一定要用真機調試A钣础D涨怼!屏富!開發(fā)工具上都是返回5位晴竞,而且偏差很大