functionList.vue 1.3 KB
<template>
	<view class="function_card">
		<view class="function_title">{{ title }}</view>
		<view class="function_list">
			<view class="function_item" v-for="(item, index) in functionData" :key="index" @click="goRouter(item.pathUrl)">
				<image class="list_icon" :src="item.icon" mode="widthFix"></image>
				<text class="list_name">{{ item.text }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		props: {
			title: {
				type: String,
				default: ''
			},
			functionData: {
				tyep: Array,
				require: true
			}
		},
		methods: {
			goRouter(path){
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.function_card{
		background: #FFFFFF;
		border-radius: 12rpx;
		.function_title{
			line-height: 84rpx;
			height: 84rpx;
			padding-left: 36rpx;
			font-size: 28rpx;
			color: #333;
			border-bottom: 2rpx solid #E1E1E1;
			box-sizing: border-box;
		}
		.function_list{
			display: flex;
			gap: 28rpx;
			flex-wrap: wrap;
			padding: 24rpx 30rpx;
			.function_item{
				width: calc((100% - 90rpx) / 4);
				display: flex;
				flex-direction: column;
				align-items: center;
				font-size: 28rpx;
				list-style: 40rpx;
				color: #333;
				.list_icon{
					width: 52rpx;
					height: 52rpx;
					margin-bottom: 14rpx;
				}
			}
		}
	}
</style>