Commit 3161dcdf by 曾经

no message

parent 1f869bf1
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
@click="playMusic" @click="playMusic"
v-if="game.backMusicFlag && game.gameExt.backMusicUrl" v-if="game.backMusicFlag && game.gameExt.backMusicUrl"
></div> ></div>
<div class="integral" v-if="game.integral"> <div class="integral" v-if="rule.integral">
{{ game.integralCount || 0 }}积分/次 {{ rule.integral || 0 }}积分/次
</div> </div>
<swiper <swiper
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
> >
<swiper-slide v-for="item in list" :key="item"> <swiper-slide v-for="item in list" :key="item">
<div class="swiper-item"> <div class="swiper-item">
<img <img src="./images/tips_bg.png" />
src="./images/tips_bg.png"
/>
<span>{{ item }}</span> <span>{{ item }}</span>
</div> </div>
</swiper-slide> </swiper-slide>
...@@ -50,38 +48,32 @@ ...@@ -50,38 +48,32 @@
<div class="points-count-box"> <div class="points-count-box">
<div> <div>
<div class="text-box"> <!-- 左边显示-右边次数显示且积分玩法开启才显示在左边 -->
<div class="text-box" v-if="rule.integral && playNumberObj && playNumberObj.playNumberFlag">
<div class="text">{{ currentIntegral }}</div> <div class="text">{{ currentIntegral }}</div>
<img <img class="text-shadow" src="./images/circle_bg.png" />
class="text-shadow" <img class="title-image" src="./images/我的积分.png" />
src="./images/circle_bg.png"
/>
<img
class="title-image"
src="./images/我的积分.png"
/>
</div> </div>
</div> </div>
<div class="game-name-box"> <img
<div class="line left"></div> class="guide-img"
<div class="game-name">点击盲盒抽取好礼</div> :src="game.gameExt.guideImageUrl"
<div class="line right"></div> mode="widthFix"
</div> />
<div> <div>
<div <div
class="text-box" class="text-box"
v-if="playNumberObj && playNumberObj.playNumberFlag" v-if="playNumberObj && playNumberObj.playNumberFlag"
> >
<div class="text">{{ playNumberObj.playNumber }}</div> <div class="text">{{ playNumberObj.playNumber }}</div>
<img <img class="text-shadow" src="./images/circle_bg.png" />
class="text-shadow" <img class="title-image" src="./images/剩余次数.png" />
src="./images/circle_bg.png" </div>
/> <div class="text-box" v-else-if="rule.integral">
<img <div class="text">{{ currentIntegral }}</div>
class="title-image" <img class="text-shadow" src="./images/circle_bg.png" />
src="./images/剩余次数.png" <img class="title-image" src="./images/我的积分.png" />
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -98,9 +90,7 @@ ...@@ -98,9 +90,7 @@
<div class="icon"> <div class="icon">
<div class="iconfont icon-yaoqing"></div> <div class="iconfont icon-yaoqing"></div>
</div> </div>
<img <img src="./images/邀请助力.png" />
src="./images/邀请助力.png"
/>
</div> </div>
</div> </div>
...@@ -131,6 +121,7 @@ const { ...@@ -131,6 +121,7 @@ const {
getGamePlayBarrage, getGamePlayBarrage,
gamePlay, gamePlay,
getIntegral, getIntegral,
getGameRule,
} = gameRequestApi; } = gameRequestApi;
import { Swiper, SwiperSlide } from "vue-awesome-swiper"; import { Swiper, SwiperSlide } from "vue-awesome-swiper";
...@@ -213,7 +204,7 @@ export default { ...@@ -213,7 +204,7 @@ export default {
disableOnInteraction: true, disableOnInteraction: true,
}, },
}, },
isPlay: true, isPlay: false,
name: "猜盲盒", name: "猜盲盒",
game: {}, game: {},
gameId: "1", gameId: "1",
...@@ -224,25 +215,51 @@ export default { ...@@ -224,25 +215,51 @@ export default {
}, },
created() { created() {
document.title = "猜盲盒"; document.title = "猜盲盒";
// this.postApi(); if (!this.audio) {
// this.getApi(); this.audio = new Audio();
this.audio.autoplay = true;
this.audio.addEventListener(
"ended",
() => {
if (this.isPlay) {
this.audio.play();
}
},
false
);
}
this.getGame(); this.getGame();
this.getGameRule();
this.getGamePlayNumber(); this.getGamePlayNumber();
this.getIntegral(); this.getIntegral();
}, },
methods: { methods: {
getGame() { async getGame() {
getGameInfo({ let res = await getGameInfo({
gameId: this.gameId, gameId: this.gameId,
enterpriseId: this.enterpriseId, enterpriseId: this.enterpriseId,
}).then((res) => {
console.log(res);
document.title = res.gameName;
res.gameExt.prizeStyleList = JSON.parse(
res.gameExt.prizeStyleJson || "[]"
);
this.game = res;
}); });
document.title = res.gameName;
res.gameExt.prizeStyleList = JSON.parse(
res.gameExt.prizeStyleJson || "[]"
);
this.game = res;
this.audio.src = res.gameExt.backMusicUrl;
if (this.isPlay) {
this.audio.play();
} else {
this.audio.pause();
}
},
async getGameRule(){
let rule = await getGameRule({
gameId: this.gameId,
enterpriseId: this.enterpriseId,
})
this.rule = rule;
}, },
async getGamePlayNumber() { async getGamePlayNumber() {
let playNumberObj = await getGamePlayNumber({ let playNumberObj = await getGamePlayNumber({
...@@ -294,6 +311,11 @@ export default { ...@@ -294,6 +311,11 @@ export default {
}, },
playMusic() { playMusic() {
this.isPlay = !this.isPlay; this.isPlay = !this.isPlay;
if (this.isPlay) {
this.audio.play();
} else {
this.audio.pause();
}
}, },
clickShareBtn() { clickShareBtn() {
this.showShareImgDialog = true; this.showShareImgDialog = true;
...@@ -538,30 +560,9 @@ export default { ...@@ -538,30 +560,9 @@ export default {
height: 16px; height: 16px;
} }
.game-name-box { .guide-img {
display: flex; width: 174px;
align-items: center; height: 17px;
position: relative;
}
.game-name-box .line {
width: 13px;
height: 3px;
border-radius: 1px;
}
.game-name-box .line.left {
background: linear-gradient(90deg, rgba(39, 41, 43, 0) 0%, #27292b 100%);
margin-right: 3px;
}
.game-name-box .line.right {
background: linear-gradient(90deg, #27292b 0%, rgba(39, 41, 43, 0) 100%);
margin-left: 3px;
}
.game-name-box .game-name {
color: #27292b;
font-size: 18px;
font-weight: 600;
} }
.ad-image { .ad-image {
......
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 to comment