comment.html 4.0 KB
<!--    <br><h3>评论</h3>
    <div class="comment-area" id="comments">
    <hr>
    <form class="js-ajax-form" action="{:cmf_plugin_url('TcComment://Index/index')}" method="post">
        <input type="hidden" name="post[object_id]" id="inpId" value="{$object_id}" />
        <input type="hidden" name="post[table_name]" id="tablename" value="{$table_name}" />
        <p><textarea class="form-control comment-postbox" placeholder="Write your comment here" style="min-height:90px;" name="post[content]"></textarea></p>
        <p><button type="submit" class="btn btn-primary js-ajax-submit"><i class="fa fa-comment-o"></i> 发表评论</button></p>
    </form>


        <div class="null_box"></div>-->
        <div class="bottom_box">
            <textarea id="textArea" placeholder="写评论..." maxlength="200"></textarea>
            <div class="submit_btn">
                <text class="iconfont icon-tijiao"></text>
                <text>提交</text>
            </div>
        </div>
        <!--弹窗-->
        <div class="public_popup_box suc">
            <text>评论成功!获得{$comment}积分!</text>
           <text>内容稍后展示出来</text>
        </div>

     <div class="public_popup_box   fial">
            <text>评论失败!</text>
           <text>请稍后重试</text>
        </div>



        <script src="__TMPL__/public/assets/js/jquery-2.1.0.js"></script>
        <script src="__TMPL__/public/assets/js/area.js"></script>
        <script src="__TMPL__/public/assets/js/select.js"></script>
        <script>
            /**
            * 提交修改信息
             */
            $('.public_popup_box').hide()
            $('.submit_btn').click(function () {
                var textArea=$('#textArea').val();
                console.log(textArea)
             var   postData=new Object();
                 postData['object_id']={$object_id};
                 postData['table_name']='{$table_name}';
                 postData['content']=textArea;
                 console.log(postData);
                console.log(JSON.stringify(postData));
                $.ajax({
                 type:'POST',
                 dataType: "json",
                 url:"{:cmf_plugin_url('TcComment://Index/index')}",
                 data:{
                     post:postData,
                 },
                 success:function(res) {
                      if (res.code==1){
                          $('.suc').show().delay(2000).hide(2)
                      }else {
                          $('.fial').show().delay(2000).hide(2)
                      }
                   }
                })

            })
        </script>
<hr>

  <div class="article_item">
        <div>
            <text class="content_title">最新评论</text>
        </div>
     <foreach name="comments" item="vo">

        <div class="comment_item">
            <div class="head_img"><img src="{:cmf_get_image_url($vo.avatar)}" alt=""></div>
            <div class="comment_content">
                <div class="user_name">{$vo.full_name}</div>
                <div>{$vo.content}</div>
                <div class="content_time">{:date('Y.m.d',$vo.create_time)}</div>
            </div>
        </div>
    </foreach>
    </div>
</div>
<!-- dibu-->
 <!--   <div class="comments">
    <foreach name="comments" item="vo">
	<div class="comment" data-id="{$vo.id}" data-uid="{$vo.user_id}" data-username="{$vo.full_name}" id="comment{$vo.id}">
		  <a class="pull-left" href="{$vo.url}">
              <if condition="empty($vo.avatar)"><img src="/plugins/tc_comment/images/headicon.png" class="media-object avatar" /><else /><img src="__ROOT__/upload/{$vo.avatar}" class="media-object avatar"/></if>
		  </a>
		  <div class="comment-body">
		    <div class="comment-content"><a href="{$vo.url}">{$vo.full_name}</a>:<br><span>{$vo.content}</span></div>
		    <div><span class="time">{:date('Y-m-d H:i',$vo.create_time)}</span></div>

		  </div>
		  <div class="clearfix"></div>
    </div>
    </foreach>
        <ul class="pagination">
        {$page}
        </ul>
    </div> -->
</div>