<template>
    <div class="search">
        <van-list v-model:loading="loading" :finished="finished" finished-text="- 更多藏品敬请期待 -" @load="getData">
            <template v-for="(item, index) in list" :key="index">
                <router-link
                    :to="{
                        path: '/activityDetail',
                        query: {
                            id: item.id
                        }
                    }"
                    class="activity"
                >
                    <div class="text1">{{ item.name }}</div>
                    <van-image
                        width="calc(100vw - 32px)"
                        height=" calc(40vw - 12.8px)"
                        radius="4"
                        :src="getImg(item.cover)"
                        fit="cover"
                    />
                </router-link>
            </template>

            <van-empty v-if="empty" description="暂无活动哦~" :image="require('@assets/kong_png_wusousuo.png')" />
        </van-list>
    </div>
</template>

<script>
import list from '../../mixins/list';
export default {
    name: 'Search',
    mixins: [list],
    data() {
        return {
            list: [],
            empty: false,
            url: '/activity/all'
        };
    },
    methods: {
        beforeData() {
            return {
                query: {
                    del: false
                }
            };
        }
    }
};
</script>

<style lang="less" scoped>
.search {
    padding-bottom: 50px;
}
/deep/.van-list__finished-text{
    font-size: 12px;
}
.activity {
    padding: 16px;
    display: block;
    .text1 {
        font-size: 16px;
        color: @text0;
        line-height: 24px;
        margin-bottom: 12px;
    }
}
</style>
