=chenming 5 years ago
parent
commit
109fd4824e
6 changed files with 56 additions and 36 deletions
  1. +9
    -6
      496_dongfengqichen/pages/index/index.js
  2. +2
    -2
      496_dongfengqichen/pages/index/index.wxml
  3. +0
    -1
      496_dongfengqichen/pages/index/index.wxss
  4. +41
    -26
      496_dongfengqichen/pages/luckyStar/luckyStar.js
  5. +1
    -1
      496_dongfengqichen/pages/luckyStar/luckyStar.wxml
  6. +3
    -0
      496_dongfengqichen/pages/luckyStar/luckyStar.wxss

+ 9
- 6
496_dongfengqichen/pages/index/index.js View File

@@ -33,7 +33,7 @@ Page({
mainShow:false,
isOnce:false,
userData:null,
kvurl: app.globalData.kvurl,//顶部大图
kvurl: null,//顶部大图
},
onLoad: function () {
app.globalData.nowPage = 1;
@@ -48,6 +48,9 @@ Page({
}
},
loadFun: function () {
this.setData({
kvurl: app.globalData.kvurl
})
if (app.globalData.userInfoData) {
this.setData({
userData: app.globalData.userInfoData
@@ -329,11 +332,6 @@ Page({
getStartAdvertising: function () {//获取开屏广告
app.wxRequest(app.globalData.urlRoot + "home/getStartAdvertising", {}, res => {
this.data.isOnce = true;
if (app.globalData.openid) {
this.loadFun();
} else {
app.globalData.openidSuccessFuc = this.loadFun;
}
if(res.code==200){
this.setData({
startAdvertisingUrl: res.data.picurl,
@@ -353,6 +351,11 @@ Page({
},1000);
}, 3000);
}
if (app.globalData.openid) {
this.loadFun();
} else {
app.globalData.openidSuccessFuc = this.loadFun;
}
},this);
},
getHomeBanner: function () {//获取banner

+ 2
- 2
496_dongfengqichen/pages/index/index.wxml View File

@@ -2,7 +2,7 @@
<view class="all" wx:if="{{mainShow}}">
<view class="main" wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}">
<view class="contentFrame">
<image style="width:750rpx;height:1506rpx;" src="{{kvurl}}"></image>
<image style="width:750rpx;" mode="widthFix" src="{{kvurl}}"></image>
<image style="width:750rpx;height:331rpx;" src="{{imgUrl+'/images/indexText.png'}}"></image>
<view class="swiperFrame">
<swiper class="swiperSty" autoplay current="{{swiperCurrent}}" bindchange="swiperChange">
@@ -65,5 +65,5 @@
</view>
<tabBar wx:if="{{isStartAdvertising==0 || !isStartAdvertisingShow}}"></tabBar>
<!-- <view wx:if="{{isStartAdvertisingShow}}" class='imgBg' catchtouchmove="ture"></view> -->
<image wx:if="{{isStartAdvertisingShow}}" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image>
<image wx:if="{{isStartAdvertisingShow}}" mode="widthFix" style="opacity:{{isStartAdvertising}};" src="{{startAdvertisingUrl}}" class='imgBg' catchtouchmove="ture"></image>
</view>

+ 0
- 1
496_dongfengqichen/pages/index/index.wxss View File

@@ -14,7 +14,6 @@ view{
top: 0;
left: 0;
width: 750rpx;
height: 1506rpx;
transition: opacity 1000ms;
z-index: 100;
}

+ 41
- 26
496_dongfengqichen/pages/luckyStar/luckyStar.js View File

@@ -43,6 +43,7 @@ Page({
isMore:true,
startDown:-1,//游戏开始倒计时
clawType:false,//是否正在抓取
gameEnd:true
},

/**
@@ -140,18 +141,17 @@ Page({
})
var setInt2 = setInterval(() => {
if (this.data.startDown > -1) {
this.data.startDown -= 1;
this.setData({
startDown: this.data.startDown -= 1
startDown: this.data.startDown
})
} else {
this.setData({
startDown: -1
})
clearInterval(setInt2);
this.data.gameSign = res.data.sign;
this.endGame();
if (this.data.gameSign) {
this.downTimeFun();
if (this.data.startDown==-1){
clearInterval(setInt2);
this.data.gameSign = res.data.sign;
this.endGame();
if (this.data.gameSign) {
this.downTimeFun();
}
}
}
}, 1000);
@@ -184,14 +184,14 @@ Page({
this.setData({
btnGroup: this.data.btnGroup
})
if (this.data.clawLeft <= 130) {
if (this.data.clawLeft <= 110) {
return;
}
this.data.setGroup.left = setInterval(() => {
this.setData({
clawLeft: this.data.clawLeft-=2
})
if (this.data.clawLeft <= 130) {
if (this.data.clawLeft <= 110) {
clearInterval(this.data.setGroup.left);
}
},20);
@@ -200,14 +200,14 @@ Page({
this.setData({
btnGroup: this.data.btnGroup
})
if (this.data.clawLeft >= 445) {
if (this.data.clawLeft >= 415) {
return;
}
this.data.setGroup.right = setInterval(() => {
this.setData({
clawLeft: this.data.clawLeft += 2
})
if (this.data.clawLeft >= 445) {
if (this.data.clawLeft >= 415) {
clearInterval(this.data.setGroup.right);
}
}, 20);
@@ -304,7 +304,7 @@ Page({
})
}
}
},1000)
},800)
},
downTimeFun: function () {//游戏倒计时
this.data.gameState = true;
@@ -327,14 +327,30 @@ Page({
downNum: 30,
clawTop: this.data.clawScale > 1 ? -100 - (2 * (this.data.clawScale - 1) * 440) : -100 + (2 * (1 - this.data.clawScale) * 440)
})
setTimeout(()=>{
setTimeout(() => {
this.setData({
gameEnd:false
})
this.setData({
downNum: 30,
clawTop: -440,
clawLeft: 268,
clawScale:1
clawScale: 1
})
}, 1200);
setTimeout(() => {
this.setData({
clawTop: -440,
})
}, 800)
setTimeout(()=>{
this.setData({
clawLeft: 268
})
},1600)
setTimeout(()=>{
this.setData({
gameEnd: true
})
},2400)
}, 800);
},
prizeLook:function(){//活动奖品
if(!this.data.gameState){
@@ -379,7 +395,6 @@ Page({
if(res.data.length<this.data.configure.count){
this.data.isMore = false;
}
console.log(this.data.isMore);
for(let i=0;i<res.data.length;i++){
this.data.gameAwardList.push(res.data[i]);
}
@@ -404,11 +419,11 @@ Page({
}
},
changeScroll:function(){
this.data.setInt = setInterval(()=>{
this.setData({
scrollNum: this.data.scrollNum+=1
})
},30);
// this.data.setInt = setInterval(()=>{
// this.setData({
// scrollNum: this.data.scrollNum+=1
// })
// },30);
},
getMore:function(){
if (!this.data.isMore){

+ 1
- 1
496_dongfengqichen/pages/luckyStar/luckyStar.wxml View File

@@ -7,7 +7,7 @@
<image class="gameTitle" src="{{imgUrl+'/images/luckyTitle.png'}}"></image>
<view class="downTime">{{'00:'+downNum}}</view>
<image class="prizeIcon2" src="{{imgUrl+'/images/prizeIcon2.png?v=003'}}"></image>
<image class="gameClaw" style="top:{{clawTop}}rpx;left:{{clawLeft}}rpx;transform: scale({{clawScale}});" src="{{imgUrl+'/images/gameClaw'+(clawType?2:1)+'.png'}}"></image>
<image class="gameClaw {{!gameEnd?'gameClaw2':''}}" style="top:{{clawTop}}rpx;left:{{clawLeft}}rpx;transform: scale({{clawScale}});" src="{{imgUrl+'/images/gameClaw'+(clawType?2:1)+'.png'}}"></image>
<image class="prizeIcon1" src="{{imgUrl+'/images/prizeIcon1.png?v=003'}}"></image>
<view class="getPrizeTip">
<view class="prizeTipLine"></view>

+ 3
- 0
496_dongfengqichen/pages/luckyStar/luckyStar.wxss View File

@@ -99,6 +99,9 @@ view{
transform: scale(2);
transform-origin:50% 0 0;
}
.gameClaw2{
transition: all 0.8s linear;
}
.prizeIcon2{
position: absolute;
left: 74rpx;

Loading…
Cancel
Save