<template>
	<view class="sx-card-list">
		<view v-for="item in list" :key="item.chanpinId" class="sx-card-box">
			<view class="card-head-box">
				<!-- 封面 -->
				<image :src="item.cover" class="head-img"></image>
				<view class="head-right-box">
					<!-- 名称 -->
					<view class="head-title">{{item.name}}</view>
					<!-- 简介 -->
					<view class="head-content">{{item.intro}}</view>
					<!-- 共计 -->
					<view class="head-content">{{item.gongji}}</view>
				</view>
			</view>
			<view class="card-body-box">
				<view class="body-title">请选择学习等级</view>
				<view class="dj-item-row">
					<view class="dj-item" v-for="cItem in item.levelList" @click="handleSelect(cItem)" :class="{active: item.active}">{{cItem.levelName}}</view>
				</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>