|
@@ -12,7 +12,8 @@
|
|
<template v-for="(item,index) in list">
|
|
<template v-for="(item,index) in list">
|
|
<!-- 当前上下册只针对数学 -->
|
|
<!-- 当前上下册只针对数学 -->
|
|
<view v-if="subjectId == 1 && index == shuxueShangxia" class="catalogue-nianji-title catalogue-mt">
|
|
<view v-if="subjectId == 1 && index == shuxueShangxia" class="catalogue-nianji-title catalogue-mt">
|
|
- {{jieTexts ? jieTexts[1]: ''}}</view>
|
|
|
|
|
|
+ {{jieTexts ? jieTexts[1]: ''}}
|
|
|
|
+ </view>
|
|
<uni-collapse-item title-border="none" :border="false" :name="index+''" class="collapse-item-box"
|
|
<uni-collapse-item title-border="none" :border="false" :name="index+''" class="collapse-item-box"
|
|
:class="{ 'collapse-active': activeCollapse === index+''}">
|
|
:class="{ 'collapse-active': activeCollapse === index+''}">
|
|
<template v-slot:title>
|
|
<template v-slot:title>
|
|
@@ -66,7 +67,7 @@
|
|
onLoad
|
|
onLoad
|
|
} from '@dcloudio/uni-app';
|
|
} from '@dcloudio/uni-app';
|
|
|
|
|
|
- // 旧道,上下分册 LevelId
|
|
|
|
|
|
+ // 旧道,上下分册 LevelId
|
|
const ShuxueObj = {
|
|
const ShuxueObj = {
|
|
7: 6,
|
|
7: 6,
|
|
8: 6,
|
|
8: 6,
|
|
@@ -83,13 +84,16 @@
|
|
const subjectId = ref(null)
|
|
const subjectId = ref(null)
|
|
const shuxueShangxia = ref(0);
|
|
const shuxueShangxia = ref(0);
|
|
const levelId = ref(null);
|
|
const levelId = ref(null);
|
|
|
|
+ const typeId = ref(null);
|
|
|
|
|
|
onShow(() => AuthCode.value = getUserIdentity()); // 用户身份
|
|
onShow(() => AuthCode.value = getUserIdentity()); // 用户身份
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
if (cacheManager.get('auth')) {
|
|
if (cacheManager.get('auth')) {
|
|
subjectId.value = cacheManager.get('auth').subjectId;
|
|
subjectId.value = cacheManager.get('auth').subjectId;
|
|
|
|
+ typeId.value = cacheManager.get('auth').typeId;
|
|
} else {
|
|
} else {
|
|
subjectId.value = options.subjectId;
|
|
subjectId.value = options.subjectId;
|
|
|
|
+ typeId.value = options.typeId;
|
|
}
|
|
}
|
|
if (subjectId.value == 1) {
|
|
if (subjectId.value == 1) {
|
|
if (cacheManager.get('auth')) {
|
|
if (cacheManager.get('auth')) {
|
|
@@ -114,8 +118,8 @@
|
|
const Message = MESSAGE_BEFORE_PAY;
|
|
const Message = MESSAGE_BEFORE_PAY;
|
|
const youkeDialogRef = ref(null);
|
|
const youkeDialogRef = ref(null);
|
|
const selectZhang = ref(null);
|
|
const selectZhang = ref(null);
|
|
- const list = ref([])
|
|
|
|
- const jieTexts = ref([])
|
|
|
|
|
|
+ const list = ref([])
|
|
|
|
+ const jieTexts = ref([])
|
|
|
|
|
|
function handleJieClick(item, jie, index, cindex) {
|
|
function handleJieClick(item, jie, index, cindex) {
|
|
selectZhang.value = item;
|
|
selectZhang.value = item;
|
|
@@ -125,11 +129,17 @@
|
|
}
|
|
}
|
|
|
|
|
|
function catalogueBjFun() {
|
|
function catalogueBjFun() {
|
|
- if (subjectId.value == 1) {
|
|
|
|
- // 数学
|
|
|
|
|
|
+ if (subjectId.value == 1 && typeId.value == 1) {
|
|
|
|
+ // 数学 新
|
|
|
|
+ return 'static/images/catalog/catalog-shuxue-bj.png'
|
|
|
|
+ } else if (subjectId.value == 1 && typeId.value == 2) {
|
|
|
|
+ // 英语 旧
|
|
return 'static/images/catalog/catalog-shuxue-bj.png'
|
|
return 'static/images/catalog/catalog-shuxue-bj.png'
|
|
- } else if (subjectId.value == 2) {
|
|
|
|
- // 英语
|
|
|
|
|
|
+ } else if (subjectId.value == 2 && typeId.value == 2) {
|
|
|
|
+ // 英语 旧
|
|
|
|
+ return 'static/images/catalog/catalog-yingyu-bj.png'
|
|
|
|
+ } else if (subjectId.value == 2 && typeId.value == 1) {
|
|
|
|
+ // 英语 新
|
|
return 'static/images/catalog/catalog-yingyu-bj.png'
|
|
return 'static/images/catalog/catalog-yingyu-bj.png'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -147,62 +157,68 @@
|
|
handleShow(data);
|
|
handleShow(data);
|
|
}
|
|
}
|
|
|
|
|
|
- function getFormatZhangListByArray(data) {
|
|
|
|
|
|
+ function getFormatZhangListByArray(data) {
|
|
|
|
|
|
- const myList = data.reduce((acc, curr) => acc.concat(curr.zhangList || []), [])
|
|
|
|
|
|
+ const myList = data.reduce((acc, curr) => acc.concat(curr.zhangList || []), [])
|
|
|
|
|
|
- const jiedian = data[0].zhangList.length;
|
|
|
|
|
|
+ const jiedian = data[0].zhangList.length;
|
|
|
|
|
|
- return {
|
|
|
|
- myList,
|
|
|
|
- jiedian,
|
|
|
|
- jieText: data.map(item => item.lable)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ return {
|
|
|
|
+ myList,
|
|
|
|
+ jiedian,
|
|
|
|
+ jieText: data.map(item => item.lable)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* @summary 展示目录弹窗
|
|
* @summary 展示目录弹窗
|
|
*/
|
|
*/
|
|
function handleShow(data) {
|
|
function handleShow(data) {
|
|
- getCatalogue().then(([err, wlist]) => {
|
|
|
|
- if (err) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- const {myList,jiedian, jieText} = getFormatZhangListByArray(wlist)
|
|
|
|
- list.value = myList;
|
|
|
|
- if (list.value) {
|
|
|
|
- jieTexts.value = jieText;
|
|
|
|
- shuxueShangxia.value = jiedian;
|
|
|
|
- if (data) {
|
|
|
|
- let callback = null;
|
|
|
|
- const index = myList.findIndex(item => item.zhangId == data.zhangId);
|
|
|
|
- scrollTop.value = 0;
|
|
|
|
- activeCollapse.value = '';
|
|
|
|
- // 滚动高度
|
|
|
|
- callback = () => {
|
|
|
|
- console.log('uni.getTopWindowStyle()', uni.getSystemInfoSync().screenWidth)
|
|
|
|
- if (subjectId.value == 2) {
|
|
|
|
- // 英语
|
|
|
|
- activeCollapse.value = index + '';
|
|
|
|
- scrollTop.value = (uni.getSystemInfoSync().screenWidth / 750) * 50 * index;
|
|
|
|
- } else {
|
|
|
|
- // 数学
|
|
|
|
- if (index < shuxueShangxia.value) {
|
|
|
|
- activeCollapse.value = index + '';
|
|
|
|
- scrollTop.value = (uni.getSystemInfoSync().screenWidth / 750) * 50 * index + (uni
|
|
|
|
- .getSystemInfoSync().screenWidth / 750) * 50;
|
|
|
|
- } else {
|
|
|
|
- activeCollapse.value = index + '';
|
|
|
|
- scrollTop.value = (uni.getSystemInfoSync().screenWidth / 750) * 50 * index + (uni
|
|
|
|
- .getSystemInfoSync().screenWidth / 750) * 50 * 2;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- setTimeout(() => callback(), 50)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- popupRef.value.open('center');
|
|
|
|
- })
|
|
|
|
|
|
+ getCatalogue().then(([err, wlist]) => {
|
|
|
|
+ if (err) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const {
|
|
|
|
+ myList,
|
|
|
|
+ jiedian,
|
|
|
|
+ jieText
|
|
|
|
+ } = getFormatZhangListByArray(wlist)
|
|
|
|
+ list.value = myList;
|
|
|
|
+ if (list.value) {
|
|
|
|
+ jieTexts.value = jieText;
|
|
|
|
+ shuxueShangxia.value = jiedian;
|
|
|
|
+ if (data) {
|
|
|
|
+ let callback = null;
|
|
|
|
+ const index = myList.findIndex(item => item.zhangId == data.zhangId);
|
|
|
|
+ scrollTop.value = 0;
|
|
|
|
+ activeCollapse.value = '';
|
|
|
|
+ // 滚动高度
|
|
|
|
+ callback = () => {
|
|
|
|
+ console.log('uni.getTopWindowStyle()', uni.getSystemInfoSync().screenWidth)
|
|
|
|
+ if (subjectId.value == 2) {
|
|
|
|
+ // 英语
|
|
|
|
+ activeCollapse.value = index + '';
|
|
|
|
+ scrollTop.value = (uni.getSystemInfoSync().screenWidth / 750) * 50 * index;
|
|
|
|
+ } else {
|
|
|
|
+ // 数学
|
|
|
|
+ if (index < shuxueShangxia.value) {
|
|
|
|
+ activeCollapse.value = index + '';
|
|
|
|
+ scrollTop.value = (uni.getSystemInfoSync().screenWidth / 750) * 50 * index + (
|
|
|
|
+ uni
|
|
|
|
+ .getSystemInfoSync().screenWidth / 750) * 50;
|
|
|
|
+ } else {
|
|
|
|
+ activeCollapse.value = index + '';
|
|
|
|
+ scrollTop.value = (uni.getSystemInfoSync().screenWidth / 750) * 50 * index + (
|
|
|
|
+ uni
|
|
|
|
+ .getSystemInfoSync().screenWidth / 750) * 50 * 2;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ setTimeout(() => callback(), 50)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ popupRef.value.open('center');
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|