微信红包dome php,微信小程序学习用demo:简易图片动画红包代码

3ce7344081224f098a6f7ba6fee54e8a.pngvar app = getApp();

Page({

data: {

userInfo: {},

src: '',

coverImg:{

hidden: false,

top: 0, //上面图片的top值

bottom: 0, //下面图片的bottom值

locked: false //首页展开触摸锁定

},

openPage: app.globalData.openPage==1?true:false

},

resetCoverImg: function() {

this.setData({

coverImg:{

hidden: false,

top: '0',

bottom: '0'

}

})

},

bindOpenTap: function () {

var that = this;

if(!that.data.coverImg.locked){

that.setData({coverImg:{locked: true}});

var dis = 0;

var timer = setInterval(function(){

dis -= 1;

that.setData({

coverImg:{

top: dis+'%',

bottom: dis+'%'

}

})

},10);

setTimeout(function(){

clearInterval(timer);

//展开首页图

that.setData({

coverImg:{

hidden: true,

locked: false

}

})

//未展示开屏页直接跳转

if(that.data.openPage){

that.goToOpenPage();

}else{

that.goToListPage();

}

},500);

}

},

goToListPage: function() {

wx.navigateTo({

url: '../list/list'

})

},

goToOpenPage: function() {

wx.navigateTo({

url: '../open/open'

})

},

//分享

onShareAppMessage: function() {

app.updateUserInfo({'type':0});

return {

title: '优惠猎手PRO',

desc: '优惠猎手PRO',

path: 'pages/index/index'

}

},

onShow: function() {

this.resetCoverImg();

}

})

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值