Commit 9cc97d2f by Lays-lzq

feat: mini新增banner

parent dce2fdbc
...@@ -41,7 +41,7 @@ export default { ...@@ -41,7 +41,7 @@ export default {
display: block; display: block;
width: 100%; width: 100%;
height: 0; height: 0;
padding-top: 115 / 330 * 100%; padding-top: 110 / 330 * 100%;
position: relative; position: relative;
} }
&__content { &__content {
......
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
v-if="+lotteryInfo.showType === LOTTERY_STYLE.grid || +lotteryInfo.showType === LOTTERY_STYLE.wheel" v-if="+lotteryInfo.showType === LOTTERY_STYLE.grid || +lotteryInfo.showType === LOTTERY_STYLE.wheel"
class="lottery-instant" class="lottery-instant"
> >
<Banner v-if="isShowBanner" class="lottery-instant__banner"></Banner>
<div v-if="+lotteryInfo.showType === LOTTERY_STYLE.grid" class="lottery-instant__layout-grid"> <div v-if="+lotteryInfo.showType === LOTTERY_STYLE.grid" class="lottery-instant__layout-grid">
<div class="lottery-instant__content-grid"> <div class="lottery-instant__content-grid">
<CountdownBar class="lottery-instant__countdown"></CountdownBar> <CountdownBar class="lottery-instant__countdown"></CountdownBar>
...@@ -172,6 +173,7 @@ import Bus from '@/utils/Bus' ...@@ -172,6 +173,7 @@ import Bus from '@/utils/Bus'
export default { export default {
name: 'MiniMain', name: 'MiniMain',
components: { components: {
Banner: () => import('@/components/Lottery/Instant/Banner'),
CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'), CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'),
Records: () => import('@/components/Lottery/Instant/Records'), Records: () => import('@/components/Lottery/Instant/Records'),
IntroductionPopup: () => import('@/components/Lottery/Instant/IntroductionPopup'), IntroductionPopup: () => import('@/components/Lottery/Instant/IntroductionPopup'),
...@@ -219,7 +221,8 @@ export default { ...@@ -219,7 +221,8 @@ export default {
id: 0, // 中奖等级 id: 0, // 中奖等级
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
} }
}, },
computed: { computed: {
...@@ -412,7 +415,7 @@ export default { ...@@ -412,7 +415,7 @@ export default {
background-size: cover; background-size: cover;
background-position: top center; background-position: top center;
background-repeat: no-repeat; background-repeat: no-repeat;
padding: 0px 15px 22px; padding: 12px 15px 22px;
overflow: hidden auto; overflow: hidden auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
&__layout-grid { &__layout-grid {
...@@ -434,7 +437,7 @@ export default { ...@@ -434,7 +437,7 @@ export default {
height: 100%; height: 100%;
} }
&__countdown { &__countdown {
padding-top: 18px; padding-top: 8px;
} }
&__times { &__times {
margin: 65px 0 5px; margin: 65px 0 5px;
......
<template> <template>
<section class="lottery-instant"> <section class="lottery-instant">
<div class="lottery-instant__main"> <div class="lottery-instant__main">
<Banner v-if="isShowBanner" class="lottery-instant__banner"></Banner>
<CountdownBar class="lottery-instant__countdown"></CountdownBar> <CountdownBar class="lottery-instant__countdown"></CountdownBar>
<div class="lottery-instant__layout-gashapon"> <div class="lottery-instant__layout-gashapon">
<div class="content-main"> <div class="content-main">
...@@ -51,6 +52,7 @@ import { ballListGashapon } from './config' ...@@ -51,6 +52,7 @@ import { ballListGashapon } from './config'
export default { export default {
components: { components: {
Banner: () => import('@/components/Lottery/Instant/Banner'),
CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'), CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'),
WinPopup: () => import('@/components/Lottery/Instant/WinPopup'), WinPopup: () => import('@/components/Lottery/Instant/WinPopup'),
BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'), BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'),
...@@ -90,7 +92,8 @@ export default { ...@@ -90,7 +92,8 @@ export default {
playId: this.$route.query.sessionId || null, // 场次id playId: this.$route.query.sessionId || null, // 场次id
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, // 引用类型
ballListGashapon // 扭蛋球图片 ballListGashapon, // 扭蛋球图片
isShowBanner: true
} }
}, },
computed: { computed: {
...@@ -155,6 +158,10 @@ export default { ...@@ -155,6 +158,10 @@ export default {
padding: 0; padding: 0;
overflow: auto; overflow: auto;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
&__banner {
margin-top: 10px;
padding: 0 25px;
}
&__countdown { &__countdown {
padding-top: 18px; padding-top: 18px;
} }
......
<template> <template>
<section class="lottery-instant"> <section class="lottery-instant">
<div class="lottery-instant__main"> <div class="lottery-instant__main">
<Banner v-if="isShowBanner" class="lottery-instant__banner"></Banner>
<img class="lottery-instant__title" src="@/assets/images/lottery/guess/game-title.png" /> <img class="lottery-instant__title" src="@/assets/images/lottery/guess/game-title.png" />
<CountdownBar class="lottery-instant__countdown"></CountdownBar> <CountdownBar class="lottery-instant__countdown"></CountdownBar>
<div class="lottery-instant__layout-guess"> <div class="lottery-instant__layout-guess">
...@@ -55,6 +56,7 @@ import { blindBoxListGuess, starConfig } from './config' ...@@ -55,6 +56,7 @@ import { blindBoxListGuess, starConfig } from './config'
export default { export default {
components: { components: {
Banner: () => import('@/components/Lottery/Instant/Banner'),
CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'), CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'),
PrizeGuess, PrizeGuess,
WinPopup: () => import('@/components/Lottery/Instant/WinPopup'), WinPopup: () => import('@/components/Lottery/Instant/WinPopup'),
...@@ -97,7 +99,8 @@ export default { ...@@ -97,7 +99,8 @@ export default {
chooseIndex: 0, chooseIndex: 0,
timer: null, timer: null,
blindBoxList: blindBoxListGuess, blindBoxList: blindBoxListGuess,
starConfig starConfig,
isShowBanner: true
} }
}, },
computed: { computed: {
...@@ -162,6 +165,10 @@ export default { ...@@ -162,6 +165,10 @@ export default {
&__main { &__main {
text-align: center; text-align: center;
} }
&__banner {
margin-top: 10px;
padding: 0 10px;
}
&__title { &__title {
width: 66.7%; width: 66.7%;
object-fit: cover; object-fit: cover;
......
<template> <template>
<section class="lottery-instant"> <section class="lottery-instant">
<div class="lottery-instant__main"> <div class="lottery-instant__main">
<Banner v-if="isShowBanner" class="lottery-instant__banner"></Banner>
<img class="lottery-instant__title" src="@/assets/images/lottery/guess/game-title.png" /> <img class="lottery-instant__title" src="@/assets/images/lottery/guess/game-title.png" />
<CountdownBar class="lottery-instant__countdown"></CountdownBar> <CountdownBar class="lottery-instant__countdown"></CountdownBar>
<div class="lottery-instant__layout-guess"> <div class="lottery-instant__layout-guess">
...@@ -55,6 +56,7 @@ import { blindBoxListGuess2 as blindBoxListGuess, starConfig } from './config' ...@@ -55,6 +56,7 @@ import { blindBoxListGuess2 as blindBoxListGuess, starConfig } from './config'
export default { export default {
components: { components: {
Banner: () => import('@/components/Lottery/Instant/Banner'),
CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'), CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'),
PrizeGuess, PrizeGuess,
WinPopup: () => import('@/components/Lottery/Instant/WinPopup'), WinPopup: () => import('@/components/Lottery/Instant/WinPopup'),
...@@ -97,7 +99,8 @@ export default { ...@@ -97,7 +99,8 @@ export default {
chooseIndex: 0, chooseIndex: 0,
timer: null, timer: null,
blindBoxList: blindBoxListGuess, blindBoxList: blindBoxListGuess,
starConfig starConfig,
isShowBanner: true
} }
}, },
computed: { computed: {
...@@ -164,19 +167,23 @@ export default { ...@@ -164,19 +167,23 @@ export default {
&__main { &__main {
text-align: center; text-align: center;
} }
&__banner {
margin-top: 10px;
padding: 0 10px;
}
&__title { &__title {
width: 66.7%; width: 66.7%;
object-fit: cover; object-fit: cover;
margin-top: 28px; margin-top: 6px;
} }
&__countdown { &__countdown {
padding-top: 6px; padding-top: 0px;
} }
&__layout-guess { &__layout-guess {
.content-img { .content-img {
position: relative; position: relative;
width: 218px; width: 218px;
height: 205px; height: 200px;
margin: -10px auto 0 auto; margin: -10px auto 0 auto;
img { img {
width: 100%; width: 100%;
...@@ -193,7 +200,7 @@ export default { ...@@ -193,7 +200,7 @@ export default {
width: 100%; width: 100%;
height: 0; height: 0;
padding-top: 156 / 367 * 100%; padding-top: 156 / 367 * 100%;
margin-top: 16px; margin-top: 6px;
&-box { &-box {
position: absolute; position: absolute;
bottom: 20%; bottom: 20%;
......
<template> <template>
<section class="lottery-instant"> <section class="lottery-instant">
<div class="lottery-instant__main"> <div class="lottery-instant__main">
<Banner v-if="isShowBanner" class="lottery-instant__banner"></Banner>
<CountdownBar class="lottery-instant__countdown"></CountdownBar> <CountdownBar class="lottery-instant__countdown"></CountdownBar>
<div class="lottery-instant__layout-scratch"> <div class="lottery-instant__layout-scratch">
<div class="lottery-instant__content-scratch"> <div class="lottery-instant__content-scratch">
...@@ -77,6 +78,7 @@ import Bus from '@/utils/Bus' ...@@ -77,6 +78,7 @@ import Bus from '@/utils/Bus'
export default { export default {
components: { components: {
Banner: () => import('@/components/Lottery/Instant/Banner'),
WinPopup: () => import('@/components/Lottery/Instant/WinPopup'), WinPopup: () => import('@/components/Lottery/Instant/WinPopup'),
CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'), CountdownBar: () => import('@/components/Lottery/Instant/CountdownBar'),
Records: () => import('@/components/Lottery/Instant/Records'), Records: () => import('@/components/Lottery/Instant/Records'),
...@@ -116,7 +118,8 @@ export default { ...@@ -116,7 +118,8 @@ export default {
id: this.$route.query.id || null, // 抽奖id id: this.$route.query.id || null, // 抽奖id
playId: this.$route.query.sessionId || null, // 场次id playId: this.$route.query.sessionId || null, // 场次id
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, // 引用类型
isShowBanner: true
} }
}, },
computed: { computed: {
...@@ -201,6 +204,10 @@ export default { ...@@ -201,6 +204,10 @@ export default {
&__main { &__main {
padding: 0 0.13rem; padding: 0 0.13rem;
} }
&__banner {
margin-top: 10px;
padding: 0 15px;
}
&__layout-scratch { &__layout-scratch {
position: relative; position: relative;
background-image: url('~@/assets/images/lottery/scratch/game-bg.png'); background-image: url('~@/assets/images/lottery/scratch/game-bg.png');
......
<template>
<section v-if="isShowBanner" class="banner">
<a class="banner__wrap" target="_blank" :href="bannerLink">
<div class="banner__content" :style="`background-image:url('${bannerImg}')`"></div>
</a>
</section>
</template>
<script>
// 默认背景图
import CONFIG from '@/config'
import { mapGetters } from 'vuex'
export default {
name: 'Banner',
computed: {
...mapGetters({
lotteryInfo: 'lottery/lotteryInfo'
}),
isShowBanner() {
const { isShowBanner } = this.lotteryInfo
return !!isShowBanner
},
bannerImg() {
const { banner } = this.lotteryInfo
const img = banner || CONFIG.defBanner
return `${img}${CONFIG.ossImageServe}`
},
bannerLink() {
return this.lotteryInfo.url || false
}
}
}
</script>
<style lang="less" scoped>
.banner {
width: 100%;
display: flex;
&__wrap {
display: block;
width: 100%;
height: 0;
padding-top: 110 / 330 * 100%;
position: relative;
}
&__content {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
border-radius: 4px;
background-size: cover;
background-position: center;
font-size: 0;
}
}
</style>
<template> <template>
<section class="main-timing" :style="{ backgroundPosition: isMini ? '0 0' : '' }"> <section class="main-timing" :style="{ backgroundPosition: isMini ? isShowBanner ? isIframe ? '0 100px' : '0 120px' : '0 0' : '' }">
<div v-if="isMini" class="main-link" @click="goRule">活动介绍</div> <div v-if="isMini" class="main-link" @click="goRule">活动介绍</div>
<Banner v-show="isShowBanner"></Banner>
<TimingStatus class="timing-status-box"></TimingStatus> <TimingStatus class="timing-status-box"></TimingStatus>
<JoinButton <JoinButton
class="join-button-box" class="join-button-box"
:style="{ bottom: isMini ? '26%' : '51%' }" :style="{ bottom: isMini ? isShowBanner ? isIframe ? '20%' : '35%' : '26%' : '51%' }"
@lottery="lotteryCallback" @lottery="lotteryCallback"
></JoinButton> ></JoinButton>
<Rewards v-if="!isMini" :style="{ height: isMini ? '65.5vh' : '40.5vh' }" class="reward-box"></Rewards> <Rewards v-if="!isMini" :style="{ height: isMini ? '65.5vh' : '40.5vh' }" class="reward-box"></Rewards>
...@@ -30,6 +31,8 @@ import Rewards from '@/components/Lottery/Timing/Rewards' ...@@ -30,6 +31,8 @@ import Rewards from '@/components/Lottery/Timing/Rewards'
import BackButton from '@/components/Lottery/Timing/BackButton' import BackButton from '@/components/Lottery/Timing/BackButton'
// 中奖弹窗 // 中奖弹窗
import WinPopup from '@/components/Lottery/Timing/WinPopup' import WinPopup from '@/components/Lottery/Timing/WinPopup'
// banner
import Banner from '../Banner.vue'
export default { export default {
...@@ -40,6 +43,7 @@ export default { ...@@ -40,6 +43,7 @@ export default {
Rewards, Rewards,
BackButton, BackButton,
WinPopup, WinPopup,
Banner,
BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'), BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'),
RulePopup: () => import('@/components/Lottery/Timing/RulePopup'), RulePopup: () => import('@/components/Lottery/Timing/RulePopup'),
Records: () => import('@/components/Lottery/Instant/Records') Records: () => import('@/components/Lottery/Instant/Records')
...@@ -74,6 +78,7 @@ export default { ...@@ -74,6 +78,7 @@ export default {
}, },
data() { data() {
return { return {
isShowBanner: true
} }
}, },
computed: { computed: {
...@@ -92,6 +97,9 @@ export default { ...@@ -92,6 +97,9 @@ export default {
? Object.values(this.lotteryInfo.prizeConfigs) ? Object.values(this.lotteryInfo.prizeConfigs)
: this.lotteryInfo.prizeConfigs : this.lotteryInfo.prizeConfigs
return list return list
},
isIframe() {
return self !== top
} }
}, },
methods: { methods: {
...@@ -109,9 +117,10 @@ export default { ...@@ -109,9 +117,10 @@ export default {
.main-timing { .main-timing {
height: 100%; height: 100%;
position: relative; position: relative;
padding-top: 20px; padding: 20px 24px 0;
background: url(../img/background-luckybag.png) no-repeat center; background: url(../img/background-luckybag.png) no-repeat center;
background-size: cover; background-size: cover;
background-color: #FD6F3C;
.main-link { .main-link {
width: 24px; width: 24px;
height: 74px; height: 74px;
...@@ -131,7 +140,7 @@ export default { ...@@ -131,7 +140,7 @@ export default {
} }
.timing-status-box { .timing-status-box {
// padding-left: 16px; // padding-left: 16px;
// margin-top: 10px; margin-top: 10px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
font-size: 14px; font-size: 14px;
......
<template> <template>
<section class="main-timing" :style="{ backgroundPosition: isMini ? '0 0' : '' }"> <section class="main-timing" :style="{ backgroundPosition: isMini ? isShowBanner ? isIframe ? '0 -190%' : '0 140px' : '0 30px' : '' }">
<div v-if="isMini" class="main-link" @click="goRule">活动介绍</div> <div v-if="isMini" class="main-link" @click="goRule">活动介绍</div>
<Banner v-show="isShowBanner"></Banner>
<TimingStatus class="timing-status-box"></TimingStatus> <TimingStatus class="timing-status-box"></TimingStatus>
<JoinButton <JoinButton
class="join-button-box" class="join-button-box"
:style="{ bottom: isMini ? '32%' : '49%' }" :style="{ bottom: isMini ? isShowBanner ? isIframe ? '22%' : '32%' : '26%' : '49%' }"
@lottery="lotteryCallback" @lottery="lotteryCallback"
></JoinButton> ></JoinButton>
<Rewards v-if="!isMini" :style="{ height: isMini ? '65.5vh' : '46.5vh' }" class="reward-box"></Rewards> <Rewards v-if="!isMini" :style="{ height: isMini ? '65.5vh' : '46.5vh' }" class="reward-box"></Rewards>
...@@ -30,6 +31,8 @@ import Rewards from '@/components/Lottery/Timing/Rewards' ...@@ -30,6 +31,8 @@ import Rewards from '@/components/Lottery/Timing/Rewards'
import BackButton from '@/components/Lottery/Timing/BackButton' import BackButton from '@/components/Lottery/Timing/BackButton'
// 中奖弹窗 // 中奖弹窗
import WinPopup from '@/components/Lottery/Timing/WinPopup' import WinPopup from '@/components/Lottery/Timing/WinPopup'
// banner
import Banner from '../Banner.vue'
export default { export default {
components: { components: {
...@@ -39,6 +42,7 @@ export default { ...@@ -39,6 +42,7 @@ export default {
Rewards, Rewards,
BackButton, BackButton,
WinPopup, WinPopup,
Banner,
BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'), BindPhoneDialog: () => import('@/components/Common/BindPhoneDialog'),
RulePopup: () => import('@/components/Lottery/Timing/RulePopup'), RulePopup: () => import('@/components/Lottery/Timing/RulePopup'),
Records: () => import('@/components/Lottery/Instant/Records') Records: () => import('@/components/Lottery/Instant/Records')
...@@ -73,6 +77,7 @@ export default { ...@@ -73,6 +77,7 @@ export default {
}, },
data() { data() {
return { return {
isShowBanner: true
} }
}, },
computed: { computed: {
...@@ -91,6 +96,9 @@ export default { ...@@ -91,6 +96,9 @@ export default {
? Object.values(this.lotteryInfo.prizeConfigs) ? Object.values(this.lotteryInfo.prizeConfigs)
: this.lotteryInfo.prizeConfigs : this.lotteryInfo.prizeConfigs
return list return list
},
isIframe() {
return self !== top
} }
}, },
methods: { methods: {
...@@ -107,9 +115,10 @@ export default { ...@@ -107,9 +115,10 @@ export default {
.main-timing { .main-timing {
height: 100%; height: 100%;
position: relative; position: relative;
padding-top: 20px; padding: 20px 24px 0;
background: url(../img/background-treasure.png) no-repeat center; background: url(../img/background-treasure.png) no-repeat center;
background-size: cover; background-size: cover;
background-color: #FD2216;
.main-link { .main-link {
width: 24px; width: 24px;
height: 74px; height: 74px;
...@@ -129,7 +138,7 @@ export default { ...@@ -129,7 +138,7 @@ export default {
} }
.timing-status-box { .timing-status-box {
// padding-left: 16px; // padding-left: 16px;
// margin-top: 10px; margin-top: 10px;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
font-size: 14px; font-size: 14px;
......
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