refactor: 重构存储与接口适配,统一金额单位与会话管理
- 新增配置、存储、金额转换工具服务 - 按userId隔离本地缓存,替换旧设备级存储 - 统一移动端金额单位为万元,新增转换适配逻辑 - 重构认证与请求逻辑,支持真实后端会话 - 调整搜索、帮助、融资模块的模拟开关与数据适配 - 更新文档说明开发状态与配置规则
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { getUserStorage, setUserStorage } from '@/services/storage.uts'
|
||||
|
||||
import { usePageLayout } from '@/services/layout.uts'
|
||||
import { financeLessons, findFinanceLesson, FinanceLesson } from '@/packages/content/services/content.uts'
|
||||
import AppHeader from '@/components/AppHeader.uvue'
|
||||
@@ -41,7 +43,7 @@
|
||||
const scrollTarget = ref('')
|
||||
const storageKey = (index: number): string => 'finance.lesson.' + lesson.value.id + '.chapter.' + index
|
||||
const restoreProgress = (): void => {
|
||||
completed.value = lesson.value.chapters.map((_item, index): boolean => uni.getStorageSync(storageKey(index)) == true)
|
||||
completed.value = lesson.value.chapters.map((_item, index): boolean => getUserStorage(storageKey(index)) == true)
|
||||
}
|
||||
const completedCount = computed((): number => completed.value.filter((value: boolean): boolean => value).length)
|
||||
const progress = computed((): number => Math.round(completedCount.value * 100 / lesson.value.chapters.length))
|
||||
@@ -59,7 +61,7 @@
|
||||
})
|
||||
const toggleChapter = (index: number): void => { activeIndex.value = activeIndex.value == index ? -1 : index }
|
||||
const completeChapter = (index: number): void => {
|
||||
uni.setStorageSync(storageKey(index), true)
|
||||
setUserStorage(storageKey(index), true)
|
||||
const next = completed.value.slice()
|
||||
next[index] = true
|
||||
completed.value = next
|
||||
|
||||
Reference in New Issue
Block a user