|
@@ -35,14 +35,12 @@
|
|
|
} from '@/utils/emitEvents.js';
|
|
|
import eggDialog from './eggDialog.vue'
|
|
|
import {
|
|
|
- toast
|
|
|
- } from "../../utils/common";
|
|
|
- import cacheManager ,{useXuekeNianji}from "@/utils/cacheManager.js";
|
|
|
- const {
|
|
|
- updateXueke,
|
|
|
- getXueke
|
|
|
- } = useXuekeNianji();
|
|
|
- const eggDialogRef = ref(null);
|
|
|
+ toast,getUserIdentity
|
|
|
+ } from "@/utils/common";
|
|
|
+ import cacheManager from "@/utils/cacheManager.js";
|
|
|
+
|
|
|
+
|
|
|
+ const eggDialogRef = ref(null);
|
|
|
const catalogueRef = ref(null);
|
|
|
const selectZhang = ref(null);
|
|
|
let infoData = reactive({
|
|
@@ -57,29 +55,29 @@
|
|
|
});
|
|
|
onLoad(() => {
|
|
|
// 获取路由参数
|
|
|
-
|
|
|
+
|
|
|
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 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 = {
|
|
@@ -108,11 +106,11 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- function getCommonZhang(data) {
|
|
|
-
|
|
|
+ function getCommonZhang(data) {
|
|
|
+ const auth = cacheManager.get('auth');
|
|
|
let req = {
|
|
|
- nianji: getXueke().nianji,
|
|
|
- cardId: getXueke().cardId,
|
|
|
+ nianji: auth.nianji,
|
|
|
+ cardId: auth.cardId,
|
|
|
zhangId: selectZhang.value? selectZhang.value.zhangId :0,
|
|
|
}
|
|
|
getCommonZhangInfo(req).then(res => {
|
|
@@ -196,6 +194,12 @@
|
|
|
|
|
|
function handleChangeZhang(data) {
|
|
|
selectZhang.value = data;
|
|
|
+ const authCode = getUserIdentity();
|
|
|
+ if (authCode !== 'Visitor') {
|
|
|
+ cacheManager.updateObject('auth', {
|
|
|
+ zhangId: data.zhangId
|
|
|
+ })
|
|
|
+ }
|
|
|
init()
|
|
|
}
|
|
|
|