style-dialog.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view class="style-dialog">
  3. <view>
  4. <view class="style-dialog_head flex-center">
  5. <view class="fw-500 color-000 fs-32">{{ title }}</view>
  6. <view class="close" @click="close">
  7. <uni-icons type="closeempty" size="24" color="#2D284B"></uni-icons>
  8. </view>
  9. </view>
  10. <view class="style-dialog_body">
  11. <slot></slot>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script lang="ts">
  17. export default {
  18. props: {
  19. title: String,
  20. },
  21. methods: {
  22. close() {
  23. this.$emit("close");
  24. },
  25. },
  26. };
  27. </script>
  28. <style lang="scss">
  29. .style-dialog {
  30. position: fixed;
  31. width: 100%;
  32. height: 100%;
  33. left: 0;
  34. bottom: 0;
  35. right: 0;
  36. top: 0;
  37. z-index: 999;
  38. background-color: rgba(0, 0, 0, 0.6);
  39. display: flex;
  40. align-items: flex-end;
  41. & > view {
  42. width: 100%;
  43. overflow: hidden;
  44. border-radius: 20rpx 20rpx 0px 0px;
  45. background-color: #fff;
  46. box-sizing: content-box;
  47. padding-bottom: constant(safe-area-inset-bottom);
  48. padding-bottom: env(safe-area-inset-bottom);
  49. }
  50. &_head {
  51. height: 92rpx;
  52. position: relative;
  53. background-color: #fff;
  54. .close {
  55. position: absolute;
  56. right: 30rpx;
  57. top: 50%;
  58. transform: translateY(-50%);
  59. }
  60. }
  61. &_body {
  62. max-height: 1000rpx;
  63. overflow-y: auto;
  64. }
  65. }
  66. </style>