diff --git a/src/api/index.ts b/src/api/index.ts index 96af2b4..0cc40db 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -478,9 +478,31 @@ interface CommentlData{ msg: string; total: number; } +interface ReplylistData{ + data: CommentList[]; + code: number; + msg: string; + score?:string, + total: number; +} export async function getcommentlist(data?:any) { - const res=await get('comments',data) - return res + console.log(data.type==2) + + if(data.type==2){ + const res=await get('comments',data) + return res + }else{ + const res=await get('comments',data) + console.log(res) + return res + } + + // if(data.type==2){ + // return res + // } + + + } /** @@ -495,8 +517,22 @@ interface SendData{ } export async function addcomment(data?:any):Promise { const res=await post('comments',data) - + if(res.code==0){ + message.success("发布成功") + } } + +/** + * 删除评论 + */ + + export async function delreply(data?:any) { + const res = await del('comments/'+data); + if(res.code==0){ + message.success("删除成功") + } + return res + } /** * 发送验证码 * @param phone 手机号 diff --git a/src/components/ReviewItem.vue b/src/components/ReviewItem.vue index 44236a4..3e2be67 100644 --- a/src/components/ReviewItem.vue +++ b/src/components/ReviewItem.vue @@ -13,6 +13,10 @@
{{(score+'').split('.')[1]?score:score+'.0'}}分
+
+ 查看所有回复 + +
{{content}} @@ -21,6 +25,20 @@
{{date}}
回复
+ +
+ +
diff --git a/src/components/VideoReview.vue b/src/components/VideoReview.vue index c417bc2..f78a176 100644 --- a/src/components/VideoReview.vue +++ b/src/components/VideoReview.vue @@ -7,26 +7,24 @@
8.0分
- -
- + - + :replyid="i.commentid" + @replying="reply" + @findall="findreply" + > +
- +
- @{{uinfo.name}} + @{{uinfo.name}}
发表留言
@@ -93,28 +91,33 @@ }