|
|
|
@ -1,30 +1,56 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div id="lottery-draw" class="body" :style="{ 'background-image': 'url(' + bkg + ')' }">
|
|
|
|
<div
|
|
|
|
|
|
|
|
id="lottery-draw"
|
|
|
|
|
|
|
|
class="body"
|
|
|
|
|
|
|
|
:style="{ 'background-image': 'url(' + bkg + ')' }"
|
|
|
|
|
|
|
|
>
|
|
|
|
<h3 class="title">
|
|
|
|
<h3 class="title">
|
|
|
|
正在抽取三等奖
|
|
|
|
<span v-if="!$route.query.result">正在抽取</span>
|
|
|
|
|
|
|
|
{{ config.draw_prize.name }}
|
|
|
|
|
|
|
|
<span v-if="$route.query.result">中奖名单</span>
|
|
|
|
</h3>
|
|
|
|
</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
<div class="container">
|
|
|
|
<div class="left">
|
|
|
|
<div class="left">
|
|
|
|
<el-image class="image" :src="config.draw_prize.image" fit="cover">
|
|
|
|
<el-image
|
|
|
|
|
|
|
|
class="image"
|
|
|
|
|
|
|
|
:src="
|
|
|
|
|
|
|
|
config.draw_prize.image_file ? config.draw_prize.image_file.url : ''
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
fit="cover"
|
|
|
|
|
|
|
|
>
|
|
|
|
</el-image>
|
|
|
|
</el-image>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="info">
|
|
|
|
<div class="info">
|
|
|
|
<p>奖品: {{ config.draw_prize.name }}</p>
|
|
|
|
<p>奖品: {{ config.draw_prize.name }}</p>
|
|
|
|
<p>赞助商 : 泽科信息科技(苏州)有限公司 </p>
|
|
|
|
<p>赞助商: {{ config.draw_prize.apply }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="right">
|
|
|
|
<div class="right">
|
|
|
|
<div class="numbers">
|
|
|
|
<div class="numbers">
|
|
|
|
<div class="numbers__item" :class="{ 'numbers__item--active': !!resultNumbers.find(i => i === item) }" v-for="(item,index) in numbers" :key="item">
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="numbers__item"
|
|
|
|
|
|
|
|
:class="{
|
|
|
|
|
|
|
|
'numbers__item--active': !!resultNumbers.find((i) => i === item),
|
|
|
|
|
|
|
|
}"
|
|
|
|
|
|
|
|
v-for="(item, index) in numbers"
|
|
|
|
|
|
|
|
:key="item"
|
|
|
|
|
|
|
|
>
|
|
|
|
{{ item }}
|
|
|
|
{{ item }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<el-image class="btn" :src="require('@/assets/mdLotteryDraw/button.png')" fit="cover" @click="draw"></el-image>
|
|
|
|
<el-image
|
|
|
|
|
|
|
|
v-if="$route.query.result != 1"
|
|
|
|
|
|
|
|
:lazy="false"
|
|
|
|
|
|
|
|
class="btn"
|
|
|
|
|
|
|
|
:src="require('@/assets/mdLotteryDraw/button.png')"
|
|
|
|
|
|
|
|
fit="cover"
|
|
|
|
|
|
|
|
@click="draw"
|
|
|
|
|
|
|
|
></el-image>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
@ -32,16 +58,19 @@
|
|
|
|
import bkg from "@/assets/mdLotteryDraw/bkg.png";
|
|
|
|
import bkg from "@/assets/mdLotteryDraw/bkg.png";
|
|
|
|
import { draw, drawConfig } from "@/api/mdLotteryDraw";
|
|
|
|
import { draw, drawConfig } from "@/api/mdLotteryDraw";
|
|
|
|
import { throttle } from "@/utils";
|
|
|
|
import { throttle } from "@/utils";
|
|
|
|
|
|
|
|
import { drawLog } from "@/api/activity/drawPrize";
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
bkg,
|
|
|
|
bkg,
|
|
|
|
|
|
|
|
flag: false, //是否开始
|
|
|
|
|
|
|
|
timer: null,
|
|
|
|
config: {
|
|
|
|
config: {
|
|
|
|
draw_prize: {},
|
|
|
|
draw_prize: {},
|
|
|
|
numbers_list: []
|
|
|
|
numbers_list: [],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
resultNumbers: [],
|
|
|
|
resultNumbers: [],
|
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
init() {
|
|
|
|
init() {
|
|
|
|
@ -52,35 +81,90 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async getConfig() {
|
|
|
|
async getConfig() {
|
|
|
|
const res = await drawConfig({
|
|
|
|
const res = await drawConfig({
|
|
|
|
id: this.$route.params.id
|
|
|
|
id: this.$route.params.id,
|
|
|
|
})
|
|
|
|
});
|
|
|
|
console.log(res)
|
|
|
|
this.config = res;
|
|
|
|
this.config = res
|
|
|
|
},
|
|
|
|
|
|
|
|
async getResult() {
|
|
|
|
|
|
|
|
const res = await drawLog(
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
page: 1,
|
|
|
|
|
|
|
|
page_size: 9999,
|
|
|
|
|
|
|
|
activity_list_id: 8,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
false
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.resultNumbers = res.data
|
|
|
|
|
|
|
|
.filter((i) => i.draw_prize_id == this.$route.params.id)
|
|
|
|
|
|
|
|
.map((i) => Number(i.mobile));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
draw: throttle(function () {
|
|
|
|
|
|
|
|
this.resultNumbers = [1,10,30,60]
|
|
|
|
draw: throttle(async function () {
|
|
|
|
|
|
|
|
if (!this.flag) {
|
|
|
|
|
|
|
|
console.log("开始抽奖");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const result = await draw({
|
|
|
|
|
|
|
|
id: this.$route.params.id,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
console.log(result);
|
|
|
|
|
|
|
|
this.flag = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.timer = setInterval(() => {
|
|
|
|
|
|
|
|
let set = new Set();
|
|
|
|
|
|
|
|
while (set.size < result.draw_numbers.length) {
|
|
|
|
|
|
|
|
let num = Math.floor(
|
|
|
|
|
|
|
|
Math.random() * this.config.numbers_list.length
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
set.add(this.config.numbers_list[num]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.resultNumbers = Array.from(set);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!this.flag) {
|
|
|
|
|
|
|
|
clearInterval(this.timer);
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
this.resultNumbers = result.draw_numbers;
|
|
|
|
|
|
|
|
}, 500);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, 500);
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
console.log(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.flag = false;
|
|
|
|
|
|
|
|
console.log("结束抽奖");
|
|
|
|
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
numbers() {
|
|
|
|
numbers() {
|
|
|
|
|
|
|
|
if (this.$route.query.result) {
|
|
|
|
|
|
|
|
return this.resultNumbers;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (this.config.numbers_list) {
|
|
|
|
if (this.config.numbers_list) {
|
|
|
|
return this.config.numbers_list.sort(() => Math.random() - 0.5)
|
|
|
|
return this.config.numbers_list.sort(() => Math.random() - 0.5);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return []
|
|
|
|
return [];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
|
this.getConfig()
|
|
|
|
this.getConfig();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.$route.query.result == 1) {
|
|
|
|
|
|
|
|
this.getResult();
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
this.init();
|
|
|
|
this.init();
|
|
|
|
|
|
|
|
|
|
|
|
window.onresize = () => {
|
|
|
|
window.onresize = () => {
|
|
|
|
this.init();
|
|
|
|
this.init();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
<style scoped lang="scss">
|
|
|
|
@ -89,15 +173,28 @@ export default {
|
|
|
|
width: 100vw;
|
|
|
|
width: 100vw;
|
|
|
|
background-size: cover;
|
|
|
|
background-size: cover;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
padding-top: 17.31vh;
|
|
|
|
padding-top: 17.31vh;
|
|
|
|
.title {
|
|
|
|
.title {
|
|
|
|
|
|
|
|
letter-spacing: 2px;
|
|
|
|
font-size: 3.11em;
|
|
|
|
font-size: 3.11em;
|
|
|
|
font-family: FZHanZhenGuangBiaoS-GB, sans-serif;
|
|
|
|
font-family: FZHanZhenGuangBiaoS-GB, sans-serif;
|
|
|
|
font-weight: 600;
|
|
|
|
font-weight: 600;
|
|
|
|
color: #9e302e;
|
|
|
|
color: #9e302e;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
background: linear-gradient(to right,#0000,#dcbb78 8%,#dcbb78 12%,#dcbb78 34%,#f1e2bb 40%,#dcc68e 58%,#dcc68e 66%,#f5ecd0 92%,#0000);
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
|
|
to right,
|
|
|
|
|
|
|
|
#0000,
|
|
|
|
|
|
|
|
#dcbb78 8%,
|
|
|
|
|
|
|
|
#dcbb78 12%,
|
|
|
|
|
|
|
|
#dcbb78 34%,
|
|
|
|
|
|
|
|
#f1e2bb 40%,
|
|
|
|
|
|
|
|
#dcc68e 58%,
|
|
|
|
|
|
|
|
#dcc68e 66%,
|
|
|
|
|
|
|
|
#f5ecd0 92%,
|
|
|
|
|
|
|
|
#0000
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.container {
|
|
|
|
.container {
|
|
|
|
@ -106,12 +203,12 @@ export default {
|
|
|
|
box-sizing: border-box;
|
|
|
|
box-sizing: border-box;
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
|
|
padding: 6.6em 7.71vw 0 7.71vw;
|
|
|
|
padding: 9.1vh 7.71vw 0 7.71vw;
|
|
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
.left {
|
|
|
|
font-size: 1em;
|
|
|
|
font-size: 1em;
|
|
|
|
|
|
|
|
|
|
|
|
padding-top: 4em;
|
|
|
|
padding-top: 5.5vh;
|
|
|
|
margin-right: 9.13em;
|
|
|
|
margin-right: 9.13em;
|
|
|
|
.image {
|
|
|
|
.image {
|
|
|
|
width: 30.75em;
|
|
|
|
width: 30.75em;
|
|
|
|
@ -119,40 +216,41 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.info {
|
|
|
|
.info {
|
|
|
|
font-weight: 400;
|
|
|
|
font-weight: 400;
|
|
|
|
color: #FFFFFF;
|
|
|
|
color: #ffffff;
|
|
|
|
line-height: 2.5em;
|
|
|
|
line-height: 2.5em;
|
|
|
|
font-size: 1.6em;
|
|
|
|
font-size: 1.6em;
|
|
|
|
font-family: FZZhengHeiS-M-GB, sans-serif;
|
|
|
|
font-family: FZZhengHeiS-M-GB, sans-serif;
|
|
|
|
|
|
|
|
|
|
|
|
margin-top: 2.73em;
|
|
|
|
margin-top: 3.8vh;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
.right {
|
|
|
|
flex: 1;
|
|
|
|
flex: 1;
|
|
|
|
max-height: 42vh;
|
|
|
|
max-height: 39.5vh;
|
|
|
|
overflow-y: scroll;
|
|
|
|
overflow-y: scroll;
|
|
|
|
|
|
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
&::-webkit-scrollbar {
|
|
|
|
width: 4px;
|
|
|
|
width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.numbers {
|
|
|
|
.numbers {
|
|
|
|
display: grid;
|
|
|
|
display: grid;
|
|
|
|
grid-template-columns: repeat(6, 1fr);
|
|
|
|
grid-template-columns: repeat(6, 1fr);
|
|
|
|
grid-column-gap: 2.8em;
|
|
|
|
grid-column-gap: 2.8em;
|
|
|
|
grid-row-gap: .73em;
|
|
|
|
grid-row-gap: 0.93vh;
|
|
|
|
|
|
|
|
|
|
|
|
&__item {
|
|
|
|
&__item {
|
|
|
|
color: #ebd1a8;
|
|
|
|
color: #ebd1a8;
|
|
|
|
text-align: center;
|
|
|
|
text-align: center;
|
|
|
|
font-size: 3.44em;
|
|
|
|
font-size: 3.4em;
|
|
|
|
font-family: PingFang SC, sans-serif;
|
|
|
|
font-family: PingFang SC, sans-serif;
|
|
|
|
font-weight: 800;
|
|
|
|
font-weight: 800;
|
|
|
|
border-radius: 2.8em;
|
|
|
|
border-radius: 2.8em;
|
|
|
|
|
|
|
|
transition: all 0.2s ease-out;
|
|
|
|
|
|
|
|
|
|
|
|
&--active {
|
|
|
|
&--active {
|
|
|
|
animation: filter .2s ease-out forwards;
|
|
|
|
animation: filter 0.3s ease-out forwards;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -160,12 +258,19 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@keyframes filter {
|
|
|
|
@keyframes filter {
|
|
|
|
from {
|
|
|
|
from {
|
|
|
|
filter: blur(5px);
|
|
|
|
filter: blur(6px);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
to {
|
|
|
|
filter: blur(0);
|
|
|
|
filter: blur(0);
|
|
|
|
color: #A9262C;
|
|
|
|
color: #a9262c;
|
|
|
|
background: linear-gradient(264deg, #F8EACC, #E0C48A, #F5E0B8, #EDDDAC, #E1B872);
|
|
|
|
background: linear-gradient(
|
|
|
|
|
|
|
|
264deg,
|
|
|
|
|
|
|
|
#f8eacc,
|
|
|
|
|
|
|
|
#e0c48a,
|
|
|
|
|
|
|
|
#f5e0b8,
|
|
|
|
|
|
|
|
#edddac,
|
|
|
|
|
|
|
|
#e1b872
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.btn {
|
|
|
|
.btn {
|
|
|
|
@ -174,7 +279,7 @@ export default {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
|
|
margin: 4.9em auto 0 auto;
|
|
|
|
margin: 4.5vh auto 0 auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|