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.
172 lines
3.4 KiB
172 lines
3.4 KiB
var Api = require('../../../utils/common.js'); |
|
var re = require('../../../utils/request.js'); |
|
Page({ |
|
|
|
/** |
|
* 页面的初始数据 |
|
*/ |
|
data: { |
|
Deputy:[ |
|
{id:'1',image:'../../../images/ava.png',name:'张三三',ispop:'true'}, |
|
{id:'2',image:'../../../images/ava.png',name:'张三三',ispop:'false'}, |
|
{id:'3',image:'../../../images/ava.png',name:'张三三',ispop:'true'}, |
|
{id:'4',image:'../../../images/ava.png',name:'张三三',ispop:'true'}, |
|
], |
|
ids:[], |
|
texts:'' |
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面加载 |
|
*/ |
|
onLoad: function (options) { |
|
this.setData({ |
|
id:options.id |
|
}) |
|
this.getCanRemove(options.id); |
|
}, |
|
sousuo(){ |
|
let that=this |
|
var header = { |
|
token:wx.getStorageSync('token'), |
|
"Content-Type": "application/x-www-form-urlencoded" |
|
}; |
|
let data={ |
|
|
|
clubId:this.data.id, |
|
name:this.data.texts |
|
} |
|
re.request(Api.memberremoveLikeList(), data, header).then((res) => { |
|
let datas = res.data.data; |
|
console.log(datas); |
|
that.setData({ |
|
Deputy:datas |
|
}) |
|
}) |
|
}, |
|
getCanRemove:function(){ |
|
var that = this; |
|
var header = { |
|
token:wx.getStorageSync('token'), |
|
"Content-Type": "application/x-www-form-urlencoded" |
|
}; |
|
var postData={ |
|
clubId:that.data.id, |
|
}; |
|
re.request(Api.getCanRemove(), postData, header).then((res) => { |
|
let datas = res.data.data; |
|
console.log(datas); |
|
that.setData({ |
|
Deputy:datas |
|
}) |
|
// wx.navigateBack({ |
|
// delta: 1 |
|
// }) |
|
}) |
|
}, |
|
checkboxChange(e){ |
|
console.log(e); |
|
if(e.detail.value.length==1){ |
|
let ids=this.data.ids; |
|
ids.push(e.detail.value[0]) |
|
this.setData({ |
|
ids |
|
}) |
|
}else{ |
|
let ids=this.data.ids; |
|
let index= ids.indexOf(this.data.Deputy[e.currentTarget.dataset.index].memberId) |
|
ids.splice(index,1) |
|
this.setData({ |
|
ids |
|
}) |
|
} |
|
}, |
|
subremove:function(){ |
|
if(this.data.ids.length==0){ |
|
wx.showToast({ |
|
title: '请选择需要移除的成员', |
|
icon:'none' |
|
}) |
|
return |
|
} |
|
var that = this; |
|
var header = { |
|
token:wx.getStorageSync('token'), |
|
"Content-Type": "application/x-www-form-urlencoded" |
|
}; |
|
var postData={ |
|
ids:this.data.ids |
|
}; |
|
this.setData({ |
|
ids:[] |
|
}) |
|
re.request(Api.removesb(), postData, header).then((res) => { |
|
// let datas = res.data.data; |
|
// console.log(datas); |
|
that.setData({ |
|
Deputy:[] |
|
}) |
|
this.getCanRemove() |
|
// wx.navigateBack({ |
|
// delta: 1 |
|
// }) |
|
}) |
|
}, |
|
quxiao:function(){ |
|
let Deputy= this.data.Deputy |
|
this.setData({ |
|
Deputy:[] |
|
}) |
|
this.setData({ |
|
Deputy |
|
}) |
|
}, |
|
/** |
|
* 生命周期函数--监听页面初次渲染完成 |
|
*/ |
|
onReady: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面显示 |
|
*/ |
|
onShow: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面隐藏 |
|
*/ |
|
onHide: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 生命周期函数--监听页面卸载 |
|
*/ |
|
onUnload: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 页面相关事件处理函数--监听用户下拉动作 |
|
*/ |
|
onPullDownRefresh: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 页面上拉触底事件的处理函数 |
|
*/ |
|
onReachBottom: function () { |
|
|
|
}, |
|
|
|
/** |
|
* 用户点击右上角分享 |
|
*/ |
|
onShareAppMessage: function () { |
|
|
|
} |
|
}) |