Skip to content

Commit

Permalink
feat: 兼容支付宝小程序
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Aug 28, 2020
1 parent e4a35c8 commit c1043bf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
7 changes: 0 additions & 7 deletions components/pi-loading/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ export default {
default() {
return loading.textStyle
}
},
// 整个loading自定义样式
customStyle: {
type: Object,
default() {
return loading.customStyle
}
}
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion components/pi-popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<view
class="pi-rela pi-w-100P pi-h-100P"
:class="{ 'pi-safearea': !['top', 'center'].includes(position) && safeAreaInsetBottom }"
:style="contentStyle"
:style="[contentStyle]"
>
<view
v-if="showCloseIcon"
Expand Down
1 change: 1 addition & 0 deletions components/pi-search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const { search } = getConfig()
export default {
name: TAG,
// 混入自定义样式customStyle和customClass
mixins: [ValueSync, createCustomPropsByConfig(search)], // 注入value与val,进行双向绑定
props: {
// 搜索框形状 round || square(默认'round')
Expand Down
13 changes: 13 additions & 0 deletions tools/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
*/
export const systemInfo = (() => {
const info = uni.getSystemInfoSync()
// 兼容某些平台没有safeArea参数
if (!info.safeArea) {
console.log('当前平台系统信息获取safeArea失败,自定义初始化')
info.safeArea = {
bottom: info.screenHeight,
height: info.screenHeight - info.statusBarHeight,
left: 0,
right: info.screenWidth,
top: info.statusBarHeight,
width: info.screenWidth
}
}

console.log('当前系统信息为:', info)
return info || {}
})()
Expand Down

0 comments on commit c1043bf

Please sign in to comment.