feat:更新
This commit is contained in:
1 parent
ee99434860
commit
03c799e6a5
3 files changed
+40
-15
No files matched your search
@@ -11,6 +11,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.19.2",
|
"axios": "^0.19.2",
|
||||||
"core-js": "^3.6.4",
|
"core-js": "^3.6.4",
|
||||||
|
"vant": "^2.12.26",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.6.11",
|
||||||
"vue-luck-draw": "^3.4.6",
|
"vue-luck-draw": "^3.4.6",
|
||||||
"vue-router": "^3.1.6",
|
"vue-router": "^3.1.6",
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ module.exports = {
|
|||||||
"postcss-design-convert": {
|
"postcss-design-convert": {
|
||||||
multiple: 2,
|
multiple: 2,
|
||||||
units: ["vw"],
|
units: ["vw"],
|
||||||
selector: /^\.yzy-/
|
selector: /^\.van-/
|
||||||
},
|
},
|
||||||
"postcss-write-svg": {
|
"postcss-write-svg": {
|
||||||
utf8: false
|
utf8: false
|
||||||
|
|||||||
+38
-14
@@ -1,19 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="home">
|
<div class="home">
|
||||||
<LuckyGrid
|
<div class="lucky-box">
|
||||||
ref="LuckDraw"
|
<LuckyGrid
|
||||||
width="400px"
|
class="lucky-grid"
|
||||||
height="200px"
|
ref="LuckDraw"
|
||||||
rows="2"
|
rows="2"
|
||||||
cols="4"
|
cols="4"
|
||||||
:prizes="prizes"
|
:prizes="prizes"
|
||||||
:blocks="blocks"
|
:blocks="blocks"
|
||||||
:default-config="defaultConfig"
|
:default-config="defaultConfig"
|
||||||
:default-style="defaultStyle"
|
:default-style="defaultStyle"
|
||||||
:active-style="activeStyle"
|
:active-style="activeStyle"
|
||||||
@start="startCallBack"
|
@start="startCallBack"
|
||||||
@end="endCallBack"
|
@end="endCallBack"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button @click="clickHander">抽奖</button>
|
<button @click="clickHander">抽奖</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -146,6 +147,12 @@ export default {
|
|||||||
this.prizes = prizes;
|
this.prizes = prizes;
|
||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
|
unitFunc(num, unit) {
|
||||||
|
console.log(num, unit);
|
||||||
|
if (unit === "vw") {
|
||||||
|
return (window.innerWidth / 100) * num;
|
||||||
|
}
|
||||||
|
},
|
||||||
startCallBack() {
|
startCallBack() {
|
||||||
if (!this.luckyNum) return alert("还剩0次抽奖机会");
|
if (!this.luckyNum) return alert("还剩0次抽奖机会");
|
||||||
this.$refs.LuckDraw.play();
|
this.$refs.LuckDraw.play();
|
||||||
@@ -163,3 +170,20 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</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