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.
130 lines
3.0 KiB
130 lines
3.0 KiB
// pages/index/join/join.js |
|
var Api = require('../../../utils/common.js'); |
|
var re = require('../../../utils/request.js'); |
|
Page({ |
|
/** |
|
* 页面的初始数据 |
|
*/ |
|
data: { |
|
navTab: ['个人报名'], |
|
currentTab: 0, |
|
people:12, |
|
person:false, |
|
activityId: '', |
|
team:true, |
|
personList:[ |
|
{img:'../../../images/ava.png',name:'李三',time:'2020-10-10 12:00'}, |
|
{img:'../../../images/ava.png',name:'李三',time:'2020-10-10 12:00'}, |
|
{img:'../../../images/ava.png',name:'李三',time:'2020-10-10 12:00',help:'1',helpname:'张可'}, |
|
], |
|
teamList:[ |
|
{img:'../../../images/logo.jpg',title:'众行天下',time:'2020-11-16',people:'12',user:'2'}, |
|
{img:'../../../images/ava.png',title:'众行天下',time:'2020-11-16',people:'12',user:'1'}, |
|
{img:'../../../images/ava.png',title:'众行天下',time:'2020-11-16',people:'12',user:'3'}, |
|
{img:'../../../images/ava.png',title:'众行天下',time:'2020-11-16',people:'12',user:'3'}, |
|
{img:'../../../images/ava.png',title:'众行天下',time:'2020-11-16',people:'12',user:'3'}, |
|
{img:'../../../images/ava.png',title:'众行天下',time:'2020-11-16',people:'12',user:'3'}, |
|
{img:'../../../images/ava.png',title:'众行天下',time:'2020-11-16',people:'12',user:'3'}, |
|
] |
|
}, |
|
currentTab: function (e) { |
|
var that = this; |
|
if (that.data.currentTab == e.currentTarget.dataset.idx){ |
|
return; |
|
} |
|
that.setData({ |
|
currentTab: e.currentTarget.dataset.idx, |
|
}) |
|
if(e.currentTarget.dataset.idx==0){ |
|
that.setData({ |
|
person: false, |
|
team: true, |
|
}) |
|
}else{ |
|
that.setData({ |
|
person: true, |
|
team: false, |
|
}) |
|
} |
|
}, |
|
toteamjoin:function(){ |
|
wx.navigateTo({ |
|
url: '../teamJoin/teamJoin' |
|
}) |
|
}, |
|
getRegisterAll:function(){ |
|
var that = this; |
|
var postData = { |
|
activityId:that.data.activityId |
|
}; |
|
var header = { |
|
token:wx.getStorageSync('token'), |
|
"Content-Type": "application/x-www-form-urlencoded" |
|
}; |
|
re.request(Api.getRegisterAll(), postData, header).then((res) => { |
|
let datas = res.data.data; |
|
that.setData({ |
|
personList: datas |
|
}) |
|
}) |
|
}, |
|
/** |
|
* 生命周期函数--监听页面加载 |
|
*/ |
|
onLoad: function (options) { |
|
var that = this; |
|
that.setData({ |
|
activityId: options.acId |
|
}) |
|
that.getRegisterAll(); |
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面初次渲染完成 |
|
*/ |
|
onReady: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面显示 |
|
*/ |
|
onShow: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面隐藏 |
|
*/ |
|
onHide: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面卸载 |
|
*/ |
|
onUnload: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
*/ |
|
onPullDownRefresh: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 页面上拉触底事件的处理函数 |
|
*/ |
|
onReachBottom: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 用户点击右上角分享 |
|
*/ |
|
onShareAppMessage: function () { |
|
|
|
} |
|
}) |