Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
公瑾
/
lucky-draw
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
9ea65295
authored
2019-12-27 16:48:56 +0800
by
zhangyongfeng
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修复多次抽奖不减去奖池人数的bug
1 parent
75e4d4dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
src/App.vue
src/components/Tool.vue
src/App.vue
View file @
9ea6529
...
...
@@ -25,6 +25,7 @@
v-for=
"item in resArr"
:key=
"item"
class=
"itemres"
:style=
"resCardStyle"
@
click=
"showRes = false"
>
{{
item
}}
...
...
@@ -32,7 +33,7 @@
</div>
<LotteryConfig
:visible
.
sync=
"showConfig"
@
resetconfig=
"reloadTagCanvas"
/>
<Tool
@
toggle=
"toggle"
:running=
"running"
/>
<Tool
@
toggle=
"toggle"
@
resetConfig=
"reloadTagCanvas"
:running=
"running"
/>
<Result
:visible
.
sync=
"showResult"
></Result>
<span
class=
"copy-right"
>
...
...
@@ -59,6 +60,18 @@ export default {
components
:
{
LotteryConfig
,
Publicity
,
Tool
,
Result
},
computed
:
{
resCardStyle
()
{
const
style
=
{};
const
{
number
}
=
this
.
config
;
if
(
number
<
100
)
{
style
.
fontSize
=
'100px'
;
}
else
if
(
number
<
1000
)
{
style
.
fontSize
=
'80px'
;
}
else
if
(
number
<
10000
)
{
style
.
fontSize
=
'60px'
;
}
return
style
;
},
config
:
{
get
()
{
return
this
.
$store
.
state
.
config
;
...
...
@@ -192,16 +205,13 @@ export default {
this
.
resArr
=
resArr
;
this
.
category
=
category
;
if
(
this
.
result
[
category
])
{
if
(
!
this
.
result
[
category
])
{
this
.
$set
(
this
.
result
,
category
,
[]);
}
const
oldRes
=
this
.
result
[
category
]
||
[];
const
data
=
Object
.
assign
({},
this
.
result
,
{
[
category
]:
oldRes
.
concat
(
resArr
)
});
this
.
result
=
data
;
window
.
TagCanvas
.
SetSpeed
(
'rootcanvas'
,
[
5
,
1
]);
}
...
...
@@ -272,7 +282,7 @@ export default {
border-radius
:
4px
;
border
:
1px
solid
#ccc
;
line-height
:
160px
;
font-size
:
10
0px
;
font-size
:
8
0px
;
font-weight
:
bold
;
margin-right
:
20px
;
margin-top
:
20px
;
...
...
src/components/Tool.vue
View file @
9ea6529
...
...
@@ -136,6 +136,7 @@ export default {
.
then
(()
=>
{
clearData
();
this
.
$store
.
commit
(
'setClearStore'
);
this
.
$emit
(
'resetConfig'
);
this
.
$message
({
type
:
'success'
,
message
:
'重置成功!'
...
...
Please
register
or
sign in
to post a comment