feat:更新
This commit is contained in:
1 parent
ee99434860
commit
03c799e6a5
3 files changed
+40
-15
No files matched your search
+38
-14
@@ -1,19 +1,20 @@
|
||||
<template>
|
||||
<div class="home">
|
||||
<LuckyGrid
|
||||
ref="LuckDraw"
|
||||
width="400px"
|
||||
height="200px"
|
||||
rows="2"
|
||||
cols="4"
|
||||
:prizes="prizes"
|
||||
:blocks="blocks"
|
||||
:default-config="defaultConfig"
|
||||
:default-style="defaultStyle"
|
||||
:active-style="activeStyle"
|
||||
@start="startCallBack"
|
||||
@end="endCallBack"
|
||||
/>
|
||||
<div class="lucky-box">
|
||||
<LuckyGrid
|
||||
class="lucky-grid"
|
||||
ref="LuckDraw"
|
||||
rows="2"
|
||||
cols="4"
|
||||
:prizes="prizes"
|
||||
:blocks="blocks"
|
||||
:default-config="defaultConfig"
|
||||
:default-style="defaultStyle"
|
||||
:active-style="activeStyle"
|
||||
@start="startCallBack"
|
||||
@end="endCallBack"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<button @click="clickHander">抽奖</button>
|
||||
</div>
|
||||
@@ -146,6 +147,12 @@ export default {
|
||||
this.prizes = prizes;
|
||||
}, 0);
|
||||
},
|
||||
unitFunc(num, unit) {
|
||||
console.log(num, unit);
|
||||
if (unit === "vw") {
|
||||
return (window.innerWidth / 100) * num;
|
||||
}
|
||||
},
|
||||
startCallBack() {
|
||||
if (!this.luckyNum) return alert("还剩0次抽奖机会");
|
||||
this.$refs.LuckDraw.play();
|
||||
@@ -163,3 +170,20 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.home {
|
||||
padding: 30px;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
.lucky-box {
|
||||
width: 600px;
|
||||
height: 300px;
|
||||
margin: 0 auto;
|
||||
.lucky-grid {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user