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.
 

139 lines
3.0 KiB

// pages/release/signIndex/signIndex.js
var Api = require('../../../utils/common.js');
var re = require('../../../utils/request.js');
Page({
/**
* 页面的初始数据
*/
data: {
activityId:'',
joinlist:[
{img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'},
{img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'}
],
cancellist:[
{img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'},
{img:'../../../images/ava.png',name:'洒洒水',price:'2334',intro:'吃葡萄不吐皮套皮'}
],
},
toindex:function(){
wx.navigateTo({
url: '../manageIndex/manageIndex'
})
},
delActivity(){
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.removeActivity(), postData, header).then((res) => {
wx.showToast({
title: res.msg,
duration: 0,
})
})
},
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;
let cancellist = [];
let joinlist = [];
//根据状态registerStatus报名状态0-未报名 1-已报名 2-已取消 3-报名中
for(let i=0;i<datas.length;i++){
if(datas[i].registerStatus == 2){
cancellist.push(datas[i])
}
if(datas[i].registerStatus == 1){
joinlist.push(datas[i])
}
}
that.setData({
cancellist: cancellist,
joinlist: joinlist
})
console.log(that.data.cancellist,that.data.joinlist)
})
},
todetail:function(){
wx.navigateTo({
url: '../addjoiner/addjoiner?edit=false'
})
},
toadd:function(){
wx.navigateTo({
url: '../addjoiner/addjoiner?edit=true'
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
activityId:options.activity_id
})
this.getRegisterAll();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.getRegisterAll();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})