|
@@ -1,40 +1,44 @@
|
|
|
<template>
|
|
|
<uni-popup ref="popupRef" :animation="false" :is-mask-click="false"
|
|
|
- mask-background-color="rgba(255, 255, 255, 0.6);" :is-shadow="false">
|
|
|
- <scroll-view :scroll-y="true" :scroll-top="scrollTop" class="ezy-catalogue-dialog"
|
|
|
- :style="{backgroundImage: 'url(' + catalogueBjFun() + ')'}">
|
|
|
+ mask-background-color="rgba(255, 255, 255, 0.6);" :is-shadow="false">
|
|
|
+ <scroll-view :scroll-y="true" :scroll-top="scrollTop" class="ezy-catalogue-dialog"
|
|
|
+ :style="{backgroundImage: 'url(' + catalogueBjFun() + ')'}">
|
|
|
<uni-icons @click="handleClose" class="catalogue-close-btn"></uni-icons>
|
|
|
<!-- 当前上下册只针对数学 -->
|
|
|
<view v-if="cardId == 1" class="catalogue-nianji-title">L{{nianji}}上</view>
|
|
|
<!-- 目录区域 -->
|
|
|
- <uni-collapse v-model="activeCollapse" class="ezy-catalogue-collapse" :class="{ 'ezy-catalogue-collapse-vip': AuthCode === 'VIP'}" accordion>
|
|
|
+ <uni-collapse v-model="activeCollapse" class="ezy-catalogue-collapse"
|
|
|
+ :class="{ 'ezy-catalogue-collapse-vip': AuthCode === 'VIP'}" accordion>
|
|
|
<template v-for="(item,index) in list">
|
|
|
<!-- 当前上下册只针对数学 -->
|
|
|
- <view v-if="cardId == 1 && index == shuxueShangxia" class="catalogue-nianji-title catalogue-mt">L{{nianji}}下</view>
|
|
|
- <uni-collapse-item title-border="none" :border="false" :name="index+''"
|
|
|
- class="collapse-item-box" :class="{ 'collapse-active': activeCollapse === index+''}">
|
|
|
+ <view v-if="cardId == 1 && index == shuxueShangxia" class="catalogue-nianji-title catalogue-mt">
|
|
|
+ L{{nianji}}下</view>
|
|
|
+ <uni-collapse-item title-border="none" :border="false" :name="index+''" class="collapse-item-box"
|
|
|
+ :class="{ 'collapse-active': activeCollapse === index+''}">
|
|
|
<template v-slot:title>
|
|
|
- <view @click.stop="handleSelectZhang(item,index)" class="collapse-title">
|
|
|
- <view class="collapse-num-box">{{index+1}}</view>
|
|
|
- <!-- 章名 -->
|
|
|
- <text class="collapse-name">{{item.zhangName}}</text>
|
|
|
- <!-- 锁 -->
|
|
|
- <template v-if="AuthCode !== 'VIP'">
|
|
|
- <view class="collapse-lock" v-if="index!=0"></view>
|
|
|
- </template>
|
|
|
- </view>
|
|
|
+ <view @click.stop="handleSelectZhang(item,index)" class="collapse-title">
|
|
|
+ <view class="collapse-num-box">{{index+1}}</view>
|
|
|
+ <!-- 章名 -->
|
|
|
+ <text class="collapse-name">{{item.zhangName}}</text>
|
|
|
+ <!-- 锁 -->
|
|
|
+ <template v-if="AuthCode !== 'VIP'">
|
|
|
+ <view class="collapse-lock" v-if="index!=0"></view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
</template>
|
|
|
<view class="collapse-content-box">
|
|
|
- <view v-for="(jie,cindex) in item.jieList" class="collapse-content-item" @click="handleJieClick(item,jie,index,cindex)">
|
|
|
- <text class="jie-index">{{`${index+1}.${cindex+1}`}}</text>
|
|
|
- <text class="text">{{jie.jieName}}</text>
|
|
|
- </view>
|
|
|
+ <view v-for="(jie,cindex) in item.jieList" class="collapse-content-item"
|
|
|
+ @click="handleJieClick(item,jie,index,cindex)">
|
|
|
+ <text class="jie-index">{{`${index+1}.${cindex+1}`}}</text>
|
|
|
+ <text class="text">{{jie.jieName}}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</uni-collapse-item>
|
|
|
</template>
|
|
|
</uni-collapse>
|
|
|
- <tip-small-dialog ref="confirmDialogRef" @confirm-btn="handleConfirmPay" :content="Message"></tip-small-dialog>
|
|
|
- <tip-middle-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" :content="MESSAGE_VISITER_TO_LOGIN"></tip-middle-dialog>
|
|
|
+ <tip-small-dialog ref="confirmDialogRef" @confirm-btn="handleConfirmPay"
|
|
|
+ :content="Message"></tip-small-dialog>
|
|
|
+ <tip-big-dialog ref="youkeDialogRef" @confirm-btn="ykConfirm" imgShow="false"></tip-big-dialog>
|
|
|
</scroll-view>
|
|
|
</uni-popup>
|
|
|
</template>
|
|
@@ -44,21 +48,29 @@
|
|
|
useCatalogue
|
|
|
} from './useCatalogue';
|
|
|
import {
|
|
|
- ref,nextTick
|
|
|
+ ref,
|
|
|
+ nextTick
|
|
|
} from "vue";
|
|
|
import {
|
|
|
toast
|
|
|
} from "@/utils/common.js"
|
|
|
- import {getUserIdentity} from "@/utils/common.js"
|
|
|
- import {MESSAGE_VISITER_TO_LOGIN,MESSAGE_BEFORE_PAY} from "@/utils/constant.js"
|
|
|
+ import {
|
|
|
+ getUserIdentity
|
|
|
+ } from "@/utils/common.js"
|
|
|
+ import {
|
|
|
+ MESSAGE_VISITER_TO_LOGIN,
|
|
|
+ MESSAGE_BEFORE_PAY
|
|
|
+ } from "@/utils/constant.js"
|
|
|
import tipSmallDialog from '@/components/dialog/tipSmallDialog.vue'
|
|
|
import tipMiddleDialog from '@/components/dialog/tipMiddleDialog.vue';
|
|
|
+ import tipBigDialog from '@/components/dialog/tipBigDialog.vue';
|
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
|
import {
|
|
|
- onShow,onLoad
|
|
|
+ onShow,
|
|
|
+ onLoad
|
|
|
} from '@dcloudio/uni-app';
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
const ShuxueObj = {
|
|
|
1: 6,
|
|
|
2: 6,
|
|
@@ -67,36 +79,38 @@
|
|
|
5: 11,
|
|
|
6: 12,
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
const growthType = ref(null);
|
|
|
const AuthCode = ref(null);
|
|
|
const scrollTop = ref(0)
|
|
|
const cardId = ref(null)
|
|
|
const shuxueShangxia = ref(0);
|
|
|
const nianji = ref(null);
|
|
|
-
|
|
|
+
|
|
|
onShow(() => AuthCode.value = getUserIdentity()); // 用户身份
|
|
|
onLoad((options) => {
|
|
|
if (cacheManager.get('auth')) {
|
|
|
- cardId.value = cacheManager.get('auth').cardId;
|
|
|
+ cardId.value = cacheManager.get('auth').cardId;
|
|
|
} else {
|
|
|
- cardId.value = options.cardId;
|
|
|
+ cardId.value = options.cardId;
|
|
|
}
|
|
|
if (cardId.value == 1) {
|
|
|
if (cacheManager.get('auth')) {
|
|
|
- nianji.value = cacheManager.get('auth').nianji;
|
|
|
+ nianji.value = cacheManager.get('auth').nianji;
|
|
|
} else {
|
|
|
nianji.value = options.nianji;
|
|
|
}
|
|
|
shuxueShangxia.value = ShuxueObj[nianji.value];
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
|
|
|
const $emit = defineEmits(['change-zhang'])
|
|
|
|
|
|
- const { getCatalogue} = useCatalogue();
|
|
|
+ const {
|
|
|
+ getCatalogue
|
|
|
+ } = useCatalogue();
|
|
|
|
|
|
const popupRef = ref(null); // 索引
|
|
|
const confirmDialogRef = ref(null);
|
|
@@ -110,12 +124,12 @@
|
|
|
type: Array,
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- function handleJieClick(item,jie,index,cindex) {
|
|
|
+
|
|
|
+ function handleJieClick(item, jie, index, cindex) {
|
|
|
selectZhang.value = item;
|
|
|
if (index == 0) {
|
|
|
// 全员可访问 第一章 第一节
|
|
|
- this.$emit('listSelectJieClick', item,jie,cindex);
|
|
|
+ this.$emit('listSelectJieClick', item, jie, cindex);
|
|
|
return;
|
|
|
}
|
|
|
if (AuthCode.value == 'Visitor') {
|
|
@@ -128,27 +142,27 @@
|
|
|
confirmDialogRef.value.handleShow();
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Vip
|
|
|
- this.$emit('listSelectJieClick', item,jie, cindex);
|
|
|
+ this.$emit('listSelectJieClick', item, jie, cindex);
|
|
|
}
|
|
|
|
|
|
- function catalogueBjFun(){
|
|
|
- if(cardId.value ==1){
|
|
|
+ function catalogueBjFun() {
|
|
|
+ if (cardId.value == 1) {
|
|
|
// 数学
|
|
|
return 'static/images/catalog/catalog-shuxue-bj.png'
|
|
|
- }else if(cardId.value ==2){
|
|
|
+ } else if (cardId.value == 2) {
|
|
|
// 英语
|
|
|
return 'static/images/catalog/catalog-yingyu-bj.png'
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function ykConfirm() {
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/login/index'
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* @summary 展示弹窗 暴露函数
|
|
|
*/
|
|
@@ -160,19 +174,21 @@
|
|
|
activeCollapse.value = '';
|
|
|
// 滚动高度
|
|
|
callback = () => {
|
|
|
- console.log('uni.getTopWindowStyle()',uni.getSystemInfoSync().screenWidth)
|
|
|
+ console.log('uni.getTopWindowStyle()', uni.getSystemInfoSync().screenWidth)
|
|
|
if (cardId.value == 2) {
|
|
|
// 英语
|
|
|
- activeCollapse.value = index+'';
|
|
|
- scrollTop.value = (uni.getSystemInfoSync().screenWidth/750)* 50 * index;
|
|
|
+ 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;
|
|
|
+ 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;
|
|
|
+ activeCollapse.value = index + '';
|
|
|
+ scrollTop.value = (uni.getSystemInfoSync().screenWidth / 750) * 50 * index + (uni
|
|
|
+ .getSystemInfoSync().screenWidth / 750) * 50 * 2;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -187,9 +203,9 @@
|
|
|
function handleShow(callback) {
|
|
|
popupRef.value.open('center');
|
|
|
if (callback) {
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
- setTimeout(() => callback(),50)
|
|
|
+ setTimeout(() => callback(), 50)
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -202,15 +218,15 @@
|
|
|
* @summary 选中
|
|
|
* @param({zhangId:string}) data
|
|
|
*/
|
|
|
- function handleSelectZhang(data,index) {
|
|
|
+ function handleSelectZhang(data, index) {
|
|
|
selectZhang.value = data;
|
|
|
- if(index !=0 && AuthCode.value == 'Visitor'){
|
|
|
+ if (index != 0 && AuthCode.value == 'Visitor') {
|
|
|
// 游客
|
|
|
youkeDialogRef.value.handleShow();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(index !=0 && AuthCode.value == 'Not-Vip'){
|
|
|
+ if (index != 0 && AuthCode.value == 'Not-Vip') {
|
|
|
// 非VIP
|
|
|
confirmDialogRef.value.handleShow();
|
|
|
return;
|
|
@@ -218,11 +234,15 @@
|
|
|
$emit('change-zhang', Object.assign({}, data));
|
|
|
handleClose();
|
|
|
}
|
|
|
+
|
|
|
function handleConfirmPay() {
|
|
|
- const url = `/pages/pay/svip?cardId=${cardId.value}&formPage=studyWithCatalgue&selectZhangId=${selectZhang.value.zhangId}`
|
|
|
- uni.redirectTo({ url })
|
|
|
+ const url =
|
|
|
+ `/pages/pay/svip?cardId=${cardId.value}&formPage=studyWithCatalgue&selectZhangId=${selectZhang.value.zhangId}`
|
|
|
+ uni.redirectTo({
|
|
|
+ url
|
|
|
+ })
|
|
|
}
|
|
|
defineExpose({
|
|
|
showPopup
|
|
|
})
|
|
|
-</script>
|
|
|
+</script>
|