<template>
	<view class="pages">
		<u--image :showLoading="false" src="../static/img/typelist-bg.png" width="100%" mode="widthFix"></u--image>
		<view class="list-wrap u-flex u-flex-wrap u-row-between">
			<view class="item" @click="typeClick(item)" v-for="(item,index) in typelist" :key="item.id">
				<view class="name">{{item.name}}</view>
				<img class="img" :src="item.classifyLogo||'../static/img/type-default-ico.png'" alt="">
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				typelist:[]
			}
		},
		onShow() {
			this.getclassify()
		},
		onLoad() {

		},
		methods: {
			getclassify(){
				this.$u.api.getclassify().then(res=>{
					this.typelist = res.data.rows.map(item=>{
						return {name:item.classifyName,id:item.id,classifyLogo:item.classifyLogo}
					});
					// console.log('res',res.data);
				}).catch(err=>{
					console.log('getclassify',err);
				})
			},
			typeClick(item){
				console.log('typeClick',item);
				uni.$u.route('/examination/examination',{
					id:item.id
				});
				
			}

		}
	}
</script>
<style>
	page{
		background-color: #F5F9FC;
	}
</style>
<style lang="scss" scoped>
.list-wrap{
	position: relative;
	top: -24rpx;
	border-radius: 24rpx 24rpx 0rpx 0rpx;
	background-color: #F5F9FC;
	padding: 30rpx 30rpx 0 0 ;
	.item{
		box-sizing: border-box;
		width: calc((100% - 60rpx) / 2);
		padding: 30rpx;
		border-radius: 24rpx;
		background-color: #fff;
		margin: 0 0 30rpx 30rpx;
		text-align: right;
		.name{
			text-align: left;
			font-size: 34rpx;
			font-family: PingFangSC-Semibold, PingFang SC;
			font-weight: 600;
			color: #333333;
			line-height: 48rpx;
		}
		.img{
			width: 120rpx;
			height: 120rpx;
			border-radius: 50%;
		}
	}
}
</style>