|
@@ -2,12 +2,12 @@
|
|
|
<view class="ezy-study-page ezy-cjdc-study-page">
|
|
<view class="ezy-study-page ezy-cjdc-study-page">
|
|
|
<view class="study-school-year" @click="clickGradeTerm">{{gradeTerm}}</view>
|
|
<view class="study-school-year" @click="clickGradeTerm">{{gradeTerm}}</view>
|
|
|
<view class="ezy-study-wrap" @touchstart="onTouchStart" @touchend="onTouchEnd">
|
|
<view class="ezy-study-wrap" @touchstart="onTouchStart" @touchend="onTouchEnd">
|
|
|
- <img class="study-name-img" :src="growthImg"/>
|
|
|
|
|
|
|
+ <img class="study-name-img" :src="growthImg" />
|
|
|
<!-- <img class="study-book-img" :src="bookImg"/> -->
|
|
<!-- <img class="study-book-img" :src="bookImg"/> -->
|
|
|
<view class="study-book-img" @click="handleCheckCatalogue">
|
|
<view class="study-book-img" @click="handleCheckCatalogue">
|
|
|
<view class="chapter-title-box">{{zhangName}}</view>
|
|
<view class="chapter-title-box">{{zhangName}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<!-- 动物类型 -->
|
|
<!-- 动物类型 -->
|
|
|
<view v-if="growthType!=null" :class="currentGrowth()"></view>
|
|
<view v-if="growthType!=null" :class="currentGrowth()"></view>
|
|
|
<view>
|
|
<view>
|
|
@@ -17,11 +17,11 @@
|
|
|
@click="listClick(item, index,options)" :class="getClass(options,index,isVip,item)">
|
|
@click="listClick(item, index,options)" :class="getClass(options,index,isVip,item)">
|
|
|
<view v-if="isVip === 'VIP'">
|
|
<view v-if="isVip === 'VIP'">
|
|
|
<!-- 序号 -->
|
|
<!-- 序号 -->
|
|
|
- <!-- <view class="brand-icon">{{ item.number }}</view> -->
|
|
|
|
|
|
|
+ <!-- <view class="brand-icon">{{ item.number }}</view> -->
|
|
|
<!-- 星星 -->
|
|
<!-- 星星 -->
|
|
|
<view class="brand-finish-icon" v-if="item.studyFlag===1"></view>
|
|
<view class="brand-finish-icon" v-if="item.studyFlag===1"></view>
|
|
|
<!-- 箭头 -->
|
|
<!-- 箭头 -->
|
|
|
- <view class="brand-arrow" v-if="item.daeFlag &&animalNum == index"></view>
|
|
|
|
|
|
|
+ <view class="brand-arrow" v-if="animalNum == index"></view>
|
|
|
<!-- 节名称 -->
|
|
<!-- 节名称 -->
|
|
|
<view class="brand-content">
|
|
<view class="brand-content">
|
|
|
<view class="content-text">{{ item.jieName }}</view>
|
|
<view class="content-text">{{ item.jieName }}</view>
|
|
@@ -29,12 +29,12 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="isVip == 'Not-Vip'">
|
|
<view v-if="isVip == 'Not-Vip'">
|
|
|
<!-- 序号 -->
|
|
<!-- 序号 -->
|
|
|
- <!-- <view class="brand-icon">{{ item.number }}</view> -->
|
|
|
|
|
- <!-- 星星 -->
|
|
|
|
|
- <view class="brand-finish-icon" v-if="item.studyFlag===1"></view>
|
|
|
|
|
|
|
+ <!-- <view class="brand-icon">{{ item.number }}</view> -->
|
|
|
|
|
+ <!-- 星星 -->
|
|
|
|
|
+ <view class="brand-finish-icon" v-if="item.studyFlag===1"></view>
|
|
|
<view v-if="item.number !=1" class="brand-lock"></view>
|
|
<view v-if="item.number !=1" class="brand-lock"></view>
|
|
|
<!-- 箭头 -->
|
|
<!-- 箭头 -->
|
|
|
- <view v-if="item.daeFlag && animalNum == index && isVip != 'Visitor'" class="brand-arrow"></view>
|
|
|
|
|
|
|
+ <view v-if="animalNum == index && isVip != 'Visitor'" class="brand-arrow"></view>
|
|
|
<!-- 节名称 -->
|
|
<!-- 节名称 -->
|
|
|
<view class="brand-content">
|
|
<view class="brand-content">
|
|
|
<view class="content-text">{{ item.jieName }}</view>
|
|
<view class="content-text">{{ item.jieName }}</view>
|
|
@@ -43,11 +43,11 @@
|
|
|
</view>
|
|
</view>
|
|
|
<view v-if="isVip == 'Visitor'">
|
|
<view v-if="isVip == 'Visitor'">
|
|
|
<!-- 锁 -->
|
|
<!-- 锁 -->
|
|
|
- <!-- <view class="brand-icon">{{ item.number }} </view> -->
|
|
|
|
|
|
|
+ <!-- <view class="brand-icon">{{ item.number }} </view> -->
|
|
|
<!-- 锁 -->
|
|
<!-- 锁 -->
|
|
|
- <view v-if="item.number !=1" class="brand-lock"></view>
|
|
|
|
|
|
|
+ <view v-if="item.number !=1" class="brand-lock"></view>
|
|
|
<!-- 箭头 -->
|
|
<!-- 箭头 -->
|
|
|
- <view v-if="item.daeFlag && animalNum == index && isVip != 'Visitor'" class="brand-arrow"></view>
|
|
|
|
|
|
|
+ <view v-if="animalNum == index && isVip != 'Visitor'" class="brand-arrow"></view>
|
|
|
<!-- 节名称 -->
|
|
<!-- 节名称 -->
|
|
|
<view class="brand-content">
|
|
<view class="brand-content">
|
|
|
<view class="content-text">{{ item.jieName }} </view>
|
|
<view class="content-text">{{ item.jieName }} </view>
|
|
@@ -93,21 +93,29 @@
|
|
|
},
|
|
},
|
|
|
gradeTerm: {
|
|
gradeTerm: {
|
|
|
type: String,
|
|
type: String,
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ weizhiIndex: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ },
|
|
|
zhangName: {
|
|
zhangName: {
|
|
|
type: String,
|
|
type: String,
|
|
|
},
|
|
},
|
|
|
|
|
+ currentSwiperIndex: {
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ default: 0
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
onShow(() => {
|
|
onShow(() => {
|
|
|
- growthType.value = cacheManager.get('auth')?cacheManager.get('auth').growthType:props.youkeImage
|
|
|
|
|
- growthImg.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').icon : props.youkeImage;
|
|
|
|
|
- // 待修改 wgy看这
|
|
|
|
|
- bookImg.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').icon : props.youkeImage;
|
|
|
|
|
- youkeImageBook.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').zhangIcon : props.youkeImageBook;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ growthType.value = cacheManager.get('auth') ? cacheManager.get('auth').growthType : props.youkeImage
|
|
|
|
|
+ growthImg.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').icon : props.youkeImage;
|
|
|
|
|
+ // 待修改 wgy看这
|
|
|
|
|
+ bookImg.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').icon : props.youkeImage;
|
|
|
|
|
+ youkeImageBook.value = cacheManager.get('auth') ? cacheManager.get('zhangInfo').zhangIcon : props
|
|
|
|
|
+ .youkeImageBook;
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
const isVip = getUserIdentity();
|
|
const isVip = getUserIdentity();
|
|
|
- console.log('isVip',isVip);
|
|
|
|
|
|
|
+ console.log('isVip', isVip);
|
|
|
const gradeMapping = {
|
|
const gradeMapping = {
|
|
|
1: '一年级',
|
|
1: '一年级',
|
|
|
2: '二年级',
|
|
2: '二年级',
|
|
@@ -132,15 +140,22 @@
|
|
|
$emit('clickGradeTerm');
|
|
$emit('clickGradeTerm');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function listClick(data,index,data2) {
|
|
|
|
|
- data.daeFlag = true
|
|
|
|
|
|
|
+ function aaa() {
|
|
|
|
|
+ console.log('123123123');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function listClick(data, index, data2) {
|
|
|
|
|
+
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
animalNum.value = index
|
|
animalNum.value = index
|
|
|
})
|
|
})
|
|
|
|
|
+ cacheManager.updateObject('zhangInfo', {
|
|
|
|
|
+ weizhiIndex: index
|
|
|
|
|
+ })
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- $emit('listClick', data,data2,index);
|
|
|
|
|
|
|
+ $emit('listClick', data, data2, index);
|
|
|
}, 300)
|
|
}, 300)
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function currentGrowth(data) {
|
|
function currentGrowth(data) {
|
|
@@ -156,14 +171,14 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取节class
|
|
// 获取节class
|
|
|
- function getClass(data, index, isVip,item) {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ function getClass(data, index, isVip, item) {
|
|
|
|
|
+
|
|
|
let brandActive = '';
|
|
let brandActive = '';
|
|
|
if (isVip === 'VIP') {
|
|
if (isVip === 'VIP') {
|
|
|
brandActive = 'brand-active';
|
|
brandActive = 'brand-active';
|
|
|
- } else if (item.firstFlag == 1 && isVip =='Not-Vip') {
|
|
|
|
|
|
|
+ } else if (item.firstFlag == 1 && isVip == 'Not-Vip') {
|
|
|
brandActive = 'brand-active';
|
|
brandActive = 'brand-active';
|
|
|
- }else if (item.firstFlag == 1 && isVip =='Visitor' &&item.type ==1){
|
|
|
|
|
|
|
+ } else if (item.firstFlag == 1 && isVip == 'Visitor' && item.type == 1) {
|
|
|
brandActive = 'brand-active';
|
|
brandActive = 'brand-active';
|
|
|
} else {
|
|
} else {
|
|
|
brandActive = '';
|
|
brandActive = '';
|
|
@@ -182,7 +197,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function onTouchStart(event) {
|
|
function onTouchStart(event) {
|
|
|
- // console.log(event.touches.length);
|
|
|
|
|
|
|
+ // console.log(event.touches.length);
|
|
|
isSliding.value = false
|
|
isSliding.value = false
|
|
|
if (event.touches.length === 1) {
|
|
if (event.touches.length === 1) {
|
|
|
isSliding.value = true;
|
|
isSliding.value = true;
|
|
@@ -195,7 +210,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function onSwipeLeft(event) {
|
|
function onSwipeLeft(event) {
|
|
|
- // console.log('11111');
|
|
|
|
|
|
|
+ // console.log('11111');
|
|
|
if (cacheManager.get('auth')) {
|
|
if (cacheManager.get('auth')) {
|
|
|
$emit('onLeft');
|
|
$emit('onLeft');
|
|
|
}
|
|
}
|
|
@@ -224,29 +239,38 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function dataRecom(data) {
|
|
function dataRecom(data) {
|
|
|
- const index = data.jieList.findIndex(item => item.studyFlag == 0);
|
|
|
|
|
|
|
+ // const index = data.jieList.findIndex(item => item.studyFlag == 0);
|
|
|
|
|
|
|
|
- if (index !== -1) {
|
|
|
|
|
- data.jieList[index].daeFlag = true;
|
|
|
|
|
- animalNum.value = index
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (index !== -1) {
|
|
|
|
|
+ // data.jieList[index].daeFlag = true;
|
|
|
|
|
+ // animalNum.value = index
|
|
|
|
|
+ // }
|
|
|
|
|
+ animalNum.value = cacheManager.get("zhangInfo").weizhiIndex || 0
|
|
|
}
|
|
}
|
|
|
watch(() => props.options, (newVal, oldVal) => {
|
|
watch(() => props.options, (newVal, oldVal) => {
|
|
|
// console.log('New options:', newVal);
|
|
// console.log('New options:', newVal);
|
|
|
// console.log('Old options:', oldVal);
|
|
// console.log('Old options:', oldVal);
|
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
|
-
|
|
|
|
|
dataRecom(newVal)
|
|
dataRecom(newVal)
|
|
|
}, {
|
|
}, {
|
|
|
deep: true,
|
|
deep: true,
|
|
|
immediate: true
|
|
immediate: true
|
|
|
});
|
|
});
|
|
|
|
|
+ watch(
|
|
|
|
|
+ () => props.currentSwiperIndex,
|
|
|
|
|
+ (newVal, oldVal) => {
|
|
|
|
|
+ console.log('swiper 索引变化:', newVal)
|
|
|
|
|
+ animalNum.value =0
|
|
|
|
|
+ // 执行你的方法
|
|
|
|
|
+ //yourMethodName(newVal)
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
watch(() => props.gradeTerm, (newVal, oldVal) => {
|
|
watch(() => props.gradeTerm, (newVal, oldVal) => {
|
|
|
// console.log('New options:', newVal);
|
|
// console.log('New options:', newVal);
|
|
|
// console.log('Old options:', oldVal);
|
|
// console.log('Old options:', oldVal);
|
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
|
gradeTerm.value = newVal
|
|
gradeTerm.value = newVal
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}, {
|
|
}, {
|
|
|
deep: true,
|
|
deep: true,
|
|
|
immediate: true
|
|
immediate: true
|