├── php-api/ # 改造后的PHP接口层 ├── java-ad-service/ # 若依框架微服务(广告+VIP+分账) ├── uniapp-reader/ # UniApp前端项目 │ ├── pages/ # 各端页面 │ └──
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.

App.vue 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="app-container">
  3. <router-view />
  4. </view>
  5. </template>
  6. <script>
  7. import config from './config'
  8. import { getToken } from '@/utils/auth'
  9. export default {
  10. onLaunch() {
  11. // 检查登录状态
  12. this.checkLogin()
  13. // 初始化主题(临时实现)
  14. this.initTheme()
  15. },
  16. methods: {
  17. // 检查用户登录状态
  18. checkLogin() {
  19. if (!getToken()) {
  20. this.$tab.reLaunch('/pages/login')
  21. }
  22. },
  23. // 临时主题初始化
  24. initTheme() {
  25. const themeName = uni.getStorageSync('selectedTheme') || 'aydzBlue'
  26. // 应用主题变量
  27. const themes = {
  28. aydzBlue: {
  29. '--primary-color': '#2a5caa',
  30. '--bg-color': '#e6f7ff',
  31. '--text-color': '#1a3353',
  32. '--card-bg': '#d0e8ff',
  33. '--header-bg': '#2a5caa'
  34. },
  35. darkMode: {
  36. '--primary-color': '#52c41a',
  37. '--bg-color': '#1a1a1a',
  38. '--text-color': '#e6e6e6',
  39. '--card-bg': '#2a2a2a'
  40. },
  41. default: {
  42. '--primary-color': '#1890ff',
  43. '--bg-color': '#f8f9fa',
  44. '--text-color': '#333',
  45. '--card-bg': '#ffffff'
  46. }
  47. }
  48. const root = document.documentElement
  49. const themeVars = themes[themeName] || themes.aydzBlue
  50. Object.keys(themeVars).forEach(key => {
  51. root.style.setProperty(key, themeVars[key])
  52. })
  53. // 动态设置导航栏颜色
  54. if (themeName === 'darkMode') {
  55. uni.setNavigationBarColor({
  56. frontColor: '#ffffff',
  57. backgroundColor: '#1a1a1a'
  58. })
  59. } else if (themeName === 'aydzBlue') {
  60. uni.setNavigationBarColor({
  61. frontColor: '#ffffff',
  62. backgroundColor: '#2a5caa'
  63. })
  64. }
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. /* 保留原有样式 */
  71. </style>