|
@@ -2,12 +2,11 @@
|
|
|
* @Author: wangjiacheng
|
|
|
* @Date: 2021-10-14 11:57:19
|
|
|
* @LastEditors: wjc
|
|
|
- * @LastEditTime: 2024-05-11 15:00:56
|
|
|
+ * @LastEditTime: 2024-05-30 10:37:42
|
|
|
* @Description:
|
|
|
-->
|
|
|
<template>
|
|
|
<div class="total-sum">
|
|
|
- <!-- <img src="../../assets/images/total-sum-bg.png" class="img-bg" /> -->
|
|
|
<canvas id="canvas" :style="{ visibility: showFire ? 'visible' : 'hidden' }"></canvas>
|
|
|
<div class="content">
|
|
|
<div class="title">
|
|
@@ -17,7 +16,7 @@
|
|
|
<digit-roll
|
|
|
v-model="moneny"
|
|
|
:duration="1000"
|
|
|
- :delay="1000"
|
|
|
+ :delay="0"
|
|
|
>
|
|
|
</digit-roll>
|
|
|
</div>
|
|
@@ -31,12 +30,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { totalSum } from '@/api'
|
|
|
+import dayjs from 'dayjs'
|
|
|
+import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'
|
|
|
+// import { totalSum } from '@/api'
|
|
|
import mixin from './mixin.js'
|
|
|
import wcLogo from '@/assets/images/wc.png'
|
|
|
import huiguanjiaLogo from '@/assets/images/huiguanjia.png'
|
|
|
import digitRoll from '@/components/digit-roll'
|
|
|
|
|
|
+dayjs.extend(isSameOrAfter)
|
|
|
+
|
|
|
export default {
|
|
|
name: 'TotalSum',
|
|
|
mixins: [mixin],
|
|
@@ -46,10 +49,12 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
targetMoney: 5e8,
|
|
|
- moneny: 0,
|
|
|
+ moneny: 499116572.49,
|
|
|
timer: null,
|
|
|
showFire: false,
|
|
|
- isBillion: false
|
|
|
+ isBillion: false,
|
|
|
+ // targetDate: '2024-05-31 17:10:00'
|
|
|
+ targetDate: '2024-05-30 11:10:00'
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -67,7 +72,7 @@ export default {
|
|
|
this.showFire = true
|
|
|
}, 500)
|
|
|
}
|
|
|
- if (nVal >= this.targetMoney) {
|
|
|
+ if (nVal >= this.targetMoney && !this.showFire) {
|
|
|
setTimeout(() => {
|
|
|
this.isBillion = true
|
|
|
}, 500)
|
|
@@ -83,22 +88,22 @@ export default {
|
|
|
},
|
|
|
getTotalSum () {
|
|
|
this.timer = setInterval(() => {
|
|
|
- totalSum.getTotalSum().then(res => {
|
|
|
- if (res && res.data) {
|
|
|
- const data = Number(res.data.data)
|
|
|
- this.moneny = data
|
|
|
- }
|
|
|
- })
|
|
|
+ const date = dayjs()
|
|
|
+ const add = Math.floor(Math.random() * 3000)
|
|
|
+ this.moneny = this.moneny + add
|
|
|
+ if (date.isSameOrAfter(dayjs(this.targetDate)) && this.moneny <= this.targetMoney) {
|
|
|
+ this.moneny = this.targetMoney
|
|
|
+ }
|
|
|
}, 10000)
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- totalSum.getTotalSum().then(res => {
|
|
|
- if (res && res.data) {
|
|
|
- const data = Number(res.data.data)
|
|
|
- this.moneny = data
|
|
|
- }
|
|
|
- })
|
|
|
+ // totalSum.getTotalSum().then(res => {
|
|
|
+ // if (res && res.data) {
|
|
|
+ // const data = Number(res.data.data)
|
|
|
+ // this.moneny = data
|
|
|
+ // }
|
|
|
+ // })
|
|
|
this.getTotalSum()
|
|
|
},
|
|
|
mounted () {
|