|
@@ -8,19 +8,19 @@
|
|
<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
|
|
<view class="brand-item" v-for="(item, index) in options.jieList" :key="item.jieId"
|
|
@click="listClick(item, index)" :class="{ 'brand-active': index === 0 }">
|
|
@click="listClick(item, index)" :class="{ 'brand-active': index === 0 }">
|
|
<view class="brand-icon">
|
|
<view class="brand-icon">
|
|
- <template v-if="item.vipFlag">{{ index + 1 }}</template>
|
|
|
|
- <template v-else-if="index === 0">1</template>
|
|
|
|
|
|
+ {{ item.number }}
|
|
</view>
|
|
</view>
|
|
- <view class="brand-lock" v-if="item.vipFlag==0 && index !== 0"></view>
|
|
|
|
- <view class="brand-growth">
|
|
|
|
- <template v-if="item.vipFlag ==1">
|
|
|
|
- <template v-if="item.growth === 0">蛋</template>
|
|
|
|
- <template v-else-if="item.growth === 10">小鹅</template>
|
|
|
|
- <template v-else-if="item.growth === 20">中鹅</template>
|
|
|
|
- <template v-else-if="item.growth === 50">大鹅</template>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <view v-if="item.daeFlag">
|
|
|
|
+ <template v-if="growthType ==0">蛋</template>
|
|
|
|
+ <template v-if="growthType ==1">小鹅</template>
|
|
|
|
+ <template v-if="growthType ==2">中鹅</template>
|
|
|
|
+ <template v-if="growthType ==3">大鹅</template>
|
|
|
|
+ </view>
|
|
|
|
+ <!-- 如果用户不是 VIP 且不是第一项,则添加 brand-lock 类 -->
|
|
|
|
+ <view v-if="!(isVip=='VIP' || item.number == 1)" class="brand-lock"></view>
|
|
|
|
+ <view class="brand-content">
|
|
|
|
+ {{ item.jieName }}
|
|
</view>
|
|
</view>
|
|
- <view class="brand-content">{{ item.jieName }}</view>
|
|
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -36,12 +36,18 @@
|
|
onMounted
|
|
onMounted
|
|
} from "vue";
|
|
} from "vue";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
import cacheManager from "@/utils/cacheManager.js";
|
|
- const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue'])
|
|
|
|
|
|
+ import {
|
|
|
|
+ toast,
|
|
|
|
+ getUserIdentity
|
|
|
|
+ } from "@/utils/common";
|
|
|
|
+ const $emit = defineEmits(['clickGradeTerm', 'onLeft', 'onRight', 'handleCheckCatalogue', 'listClick'])
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
options: {
|
|
options: {
|
|
type: Object,
|
|
type: Object,
|
|
},
|
|
},
|
|
})
|
|
})
|
|
|
|
+ const isVip = getUserIdentity();
|
|
|
|
+ const growthType = cacheManager.get('auth').growthType;
|
|
const gradeMapping = {
|
|
const gradeMapping = {
|
|
1: '一年级',
|
|
1: '一年级',
|
|
2: '二年级',
|
|
2: '二年级',
|
|
@@ -52,8 +58,8 @@
|
|
};
|
|
};
|
|
|
|
|
|
const termMapping = {
|
|
const termMapping = {
|
|
- 1: '数学',
|
|
|
|
- 2: '英语'
|
|
|
|
|
|
+ 1: ' 数学',
|
|
|
|
+ 2: ' 英语'
|
|
};
|
|
};
|
|
|
|
|
|
let startX = ref(0);
|
|
let startX = ref(0);
|
|
@@ -65,6 +71,10 @@
|
|
$emit('clickGradeTerm');
|
|
$emit('clickGradeTerm');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function listClick(data) {
|
|
|
|
+ $emit('listClick', data);
|
|
|
|
+ }
|
|
|
|
+
|
|
function translateData(data) {
|
|
function translateData(data) {
|
|
return gradeMapping[data.nianji] + termMapping[data.cardId]
|
|
return gradeMapping[data.nianji] + termMapping[data.cardId]
|
|
}
|
|
}
|
|
@@ -114,11 +124,25 @@
|
|
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;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ console.log(data);
|
|
|
|
+ console.log("1111");
|
|
|
|
+ }
|
|
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 做一些操作,比如发起请求等
|
|
gradeTerm.value = translateData(newVal);
|
|
gradeTerm.value = translateData(newVal);
|
|
|
|
+ dataRecom(newVal)
|
|
}, {
|
|
}, {
|
|
deep: true,
|
|
deep: true,
|
|
immediate: true
|
|
immediate: true
|