<template>
	<view>
		<view class="personalInfo">
			<view class="ulBox">
				<view v-for="item in menuList.filter(v=>v.isShow)" :key="item.title" @click="goDetail(item)"
					class="liBox">
					<view class="infoBox">
						<!-- <image :src="'/static/moduleIcon/'+item.icon+'.png'" alt="" srcset="" mode="widthFix"></image> -->
						<text>{{item.title}}</text>
					</view>
					<view class="iconBox">
						<text v-if="item.contentType">{{item.contentType}}</text>
						<i v-else class="iconfont icon-youjiantou"></i>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			menuList: {
				type: Array
			}
		},
		data() {
			return {}
		},
		mounted() {
			console.log(this.minorMenuLists, 7412)
		},
		destroyed() {
			uni.hideToast();
		},
		methods: {
			goDetail(item) {
				console.log(item, 844)
				if (item.isShow == true && item.isOpen == true) {
						if (item.isTips == true) {
							uni.showModal({
								title: item.title,
								content: '确定要进行' + item.title + '操作吗?',
								showCancel: true,
								success: function(res) {
									if (res.confirm) {
										uni.showToast({
											title: '操作成功',
											icon: 'none'
										});
									} else {
										console.log('已取消')
									}
								}
							});
						} else if (item.link != null) {
							uni.navigateTo({
								url: item.link
							});
						}else {
							console.log('错误抛出')
						}
				} else {
					common.errorDialog(2, '该模块正在开发中，敬请期待！', '提示');
				}
			}
		}
	}
</script>

<style lang="scss">
	.personalInfo {
		background: #fff;
		width: 95%;
		margin: 6rpx auto 0;

		.ulBox {
			padding: 0 30rpx;

			.liBox {
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1px solid #E6E6E6;
				height: 92rpx;

				.infoBox {
					display: flex;
					align-items: center;

					image {
						width: 52rpx !important;
						height: 52rpx;
					}
				}

				&:last-child {
					border: none;
				}
			}
		}
	}
</style>
