微信升级后,微信小程序 cover-view上的文字和图片突然全部都不能显示了,这是为什么啊
Page({
data: {
cost: 3,
loadingHidden: true,
timer: ‘0:00:00’,
percent: ‘0%’,
isUse: false,
startTime: ‘0:00:00’,
scale: 18,
latitude: 0,
longitude: 0,
},
//回到自己的位置
onLoad: function (options) {
this.mapCtx = wx.createMapContext(“ParkingMap”)
this.movetoPosition();
wx.getSystemInfo({
success: (res) => {
this.setData({
controls: [{
id: 1,
iconPath: ‘/images/test.png’,
position: {
left: 20,
top: res.windowHeight - 90,
width: 50,
height: 50
},
clickable: true
}]
})
}
})
},
bindcontroltap: function(e) {
switch (e.controlId) {
case 1:
this.setData({
loadingHidden: !this.data.loadingHidden,
isUse: !this.data.isUse
})
}
},
//定位函数
movetoPosition: function () {
this.mapCtx.moveToLocation();
},
})
<!–pages/index/index.wxml–>
<view class=“mapContainer”>
<map id=“ParkingMap”
latitude="{{latitude}}"
longitude="{{longitude}}"
scale="{{scale}}"
controls="{{controls}}"
bindcontroltap = “bindcontroltap”
markers="{{markers}}"
bindmarkertap=“bindmarkertap”
show-location>
<cover-view class=‘timerView’ hidden=’{{!isUse}}’>
<cover-view class=‘start’>
<cover-view class=‘caption’>起始时间:</cover-view>
<cover-view class=‘time’>{{startTime}}</cover-view>
</cover-view>
<cover-view class=‘end’>
<cover-view class=‘caption’>使用时长:</cover-view>
<cover-view class=‘time’>{{timer}}</cover-view>
</cover-view>
<cover-view class=‘end’>
<cover-view class=‘caption’>费用(元):</cover-view>
<cover-view class=‘time’>{{cost}}</cover-view>
</cover-view>
</cover-view>
<cover-view class=‘loadingCover’ disable-scroll=“true” hidden=’{{loadingHidden}}’>
<cover-view class=‘imageView’>
<cover-image class=‘loadingImage’ src=’/images/loading.png’ ></cover-image>
<cover-view class=‘loadingText’>{{percent}}</cover-view>
</cover-view>
</cover-view>
</map>
</view>
/**index.wxss**/
.mapContainer{
position: absolute;
width: 100%;
height: 100%;
}
#ParkingMap{
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
}
.timerView{
position: absolute;
height: 15%;
width: 90%;
display: flex;
align-items: stretch;
justify-content: center;
flex-direction: row;
background: white;
margin:5%;
border: 1px solid #F0F0F0;
/* text-align: center */
}
.loadingCover{
/* position: absolute; */
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 80%;
background: transparent
}
.imageView{
position: relative;
width: 120px;
height: 150px;
background-color: #383838;
color: #F0F0F0;
text-align: center;
}
.loadingCover cover-image{
position: relative;
margin: 15%;
width: 70%;
height: 60%;
align-items: center;
background-color: #383838
}
.loadingText{
color: #F0F0F0;
background-color: #383838;
border-color: #383838
}
点击地图上的控件,两个cover-view会显示,模拟器上测试没问题,真机测试时,cover-view上的图片和文字都显示不出来。 手机是iphone6s,微信版本6.5.22,升级前是可以正常显示的。