FindPartner.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <script setup lang="ts">
  2. import { useI18n } from 'vue-i18n'
  3. import { useFindPartnerPopup } from '~/composables/useFindPartnerPopup'
  4. const { state, close, toggleTag, applyFilters } = useFindPartnerPopup()
  5. const { t } = useI18n()
  6. const handleUpdateShow = (value: boolean) => {
  7. if (!value) {
  8. close()
  9. }
  10. }
  11. const handleSubmit = () => {
  12. applyFilters()
  13. close()
  14. }
  15. </script>
  16. <template>
  17. <van-popup
  18. :show="state.visible"
  19. round
  20. position="bottom"
  21. class="find-partner-popup"
  22. @update:show="handleUpdateShow"
  23. >
  24. <div class="find-partner-popup__container">
  25. <!-- title -->
  26. <h3 class="find-partner-popup__title">
  27. {{ t('home.findPartner.title') }}
  28. </h3>
  29. <!-- white card -->
  30. <section class="find-partner-popup__card">
  31. <div
  32. v-for="section in state.sections"
  33. :key="section.id"
  34. class="find-partner-popup__section"
  35. >
  36. <p class="find-partner-popup__section-title">
  37. {{ t(section.titleKey) }}
  38. </p>
  39. <div class="find-partner-popup__tags-row">
  40. <button
  41. v-for="tag in section.tags"
  42. :key="tag.id"
  43. type="button"
  44. class="find-partner-popup__tag"
  45. :class="{
  46. 'find-partner-popup__tag--active':
  47. state.selected[section.id] === tag.id,
  48. }"
  49. @click="toggleTag(section.id, tag.id)"
  50. >
  51. {{ section.id === 'region' ? t(`region.${tag.labelKey}`, {}, tag.labelKey) : t(tag.labelKey) }}
  52. </button>
  53. </div>
  54. </div>
  55. </section>
  56. <!-- bottom button -->
  57. <button
  58. type="button"
  59. class="find-partner-popup__submit"
  60. @click="handleSubmit"
  61. >
  62. {{ t('home.findPartner.submit') }}
  63. </button>
  64. </div>
  65. </van-popup>
  66. </template>
  67. <style scoped lang="scss">
  68. .find-partner-popup {
  69. background-color: transparent;
  70. &__container {
  71. position: relative;
  72. padding: 16px 16px 24px;
  73. border-radius: 20px 20px 0 0;
  74. background: linear-gradient(181deg, #B7EEFF 0.58%, #FFF 99.62%);
  75. }
  76. &__title {
  77. text-align: center;
  78. font-family: var(--font-title);
  79. font-size: 16px;
  80. font-weight: 600;
  81. color: var(--color-text-primary);
  82. margin-bottom: 15px;
  83. }
  84. &__game-tabs {
  85. display: flex;
  86. justify-content: space-between;
  87. margin-bottom: 12px;
  88. }
  89. &__game-tab {
  90. flex: 1;
  91. padding: 4px 0;
  92. border: none;
  93. background: transparent;
  94. font-size: 12px;
  95. color: #4e5969;
  96. border-radius: 999px;
  97. }
  98. &__game-tab--active {
  99. background-color: rgba(47, 150, 255, 0.7);
  100. color: #fff;
  101. }
  102. &__card {
  103. padding: 14px;
  104. border-radius: 12px;
  105. background-color: #fff;
  106. }
  107. &__section {
  108. & + & {
  109. margin-top: 12px;
  110. }
  111. }
  112. &__section-title {
  113. font-size: 14px;
  114. font-weight: 600;
  115. color: #1d2129;
  116. margin-bottom: 6px;
  117. }
  118. &__tags-row {
  119. display: flex;
  120. flex-wrap: wrap;
  121. gap: 8px;
  122. }
  123. &__tag {
  124. padding: 4px 11px;
  125. border-radius: 200px;
  126. border: none;
  127. background-color: #f9fafb;
  128. font-size: 13px;
  129. color: #4e5969;
  130. cursor: pointer;
  131. -webkit-tap-highlight-color: transparent;
  132. }
  133. &__tag--active {
  134. background-color: #e6fffa;
  135. color: #3fbfbd;
  136. font-weight: 600;
  137. }
  138. &__submit {
  139. margin-top: 12px;
  140. @include size(100%, 47px);
  141. border: none;
  142. border-radius: 100px;
  143. background-image: linear-gradient(90deg, #2f95ff 0%, #50ffd8 100%);
  144. color: #fff;
  145. font-family: var(--font-title);
  146. font-size: 16px;
  147. font-weight: 600;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. cursor: pointer;
  152. -webkit-tap-highlight-color: transparent;
  153. }
  154. }
  155. </style>