Browse Source

添加类型入参

tbphp 9 months ago
parent
commit
d72273180c

+ 4 - 2
application/member/view/comment/index.html

@@ -11,7 +11,7 @@
         <p><a href="{$d['m']['url']}">{$d['m']['name']}</a> 对我的{$d['tip']}进行了评论:</p>
         <p><span>{$d['create_time']}</span></p>
         <p>{$d['content']|nl2br}</p>
-        <span class="btns" data-id="{$d['id']}" data-aid="{$d['aid']}">回复</span>
+        <span class="btns" data-id="{$d['id']}" data-aid="{$d['aid']}" data-type="{$d['type']}">回复</span>
       </div>
       <div class="cl"></div>
     </li>
@@ -40,10 +40,12 @@
   var hf  = $('#commentMsgHf')
   var id  = 0
   var aid = 0
+  var type = 0
   $('.btns').click(function() {
     var t = $(this)
     var i = t.data('id')
     aid = t.data('aid')
+    type = t.data('type')
     if (i == id) {
       id = 0
       hf.hide()
@@ -80,7 +82,7 @@
       return false
     }
 
-    $.post('/comment/send', {id: aid, content: msg, fid: id}, function(d) {
+    $.post('/comment/send', {id: aid, type: type, content: msg, fid: id}, function(d) {
       if (d.code) {
         alert('回复成功')
         location.reload()

+ 4 - 2
application/member/view/comment/reply.html

@@ -16,7 +16,7 @@
           <a href="{$Think.cookie.user['url']}">我</a> 说:
           <p>{$d['hf']['content']|nl2br}</p>
         </div>
-        <span class="btns" data-id="{$d['id']}" data-aid="{$d['aid']}">回复</span>
+        <span class="btns" data-id="{$d['id']}" data-aid="{$d['aid']}" data-type="{$d['type']}">回复</span>
       </div>
       <div class="cl"></div>
     </li>
@@ -45,10 +45,12 @@
   var hf  = $('#commentMsgHf')
   var id  = 0
   var aid = 0
+  var type = 0
   $('.btns').click(function() {
     var t = $(this)
     var i = t.data('id')
     aid = t.data('aid')
+    type = t.data('type')
     if (i == id) {
       id = 0
       hf.hide()
@@ -85,7 +87,7 @@
       return false
     }
 
-    $.post('/comment/send', {id: aid, content: msg, fid: id}, function(d) {
+    $.post('/comment/send', {id: aid, type: type, content: msg, fid: id}, function(d) {
       if (d.code) {
         alert('回复成功')
         location.reload()