当前位置 博文首页 > 你是人间四月天:jquery+php+ajax异步提交,实现留言评论点赞

    你是人间四月天:jquery+php+ajax异步提交,实现留言评论点赞

    作者:[db:作者] 时间:2021-09-05 13:08

    代码没有很好整理,不过功能基本实现了

    在这里插入图片描述

    html部分:

    		<div class="main" id="allMessage">
            <foreach name="resComms" item="vo">
                <div class="reply Reply_1 clear" id="comms" data-id="{$vo.id}" data-fromuid="{$vo.fromuid}">
                    <div class="clear" style=" margin:0">
                        
                        <a href="__APP__/Video/User/index?uid={$vo.fromuid}" target="_blank" id="fromNmae"><img src="/{$vo['fromPortrait']}" target="_blank" width="30px" height="30px" style="display: inline;border-radius:50%;">{$vo['fromInfo']}</a>
                        <span style=" color:red"> 回复 </span><a href="__APP__/Video/User/index?uid={$vo.touid}" target="_blank"> <img src="/{$vo['toPortrait']}" target="_blank" width="30px" height="30px" style="display: inline;border-radius:50%;">{$vo['toInfo']}</a>
                        :{$vo.content}
                    </div>
                    <div class="clear" style=" margin-top:10px;">
                        <span class="count" onclick="newReply(this)" style="line-height:16px; font-size:12px;">回复</span>
                        <span class="ri clear" style=" margin:0 10px;" onclick="dianzan(this)" value="{$vo.id}">
                            <i class="le" style="width:16px; height:16px; display:block;float: left;"><img src="__PUBLIC__/videos/images/dz1.png" width="100%" height="100%"></i>
                            <b id="commNums" class="lr" value="{$voo.likes}" style="line-height:16px; font-size:12px;float: left;">{$vo.likes}</b>
                        </span>
                        <p class="le" style=" margin:0; font-size:12px; float:left"><?php echo(date("Y-m-d",$vo['cdate'])); ?></p>
                    </div>
                </div>
                <!--
                <div id="comms" style="background:#cccccc;border-radius: 5px;" data-id="{$vo.id}" data-fromuid="{$vo.fromuid}">-->
                    <foreach name="vo['newchild']" item="voo">
                        <div class="reply Reply_2 clear" data-id="{$vo.id}" id="comms" data-fromuid="{$voo.fromuid}">
                    		<div class="clear" style=" margin:0">
                            <a href="__APP__/Video/User/index?uid={$voo.fromuid}" target="_blank" id="fromNmae"><img src="/{$voo['fromInfo'][0]['portrait']}" target="_blank" width="30px" height="30px" style="display: inline;border-radius:50%;">{$voo['fromInfo'][0]['username']}</a>
                            <span style=" color:red"> 回复 </span><a href="__APP__/Video/User/index?uid={$voo.touid}" target="_blank"><img src="/{$voo['toInfo'][0]['portrait']}" target="_blank" width="30px" height="30px" style="display: inline;border-radius:50%;"> {$voo['toInfo'][0]['username']}</a>
                            :{$voo.content}
                        </div>
                    	<div class="clear" style=" margin-top:10px;">
                            <span class="count" onclick="newReply(this)" style="line-height:16px; font-size:12px;">回复</span>
                            <span class=" ri clear" style=" margin:0 10px;" onclick="dianzan(this)" value="{$voo.id}">
                                <i class="