oppositePhonenumberChoose.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!--
  2. 这里是自定义展示框组件,选择联系人姓名、电话号码
  3. 张志宏
  4. 24.9.28
  5. -->
  6. <template>
  7. <view class="modal-container" v-if="visible">
  8. <!-- 遮盖罩 -->
  9. <view class="modal-overlay" @click="close"></view>
  10. <!-- 提示栏内容 -->
  11. <scroll-view class="modal-content" @touchmove.stop>
  12. <view class="modal-title">{{ title }}</view>
  13. <view class="modal-body">
  14. <slot></slot>
  15. <!-- 插槽 -->
  16. </view>
  17. </scroll-view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name:"oppositePhonenumberChoose",
  23. props: {
  24. visible: Boolean,
  25. title: String,
  26. },
  27. methods: {
  28. close() {
  29. this.$emit('update:visible', false);
  30. },
  31. }
  32. }
  33. </script>
  34. <style scoped>
  35. .modal-container {
  36. position: fixed;
  37. top: 0;
  38. left: 0;
  39. right: 0;
  40. bottom: 0;
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. z-index: 10000;
  45. overflow: hidden;
  46. }
  47. /* 遮盖罩样式 */
  48. .modal-overlay {
  49. position: absolute;
  50. top: 0;
  51. left: 0;
  52. right: 0;
  53. bottom: 0;
  54. background-color: rgba(0, 0, 0, 0.5);
  55. z-index: 9990; /* 确保遮罩在内容下层 */
  56. }
  57. .modal-content {
  58. max-height: 60%;
  59. position: fixed;
  60. bottom: 0%;
  61. padding: 20px;
  62. border-radius: 8px;
  63. width: 100%;
  64. max-width: 90%;
  65. background: #f0efef;
  66. z-index: 9999; /* 确保遮罩在内容上层 */
  67. }
  68. .modal-title {
  69. display: flex;
  70. align-items: center;
  71. justify-content: center;
  72. font-size: 100rpx;
  73. font-weight: bold;
  74. margin-bottom: 5rpx;
  75. padding-bottom: 15rpx;
  76. }
  77. .modal-body {
  78. background-color: aqua;
  79. display: flex;
  80. flex-direction: column;/*按列排布*/
  81. align-items: center;
  82. justify-content: center;
  83. font-size: 70rpx;
  84. padding: 5rpx;
  85. margin: 5rpx;
  86. padding-bottom: 15rpx;
  87. }
  88. .modal-buttons {
  89. display: flex;
  90. justify-content: space-between;
  91. }
  92. .confirm-btn, .cancel-btn {
  93. flex: 1;
  94. padding: 2px;
  95. margin: 8px;
  96. background: transparent; /* 背景透明 */
  97. border-radius: 4px;
  98. font-size: 36px;
  99. }
  100. .confirm-btn {
  101. outline: none;
  102. border: none;
  103. color: red;
  104. }
  105. .cancel-btn {
  106. border: none;
  107. outline: none;
  108. color: blue;
  109. }
  110. </style>