<template>
	<view class="customRowCell">
		<u-cell-group>
			<u-cell center :url="linkUrl" :link-type="linkType" arrow="false">
				<view slot="icon" :class="['t-icon cell-leftIcon', 't-icon-' + leftIcon]" />
				<view slot="title" class="customRow-title">
					<slot name="title"></slot>
					<text :class="{ overflowOmitRows: isOmits}" v-if="title">{{title}}</text>
				</view>
				<view class="customRow-value" slot="value">
					<slot name="value"></slot>
					<text v-if="value"> {{value}}</text>
				</view>
				<view slot="right-icon" class="flex_sb icon-min-width">
					<text class="right-separator" v-if="separator" />
					<slot name="rightIcon"></slot>
					<view slot="icon" :class="['t-icon cell-rightIcon', 't-icon-' + rightIcon]" v-if="rightIcon" />
				</view>
			</u-cell>
		</u-cell-group>
	</view>
</template>

<script>
	export default {
		name: 'bs-customRowCell',
		options: { styleIsolation: 'shared' },
		props: {
			title: { //标题
				type: String,
				default: ''
			},
			value: { //右侧内容
				type: String,
				default: ''
			},
			leftIcon: { //标题左侧图标
				type: String,
				default: ""
			},
			rightIcon: { //右侧图标
				type: String,
				default: ""
			},
			linkUrl: { //跳转页面地址
				type: String,
				default: ""
			},
			linkType: { //跳转类型
				type: String,
				default: 'navigateTo'
			},
			isOmits: { //是否多行省略
				type: Boolean,
				default: false
			},
			separator: { //是否显示分隔符
				type: Boolean,
				default: false
			}
		}
	}
</script>

<style lang="scss">
	.customRowCell {
		&/deep/.u-cell-group {
			.u-line {
				border: none !important;
			}

			.u-cell__body {
				padding: 20rpx 0;
				border: none !important;
			}
		}

		.cell-leftIcon,
		.cell-rightIcon {
			width: 44rpx;
			height: 44rpx;
		}

		.right-separator {
			border-left: 2rpx solid #E5E5E5;
			min-height: 30rpx;
		}

		.customRow-title {
			margin-left: 20rpx;
		}

		.customRow-value {
			color: #333333;
			white-space: nowrap;
		}

		.icon-min-width {
			min-width: 75rpx;
		}
	}
</style>
