朋友圈

This commit is contained in:
cansnow
2026-01-11 14:00:09 +08:00
parent c38846f13b
commit 2a0677014a
3 changed files with 14 additions and 22 deletions
+3 -10
View File
@@ -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);