|
@@ -15,7 +15,7 @@ import {
|
|
|
toast
|
|
|
} from "@/utils/common.js"
|
|
|
import * as httpUnit from "@/api/unitTest.js"
|
|
|
-import {getXueke} from "@/utils/cacheManager.js"
|
|
|
+import cacheManager, {useXuekeNianji,useUnitTestTishi} from "@/utils/cacheManager.js"
|
|
|
|
|
|
|
|
|
function useJifen() {
|
|
@@ -39,9 +39,14 @@ function useJifen() {
|
|
|
}
|
|
|
|
|
|
export function useExam() {
|
|
|
+ // 缓存
|
|
|
+ const {getXueke} = useXuekeNianji();
|
|
|
+ const { updateTishi, getTishi} = useUnitTestTishi();
|
|
|
+
|
|
|
const { showTishi, handleCloseTishi, handleShowTishi} = useTishiLeftRight()
|
|
|
const {rightAnswer,wrongAnswer,jifen, updateJifen} = useJifen();
|
|
|
- const {getXueke} = getXueke();
|
|
|
+
|
|
|
+
|
|
|
const data = reactive({
|
|
|
count: 0, // 已答题数
|
|
|
total: 0, // 总题数
|
|
@@ -52,8 +57,8 @@ export function useExam() {
|
|
|
nianji: null,
|
|
|
xueke: null,
|
|
|
})
|
|
|
- const {xueke} = getXueke();
|
|
|
onLoad((options) => {
|
|
|
+ const { xueke } = getXueke();
|
|
|
const {
|
|
|
jieId,zhangId,nianji
|
|
|
} = options;
|
|
@@ -143,12 +148,12 @@ function useTishiLeftRight() {
|
|
|
const showTishi = ref(false);
|
|
|
// 大鹅关闭追加缓存 --- 单独针对当前手机的缓存提示
|
|
|
function handleCloseTishi() {
|
|
|
- uni.setStorageSync('isShowTishi','has');
|
|
|
+ updateTishi();
|
|
|
showTishi.value = false;
|
|
|
}
|
|
|
// 大鹅显示追加缓存 --- 单独针对当前手机的缓存提示
|
|
|
function handleShowTishi() {
|
|
|
- const isNotShow = Boolean(uni.getStorageSync('isShowTishi'));
|
|
|
+ const isNotShow = Boolean(getTishi());
|
|
|
showTishi.value = !isNotShow;
|
|
|
}
|
|
|
|