Commit 9fd4f9e9 authored by Mac's avatar Mac

首页改动

parent 51162a43
......@@ -74,12 +74,12 @@
}).fail(data => {});
getMsg()
function sendMsg(msg,type) {
if(type ==1){
function sendMsg(msg) {
proxy.invoke("SendBarrage", msg).done(data => {
layer.msg('发送成功');
});
}
}
function send() {
var value = $('.bar_input input').val();
......@@ -87,7 +87,7 @@
layer.msg('不能为空哦');
return
}
sendMsg(value,1)
sendMsg(value)
}
function getMsg() {
......
......@@ -98,37 +98,7 @@
</div>
<div class="circleCount">3</div>
<input type="button" value="开始" id="Start" style="z-index:9999;position: fixed;top:0;">
<!-- &lt;!&ndash; 排行榜&ndash;&gt;-->
<!-- <div class="rank_mask">-->
<!-- <div class="zhezao"></div>-->
<!-- <div class="rank_box">-->
<!-- <div class="rBox_top"></div>-->
<!-- <div class="rank_y">-->
<!-- <p>你的排名 第</p>-->
<!-- <p style="font-style: oblique">1</p>-->
<!-- <p style="margin-left: 0.05rem">名</p>-->
<!-- </div>-->
<!-- <div class="rank_i">-->
<!-- <div class="rank_item">-->
<!-- <div class="rank_itemL">-->
<!-- <div class="rank_num">10</div>-->
<!-- <p>李思思</p>-->
<!-- </div>-->
<!-- <div class="rank_itemR">-->
<!-- <div class="shuxi"></div>-->
<!-- <p>1234</p>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="Close"></div>-->
<!-- </div>-->
<!-- </div>-->
</div>
......@@ -151,7 +121,10 @@
});
var proxy = conn.createHubProxy("annualLeaveHub");
conn.start().done(data => {
sendMsg()
sendMsg();
sendScore();
joinGeme() //参加活动
}).fail(data => {});
getMsg()
......@@ -185,19 +158,22 @@
$('.status3').css({'display':'flex'});
}
});
if(type ==1){
proxy.invoke("SetGameScore", 'Mouse',msg).done(data => { //发送分数
console.log(data)
});
}
proxy.invoke("JoinGame", 'Mouse').done(data => { //进入页面调用
}
function sendScore(msg) {
proxy.invoke("SetGameScore", 'Mouse',msg).done(data => { //发送分数
console.log(data)
});
}
function joinGeme() {
proxy.invoke("JoinGame", 'Mouse').done(data => { //加入活动
console.log(data)
});
}
function getMsg() {
//随时获取游戏的状态
proxy.on('getChangeMenu',function (data) {
......@@ -209,12 +185,14 @@
$('.status1').css({'display':'none'});
$('.status2').css({'display':'none'});
$('.status3').css({'display':'none'});
joinGeme()
}
if(data.status==1){
$('.status').css({'display':'none'});
$('.status1').css({'display':'flex'});
$('.status2').css({'display':'none'});
$('.status3').css({'display':'none'});
joinGeme()
}
if(data.status==2){
StartGame()
......@@ -240,6 +218,9 @@
function ces2(){
score=0
key = 0
for (var i=0 ;i<laoshudata.length; i++){
laoshudata[i].noclick =0; //0 为未点击 1为点击过
}
timer1 = setInterval(increase ,laoshudata[key].Interval+300)
}
......@@ -251,12 +232,13 @@
$('.hole-container .hole:eq('+wz+') .mouse img').animate({top:"0.05rem"},600);
//为老鼠的时候加100分
$('.hole-container .hole:eq('+wz+') .mouse img').click(function () {
score=score+100;
$('.score').html(score+ '分')
$('.hole-container .hole:eq('+wz+') .mouse img').attr('src','../../images/aM/dadao.png').click(function () {
});
if(laoshudata[key].noclick == 0) {
score = score + 100;
$('.score').html(score + '分')
sendScore(score)
$('.hole-container .hole:eq(' + wz + ') .mouse img').attr('src', '../../images/aM/dadao.png')
laoshudata[key].noclick=1
}
})
$('.hole-container .hole:eq('+wz+') .mouse img').animate({top:"0.65rem"},600);
......@@ -270,12 +252,13 @@
$('.hole-container .hole:eq('+wz+') .mouse').append('<img src="../../images/aM/pig.png" alt="">');
$('.hole-container .hole:eq('+wz+') .mouse img').animate({top:"0.05rem"},600);
$('.hole-container .hole:eq('+wz+') .mouse img').click(function () {
score=score-50;
$('.score').html(score+ '分')
$('.hole-container .hole:eq('+wz+') .mouse img').attr('src','../../images/aM/dadao.png').click(function () {
});
if(laoshudata[key].noclick == 0){
score=score-50;
$('.score').html(score+ '分')
sendScore(score)
$('.hole-container .hole:eq('+wz+') .mouse img').attr('src','../../images/aM/dadao.png')
laoshudata[key].noclick=1
}
})
$('.hole-container .hole:eq('+wz+') .mouse img').animate({top:"0.65rem"},600);
setTimeout(function () {
......@@ -289,10 +272,6 @@
key++
}
//模拟监听到开始事件
$("#Start").click(function(){
StartGame();
});
function StartGame() {
Count=3;
Count2=30;
......@@ -325,7 +304,7 @@
if (Count2 === 0) {
window.clearInterval(clock);
window.clearInterval(timer1); //清除老鼠
sendMsg(score,1)
sendScore(score)
//显示统计窗口
$('.rank_mask').css('display','block');
}
......
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