允许用户根据用户状态进行回复 [英] Allow user to reply based on user status

查看:62
本文介绍了允许用户根据用户状态进行回复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了评论页面,用户可以在其中提交评论。一旦他提交审查,它就会出现在下面。我想在用户帖子审核时可以回复它,但是一旦他回复,他就必须等待管理员回答。

看起来应该是这样的:



`用户提交的评论

用户回复

管理员回复

用户回复

管理员回复`

....

但我不知道怎么做。



我尝试了什么:



我想在发布回复时将用户状态保存到数据库。





I made review page where user can submit reviews. Once he submits review it appears below. I want to make that when user posts review he can reply to it, but once he replies, he has to wait for admin to answer.
It should look like:

`Comment that user submited
User reply
Admin reply
User reply
Admin reply`
....
But I am not sure how to do it.

What I have tried:

I think of saving user status to database when posting reply.


$scope.postReply=function(index,comment){
            var status="";
        console.log($cookies.get('userCookie'));debugger;
        if($cookies.get('userCookie')){
            status="user";
        }
        else{
            status="admin";
        }debugger;
        var JSONObject={
                "userStatus":status,
                "reviewId":$scope.all[index].id,
                "email":$scope.all[index].email,
                "time":"",
                "comment": comment
            };
            var Results = UniversalService.PostReply(JSON.stringify(JSONObject));
    }



但我不知道怎么显示/

基于此隐藏回复,因为我的用户和管理员共享同样的评论观点。





这是我的HTML:

[HTML]< html - Pastebin.com [ ^ ]

有没有人有任何想法?


But I am not sure how to show/
hide reply based on that, because my user and admin shares the same view for reviews.


This is my html:
[HTML] <html - Pastebin.com[^]
Does anyone have any ideas?

推荐答案

scope.postReply = function(index,comment){
var status =;
console.log(
scope.postReply=function(index,comment){ var status=""; console.log(


cookies.get('userCookie')); debugger;
if(
cookies.get('userCookie'));debugger; if(


cookies.get('userCookie')){
status =user;
}
else {
status =admin;
}调试器;
var JSONObject = {
userStatus:status,
reviewId:
cookies.get('userCookie')){ status="user"; } else{ status="admin"; }debugger; var JSONObject={ "userStatus":status, "reviewId":


这篇关于允许用户根据用户状态进行回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆