<template>
    <div class="promotion-page">
        <div class="promotion-page-list">
            <div class="promotion-page-list-item" v-for="(item, index) in dataList" :key="index" @click="goDetail(item)">
                <el-image :src="item.pc_image" style="width: 100%;border-radius: 8px;"></el-image>
            </div>
        </div>
    </div>
</template>

<script setup>
import { useI18n } from 'vue-i18n'
import { getActivity } from '@/request/api'
const {t} = useI18n()
const router = useRouter();

const pagingRef = ref(null);
const dataList = ref([]);

function onQuery() {
    getActivity({ type: 3 }).then((res) => {
        dataList.value = res.data.list || [];
        // pagingRef.value.complete(true);
    }).catch(() => {
        // pagingRef.value.complete(true);
    });
}

function goDetail(item) {
    router.push({ name: 'PromotionDetail', query: { id: item.id } });

}

function goBack() {
    router.back();
}

onQuery()
</script>

<style lang="scss" scoped>
.promotion-page {
    box-sizing: border-box;
    &-list{
        margin-top: 10px;
        &-item{
            margin-bottom: 10px;
            cursor: pointer;
        }
    }
}
</style>