You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
// pages/heartNew/heartNew.js
|
|
|
|
const app = getApp()
|
|
|
|
Page({
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面的初始数据
|
|
|
|
*/
|
|
|
|
data: {
|
|
|
|
statusHeight: 0, // 自定义头部状态栏高度
|
|
|
|
navigationHeight: 0, // 自定义头部导航栏高度
|
|
|
|
selectedTab: 'tab0',
|
|
|
|
// banner 相关
|
|
|
|
banner: [{
|
|
|
|
actId:'1',
|
|
|
|
bannerImg:'https://epdc-shibei.elinkservice.cn/epdcFile/M00/02/B2/rBAAM16W7SqAY1XjAAMWUuGo2D4654.jpg',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
actId:'2',
|
|
|
|
bannerImg:'https://epdc-shibei.elinkservice.cn/epdcFile/M00/02/B2/rBAAM16W7SqAY1XjAAMWUuGo2D4654.jpg',
|
|
|
|
}],
|
|
|
|
indicatorDots: false, //指示点
|
|
|
|
autoplay: true, //true false,//自动播放
|
|
|
|
circular: true, //衔接滑动
|
|
|
|
interval: 4000, //自动播放间隔时长(ms)
|
|
|
|
duration: 500, //幻灯片切换时长(ms)
|
|
|
|
currentSwiper: 0
|
|
|
|
// banner 相关end
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
this.setData({
|
|
|
|
statusHeight: app.globalData.deviceInfo.statusHeight,
|
|
|
|
navigationHeight: app.globalData.deviceInfo.navigationHeight,
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// tab 切换
|
|
|
|
tabBarChange(e) {
|
|
|
|
console.log(e.currentTarget.dataset.tab)
|
|
|
|
if (e.currentTarget.dataset.tab == 'tab3') {
|
|
|
|
wx.navigateTo({
|
|
|
|
url: `/subpages/heart/pages/leaderboardNew/leaderboardNew`
|
|
|
|
})
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
selectedTab: e.currentTarget.dataset.tab
|
|
|
|
})
|
|
|
|
},
|
|
|
|
//返回上一级
|
|
|
|
goback() {
|
|
|
|
wx.navigateBack({
|
|
|
|
delta: 1
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// banner 切换
|
|
|
|
swiperChange: function(e) {
|
|
|
|
this.setData({
|
|
|
|
currentSwiper: e.detail.current
|
|
|
|
})
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
*/
|
|
|
|
onReady: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面显示
|
|
|
|
*/
|
|
|
|
onShow: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面隐藏
|
|
|
|
*/
|
|
|
|
onHide: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面卸载
|
|
|
|
*/
|
|
|
|
onUnload: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
*/
|
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 页面上拉触底事件的处理函数
|
|
|
|
*/
|
|
|
|
onReachBottom: function () {
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 用户点击右上角分享
|
|
|
|
*/
|
|
|
|
onShareAppMessage: function () {
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|