|
|
|
@ -0,0 +1,88 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="turntable">
|
|
|
|
|
<div class="view">
|
|
|
|
|
当前积分:{{ score }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="btn" :class="{active:active===0}"><span>{{ awards[0].name }}</span></div>
|
|
|
|
|
<div class="btn" :class="{active:active===1}"><span>{{ awards[1].name }}</span></div>
|
|
|
|
|
<div class="btn" :class="{active:active===2}"><span>{{ awards[2].name }}</span></div>
|
|
|
|
|
<div class="btn" :class="{active:active===7}"><span>{{ awards[7].name }}</span></div>
|
|
|
|
|
<div class="btn roll" @click="roll"><span>抽奖</span></div>
|
|
|
|
|
<div class="btn" :class="{active:active===3}"><span>{{ awards[3].name }}</span></div>
|
|
|
|
|
<div class="btn" :class="{active:active===6}"><span>{{ awards[6].name }}</span></div>
|
|
|
|
|
<div class="btn" :class="{active:active===5}"><span>{{ awards[5].name }}</span></div>
|
|
|
|
|
<div class="btn" :class="{active:active===4}"><span>{{ awards[4].name }}</span></div>
|
|
|
|
|
<div class="award">
|
|
|
|
|
<ul>
|
|
|
|
|
<li v-for="item in list">{{ item.name }}</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {ref, reactive, computed} from "vue"
|
|
|
|
|
|
|
|
|
|
export default {}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.turntable {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
width: 100%;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.view {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100px;
|
|
|
|
|
font-size: 25px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
line-height: 100px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
position: relative;
|
|
|
|
|
width: 33.3%;
|
|
|
|
|
height: 0;
|
|
|
|
|
/*通过边距形成正方形的Hack*/
|
|
|
|
|
padding-top: 33.3%;
|
|
|
|
|
border: 1px solid #2c3e50;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
font-size: 25px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
cursor: default;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn.roll {
|
|
|
|
|
background-color: yellow;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn.active {
|
|
|
|
|
background-color: red;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*遍历所有子元素*/
|
|
|
|
|
.btn > * {
|
|
|
|
|
position: absolute;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.award {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.award > li {
|
|
|
|
|
width: 100%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|