fix: resolve header overlap on Dynamic Island iPhones
- app.js 通过 wx.getSystemInfoSync 获取 statusBarHeight 存入 globalData
- 所有12个自定义导航页面的 JS 读取 statusBarHeight
- WXML 通过 style="padding-top: {{statusBarHeight + 24}}px" 动态适配
- 普通手机和灵动岛手机都能正确显示
这个提交包含在:
@@ -2,11 +2,17 @@ var http = require('../../utils/request')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
statusBarHeight: 44,
|
||||
scanning: false,
|
||||
deviceId: '',
|
||||
error: ''
|
||||
},
|
||||
|
||||
onLoad: function () {
|
||||
var app = getApp()
|
||||
this.setData({ statusBarHeight: app.globalData.statusBarHeight })
|
||||
},
|
||||
|
||||
onScan: function () {
|
||||
var self = this
|
||||
self.setData({ scanning: true, error: '' })
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<view class="page">
|
||||
<view class="page-header page-header-pink">
|
||||
<view class="page-header page-header-pink" style="padding-top: {{statusBarHeight + 24}}px;">
|
||||
<view class="page-header-title">扫码绑定</view>
|
||||
<view class="page-header-subtitle">扫描设备底部二维码</view>
|
||||
</view>
|
||||
|
||||
在新工单中引用
屏蔽一个用户