yinshaojie преди 9 месеца
родител
ревизия
8d05972073
променени са 6 файла, в които са добавени 91 реда и са изтрити 157 реда
  1. 47
    140
      RuoYi-App/App.vue
  2. 10
    0
      RuoYi-App/jsconfig.json
  3. 8
    0
      RuoYi-App/package.json
  4. 11
    6
      RuoYi-App/pages/index/index.vue
  5. 13
    10
      RuoYi-App/pages/login.vue
  6. 2
    1
      RuoYi-App/permission.js

+ 47
- 140
RuoYi-App/App.vue Целия файл

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <view :class="['app-container', `theme-${themeStore.currentTheme}`]">
2
+  <view class="app-container">
3 3
     <router-view />
4 4
   </view>
5 5
 </template>
@@ -7,54 +7,16 @@
7 7
 <script>
8 8
 import config from './config'
9 9
 import { getToken } from '@/utils/auth'
10
-import { onLaunch, onShow } from '@dcloudio/uni-app'
11
-import { mapState } from 'pinia'
12
-import { useThemeStore } from '@/store/theme'  // 修正路径
13
-import { useUserStore } from '@/store/user'    // 修正路径
14
-import { useVipStore } from '@/store/vip'      // 修正路径
15
-import { useReminder } from '@/utils/reminder'
16
-import { readingService } from '@/services/readingService'
17 10
 
18 11
 export default {
19
-  data() {
20
-    return {
21
-    }
22
-  },
23
-    computed: {
24
-      ...mapState(useThemeStore, ['currentTheme']),
25
-      ...mapState(useUserStore, ['user']),
26
-      ...mapState(useVipStore, ['vipStatus'])
27
-    },
28 12
   onLaunch() {
29
-    // 初始化主题
30
-    const themeStore = useThemeStore()
31
-    themeStore.initTheme()
32 13
     // 检查登录状态
33 14
     this.checkLogin()
34
-    // 初始化用户
35
-    this.userStore.initUser()
36
-    // 初始化签到提醒
37
-    useReminder.init()
38 15
     
39
-    // 登录成功后同步进度
40
-    // uni.$on('loginSuccess', async () => {
41
-    //   await readingService.syncAllLocalProgress()
42
-    //   uni.showToast({ title: '阅读进度已同步', icon: 'success' })
43
-    // })
44
-    
45
-    // 检查登录状态
46
-    //this.checkLogin()
47
-  },
48
-  onShow() {
49
-    // 加载用户和VIP状态
50
-    this.loadUserData()
16
+    // 初始化主题(临时实现)
17
+    this.initTheme()
51 18
   },
52 19
   methods: {
53
-    // 初始化应用配置
54
-    initConfig() {
55
-      this.globalData.config = config
56
-    },
57
-    
58 20
     // 检查用户登录状态
59 21
     checkLogin() {
60 22
       if (!getToken()) {
@@ -62,112 +24,57 @@ export default {
62 24
       }
63 25
     },
64 26
     
65
-        // 同步阅读进度(需要实现)
66
-        async syncReadingProgress() {
67
-          // 实现阅读进度同步逻辑
68
-          console.log('阅读进度同步逻辑待实现')
27
+    // 临时主题初始化
28
+    initTheme() {
29
+      const themeName = uni.getStorageSync('selectedTheme') || 'aydzBlue'
30
+      
31
+      // 应用主题变量
32
+      const themes = {
33
+        aydzBlue: {
34
+          '--primary-color': '#2a5caa',
35
+          '--bg-color': '#e6f7ff',
36
+          '--text-color': '#1a3353',
37
+          '--card-bg': '#d0e8ff',
38
+          '--header-bg': '#2a5caa'
39
+        },
40
+        darkMode: {
41
+          '--primary-color': '#52c41a',
42
+          '--bg-color': '#1a1a1a',
43
+          '--text-color': '#e6e6e6',
44
+          '--card-bg': '#2a2a2a'
69 45
         },
70
-    // 加载用户数据
71
-    async loadUserData() {
72
-      // 检查登录状态
73
-      if (uni.getStorageSync('token')) {
74
-        // 加载用户信息
75
-        await this.userStore.initUser()
76
-        
77
-        // 加载VIP状态
78
-        if (this.userStore.userId) {
79
-          await this.vipStore.loadVipStatus(this.userStore.userId)
46
+        default: {
47
+          '--primary-color': '#1890ff',
48
+          '--bg-color': '#f8f9fa',
49
+          '--text-color': '#333',
50
+          '--card-bg': '#ffffff'
80 51
         }
81 52
       }
53
+      
54
+      const root = document.documentElement
55
+      const themeVars = themes[themeName] || themes.aydzBlue
56
+      
57
+      Object.keys(themeVars).forEach(key => {
58
+        root.style.setProperty(key, themeVars[key])
59
+      })
60
+      
61
+      // 动态设置导航栏颜色
62
+      if (themeName === 'darkMode') {
63
+        uni.setNavigationBarColor({
64
+          frontColor: '#ffffff',
65
+          backgroundColor: '#1a1a1a'
66
+        })
67
+      } else if (themeName === 'aydzBlue') {
68
+        uni.setNavigationBarColor({
69
+          frontColor: '#ffffff',
70
+          backgroundColor: '#2a5caa'
71
+        })
72
+      }
82 73
     }
83 74
   }
84 75
 }
85 76
 </script>
86 77
 
87 78
 <style lang="scss">
88
-	  /* 确保所有页面有基本样式 */
89
-	  page {
90
-	    height: 100%;
91
-	    background-color: #ffffff;
92
-	    font-size: 28rpx;
93
-	    color: #333;
94
-	  }
95
-	    /* 解决部分设备显示问题 */
96
-	    body, html {
97
-	      height: 100%;
98
-	      background-color: #ffffff;
99
-	    }
100
-		  /* 容器样式 */
101
-		  .container {
102
-		    min-height: 100%;
103
-		    padding: 20rpx;
104
-		    box-sizing: border-box;
105
-		  }
106
-/* 修正:每个 @import 语句末尾添加分号 */
107
-@import '@/static/scss/index.scss';
108
-//@import '@/styles/themes/default.scss';
109
-//@import '@/styles/themes/aydz-blue.scss';
110
-
111
-.app-container {
112
-  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
113
-  height: 100vh;
114
-  background-color: var(--bg-color);
115
-  color: var(--text-color);
116
-}
117
-
118
-/* 全局主题变量 */
119
-:root {
120
-  --primary-color: #1890ff;
121
-  --bg-color: #f8f9fa;
122
-  --text-color: #333;
123
-  --card-bg: #ffffff;
124
-  --header-bg: #ffffff;
125
-  
126
-  /* 确保所有页面继承主题 */
127
-  background-color: var(--bg-color);
128
-  color: var(--text-color);
129
-}
130
-
131
-/* 哎呀科技蓝主题变量覆盖 */
132
-.theme-aydzBlue {
133
-  --primary-color: #2a5caa;
134
-  --bg-color: #e6f7ff;
135
-  --text-color: #1a3353;
136
-  --card-bg: #d0e8ff;
137
-  --header-bg: #2a5caa;
138
-}
139
-
140
-/* 深色模式主题变量覆盖 */
141
-.theme-darkMode {
142
-  --primary-color: #52c41a;
143
-  --bg-color: #1a1a1a;
144
-  --text-color: #e6e6e6;
145
-  --card-bg: #2a2a2a;
146
-  --header-bg: #1a1a1a;
147
-}
148
-
149
-/* 公共组件样式 */
150
-.card {
151
-  background-color: var(--card-bg);
152
-  border-radius: 12px;
153
-  padding: 16px;
154
-  margin-bottom: 16px;
155
-  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
156
-}
157
-
158
-.primary-button {
159
-  background-color: var(--primary-color);
160
-  color: white;
161
-  border: none;
162
-  border-radius: 24px;
163
-  padding: 10px 20px;
164
-  font-weight: bold;
165
-}
166
-
167
-/* 全局样式 */
168
-page {
169
-  background-color: var(--bg-color);
170
-  color: var(--text-color);
171
-  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
172
-}
79
+/* 保留原有样式 */
173 80
 </style>

+ 10
- 0
RuoYi-App/jsconfig.json Целия файл

@@ -0,0 +1,10 @@
1
+{
2
+  "compilerOptions": {
3
+    "baseUrl": ".",
4
+    "paths": {
5
+      "@/*": ["src/*"],
6
+      "pinia": ["./node_modules/pinia/dist/pinia.mjs"]
7
+    }
8
+  },
9
+  "exclude": ["node_modules", "dist"]
10
+}

+ 8
- 0
RuoYi-App/package.json Целия файл

@@ -0,0 +1,8 @@
1
+{
2
+  "dependencies": {
3
+    "vue": "^2.6.14",
4
+    "@vue/composition-api": "^1.7.2",
5
+    "uview-ui": "^1.8.4",
6
+    "uni-app": "^2.0.0"
7
+  }
8
+}

+ 11
- 6
RuoYi-App/pages/index/index.vue Целия файл

@@ -1,12 +1,17 @@
1 1
 <template>
2
-  <view class="content">
3
-    <image class="logo" src="@/static/logo.png"></image>
4
-    <view class="text-area">
5
-      <text class="title">Hello RuoYi</text>
6
-    </view>
2
+  <view class="container">
3
+    <h1>欢迎使用哎呀小说</h1>
4
+    <p>基础框架已加载!</p>
5
+    <p>当前时间: {{ new Date().toLocaleString() }}</p>
7 6
   </view>
8 7
 </template>
9
-
8
+<script>
9
+export default {
10
+  mounted() {
11
+    console.log('首页已加载')
12
+  }
13
+}
14
+</script>
10 15
 <style scoped>
11 16
 	  page {
12 17
 	    height: 100%;

+ 13
- 10
RuoYi-App/pages/login.vue Целия файл

@@ -1,8 +1,7 @@
1 1
 <template>
2 2
   <view class="normal-login-container">
3 3
     <view class="logo-content align-center justify-center flex">
4
-      <image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
5
-      </image>
4
+<!--      <image :src="globalConfig.appInfo.logo" class="logo" /> -->
6 5
       <text class="title">若依移动端登录</text>
7 6
     </view>
8 7
     <view class="login-form-content">
@@ -62,6 +61,10 @@
62 61
       this.getCode()
63 62
     },
64 63
     onLoad() {
64
+		// 如果全局配置已设置,则使用全局配置
65
+		    if (this.$config) {
66
+		      this.globalConfig = this.$config
67
+		    }
65 68
       //#ifdef H5
66 69
       if (getToken()) {
67 70
         this.$tab.reLaunch('/pages/index')
@@ -74,15 +77,15 @@
74 77
         this.$tab.redirectTo(`/pages/register`)
75 78
       },
76 79
       // 隐私协议
77
-      handlePrivacy() {
78
-        let site = this.globalConfig.appInfo.agreements[0]
79
-        this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
80
-      },
80
+      // handlePrivacy() {
81
+      //   let site = this.globalConfig.appInfo.agreements[0]
82
+      //   this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
83
+      // },
81 84
       // 用户协议
82
-      handleUserAgrement() {
83
-        let site = this.globalConfig.appInfo.agreements[1]
84
-        this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
85
-      },
85
+      // handleUserAgrement() {
86
+      //   let site = this.globalConfig.appInfo.agreements[1]
87
+      //   this.$tab.navigateTo(`/pages/common/webview/index?title=${site.title}&url=${site.url}`)
88
+      // },
86 89
       // 获取图形验证码
87 90
       getCode() {
88 91
         getCodeImg().then(res => {

+ 2
- 1
RuoYi-App/permission.js Целия файл

@@ -5,7 +5,8 @@ const loginPage = "/pages/login"
5 5
   
6 6
 // 页面白名单
7 7
 const whiteList = [
8
-  '/pages/login', '/pages/register', '/pages/common/webview/index'
8
+    '/pages/index/index', // 确保首页在名单中
9
+	'/pages/login', '/pages/register', '/pages/common/webview/index'
9 10
 ]
10 11
 
11 12
 // 检查地址白名单

Loading…
Отказ
Запис