|
...
|
...
|
@@ -12,11 +12,18 @@ Component({ |
|
|
|
},
|
|
|
|
attached(){
|
|
|
|
let peoplelist=[]
|
|
|
|
for(let i=4;i<=30;i++){
|
|
|
|
for(let i=0;i<=Math.ceil((30-4)/5);i++){
|
|
|
|
peoplelist.push({
|
|
|
|
list:[]
|
|
|
|
})
|
|
|
|
}
|
|
|
|
for(let i=4;i<=30;i++){
|
|
|
|
let thiscurrent=Math.floor((i-4)/5);
|
|
|
|
peoplelist[thiscurrent]['list'].push({
|
|
|
|
count:i,
|
|
|
|
isactive:false
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
peoplelist:peoplelist
|
|
...
|
...
|
@@ -34,16 +41,19 @@ Component({ |
|
|
|
},
|
|
|
|
editpeoplelist(count){
|
|
|
|
let peoplelist=this.data.peoplelist,setdata={};
|
|
|
|
peoplelist.forEach((v,i)=>{
|
|
|
|
if(v.isactive){
|
|
|
|
v.isactive=false;
|
|
|
|
let setprevkey='peoplelist['+i+'].isactive';
|
|
|
|
setdata[setprevkey]=false;
|
|
|
|
}
|
|
|
|
if(v.count==count && !v.isactive){
|
|
|
|
let setcurrentkey='peoplelist['+i+'].isactive';
|
|
|
|
setdata[setcurrentkey]=true;
|
|
|
|
}
|
|
|
|
peoplelist.forEach((r,n)=>{
|
|
|
|
r.list.forEach((v,i)=>{
|
|
|
|
if(v.isactive){
|
|
|
|
v.isactive=false;
|
|
|
|
let setprevkey='peoplelist['+n+'].list['+i+'].isactive';
|
|
|
|
setdata[setprevkey]=false;
|
|
|
|
}
|
|
|
|
if(v.count==count && !v.isactive){
|
|
|
|
let setcurrentkey='peoplelist['+n+'].list['+i+'].isactive';
|
|
|
|
setdata[setcurrentkey]=true;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
this.setData(setdata)
|
|
|
|
}
|
...
|
...
|
|