Commit d147911a by pangchong

feat: 解决ios底部兼容问题

parent ff3315a9
...@@ -84,8 +84,8 @@ ...@@ -84,8 +84,8 @@
<slot v-else></slot> <slot v-else></slot>
</view> </view>
<!-- 底部 --> <!-- 底部 -->
<template #bottom> <template #bottom v-if="showBottom">
<view class="footer-btn" v-if="showFooterBtn"> <view class="footer-btn" v-if="showFooterBtn" :style="{ visibility: showBottom ? 'visible' : 'hidden' }">
<global-button type="primary" size="large" @tap="handleFooterClick">{{ footerBtnText }}</global-button> <global-button type="primary" size="large" @tap="handleFooterClick">{{ footerBtnText }}</global-button>
</view> </view>
<slot name="bottom"></slot> <slot name="bottom"></slot>
...@@ -476,6 +476,14 @@ defineExpose({ ...@@ -476,6 +476,14 @@ defineExpose({
}, },
element: paging element: paging
}) })
//处理ios底部兼容问题
const showBottom = ref(true)
uni.$on('changeShowBottom', (boolean) => {
const systemInfo = uni.getSystemInfoSync()
if (systemInfo.platform === 'ios') {
showBottom.value = !boolean
}
})
</script> </script>
<script> <script>
export default { export default {
......
...@@ -287,6 +287,9 @@ watch( ...@@ -287,6 +287,9 @@ watch(
}, },
{ immediate: true } { immediate: true }
) )
watch(show, (value) => {
uni.$emit('changeShowBottom', value)
})
//点击确定按钮 //点击确定按钮
const confirm = (e) => { const confirm = (e) => {
show.value = false show.value = false
......
...@@ -120,6 +120,7 @@ watch( ...@@ -120,6 +120,7 @@ watch(
scrollTop.value = ps.distance > 0 ? ps.distance : oldScrollTop.value scrollTop.value = ps.distance > 0 ? ps.distance : oldScrollTop.value
}) })
} }
uni.$emit('changeShowBottom', value)
} }
) )
const close = () => { const close = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment