<template>
    <view class="emoji--lay" v-show="show">
        <scroll-view class="scroll" :scroll-y="true">
            <view class="emoji-flex">
                <view class="item" v-for="(item, index) in emojiArr" :key="index" @click="$emit('onEmoji', item)">
                    {{item.emoji}}
                </view>
            </view>
        </scroll-view>
        <view class="tool">
            <!-- <view class="item" @click="$emit('delete')">删除</view> -->
            <view class="item sent" @click="$emit('sent')">发送</view>
        </view>
    </view>
</template>

<script>
    import emoji from '@/static/im/emoji'
    export default {
        props: {
            show: {
                type: Boolean,
                default: () => {
                    return false
                }
            }
        },
        data() {
            return {
                emojiArr: emoji
            }
        }
    }
</script>

<style lang="scss" scoped>
    .emoji--lay {
        height: 600rpx;
        position: relative;

        .scroll {
            height: 600rpx;

            .emoji-flex {
                padding: 15rpx 15rpx 120rpx;
                display: flex;
                flex-wrap: wrap;

                .item {
                    margin: 10rpx 15rpx;
                    font-size: 52rpx;
                    width: calc(12.5% - 30rpx);
                    box-sizing: border-box;
                }
            }
        }

        .tool {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background-image: linear-gradient(to top, #FFF, rgba(255, 255, 255, .0));
            display: flex;
            justify-content: flex-end;
            padding: 20rpx 30rpx 30rpx;

            .item {
                line-height: 70rpx;
                border-radius: 35rpx;
                width: 140rpx;
                text-align: center;
                font-size: 28rpx;
                margin-left: 20rpx;
                background: white;
                border: solid 1rpx #f5f5f5;
                box-sizing: border-box;

                &.sent {
                    border-color: #34CE98;
                    background: #34CE98;
                    color: white;
                }
            }
        }
    }
</style>
