Files
luckyrun/src/components/prizesList/main.vue
T
2021-09-05 16:11:27 +08:00

69 lines
1.3 KiB
Vue

<template>
<div class="prizes-list">
<div class="prizes-list-item" v-for="item in curList" :key="item.prizeId">
<div class="prizes-list-item-image">
<van-image
width="100%"
height="100%"
:src="item.prizeImgUrl"
fit="cover"
/>
</div>
<div class="prizes-list-item-name">
<span>{{ item.prizeName }}</span>
</div>
</div>
</div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
name: "PrizesList",
props: {
drawType: {
type: String,
default: "turntable1"
}
},
computed: {
...mapGetters(["prizeInfo"]),
curList() {
return this.prizeInfo[this.drawType];
}
},
created() {
if (this.curList.length === 0) this.getQueryPrizeInfo(this.drawType);
},
mounted() {},
methods: {
...mapActions(["getQueryPrizeInfo"])
}
};
</script>
<style lang="less" scoped>
.prizes-list {
display: flex;
flex-wrap: wrap;
&-item {
width: 170px;
margin: 20px 33px;
&-image {
width: 170px;
height: 170px;
background: #26144d;
border-radius: 24px;
}
&-name {
text-align: center;
font-size: 28px;
font-weight: 500;
color: #dbcfff;
line-height: 48px;
margin-top: 20px;
}
}
}
</style>