|
@@ -74,7 +74,9 @@
|
|
|
const catalogueRef = ref(null);
|
|
|
const youkeZhangInfoData = ref(null);
|
|
|
const currentProduct = ref(null);
|
|
|
- const selectZhang = ref(null);
|
|
|
+ const localAuth = ref(null);
|
|
|
+ const levelId = ref(null);
|
|
|
+ const typeId = ref(null);
|
|
|
const zhangList = ref(null);
|
|
|
const gradeTerm = ref(null);
|
|
|
let infoData = reactive({
|
|
@@ -87,14 +89,6 @@
|
|
|
zhangName: '',
|
|
|
numberStr: '',
|
|
|
});
|
|
|
- const gradeMapping = {
|
|
|
- 1: 'L1',
|
|
|
- 2: 'L2',
|
|
|
- 3: 'L3',
|
|
|
- 4: 'L4',
|
|
|
- 5: 'L5',
|
|
|
- 6: 'L6'
|
|
|
- };
|
|
|
|
|
|
const termMapping = {
|
|
|
1: ' 数学',
|
|
@@ -177,39 +171,42 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function init(options) {
|
|
|
+ function init(options) {
|
|
|
+ // FIXME 待修改 部分字段写死
|
|
|
if (cacheManager.get('auth')) {
|
|
|
- //会员 取auth
|
|
|
- selectZhang.value = cacheManager.get('auth');
|
|
|
- currentProduct.value = cacheManager.get('auth').cardId;
|
|
|
+ levelId.value = options.levelId
|
|
|
+ typeId.value = options.typeId //1新2旧
|
|
|
+ localAuth.value = cacheManager.get('auth');
|
|
|
+ // currentProduct.value = cacheManager.get('auth').subjectId;
|
|
|
+ currentProduct.value = 1;
|
|
|
//let currentObject = this.cacheZhangInfo.jieList.find(item => item.jieId == this.jieId);
|
|
|
- console.log(selectZhang.value);
|
|
|
+ console.log(localAuth.value);
|
|
|
// 已登录
|
|
|
- if (selectZhang.value.firstLogin) {
|
|
|
+ if (localAuth.value.firstLogin) {
|
|
|
nextTick(() => {
|
|
|
eggDialogRef.value.eggShow();
|
|
|
})
|
|
|
}
|
|
|
- // cacheManager.set('daoPageCache',{isCache:true})
|
|
|
- if(!cacheManager.get('daoPageCache').isCache){
|
|
|
- getZhangInfo()
|
|
|
-
|
|
|
- }else{
|
|
|
- console.log('shiyonghuancun');
|
|
|
- translateData(cacheManager.get('auth'))
|
|
|
- zhangList.value = cacheManager.get('zhangInfo').zhangList
|
|
|
- current.value = cacheManager.get('auth').currentZhang
|
|
|
- infoData.zhangId = cacheManager.get('zhangInfo').zhangList[current.value].zhangId
|
|
|
- recordZhangJie()
|
|
|
- }
|
|
|
+ getZhangInfo()
|
|
|
+ // if(!cacheManager.get('daoPageCache').isCache){
|
|
|
+ // console.log('不实用换葱');
|
|
|
+ // getZhangInfo()
|
|
|
+ // }else{
|
|
|
+ // console.log('shiyonghuancun');
|
|
|
+ // translateData(cacheManager.get('auth'))
|
|
|
+ // zhangList.value = cacheManager.get('zhangInfo').zhangList
|
|
|
+ // current.value = cacheManager.get('auth').currentZhang
|
|
|
+ // infoData.zhangId = cacheManager.get('zhangInfo').zhangList[current.value].zhangId
|
|
|
+ // recordZhangJie()
|
|
|
+ // }
|
|
|
|
|
|
- // 已登录付费未支付选择返回 -> 恢复弹窗
|
|
|
- if (options.studyWithCatalgue) {
|
|
|
- // 展开弹窗
|
|
|
- nextTick(() => {
|
|
|
- catalogueRef.value.showPopup({zhangId: infoData.zhangId});
|
|
|
- })
|
|
|
- }
|
|
|
+ // // 已登录付费未支付选择返回 -> 恢复弹窗
|
|
|
+ // if (options.studyWithCatalgue) {
|
|
|
+ // // 展开弹窗
|
|
|
+ // nextTick(() => {
|
|
|
+ // catalogueRef.value.showPopup({zhangId: infoData.zhangId});
|
|
|
+ // })
|
|
|
+ // }
|
|
|
} else {
|
|
|
zhangId.value = options.zhangId
|
|
|
nianji.value = options.nianji
|
|
@@ -223,15 +220,14 @@
|
|
|
}
|
|
|
|
|
|
function getZhangInfo(data) {
|
|
|
- let req = {
|
|
|
- nianji: selectZhang.value.nianji,
|
|
|
- cardId: selectZhang.value.cardId,
|
|
|
- zhangId: selectZhang.value.zhangId,
|
|
|
+ let req = {
|
|
|
+ levelId:7
|
|
|
}
|
|
|
userZhangInfo(req).then(res => {
|
|
|
cacheManager.set('zhangInfo', res.data)
|
|
|
- let zhang = cacheManager.get('zhangInfo').zhangList.findIndex(zhang => zhang.zhangId == selectZhang
|
|
|
- .value.zhangId);
|
|
|
+ let zhang = cacheManager.get('zhangInfo').zhangList.findIndex(zhang => zhang.zhangId == localAuth
|
|
|
+ .value.zhangId);
|
|
|
+ console.log('zhang',zhang);
|
|
|
if (zhang != -1) {
|
|
|
cacheManager.updateObject('auth', {
|
|
|
currentZhang: zhang
|
|
@@ -271,10 +267,10 @@
|
|
|
|
|
|
function recordZhangJie() {
|
|
|
let req = {
|
|
|
- nianji: selectZhang.value.nianji,
|
|
|
+ levelId: levelId.value,
|
|
|
userId: cacheManager.get('auth').userId,
|
|
|
zhangId: infoData.zhangId,
|
|
|
- cardId: selectZhang.value.cardId,
|
|
|
+ subjectId: currentProduct.value
|
|
|
|
|
|
}
|
|
|
userLocate(req).then(res => {
|
|
@@ -290,7 +286,6 @@
|
|
|
|
|
|
function handleChangeZhang(data) {
|
|
|
console.log(data);
|
|
|
- selectZhang.value = data;
|
|
|
const authCode = getUserIdentity();
|
|
|
if (authCode !== 'Visitor') {
|
|
|
cacheManager.updateObject('auth', {
|
|
@@ -333,30 +328,31 @@
|
|
|
})
|
|
|
} else {
|
|
|
uni.redirectTo({
|
|
|
- url: '/pages/study/lookShipin?jieId=' + data.jieId
|
|
|
+ url: '/pages/study/lookShipin?jieId=' + data.jieId + '&levelId=' + 7 + '&typeId=' + 2 + '&subjectId=' + 1
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function translateData(data) {
|
|
|
- gradeTerm.value = termMapping[data.cardId] +' · '+ gradeMapping[data.nianji]
|
|
|
+ // gradeTerm.value = termMapping[data.subjectId] +' · '+ data.levelName
|
|
|
+ gradeTerm.value = data.levelName
|
|
|
}
|
|
|
|
|
|
function listClick(data,data2,index) {
|
|
|
- //debugger
|
|
|
- console.log('data',data);
|
|
|
- console.log('data2',data2);
|
|
|
- if ((!cacheManager.get('auth') && data2.number != 1)||(!cacheManager.get('auth') && data.type == 2) ) {
|
|
|
+ console.log('data',data);// 节内容
|
|
|
+ console.log('data2',data2); //章内容
|
|
|
+ if (!cacheManager.get('auth') ) {
|
|
|
youkeDialogRef.value.handleShow();
|
|
|
return;
|
|
|
}
|
|
|
const authCode = getUserIdentity();
|
|
|
console.log('authCode', authCode);
|
|
|
- if (!(authCode == 'VIP' || data2.number == 1)) {
|
|
|
+ if (!(authCode == 'VIP' || data.firstFlag == 1)) {
|
|
|
// debugger
|
|
|
goPayDialogRef.value.handleShow();
|
|
|
return false
|
|
|
- }
|
|
|
+ }
|
|
|
+ return
|
|
|
if (data.type == 2) {
|
|
|
// 最后一项
|
|
|
goKaoshi(data,index)
|