<template>
	<view class="bg-wrap" :class="{hide:isHide}">
		<slot></slot>
		<view class="more" @click="handlSw">
			<view class="label-s">
				{{isHide ? '全部' : '收起'}}
			</view>
			<u-icon class="icon" :class="{s:!isHide}" name="arrow-left-double" size="28"></u-icon>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			hide:{
				type:Boolean,
				default:true
			}
		},
		data(){
			return {
				isHide:this.hide
			}
		},
		methods:{
			handlSw(){
				this.isHide = !this.isHide
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bg-wrap{
		background: #f2f2f2;
		padding: 20rpx 20rpx 80rpx;
		position: relative;
		&.hide{
			height: 160rpx;
			overflow: hidden;
		}
		.more{
			width: 100%;
			height: 60rpx;
			text-align: center;
			position: absolute;
			bottom: 0;
			left: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #7F7F7F;
			background-color: #f2f2f2;
			.icon{
				transform: rotate(-90deg);
				&.s{
					transform: rotate(90deg);
				}
			}
		}
	}
</style>