App.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <script setup lang="ts">
  2. import { onLaunch, onShow, onHide } from '@dcloudio/uni-app';
  3. import { useUserStore } from './store/user';
  4. onLaunch(() => {
  5. console.log('App Launch');
  6. const userStore = useUserStore();
  7. userStore.initUser();
  8. });
  9. onShow(() => {
  10. console.log('App Show');
  11. });
  12. onHide(() => {
  13. console.log('App Hide');
  14. });
  15. </script>
  16. <template>
  17. <view id="app"></view>
  18. </template>
  19. <style>
  20. /* 全局样式 */
  21. page {
  22. background-color: #f9fafb;
  23. font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  24. font-size: 14px;
  25. color: #1f2937;
  26. min-height: 100vh;
  27. }
  28. /* 主色调 */
  29. :root {
  30. --primary-color: #4f46e5;
  31. --primary-light: #6366f1;
  32. --primary-lighter: #818cf8;
  33. --accent-color: #f97316;
  34. --success-color: #10b981;
  35. --error-color: #ef4444;
  36. --text-primary: #1f2937;
  37. --text-secondary: #6b7280;
  38. --bg-primary: #f9fafb;
  39. --bg-card: #ffffff;
  40. }
  41. /* 禁止选择文本 */
  42. text {
  43. user-select: none;
  44. }
  45. /* 安全区域 */
  46. .safe-area-bottom {
  47. padding-bottom: constant(safe-area-inset-bottom);
  48. padding-bottom: env(safe-area-inset-bottom);
  49. }
  50. </style>