朋友圈
This commit is contained in:
+3
-10
@@ -52,16 +52,9 @@ const actions = {
|
||||
return new Promise((resolve,reject)=>{
|
||||
uni.$u.http.post('/friendcircle/comment',params).then(data=>{
|
||||
console.log("评论成功",data);
|
||||
let index = -1;
|
||||
for(let i=0;i<state.list.length;i++){
|
||||
if(state.list[i].id==params.id){
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log("index",index);
|
||||
if(index!=-1){
|
||||
state.list[index].comments.unshift(params);
|
||||
const index = state.list.findIndex(i => i.id ==params.id);
|
||||
if(index>=0){
|
||||
state.list[index].comments.unshift(data);
|
||||
resolve(data);
|
||||
}else{
|
||||
reject(data);
|
||||
|
||||
Reference in New Issue
Block a user