Commit bcf46435 by 赖慧粮

feat(lottery): 补充跳转通信 & 补充转盘谢谢参与图片

parent a2d6808e
...@@ -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>
......
...@@ -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>
......
...@@ -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 })
})
} }
} }
} }
......
...@@ -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}`
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment