feat: 弹窗展示优化
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<uni-popup ref="popupRef" type="bottom" background-color="#fff">
|
||||
<view class="receive-popup" @tap.stop>
|
||||
<uni-popup ref="popupRef" :type="popupType" background-color="transparent">
|
||||
<view class="receive-popup" :class="`receive-popup--${popupType}`" @tap.stop>
|
||||
<view class="receive-popup__header">
|
||||
<view>
|
||||
<view class="receive-popup__title">确认收货</view>
|
||||
@@ -70,6 +70,10 @@
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
popupType: {
|
||||
type: String,
|
||||
default: 'bottom',
|
||||
},
|
||||
orderNo: {
|
||||
type: String,
|
||||
default: '',
|
||||
@@ -393,14 +397,33 @@ defineExpose({ open, close });
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.receive-popup {
|
||||
width: 100%;
|
||||
max-height: 80vh;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding: 32rpx 32rpx 0 32rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
|
||||
&--bottom {
|
||||
width: 100%;
|
||||
max-height: 82vh;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding: 32rpx 32rpx calc(24rpx + env(safe-area-inset-bottom)) 32rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&--center {
|
||||
width: 680rpx;
|
||||
max-height: 78vh;
|
||||
border-radius: 24rpx;
|
||||
padding: 32rpx 32rpx 0 32rpx;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
&--center &__content {
|
||||
max-height: 52vh;
|
||||
}
|
||||
&--center &__btn {
|
||||
min-width: 160rpx;
|
||||
}
|
||||
|
||||
&__header {
|
||||
display: flex;
|
||||
@@ -439,7 +462,8 @@ defineExpose({ open, close });
|
||||
}
|
||||
&__content {
|
||||
flex: 1;
|
||||
max-height: 56vh;
|
||||
min-height: 0;
|
||||
max-height: calc(82vh - 420rpx - env(safe-area-inset-bottom));
|
||||
margin-top: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@@ -534,13 +558,22 @@ defineExpose({ open, close });
|
||||
font-weight: 500;
|
||||
}
|
||||
&__actions {
|
||||
padding: 20rpx 0 32rpx 0;
|
||||
padding: 16rpx 0 0 0;
|
||||
background: #ffffff;
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 20;
|
||||
box-shadow: 0 -8rpx 20rpx -10rpx rgba(0, 0, 0, 0.06);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
&__select-all {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 8rpx 0 20rpx 0;
|
||||
padding: 8rpx 0 16rpx 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
&__select-all-text {
|
||||
margin-left: 12rpx;
|
||||
@@ -553,6 +586,8 @@ defineExpose({ open, close });
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 20rpx;
|
||||
padding-bottom: 20rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
&__btn {
|
||||
min-width: 180rpx;
|
||||
@@ -577,4 +612,28 @@ defineExpose({ open, close });
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .uni-popup {
|
||||
background: transparent !important;
|
||||
}
|
||||
::v-deep .uni-popup__wrapper {
|
||||
background: transparent !important;
|
||||
}
|
||||
::v-deep .uni-popup__wrapper-box {
|
||||
background: transparent !important;
|
||||
}
|
||||
::v-deep .uni-popup__content {
|
||||
background: transparent !important;
|
||||
}
|
||||
.receive-popup--bottom ::v-deep .uni-popup__content,
|
||||
.receive-popup--bottom ::v-deep .uni-popup__wrapper-box {
|
||||
border-radius: 24rpx 24rpx 0 0 !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
.receive-popup--center ::v-deep .uni-popup__content,
|
||||
.receive-popup--center ::v-deep .uni-popup__wrapper-box {
|
||||
border-radius: 24rpx !important;
|
||||
overflow: hidden !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user