<template>
    <view class="component-appraise-section">
        <view class="appraise-total"> 累计 {{ total }} 条真实用户评价 </view>
        <view class="appraise-tags-group">
            <view class="tag-item" v-for="(item, index) in tags" :key="index">
                <text>{{ item.name }}（{{ item.count }}）</text>
            </view>
        </view>
        <div class="appraise-group-box">
            <appraise-group :cate="cate" @changeCate="changeCate" />
        </div>
    </view>
</template>

<script>
import AppraiseGroup from "@/components/appraise/group";
export default {
    name: "appraise-section",
    data() {
        return {};
    },
    props: {
        total: {
            type: [Number, String],
            default: 0,
        },
        tags: {
            type: Array,
            default: [],
        },
        cate: {
            type: Array,
            default: [],
        },
    },
    components: {
        AppraiseGroup,
    },
    created() {},
    mounted() {},
    destroyed() {},
    methods: {
        /**
         * 修改分类
         */
        changeCate(cate, index) {
            this.$emit("changeCate", cate, index);
        },
    },
};
</script>

<style lang="less" scoped>
.component-appraise-section {
    width: 100%;
    box-sizing: border-box;
    padding: 30rpx;
    background-color: #ffffff;
    .appraise-total {
        font-size: 24rpx;
        line-height: 24rpx;
        color: #333333;
    }
    .appraise-tags-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 35rpx;
        .tag-item {
            background: #f6f7ff;
            border-radius: 26rpx;
            padding: 14rpx 10rpx;
            box-sizing: border-box;
            text-align: center;
            font-size: 24rpx;
            line-height: 24rpx;
            color: #333333;
            margin-right: 18rpx;
            margin-top: 35rpx;
        }
        .tag-item:nth-child(3n) {
            margin-right: 0;
        }
    }
}
</style>