|
@@ -37,16 +37,13 @@
|
|
|
import {
|
|
|
toast
|
|
|
} from "../../utils/common";
|
|
|
- import cacheManager from "../../utils/cacheManager.js";
|
|
|
- import {
|
|
|
- useXuekeNianji
|
|
|
- } from "@/utils/cacheManager.js"
|
|
|
-
|
|
|
+ import cacheManager ,{useXuekeNianji}from "@/utils/cacheManager.js";
|
|
|
const {
|
|
|
updateXueke,
|
|
|
getXueke
|
|
|
} = useXuekeNianji();
|
|
|
- const eggDialogRef = ref(null);
|
|
|
+ const eggDialogRef = ref(null);
|
|
|
+ const catalogueRef = ref(null);
|
|
|
const selectZhang = ref(null);
|
|
|
let infoData = reactive({
|
|
|
jieList: [],
|
|
@@ -60,25 +57,30 @@
|
|
|
});
|
|
|
onLoad(() => {
|
|
|
// 获取路由参数
|
|
|
- //会员 取auth
|
|
|
- selectZhang.value = cacheManager.get('auth');
|
|
|
-
|
|
|
- console.log(selectZhang.value);
|
|
|
- if (cacheManager.get('auth')) {
|
|
|
- // 已登录
|
|
|
- // 选择年级进入调用此接口
|
|
|
- //options.flag == 'selectGrades'
|
|
|
- getZhangInfo()
|
|
|
- // 蛋
|
|
|
- // eggDialogRef.value.eggShow();
|
|
|
- } else {
|
|
|
- // 未登录 游客
|
|
|
- getCommonZhang()
|
|
|
-
|
|
|
+
|
|
|
+ init()
|
|
|
|
|
|
- }
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
+ function init(){
|
|
|
+ if (cacheManager.get('auth')) {
|
|
|
+ //会员 取auth
|
|
|
+ selectZhang.value = cacheManager.get('auth');
|
|
|
+
|
|
|
+ console.log(selectZhang.value);
|
|
|
+ // 已登录
|
|
|
+ // 选择年级进入调用此接口
|
|
|
+ //options.flag == 'selectGrades'
|
|
|
+ getZhangInfo()
|
|
|
+ // 蛋
|
|
|
+ // eggDialogRef.value.eggShow();
|
|
|
+ } else {
|
|
|
+ // 未登录 游客
|
|
|
+ getCommonZhang()
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function getZhangInfo(data) {
|
|
|
let req = {
|
|
|
nianji: selectZhang.value.nianji,
|
|
@@ -106,11 +108,12 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function getCommonZhang(data) {
|
|
|
+ function getCommonZhang(data) {
|
|
|
+
|
|
|
let req = {
|
|
|
- nianji: selectZhang.value.nianji,
|
|
|
- cardId: selectZhang.value.cardId,
|
|
|
- zhangId: selectZhang.value.zhangId,
|
|
|
+ nianji: getXueke().nianji,
|
|
|
+ cardId: getXueke().cardId,
|
|
|
+ zhangId: selectZhang.value? selectZhang.value.zhangId :0,
|
|
|
}
|
|
|
getCommonZhangInfo(req).then(res => {
|
|
|
infoData.jieList = res.data.jieList
|
|
@@ -121,7 +124,7 @@
|
|
|
infoData.cardId = res.data.cardId
|
|
|
infoData.zhangId = res.data.zhangId
|
|
|
infoData.zhangName = res.data.zhangName
|
|
|
-
|
|
|
+ //getNewData()
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -193,7 +196,7 @@
|
|
|
|
|
|
function handleChangeZhang(data) {
|
|
|
selectZhang.value = data;
|
|
|
- getZhangInfo(true)
|
|
|
+ init()
|
|
|
}
|
|
|
|
|
|
function goKaoshi(data) {
|