|
@@ -13,11 +13,8 @@
|
|
<!-- 星星 -->
|
|
<!-- 星星 -->
|
|
<view class="brand-finish-icon" v-if="item.studyFlag===1"></view>
|
|
<view class="brand-finish-icon" v-if="item.studyFlag===1"></view>
|
|
<!-- 动物类型 -->
|
|
<!-- 动物类型 -->
|
|
- <view v-if="item.daeFlag && growthType ==0" class="animal-img dan-img"></view>
|
|
|
|
- <view v-if="item.daeFlag && growthType ==1" class="animal-img xiao-e-img"></view>
|
|
|
|
- <view v-if="item.daeFlag && growthType ==2" class="animal-img zhong-e-img"></view>
|
|
|
|
- <view v-if="item.daeFlag && growthType ==3" class="animal-img da-e-img"></view>
|
|
|
|
- <view class="icon-content-box">
|
|
|
|
|
|
+ <view v-if="item.daeFlag &&animalNum == index" :class="currentGrowth()"></view>
|
|
|
|
+ <view class="icon-content-box">
|
|
<!-- 序号 -->
|
|
<!-- 序号 -->
|
|
<view class="brand-icon" v-if="item.studyFlag===0">{{ item.number }}</view>
|
|
<view class="brand-icon" v-if="item.studyFlag===0">{{ item.number }}</view>
|
|
<!-- 节名称 -->
|
|
<!-- 节名称 -->
|
|
@@ -28,17 +25,14 @@
|
|
<!-- 锁 -->
|
|
<!-- 锁 -->
|
|
<view v-if="item.firstFlag !='1'" class="brand-lock"></view>
|
|
<view v-if="item.firstFlag !='1'" class="brand-lock"></view>
|
|
<!-- 动物类型 -->
|
|
<!-- 动物类型 -->
|
|
- <view v-if="item.daeFlag && growthType ==0" class="animal-img dan-img"></view>
|
|
|
|
- <view v-if="item.daeFlag && growthType ==1" class="animal-img xiao-e-img"></view>
|
|
|
|
- <view v-if="item.daeFlag && growthType ==2" class="animal-img zhong-e-img"></view>
|
|
|
|
- <view v-if="item.daeFlag && growthType ==3" class="animal-img da-e-img"></view>
|
|
|
|
- <view class="icon-content-box">
|
|
|
|
|
|
+ <view v-if="item.daeFlag && animalNum == index" :class="currentGrowth()"></view>
|
|
|
|
+ <view class="icon-content-box">
|
|
<!-- 序号 -->
|
|
<!-- 序号 -->
|
|
<view class="brand-icon">{{ item.number }}</view>
|
|
<view class="brand-icon">{{ item.number }}</view>
|
|
<!-- 节名称 -->
|
|
<!-- 节名称 -->
|
|
<view class="brand-content"> {{ item.jieName }} </view>
|
|
<view class="brand-content"> {{ item.jieName }} </view>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -52,6 +46,7 @@
|
|
ref,
|
|
ref,
|
|
watch,
|
|
watch,
|
|
getCurrentInstance,
|
|
getCurrentInstance,
|
|
|
|
+ nextTick,
|
|
onMounted
|
|
onMounted
|
|
} from "vue";
|
|
} from "vue";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
@@ -59,11 +54,11 @@
|
|
toast,
|
|
toast,
|
|
getUserIdentity
|
|
getUserIdentity
|
|
} from "@/utils/common";
|
|
} from "@/utils/common";
|
|
- import {
|
|
|
|
- onShow
|
|
|
|
- } from '@dcloudio/uni-app';
|
|
|
|
- const growthType = ref(null);
|
|
|
|
- onShow(() => growthType.value = cacheManager.get('auth').growthType)
|
|
|
|
|
|
+ import {
|
|
|
|
+ onShow
|
|
|
|
+ } from '@dcloudio/uni-app';
|
|
|
|
+ const growthType = ref(null);
|
|
|
|
+ onShow(() => growthType.value = cacheManager.get('auth').growthType)
|
|
|
|
|
|
const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
|
|
const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -93,49 +88,67 @@
|
|
let isSliding = ref(false);
|
|
let isSliding = ref(false);
|
|
let endX = ref(0);
|
|
let endX = ref(0);
|
|
let gradeTerm = ref('');
|
|
let gradeTerm = ref('');
|
|
-
|
|
|
|
|
|
+ let animalNum = ref(0);
|
|
|
|
|
|
function clickGradeTerm() {
|
|
function clickGradeTerm() {
|
|
$emit('clickGradeTerm');
|
|
$emit('clickGradeTerm');
|
|
}
|
|
}
|
|
|
|
|
|
- function listClick(data) {
|
|
|
|
- $emit('listClick', data);
|
|
|
|
|
|
+ function listClick(data,index) {
|
|
|
|
+ data.daeFlag = true
|
|
|
|
+ nextTick(() => {
|
|
|
|
+ animalNum.value = index
|
|
|
|
+ })
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ $emit('listClick', data);
|
|
|
|
+ }, 1000)
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function currentGrowth(data) {
|
|
|
|
+ if (growthType.value == 0) {
|
|
|
|
+ return 'animal-img dan-img'
|
|
|
|
+ } else if (growthType.value == 2) {
|
|
|
|
+ return 'animal-img xiao-e-img'
|
|
|
|
+ } else if (growthType.value == 3) {
|
|
|
|
+ return 'animal-img zhong-e-img'
|
|
|
|
+ } else {
|
|
|
|
+ return 'animal-img da-e-img'
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
// 章换行显示
|
|
// 章换行显示
|
|
- function getZhangContent(data){
|
|
|
|
- console.log(data.length,'data.length');
|
|
|
|
|
|
+ function getZhangContent(data) {
|
|
|
|
+ console.log(data.length, 'data.length');
|
|
let length = data.length;
|
|
let length = data.length;
|
|
// 初始将字符串平分成两半
|
|
// 初始将字符串平分成两半
|
|
- let halfLength = Math.floor(length / 2);
|
|
|
|
-
|
|
|
|
|
|
+ let halfLength = Math.floor(length / 2);
|
|
|
|
+
|
|
// 插入换行符
|
|
// 插入换行符
|
|
let firstLine = data.slice(0, halfLength);
|
|
let firstLine = data.slice(0, halfLength);
|
|
let secondLine = data.slice(halfLength);
|
|
let secondLine = data.slice(halfLength);
|
|
- console.log(firstLine + '\n' + secondLine,'firstLine + + secondLine');
|
|
|
|
|
|
+ console.log(firstLine + '\n' + secondLine, 'firstLine + + secondLine');
|
|
return firstLine + '\n' + secondLine;
|
|
return firstLine + '\n' + secondLine;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// 获取节class
|
|
// 获取节class
|
|
- function getClass (data,index,isVip){
|
|
|
|
|
|
+ function getClass(data, index, isVip) {
|
|
let brandActive = '';
|
|
let brandActive = '';
|
|
- if(isVip==='VIP'){
|
|
|
|
|
|
+ if (isVip === 'VIP') {
|
|
brandActive = 'brand-active';
|
|
brandActive = 'brand-active';
|
|
- }else if(data[index].firstFlag==1){
|
|
|
|
|
|
+ } else if (data[index].firstFlag == 1) {
|
|
brandActive = 'brand-active';
|
|
brandActive = 'brand-active';
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
brandActive = '';
|
|
brandActive = '';
|
|
}
|
|
}
|
|
- let indexLast = data.length -1;
|
|
|
|
|
|
+ let indexLast = data.length - 1;
|
|
// 判断最后一个为名称是否为单元测试,是单元测试则返回ceshi-jie
|
|
// 判断最后一个为名称是否为单元测试,是单元测试则返回ceshi-jie
|
|
- if(index===indexLast && data[data.length -1].jieName =='Testing'){
|
|
|
|
- return 'ceshi-brand-item' +' '+ brandActive;
|
|
|
|
- }else{
|
|
|
|
|
|
+ if (index === indexLast && data[data.length - 1].jieName == 'Testing') {
|
|
|
|
+ return 'ceshi-brand-item' + ' ' + brandActive;
|
|
|
|
+ } else {
|
|
return brandActive;
|
|
return brandActive;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
function handleCheckCatalogue() {
|
|
function handleCheckCatalogue() {
|
|
$emit('handleCheckCatalogue');
|
|
$emit('handleCheckCatalogue');
|
|
}
|
|
}
|
|
@@ -181,33 +194,31 @@
|
|
console.log('error');
|
|
console.log('error');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- function dataRecom(data){
|
|
|
|
- if(data&&data.jieList.length>0){
|
|
|
|
- data.jieList.some(item => {
|
|
|
|
- if (item.studyFlag == 0) {
|
|
|
|
- item.daeFlag = true;
|
|
|
|
- return true; // 返回 true 以终止 some 循环
|
|
|
|
- }
|
|
|
|
- return false;
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
|
|
+ function dataRecom(data) {
|
|
|
|
+ const index = data.jieList.findIndex(item => item.studyFlag == 0);
|
|
|
|
+
|
|
|
|
+ if (index !== -1) {
|
|
|
|
+ data.jieList[index].daeFlag = true;
|
|
|
|
+ animalNum.value = index
|
|
}
|
|
}
|
|
}
|
|
}
|
|
watch(() => props.options, (newVal, oldVal) => {
|
|
watch(() => props.options, (newVal, oldVal) => {
|
|
- // console.log('New options:', newVal);
|
|
|
|
- // console.log('Old options:', oldVal);
|
|
|
|
|
|
+ // console.log('New options:', newVal);
|
|
|
|
+ // console.log('Old options:', oldVal);
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
-
|
|
|
|
|
|
+
|
|
dataRecom(newVal)
|
|
dataRecom(newVal)
|
|
}, {
|
|
}, {
|
|
deep: true,
|
|
deep: true,
|
|
immediate: true
|
|
immediate: true
|
|
});
|
|
});
|
|
watch(() => props.gradeTerm, (newVal, oldVal) => {
|
|
watch(() => props.gradeTerm, (newVal, oldVal) => {
|
|
- // console.log('New options:', newVal);
|
|
|
|
- // console.log('Old options:', oldVal);
|
|
|
|
|
|
+ // console.log('New options:', newVal);
|
|
|
|
+ // console.log('Old options:', oldVal);
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
// 在这里可以根据新的 options 做一些操作,比如发起请求等
|
|
gradeTerm.value = newVal
|
|
gradeTerm.value = newVal
|
|
-
|
|
|
|
|
|
+
|
|
}, {
|
|
}, {
|
|
deep: true,
|
|
deep: true,
|
|
immediate: true
|
|
immediate: true
|