<template>
    <div class="draw_main">
        <div class="collapse" @click="handleDrawCancle">
            <span>收起>></span>
        </div>
        <div class="top">
            <div class="top_title">点评记录</div>
            <div class="top_main">
                <div v-for="(item, index) in commentList" :key="index" class="top_main_list">
                    <div class="top_main_left">●</div>
                    <div class="top_main_right">
                        <span>{{item.createTime}}</span>
                        <span class="item_margin_left">{{item.nickName}}</span>
                        <span class="item_margin_left">点评了</span>
                        <span class="item_margin_left">“{{item.comment}}”</span>
                    </div>
                </div>
            </div>
        </div>
        <el-row>
            <el-col>
                <el-input v-model="textarea" type="textarea" :rows="5" placeholder="请输入"></el-input>
            </el-col>
        </el-row>
        <el-row class="comment_footer">
            <el-col>
                <el-button type="primary" @click="handleDrawCommit">确认</el-button>
                <el-button @click="handleDrawCancle">取消</el-button>
            </el-col>
        </el-row>
    </div>
</template>
<script>
export default {
    props: {
        commentList: {
            type: Array,
            default: () => [],
        },
    },
    data() {
        return {
            textarea: ''
        }
    },

    methods: {
        handleDrawCommit() {
            this.$emit('confirm', this.textarea)
            this.textarea=''
        },
        handleDrawCancle() {
            this.textarea=''
            this.$emit('cancle')
        },
    },
}
</script>
<style lang="scss" scoped>
.draw_main {
    padding: 30px;
    position: relative;
}
.collapse{
    position: fixed;
    right: 570px;
    background: #fff;
    height: 100px;
    font-size: 14px;
    color: #4886f8;
    margin-left: 2px;
    display: flex;
    align-items: center;
    top: 38%;
    cursor: pointer;
    padding-left: 5px;
    border-radius: 10px 0 0 10px;
}
.top_title {
    font-size: 20px;
    font-weight: 600;
}

.top_main {
    margin: 20px 0;

}

.top_main_list {
    display: flex;
    align-items: center;
    line-height: 30px;
}

.top_main_left {
    font-size: 12px;
    color: #4886f8;
}

.top_main_right {
    margin-left: 10px;
}
.item_margin_left{
    margin-left: 15px;
}
.comment_footer {
    margin-top: 50px;
    text-align: center;
}</style>