在自己写小程序的时候 订单这块切换到ipad就往下拖动 下面部分页面不显示
- 在js里加一个判断 如果是ipad就直接给一个限定高度
// xx.js 处理ipad不兼容
onLoad: function (options) {
var that = this;
wx.getSystemInfo({
success(res) {
if (res.model.indexOf('iPad') > -1) {
console.log(res.model.indexOf('iPad'));
that.setData({
yincang: 'height:700rpx'
})
}
}
})
},
- 然后在wxml中给一个全局 就可以了
<view bindtap="starTap" data-index="{{index}}" class="star xiayi" wx:for="{{userStars}}" wx:key="index">
<image src="{{item}}" mode='aspectFill'></image>
</view>
- 第2步不行的话就在部分不显示页面的class标签给一个style变量,让js能找到找个class就可以了
<view class="xx" style='{{yincang}}'>
</view>