<template>
	<view>
		<view v-for="item in list" :key="item.chanpinId">
			<!-- 封面 -->
			<image :src="item.cover"></image>
			<!-- 名称 -->
			<view>{{item.name}}</view>
			<!-- 简介 -->
			<view>{{item.intro}}</view>
			<!-- 共计 -->
			<view>共计{{item.gongji}}节课程</view>
			<view>
				<view>请选择学习等级</view>
				<view v-for="cItem in item.levelList" @click="handleSelect(cItem)" :class="{active: item.active}">{{cItem.levelName}}</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	
	const props = defineProps({
		list: {
			type: Array
		}
	})
	
	// 选择产品等级
	function handleSelect(item) {
		console.log('item', item)
		uni.navigateTo({
			url: `/pages/chanpinXuanze/banben?dengjiId=${item.dengjiId}`
		})
	}
</script>

<style scoped lang="scss">
.active {
	color: red
}
</style>