<style>
	.categoryMain{
		height:auto;
		width:100%;
		background-color: #F3F5F7;
		padding-top:20px;
	}
	.categoryContent{
		display: flex;
		flex-wrap: wrap;
		margin:15px 15px 0 15px;
		padding-bottom:20px;
	}
	.cateList{
		width:31%;
		height:130px;
		background-color: #fff;
		border-radius: 3px;
		color:#404040;
		text-align: center;
		margin-right:3.5%;
		font-size:13px;
		margin-bottom:12px;
		display:inline-block;
	}
	.cateList:nth-child(3n+3){
		margin-right:0;
	}
	.categoryTop{
		width:100%;
		height:92px;
	}
	.categoryTop img{
		width:100%;
		height:100%;
	}
	.cateName{
		margin-top:10px;
	}
	.categray_Brand{
		width:84px;
		height:26px;
		color:#fff;
		font-size:14px;
		line-height: 26px;
		padding-right:12px;
		text-align: center;
		background-image: url(../../static/images/brand.png);
	}
</style>
<template>
	<view class="categoryMain">
		<view class="categray_Brand">
			品牌
		</view>
		<view class="categoryContent">
			<view class="cateList" v-for="(item,index) in dataList" :key="index" @click="goDetail(item)">
				<view class="categoryTop">
					<img :src="item.IconPath" alt=""/>
				</view>
				<view class="cateName">{{item.Name}}</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				pageTitle: '',
				mainColor: '',
				dataList:[]
			}
		},
		created() {
		},
		mounted() {
			this.getData();
		},
		onLoad(option) {
		},
		methods: {
			//获取数据
			getData() {
				this.request2({
						url: "/api/AppletGoods/GetProductCategoryAllList",
						data: {},
					},
					(res) => {
						if (res.resultCode == 1) {
							this.dataList = res.data;
						}
					}
				);
			},
			//跳转详情
			goDetail(item){
				uni.navigateTo({
					url: '/pages/goods/list?CategoryIds=' + item.Id + '&Name='+item.Name
				});
			}
		}
	}
</script>

<style>

</style>
