Skip to content

Commit

Permalink
修复ios 状态栏错位
Browse files Browse the repository at this point in the history
修复ios 状态栏错位
  • Loading branch information
wen-gang committed Sep 16, 2019
1 parent 0b10b63 commit cec4e9f
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 15 deletions.
14 changes: 10 additions & 4 deletions Colorui-UniApp/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
};
// #endif
// #ifdef MP-WEIXIN
// #ifdef MP-WEIXIN || MP-QQ
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
let capsule = wx.getMenuButtonBoundingClientRect();
if (capsule) {
Vue.prototype.Custom = capsule;
// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
}
// #endif
// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Expand Down
2 changes: 1 addition & 1 deletion Colorui-UniApp/pages/plugin/animation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</view>
</view>
<view class="margin radius bg-gradual-green shadow-blur">
<image src="https://image.weilanwl.com/gif/wave.gif" mode="scaleToFill" class="gif-black response" style="height:100upx"></image>
<image src="https://raw.githubusercontent.com/weilanwl/ColorUI/master/demo/images/wave.gif" mode="scaleToFill" class="gif-black response" style="height:100upx"></image>
</view>
<view class="margin flex">
<view class="bg-black flex-sub margin-right radius shadow-lg">
Expand Down
10 changes: 7 additions & 3 deletions demo/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ App({
wx.getSystemInfo({
success: e => {
this.globalData.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
let capsule = wx.getMenuButtonBoundingClientRect();
if (capsule) {
this.globalData.Custom = capsule;
this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
} else {
this.globalData.CustomBar = e.statusBarHeight + 50;
}
}
})
},
Expand Down
5 changes: 3 additions & 2 deletions demo/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"navigationBarTextStyle": "white"
},
"usingComponents": {
"cu-custom":"/colorui/components/cu-custom"
}
"cu-custom": "/colorui/components/cu-custom"
},
"sitemapLocation": "sitemap21.json"
}
2 changes: 1 addition & 1 deletion demo/pages/about/home/home.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<view class="margin-top-sm">
<text>By:文晓港</text>
</view>
<image src="https://image.weilanwl.com/gif/wave.gif" mode="scaleToFill" class="gif-wave"></image>
<image src="https://raw.githubusercontent.com/weilanwl/ColorUI/master/demo/images/wave.gif" mode="scaleToFill" class="gif-wave"></image>
</view>
<view class="padding flex text-center text-grey bg-white shadow-warp">
<view class="flex flex-sub flex-direction solid-right">
Expand Down
2 changes: 1 addition & 1 deletion demo/pages/plugin/animation/animation.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</view>
</view>
<view class="margin radius bg-gradual-green shadow-blur">
<image src="https://image.weilanwl.com/gif/wave.gif" mode="scaleToFill" class="gif-black response" style="height:100rpx"></image>
<image src="https://raw.githubusercontent.com/weilanwl/ColorUI/master/demo/images/wave.gif" mode="scaleToFill" class="gif-black response" style="height:100rpx"></image>
</view>
<view class="margin flex">
<view class="bg-black flex-sub margin-right radius shadow-lg">
Expand Down
2 changes: 2 additions & 0 deletions demo/project.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"hidedInDevtools": []
},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
Expand Down
7 changes: 7 additions & 0 deletions demo/sitemap21.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
10 changes: 7 additions & 3 deletions template/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ App({
wx.getSystemInfo({
success: e => {
this.globalData.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
this.globalData.Custom = custom;
this.globalData.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
let capsule = wx.getMenuButtonBoundingClientRect();
if (capsule) {
this.globalData.Custom = capsule;
this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
} else {
this.globalData.CustomBar = e.statusBarHeight + 50;
}
}
})
},
Expand Down

0 comments on commit cec4e9f

Please sign in to comment.