index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <script setup lang="ts">
  2. import { Input } from "ant-design-vue";
  3. import SearchCard from "@/components/SearchCard.vue";
  4. import BackButton from "@/components/BackButton.vue";
  5. import { ref } from "vue";
  6. import { useRouter } from "vue-router";
  7. const router = useRouter();
  8. const inputValue = ref("");
  9. </script>
  10. <template>
  11. <div
  12. class="h-screen w-full bg-[url('/image/bg.png')] bg-cover flex text-white flex-col relative"
  13. >
  14. <!-- 返回按钮 -->
  15. <BackButton
  16. class="absolute top-3 md:top-[70px] left-9"
  17. @click="router.push('/')"
  18. />
  19. <div class="w-[691px] mx-auto">
  20. <!-- 搜索框 -->
  21. <div
  22. class="h-[72px] backdrop-blur-sm mx-auto bg-gray-800 mt-[83px] bg-opacity-20 flex justify-between items-center rounded-xl overflow-hidden"
  23. >
  24. <div>
  25. <Input
  26. class="bg-transparent text-white text-lg px-4 placeholder:text-gray-100"
  27. :bordered="false"
  28. placeholder="请输入学生姓名"
  29. v-model:value="inputValue"
  30. />
  31. </div>
  32. <div
  33. class="h-full select-none w-[134px] bg-blue-400 flex justify-center items-center font-medium text-xl cursor-pointer"
  34. >
  35. 搜索
  36. </div>
  37. </div>
  38. <!-- 结果框 -->
  39. <div
  40. v-show="inputValue.length > 0"
  41. class="bg-[#c7dfeb] bg-opacity-70 backdrop-blur-sm rounded-xl mt-2 text-black flex flex-col py-8 gap-2 max-h-[400px] overflow-auto"
  42. >
  43. <SearchCard v-for="i in 3" :key="i" class="flex-none" />
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <style scoped></style>