index.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <script setup lang="ts">
  2. import { Input } from "ant-design-vue";
  3. const router = useRouter();
  4. const inputValue = ref("");
  5. const localStore = useLocalStore();
  6. const showIndex = ref(0);
  7. onMounted(() => {
  8. console.log(localStore.initialized);
  9. console.log(localStore.locals);
  10. });
  11. </script>
  12. <template>
  13. <div
  14. class="h-screen bg w-full bg-[url('/image/bg.png')] bg-cover flex text-white"
  15. >
  16. <!-- 初始化后展示 -->
  17. <div
  18. v-if="localStore.initialized"
  19. class="flex-col relative w-full h-screen"
  20. >
  21. <!-- 打上标记的点 -->
  22. <ShowPoint
  23. v-for="(item, i) in localStore.locals"
  24. :key="i"
  25. :local="item"
  26. :show="showIndex === i"
  27. />
  28. <!-- 返回按钮 -->
  29. <BackButton
  30. class="absolute top-3 md:top-[40px] left-9"
  31. @click="router.push('/')"
  32. />
  33. <div class="w-[691px] mx-auto">
  34. <!-- 搜索框 -->
  35. <div
  36. 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"
  37. >
  38. <div>
  39. <Input
  40. class="bg-transparent text-white text-lg px-4 placeholder:text-gray-100"
  41. :bordered="false"
  42. placeholder="请输入学生姓名"
  43. v-model:value="inputValue"
  44. />
  45. </div>
  46. <div
  47. @click="showIndex++"
  48. class="h-full select-none w-[134px] bg-blue-400 flex justify-center items-center font-medium text-xl cursor-pointer"
  49. >
  50. 搜索
  51. </div>
  52. </div>
  53. <!-- 结果框 -->
  54. <div
  55. v-show="inputValue.length > 0"
  56. class="bg-[#c7dfeb] z-50 bg-opacity-70 backdrop-blur-sm rounded-xl mt-2 text-black flex flex-col py-8 gap-2 max-h-[400px] overflow-auto"
  57. >
  58. <SearchCard v-for="i in 3" :key="i" class="flex-none" />
  59. </div>
  60. </div>
  61. </div>
  62. <!-- 未初始化展示 -->
  63. <Init v-else />
  64. </div>
  65. </template>
  66. <style scoped></style>