<!-- 选择框-账户-下部 -->
<template>
	<view class="content">
		<view class="mix-list-cell" :class="border" @click="eventClick" hover-class="cell-hover" :hover-stay-time="50">
			<!-- <text v-if="icon" class="cell-icon yticon" :style="[{color: iconColor,}]" :class="icon"></text> -->
			<img v-if="imagesrc" :src="imagesrc" :style="[{color: iconColor,}]" class="cell-icon yticon"></img>
			<image v-if="imagesrcnew" :src="imagesrcnew" :style="[{color: iconColor,width:'20px',height:'20px'}]"
				class="cell-icon yticon">
			</image>
			<text class="cell-tit clamp">{{title}}</text>
			<text v-if="tips" class="cell-tip">{{tips}}</text>
			<!-- <text class="cell-more yticon"
				:class="typeList[navigateType]"
			></text> -->
			<i class="fa cell-more yticon" style="width: 25upx;color: #333;" :class="typeList[navigateType]"></i>

		</view>

	</view>
</template>

<script>
	/**
	 *  简单封装了下， 应用范围比较狭窄，可以在此基础上进行扩展使用
	 *  比如加入image， iconSize可控等
	 */
	export default {
		data() {
			return {
				typeList: {
					left: 'fa-angle-left',
					right: 'fa-angle-right',
					up: 'fa-angle-up',
					down: 'fa-angle-down'
				},
			}
		},
		props: {
			icon: {
				type: String,
				default: ''
			},
			title: {
				type: String,
				default: '标题'
			},
			tips: {
				type: String,
				default: ''
			},
			navigateType: {
				type: String,
				default: 'right'
			},
			border: {
				type: String,
				default: 'b-b'
			},
			hoverClass: {
				type: String,
				default: 'cell-hover'
			},
			iconColor: {
				type: String,
				default: '#333'
			},
			imagesrc: {
				type: String,
				default: ''
			},
			imagesrcnew: {
				type: String,
				default: ''
			}
		},
		computed: {
			i18n() {
				return this.$t('common');
			}
		},
		onShow() {
			console.log(this.title);
		},
		methods: {

			eventClick() {
				this.$emit('eventClick');
			}
		},
	}
</script>

<style lang='scss'>
	.icon .mix-list-cell.b-b:after {
		left: 90upx;
	}

	.mix-list-cell {
		display: flex;
		align-items: baseline;
		padding: 10upx $page-row-spacing;
		line-height: 60upx;
		position: relative;

		&.cell-hover {
			background: #fafafa;
		}

		&.b-b:after {
			left: 30upx;
		}

		.cell-icon {
			align-self: center;
			width: 40upx;
			max-height: 60upx;
			font-size: 38upx;
			margin-right: 10upx;
		}

		.cell-more {
			align-self: center;
			font-size: 30upx;
			color: $font-color-base;
			margin-left: $uni-spacing-row-sm;
		}

		.cell-tit {
			flex: 1;
			font-size: $font-base+2upx;
			color: $font-color-dark;
			margin-right: 10upx;
		}

		.cell-tip {
			font-size: $font-sm+2upx;
			color: $font-color-light;
		}
	}
</style>
