大空间消毒机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
3.2 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="log_picker_dialog_container">
  3. <div class="modal_content">
  4. <p class="title">设置消毒等级</p>
  5. <div class="log_select">
  6. <van-picker
  7. :columns="columns"
  8. :show-toolbar="false"
  9. visible-option-num="3"
  10. option-height="42"
  11. v-model="selectedValues"
  12. />
  13. </div>
  14. <div class="ok_btn style-btn" @click="chooseLog">确定</div>
  15. <svg
  16. class="close"
  17. @click="handleClickClose"
  18. xmlns="http://www.w3.org/2000/svg"
  19. xmlns:xlink="http://www.w3.org/1999/xlink"
  20. fill="none"
  21. version="1.1"
  22. width="13.06049919128418"
  23. height="13.062000274658203"
  24. viewBox="0 0 13.06049919128418 13.062000274658203"
  25. >
  26. <g>
  27. <path
  28. d="M6.531,7.5915L12,13.062L13.0605,12.0015L7.5915,6.531L13.0605,1.062L12,3.57628e-7L6.531,5.4705L1.062,0L0,1.062L5.4705,6.531L0,12L1.062,13.062L6.531,7.5915Z"
  29. fill="#323233"
  30. fill-opacity="1"
  31. />
  32. </g>
  33. </svg>
  34. </div>
  35. </div>
  36. </template>
  37. <script setup>
  38. import { ref, watch } from 'vue'
  39. const props = defineProps({
  40. changeLogVal: {
  41. type: Function,
  42. },
  43. logVal: {
  44. type: String,
  45. },
  46. hiddenLogVisible: {
  47. type: Function,
  48. },
  49. })
  50. const columns = ref([
  51. { text: '1 Log', value: '1' },
  52. { text: '2 Log', value: '2' },
  53. { text: '3 Log', value: '3' },
  54. { text: '4 Log', value: '4' },
  55. { text: '5 Log', value: '5' },
  56. { text: '6 Log', value: '6' },
  57. { text: '7 Log', value: '7' },
  58. { text: '8 Log', value: '8' },
  59. { text: '9 Log', value: '9' },
  60. { text: '10 Log', value: '10' },
  61. { text: '11 Log', value: '11' },
  62. { text: '12 Log', value: '12' },
  63. ])
  64. const chooseLog = () => {
  65. props.changeLogVal(selectedValues.value[0])
  66. }
  67. const handleClickClose = () => {
  68. props.hiddenLogVisible()
  69. }
  70. const selectedValues = ref([localStorage.getItem('logVal') || '6'] || ['6'])
  71. watch(() => {
  72. selectedValues.value = [props.logVal]
  73. })
  74. </script>
  75. <style lang="scss" scoped>
  76. .log_picker_dialog_container {
  77. position: fixed;
  78. top: 0;
  79. left: 0;
  80. right: 0;
  81. bottom: 0;
  82. background: rgba(0, 0, 0, 0.5);
  83. z-index: 2;
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. .modal_content {
  88. width: 476px;
  89. height: 407px;
  90. border-radius: 16px;
  91. background: #ffffff;
  92. box-sizing: border-box;
  93. padding: 45px 68px 62px 68px;
  94. display: flex;
  95. flex-direction: column;
  96. align-items: center;
  97. position: relative;
  98. .close {
  99. position: absolute;
  100. right: 24px;
  101. top: 18px;
  102. }
  103. .title {
  104. font-family: Source Han Sans CN;
  105. font-size: 22px;
  106. font-weight: normal;
  107. letter-spacing: 0.04em;
  108. color: #000000;
  109. margin-bottom: 39px;
  110. }
  111. .log_select {
  112. width: 340px;
  113. height: 113px;
  114. overflow: hidden;
  115. margin-bottom: 48px;
  116. }
  117. .ok_btn {
  118. width: 340px;
  119. height: 68px;
  120. border-radius: 8px;
  121. background: #06518b;
  122. display: flex;
  123. align-items: center;
  124. justify-content: center;
  125. font-family: Source Han Sans CN;
  126. font-size: 23px;
  127. font-weight: 350;
  128. letter-spacing: 0em;
  129. color: #ffffff;
  130. }
  131. }
  132. }
  133. </style>