Commit d2fa9ed6 authored by 华国豪's avatar 华国豪 🙄

新增一些背景音乐

parent 18545a00
...@@ -46,15 +46,22 @@ export default { ...@@ -46,15 +46,22 @@ export default {
}, false); }, false);
// 游戏准备321的音乐 // 游戏准备321的音乐
this.MsgBus.$on('daojishiMp3', function (type) { this.MsgBus.$on('daojishiMp3', function (type) {
if (type === 1) { if (type === 1) { // 倒计时
$this.url = '/static/audio/ready321go.mp3' $this.url = '/static/audio/ready321go.mp3'
} else { } else if (2){ // 开始
$this.url = '/static/audio/game_running.mp3' $this.url = '/static/audio/game_running.mp3'
} }
setTimeout(()=>{ setTimeout(()=>{
$this.setAudioPlay(0) $this.setAudioPlay(0)
}, 50) }, 50)
}) })
// 更换背景音乐
this.MsgBus.$on('changeBGM', function (url) {
$this.url = url
setTimeout(()=>{
$this.setAudioPlay(0)
}, 50)
})
//$this.connectServer() //$this.connectServer()
this.MsgBus.$on('setBarrageShow', function (type) { this.MsgBus.$on('setBarrageShow', function (type) {
$this.barrageIsShow = type $this.barrageIsShow = type
......
.Ranking{
width: 100%;
height: 100%;
background: url(/static/image/gamerank/bg.png);
background-repeat: no-repeat;
background-size: 100% 100%;
position: absolute;
left: 0;
top: 0;
z-index: 10009;
}
.Ranking .logo{
position: relative;
left: 4rem;
top: 2rem;
}
.Ranking p.tit{
text-align: center;
font-size: 4rem;
color: white;
position: relative;
top: -20px;
}
.Ranking .rank-box{
width: 80%;
margin: 0 auto;
display: flex;
padding-top: 4rem;
}
.Ranking .rank-box .item {
width: 9rem;
}
.Ranking .rank-box .item .head{
position: relative;
width: 7rem;
height: 7rem;
border-radius: 50%;
background:linear-gradient(0deg,rgba(247,213,23,1),rgba(255,171,2,1));
padding: .4rem;
margin: 0 auto;
}
.Ranking .rank-box .item .head .maozi{
position: absolute;
left: -12px;
top: -20px;
box-sizing: border-box;
}
.Ranking .rank-box .item .head .user-img{
width: 7rem;
height: 7rem;
border-radius: 50%;
}
.Ranking .rank-box .item .body{
background: url(/static/image/gamerank/tiao.png);
background-repeat: no-repeat;
background-size: 100% 100%;
width: 60px;
margin: 0 auto;
height: 292px;
position: relative;
}
.Ranking .rank-box .item .body .color{
position: absolute;
left: 5%;
bottom: 0;
width: 89%;
background:linear-gradient(90deg,rgba(186,76,11,1),rgba(233,154,53,1),rgba(253,244,139,1),rgba(209,151,25,1));
border-radius:0px 0px 30px 30px;
}
.Ranking .rank-box .item .name{
text-align: center;
font-family: 'PingFangR';
font-size: 2.4rem;
color: white;
}
.Ranking .rank-box .item .name p:nth-child(1) {
padding: .4rem;
}
\ No newline at end of file
...@@ -27,4 +27,5 @@ ...@@ -27,4 +27,5 @@
.rank-box{ .rank-box{
background-color: wheat; background-color: wheat;
height: 65%; height: 65%;
box-sizing: border-box;
} }
...@@ -830,6 +830,9 @@ ...@@ -830,6 +830,9 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.dalaoshu .z_index10010{
z-index: 10010 !important;
}
.dalaoshu .hd-game-btn-container.hd-game-btn-container2{ .dalaoshu .hd-game-btn-container.hd-game-btn-container2{
width: 120px; width: 120px;
} }
......
...@@ -3,13 +3,15 @@ const leftNavMenu = [ ...@@ -3,13 +3,15 @@ const leftNavMenu = [
Class: 'iconfont iconshouye', Class: 'iconfont iconshouye',
Name: '首页', Name: '首页',
Url: 'index', Url: 'index',
children: [] children: [],
bgm: '/static/audio/bg_m_000.mp3',
}, },
{ {
Class: 'iconfont iconqiandao', Class: 'iconfont iconqiandao',
Name: '签到', Name: '签到',
Url: 'SignIn', Url: 'SignIn',
children: [] children: [],
bgm: '/static/audio/signIn.mp3',
}, },
{ {
Class: 'iconfont iconyouxi', Class: 'iconfont iconyouxi',
...@@ -20,19 +22,22 @@ const leftNavMenu = [ ...@@ -20,19 +22,22 @@ const leftNavMenu = [
Class: 'iconfont icon-laoshu', Class: 'iconfont icon-laoshu',
Name: '瑞鼠迎福', Name: '瑞鼠迎福',
Url: 'Mouse', Url: 'Mouse',
children: [] children: [],
bgm: '/static/audio/game_mouse_bg.mp3',
}, },
{ {
Class: 'iconfont iconqian', Class: 'iconfont iconqian',
Name: '疯狂数钞票', Name: '疯狂数钞票',
Url: 'Money', Url: 'Money',
children: [] children: [],
bgm: '/static/audio/game_money_bg.mp3',
}, },
{ {
Class: 'iconfont icondatiqia', Class: 'iconfont icondatiqia',
Name: '答题', Name: '答题',
Url: 'Answer', Url: 'Answer',
children: [] children: [],
bgm: '/static/audio/toupiao.mp3',
} }
] ]
}, },
...@@ -40,19 +45,22 @@ const leftNavMenu = [ ...@@ -40,19 +45,22 @@ const leftNavMenu = [
Class: 'iconfont iconchoujiang', Class: 'iconfont iconchoujiang',
Name: '抽奖', Name: '抽奖',
Url: 'LuckDraw', Url: 'LuckDraw',
children: [] children: [],
bgm: '/static/audio/choujiang.mp3',
}, },
{ {
Class: 'iconfont iconzu', Class: 'iconfont iconzu',
Name: '投票', Name: '投票',
Url: 'Vote', Url: 'Vote',
children: [] children: [],
bgm: '/static/audio/toupiao.mp3',
}, },
{ {
Class: 'iconfont iconpaihangbang', Class: 'iconfont iconpaihangbang',
Name: '排行榜', Name: '排行榜',
Url: 'PerformRanking', Url: 'PerformRanking',
children: [] children: [],
bgm: '/static/audio/choujiang.mp3',
} }
] ]
const controlMenu = [ const controlMenu = [
......
<template> <template>
<div class="pageNav"> <div class="pageNav">
<div class="left_nav ce9"> <div class="left_nav ce9">
<div class="left_nav_item" @click="goPage(item)" @mouseover="mouseOver(index)" @mouseleave="mouseLeave" v-for="(item, index) in leftNavMenu" :key="index" :index="index"> <div class="left_nav_item" @click.stop="goPage(item)" @mouseover="mouseOver(index)" @mouseleave="mouseLeave" v-for="(item, index) in leftNavMenu" :key="index" :index="index">
<div class="f1"> <div class="f1">
<i :class="item.Class"></i> <i :class="item.Class"></i>
</div> </div>
<template v-if="item.children.length"> <template v-if="item.children.length">
<p class="item_name">{{item.Name}}</p> <p class="item_name">{{item.Name}}</p>
<div class="left_nav_item_children" :class="animateClass" v-if="mouseIndex === index"> <div class="left_nav_item_children" :class="animateClass" v-if="mouseIndex === index">
<div class="children_item" @click="goPage(children)" v-for="(children, childrenIndex) in item.children" :key="childrenIndex" :index="`${index}-${childrenIndex}`" > <div class="children_item" @click.stop="goPage(children)" v-for="(children, childrenIndex) in item.children" :key="childrenIndex" :index="`${index}-${childrenIndex}`" >
<i :class="children.Class"></i><span>{{children.Name}}</span> <i :class="children.Class"></i><span>{{children.Name}}</span>
</div> </div>
</div> </div>
...@@ -155,6 +155,8 @@ export default { ...@@ -155,6 +155,8 @@ export default {
window.open('http://activity.oytour.com/html/SignIn/signin.html') window.open('http://activity.oytour.com/html/SignIn/signin.html')
return return
} }
console.log(obj)
this.MsgBus.$emit('changeBGM', obj.bgm)
if (!obj.children.length && this.$route.name !== obj.Url) { if (!obj.children.length && this.$route.name !== obj.Url) {
this.$router.push({ this.$router.push({
name: obj.Url name: obj.Url
......
<template> <template>
<div class="Ranking"> <div class="Ranking">
<img class="logo" src="/static/image/jiemu/logo.png" alt="">
<p class="tit"><span></span> <span></span> <span></span></p>
<div class="rank-box">
<div class="item" v-for="(item, index) in rankingList">
<div class="head">
<img v-if="index < 3" class="maozi" :src="`/static/image/gamerank/maozi_${index+1}.png`" alt="">
<img class="user-img" :src="item.photo" alt="">
</div>
<div class="body">
<div class="color" :style="{'height': (item.height * 20) + 'px'}"></div>
</div>
<div class="name">
<p>{{item.name}}</p>
<p>{{item.rank}}</p>
</div>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'Ranking', name: 'Ranking',
props: ['RankingList'], props: {
rankingList: {
type: Array,
default: []
}
},
data () { data () {
return { return {
......
...@@ -70,6 +70,12 @@ ...@@ -70,6 +70,12 @@
<span>准备</span> <span>准备</span>
</div> </div>
</div> </div>
<div class="hd-game-btn-container hd-game-btn-container2 z_index10010" v-show="rankingShow">
<div class="hd-game-btn" @click="RestGame()">
<i class="iconfont icon-go"></i>
<span>重置</span>
</div>
</div>
<div class="hd-game-btn-container" v-show="!showCount && !noReady && !showThrityCount"> <div class="hd-game-btn-container" v-show="!showCount && !noReady && !showThrityCount">
<div class="hd-game-btn" @click="StartGame()"> <div class="hd-game-btn" @click="StartGame()">
<i class="iconfont icon-go"></i> <i class="iconfont icon-go"></i>
...@@ -131,8 +137,8 @@ ...@@ -131,8 +137,8 @@
<h1>{{totalTime2}}</h1> <h1>{{totalTime2}}</h1>
</div> </div>
</div> </div>
<rank-list :rankingList="rankingList" v-show="rankingShow"></rank-list>
</div> </div>
<rank-list :rankingList="rankingList" v-show="rankingShow"></rank-list>
</div> </div>
</div> </div>
</template> </template>
...@@ -260,23 +266,13 @@ export default { ...@@ -260,23 +266,13 @@ export default {
// 监听游戏结束 展示排行榜 // 监听游戏结束 展示排行榜
this.$PROXY.on("notifyMouseGamerResult", data => { this.$PROXY.on("notifyMouseGamerResult", data => {
console.log(data) console.log(data)
if (data.length) { $this.getRankList(data)
$this.rankingShow = true
data.map(x=>{
$this.rankingList.push({
name: x.n,
photo: x.p,
rank: x.r
})
})
}
}) })
// 监听玩家分数 // 监听玩家分数
this.$PROXY.on("notifyeMouseGamerRank", data => { this.$PROXY.on("notifyeMouseGamerRank", data => {
console.log(data) console.log(data)
$this.rankingListNow = []; $this.rankingListNow = [];
if (data.length) { if (data.length) {
$this.rankingShow = true
data.map(x=>{ data.map(x=>{
$this.rankingListNow.push({ $this.rankingListNow.push({
name: x.n, name: x.n,
...@@ -303,6 +299,7 @@ export default { ...@@ -303,6 +299,7 @@ export default {
}); });
this.noReady = true this.noReady = true
this.showPeople = false this.showPeople = false
this.rankingShow = false
this.dataIndex = 0 this.dataIndex = 0
this.totalTime2 = 30 this.totalTime2 = 30
}, },
...@@ -336,8 +333,8 @@ export default { ...@@ -336,8 +333,8 @@ export default {
$this.countDown() $this.countDown()
$this.laoshuData = JSON.parse(data.data) $this.laoshuData = JSON.parse(data.data)
$this.StartGame() $this.StartGame()
} else { } else if (data.status === -1) {
$this.RestGame() $this.getRankList(data.rank)
} }
}); });
} catch (error) { } catch (error) {
...@@ -345,7 +342,19 @@ export default { ...@@ -345,7 +342,19 @@ export default {
$this.initData() $this.initData()
}, 1000); }, 1000);
} }
},
getRankList: function (data) {
if (data.length) {
data.map((x, index)=>{
this.rankingList.push({
name: x.n,
photo: x.p,
rank: x.s,
height: data.length - index
})
})
this.rankingShow = true
}
}, },
StartGame: function () { StartGame: function () {
console.log('游戏开始111111·') console.log('游戏开始111111·')
......
This diff is collapsed.
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