<template>
	<div class="catsstyle1">
		<u-grid :col="4" :border="false">
			<u-grid-item v-for="(c, i) in d" :key="i" @click="clickHandler(c)">
				<image :src="getIconLink(c.IconPath)" style="width: 80rpx; height: 80rpx;" />
				<text class="grid-text">{{ c.Name }}</text>
			</u-grid-item>
		</u-grid>
	</div>
</template>

<script>
	export default {
		props: ["d"],
		data() {
			return {
				activeId: 0,
			};
		},
		methods: {
			clickHandler(item) {
				let IsEducation = uni.getStorageSync('basedata') ?
					(uni.getStorageSync('basedata').mall.setting.mallStyle.IsEducation ? uni.getStorageSync('basedata').mall.setting.mallStyle
						.IsEducation : 0) :
					0;
				if (IsEducation == 1) {
					uni.navigateTo({
						url: '/pages/school/courseList?CategoryIds=' + item.Id
					});
				} else {
					uni.navigateTo({
						url: '/pages/goods/list?CategoryIds=' + item.Id
					});
				}
			},
		},
	};
</script>

<style>
	.catsstyle1 {
		padding: 12px 0;
	}

	.catsstyle1 .grid-text {
		font-size: 24rpx;
		margin-top: 4rpx;
		color: "#330330";
	}
</style>
