Z1hgq hace 7 años
padre
commit
cf13a53c9e

+ 7 - 4
Furniture/page/homePage/detail/conment/conment.js

xqd xqd xqd xqd
@@ -15,7 +15,8 @@ Page({
     re_reply_id:0,
     reply_id: 0,
     reply_content: '',
-    replys: []
+    replys: [],
+    re_flag:'',
   },
 
   /**
@@ -230,6 +231,7 @@ Page({
       is_reply: true,
       re_reply_id: e.currentTarget.id,
       reply_content: '回复 @' + e.currentTarget.dataset.name+':',
+      re_flag: '回复 @' + e.currentTarget.dataset.name + ':',
     })
   },
   reply: function(e) {
@@ -302,7 +304,7 @@ Page({
           }
         })
       }else if(that.data.is_reply == true){
-        if (text != '') {
+        if (text != that.data.re_flag) {
           app.request({
             url: 'https://t6.9026.com/api/furniture/add_comments',
             data: {
@@ -379,9 +381,10 @@ Page({
           })
         } else {
           that.setData({
+            reply_content: '',
             is_reply: false,
-            reply_id: 0,
-            placeholder: '随便说些什么...',
+            re_reply_id: 0,
+            placeholder: '说些什么...',
           })
         }
       }

+ 2 - 2
Furniture/page/homePage/detail/conment/conment.wxml

xqd xqd
@@ -21,7 +21,7 @@
         全部回复({{comments_replys.total}})
       </view>
     </view>
-    <view class='conment' style='margin:20rpx;margin-top:50rpx' wx:for='{{replys}}'>
+    <view class='conment' style='margin:20rpx;margin-top:50rpx' wx:for='{{replys}}' id='{{item.id}}' bindtap='re_reply' data-name='{{item.username}}'>
       <view class='container1' style='margin-left:0rpx;margin-top:0rpx'>
         <image src='{{item.avatar}}' style='width:80rpx;height:80rpx'></image>
       </view>
@@ -29,7 +29,7 @@
       <view class='container1' style='margin-left:100rpx;margin-top:5rpx;font-size:24rpx;color:#d3d3d3'>
         {{item.created_at}}
       </view>
-      <view style='font-size:35rpx;margin-left:100rpx;margin-top:50rpx;word-break:break-all;' id='{{item.id}}' bindtap='re_reply' data-name='{{item.username}}'>
+      <view style='font-size:35rpx;margin-left:100rpx;margin-top:50rpx;word-break:break-all;'>
         {{item.content}}
       </view>
       <view style='margin-top:5rpx;background-color:#f5f5f5;margin-left:100rpx;height:50rpx;padding:5rpx' id='{{item.id}}' bindtap='toConment' wx:if='{{item.replys.total != 0}}'>

+ 1 - 3
Furniture/page/homePage/detail/detail.wxml

xqd
@@ -41,10 +41,8 @@
           </view>
         </view>
       </view>
-
-      
     </view>
-    <view style='margin-top:80rpx;background-color:#eee;width:100%;height:50rpx;padding:10rpx 0 5rpx 15rpx;color:#999;'>
+    <view style='margin-top:80rpx;background-color:#f5f5f5;width:100%;height:50rpx;padding:10rpx 0 5rpx 15rpx;color:#999;'>
         全部评论({{news_comments.total}})
     </view>
     <view class='conment' wx:for='{{comments}}'>