Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
activities
/
web-lottery
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d8c4e85f
authored
Nov 15, 2023
by
Lays-lzq
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/wheel'
parents
fc9e537e
6d6058f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
components/Lottery/Instant/MiniMain.vue
+22
-8
No files found.
components/Lottery/Instant/MiniMain.vue
View file @
d8c4e85f
...
@@ -222,7 +222,8 @@ export default {
...
@@ -222,7 +222,8 @@ export default {
name
:
'谢谢参与'
// 中奖等级
name
:
'谢谢参与'
// 中奖等级
},
// 中奖信息
},
// 中奖信息
randomType
:
Math
.
floor
(
Math
.
random
()
*
(
2
-
1
+
1
))
+
1
,
// 部分抽奖类型随机进1或2
randomType
:
Math
.
floor
(
Math
.
random
()
*
(
2
-
1
+
1
))
+
1
,
// 部分抽奖类型随机进1或2
isShowBanner
:
true
isShowBanner
:
true
,
formattedPrizeList
:
[]
}
}
},
},
computed
:
{
computed
:
{
...
@@ -235,13 +236,8 @@ export default {
...
@@ -235,13 +236,8 @@ export default {
prizeList
()
{
prizeList
()
{
return
this
.
lotteryInfo
.
prizeConfigs
return
this
.
lotteryInfo
.
prizeConfigs
},
},
formattedPrizeList
()
{
prizeLen
()
{
const
prizeLen
=
this
.
lotteryInfo
?.
prizeConfigs
?.
length
||
0
return
this
.
prizeList
.
length
if
(
prizeLen
>=
6
&&
prizeLen
%
2
===
0
)
{
const
freePrizes
=
new
Array
(
2
).
fill
({
id
:
0
,
name
:
'谢谢参与'
})
return
[...
this
.
lotteryInfo
.
prizeConfigs
,
...
freePrizes
]
}
return
this
.
lotteryInfo
.
prizeConfigs
},
},
isNotStart
()
{
isNotStart
()
{
// 抽奖不在活动日期内
// 抽奖不在活动日期内
...
@@ -258,7 +254,25 @@ export default {
...
@@ -258,7 +254,25 @@ export default {
return
''
return
''
}
}
},
},
watch
:
{
prizeLen
(
nVal
,
oVal
)
{
if
(
nVal
===
oVal
)
{
return
}
if
(
this
.
nVal
>=
6
&&
this
.
nVal
%
2
===
0
)
{
const
freePrizes
=
new
Array
(
2
).
fill
({
id
:
0
,
name
:
'谢谢参与'
})
this
.
formattedPrizeList
=
[...
this
.
lotteryInfo
.
prizeConfigs
,
...
freePrizes
]
}
this
.
formattedPrizeList
=
this
.
lotteryInfo
.
prizeConfigs
}
},
mounted
()
{
mounted
()
{
if
(
this
.
prizeLen
>=
6
&&
this
.
prizeLen
%
2
===
0
)
{
const
freePrizes
=
new
Array
(
2
).
fill
({
id
:
0
,
name
:
'谢谢参与'
})
this
.
formattedPrizeList
=
[...
this
.
lotteryInfo
.
prizeConfigs
,
...
freePrizes
]
}
else
{
this
.
formattedPrizeList
=
this
.
lotteryInfo
.
prizeConfigs
}
Bus
.
$on
(
'updateMain'
,
data
=>
{
Bus
.
$on
(
'updateMain'
,
data
=>
{
for
(
const
[
key
,
value
]
of
Object
.
entries
(
data
))
{
for
(
const
[
key
,
value
]
of
Object
.
entries
(
data
))
{
if
(
key
===
'func'
)
{
if
(
key
===
'func'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment