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
bcf46435
authored
Sep 10, 2021
by
赖慧粮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(lottery): 补充跳转通信 & 补充转盘谢谢参与图片
parent
a2d6808e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
3 deletions
+42
-3
components/Lottery/Instant/Main.vue
+2
-1
components/Lottery/Instant/MiniMain.vue
+2
-1
pages/mini/index/index.vue
+29
-1
store/users.js
+9
-0
No files found.
components/Lottery/Instant/Main.vue
View file @
bcf46435
...
@@ -61,7 +61,8 @@
...
@@ -61,7 +61,8 @@
{{
rows
.
name
}}
</p>
{{
rows
.
name
}}
</p>
</div>
</div>
<div
class=
"lottery-instant__prize-img"
>
<div
class=
"lottery-instant__prize-img"
>
<img
src=
"@/assets/images/lottery/gift.png"
alt=
""
>
<img
v-if=
"rows.id"
src=
"@/assets/images/lottery/gift.png"
alt=
""
>
<img
v-else
src=
"@/assets/images/lottery/free.png"
alt=
""
/>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
components/Lottery/Instant/MiniMain.vue
View file @
bcf46435
...
@@ -60,7 +60,8 @@
...
@@ -60,7 +60,8 @@
{{
rows
.
name
}}
</p>
{{
rows
.
name
}}
</p>
</div>
</div>
<div
class=
"lottery-instant__prize-img"
>
<div
class=
"lottery-instant__prize-img"
>
<img
src=
"@/assets/images/lottery/gift.png"
alt=
""
>
<img
v-if=
"rows.id"
src=
"@/assets/images/lottery/gift.png"
alt=
""
>
<img
v-else
src=
"@/assets/images/lottery/free.png"
alt=
""
/>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
...
...
pages/mini/index/index.vue
View file @
bcf46435
...
@@ -27,7 +27,9 @@ export default {
...
@@ -27,7 +27,9 @@ export default {
[
LOTTERY_TYPE
.
timing
]:
()
=>
import
(
'@/components/Lottery/Timing/Main'
)
[
LOTTERY_TYPE
.
timing
]:
()
=>
import
(
'@/components/Lottery/Timing/Main'
)
},
},
id
:
this
.
$route
.
query
.
id
||
null
,
// 接收抽奖id
id
:
this
.
$route
.
query
.
id
||
null
,
// 接收抽奖id
sessionId
:
this
.
$route
.
query
.
sessionId
||
null
// 接收抽奖场次id
sessionId
:
this
.
$route
.
query
.
sessionId
||
null
,
// 接收抽奖场次id
connection
:
null
,
timer
:
null
// sid: this.$route.query.sid || null, // 引用id
// sid: this.$route.query.sid || null, // 引用id
// stype: this.$route.query.stype || null, // 引用类型
// stype: this.$route.query.stype || null, // 引用类型
}
}
...
@@ -40,11 +42,14 @@ export default {
...
@@ -40,11 +42,14 @@ export default {
})
})
},
},
created
()
{
created
()
{
this
.
connectionInit
()
this
.
dataInit
()
this
.
dataInit
()
},
},
destroyed
()
{
destroyed
()
{
Bus
.
$off
(
'LotteryInfoUpdate'
)
Bus
.
$off
(
'LotteryInfoUpdate'
)
Bus
.
$off
(
'LotteryStateUpdate'
)
Bus
.
$off
(
'LotteryStateUpdate'
)
Bus
.
$off
(
'BusToLogin'
)
Bus
.
$off
(
'BusToBindPhone'
)
},
},
methods
:
{
methods
:
{
...
mapActions
({
...
mapActions
({
...
@@ -53,6 +58,21 @@ export default {
...
@@ -53,6 +58,21 @@ export default {
getUerInfo
:
'users/getUerInfo'
,
getUerInfo
:
'users/getUerInfo'
,
postInfo
:
'users/postInfo'
postInfo
:
'users/postInfo'
}),
}),
connectionInit
()
{
if
(
process
.
client
)
{
const
{
ClientConnection
}
=
require
(
'@easy-messenger/client-connection/dist/clientConnection.cjs.js'
)
this
.
connection
=
new
ClientConnection
()
let
counter
=
0
this
.
timer
=
setInterval
(()
=>
{
this
.
connection
.
init
()
counter
++
if
(
this
.
connection
.
connected
||
counter
>
60
)
{
clearInterval
(
this
.
timer
)
this
.
connectionListener
()
}
},
1000
)
}
},
// 页面进入初始化
// 页面进入初始化
dataInit
()
{
dataInit
()
{
const
{
id
,
sessionId
:
playId
,
uin
}
=
this
.
$route
.
query
const
{
id
,
sessionId
:
playId
,
uin
}
=
this
.
$route
.
query
...
@@ -114,6 +134,14 @@ export default {
...
@@ -114,6 +134,14 @@ export default {
}
}
}
}
})
})
// 转跳至登录页
Bus
.
$on
(
'BusToLogin'
,
data
=>
{
this
.
connection
.
emit
(
'directionalJump'
,
{
type
:
'login'
,
currentUrl
:
window
.
location
.
href
})
})
// 转跳至绑定手机页
Bus
.
$on
(
'BusToBindPhone'
,
data
=>
{
this
.
connection
.
emit
(
'directionalJump'
,
{
type
:
'bindPhone'
,
currentUrl
:
window
.
location
.
href
})
})
}
}
}
}
}
}
...
...
store/users.js
View file @
bcf46435
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
getUserInfo
,
setPvInfo
}
from
'@/api/modules/common'
import
{
getUserInfo
,
setPvInfo
}
from
'@/api/modules/common'
import
QuickStorage
from
'@/utils/QuickStorage'
import
QuickStorage
from
'@/utils/QuickStorage'
import
{
CUSTOM_SOURCE_TYPE
}
from
'@/utils/constant'
import
{
CUSTOM_SOURCE_TYPE
}
from
'@/utils/constant'
import
Bus
from
'@/utils/Bus'
export
const
state
=
()
=>
({
export
const
state
=
()
=>
({
uin
:
0
,
uin
:
0
,
...
@@ -66,6 +67,10 @@ export const actions = {
...
@@ -66,6 +67,10 @@ export const actions = {
}
}
const
origin
=
window
.
location
.
origin
const
origin
=
window
.
location
.
origin
const
backUrl
=
encodeURIComponent
(
window
.
location
.
href
)
const
backUrl
=
encodeURIComponent
(
window
.
location
.
href
)
if
(
window
.
top
!==
window
.
self
)
{
Bus
.
$emit
(
'BusToLogin'
)
return
}
window
.
location
.
href
=
`
${
origin
}
/my/login?uin=
${
state
.
uin
}
&backUrl=
${
backUrl
}
`
window
.
location
.
href
=
`
${
origin
}
/my/login?uin=
${
state
.
uin
}
&backUrl=
${
backUrl
}
`
},
},
jumpToBinding
({
state
})
{
jumpToBinding
({
state
})
{
...
@@ -75,6 +80,10 @@ export const actions = {
...
@@ -75,6 +80,10 @@ export const actions = {
}
}
const
origin
=
window
.
location
.
origin
const
origin
=
window
.
location
.
origin
const
backUrl
=
encodeURIComponent
(
window
.
location
.
href
)
const
backUrl
=
encodeURIComponent
(
window
.
location
.
href
)
if
(
window
.
top
!==
window
.
self
)
{
Bus
.
$emit
(
'BusToBindPhone'
)
return
}
window
.
location
.
href
=
`
${
origin
}
/my/login/binding?uin=
${
state
.
uin
}
&backUrl=
${
backUrl
}
`
window
.
location
.
href
=
`
${
origin
}
/my/login/binding?uin=
${
state
.
uin
}
&backUrl=
${
backUrl
}
`
}
}
}
}
...
...
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