|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
// 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:'吃葡萄不吐皮套皮'} |
|
|
|
@ -19,6 +22,51 @@ Page({
|
|
|
|
|
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' |
|
|
|
@ -33,7 +81,11 @@ Page({
|
|
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
|
*/ |
|
|
|
|
onLoad: function (options) { |
|
|
|
|
|
|
|
|
|
console.log(options) |
|
|
|
|
this.setData({ |
|
|
|
|
activityId:options.activity_id |
|
|
|
|
}) |
|
|
|
|
this.getRegisterAll(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -47,7 +99,7 @@ Page({
|
|
|
|
|
* 生命周期函数--监听页面显示 |
|
|
|
|
*/ |
|
|
|
|
onShow: function () { |
|
|
|
|
|
|
|
|
|
this.getRegisterAll(); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|