Kaynağa Gözat

feat: 优化留言

Moss 1 yıl önce
ebeveyn
işleme
b90ef00a78

+ 2 - 1
src/components/zj-dialog/zj-dialog-remark.vue

@@ -8,7 +8,7 @@
 		<u--textarea
 			fixed
 			v-model="value"
-			:placeholder="replyItem ? `回复${replyItem.uaerName || ''}:` : `留言内容:`"
+			:placeholder="replyItem ? `回复${replyItem.userName || ''}:` : `留言内容:`"
 			border="none"
 			height="250">
 		</u--textarea>
@@ -40,6 +40,7 @@
 
 		methods: {
 			setValue(replyItem) {
+        console.log(replyItem);
         this.replyItem = replyItem;
 				this.value = '';
 			},

+ 27 - 19
src/pages/goods/detail.vue

@@ -16,7 +16,7 @@
           <image :src="detail.userPic ? (imageUrl + detail.userPic) : require('@/static/common/logo.png')"></image>
           <view class="info">
             <view class="name">{{detail.userName}}</view>
-            <view class="phone">{{detail.phone | phoneFilter}}</view>
+            <view class="phone">{{detail.phone}}</view>
           </view>
         </view>
         <view class="btns">
@@ -71,26 +71,30 @@
           <view class="tit">全部留言</view>
           <view class="right" v-if="!isMine" @tap="isShowReportDialog = true;">内容违规,我要举报</view>
         </view>
-        <view class="item" v-for="(item, index) in remarkList" :key="index">
-          <view class="top">
-            <image :src="item.userPic ? (imageUrl + item.userPic) : require('@/static/common/logo.png')"></image>
-            <view class="user">
-              <view class="name">{{item.userName}}</view>
-              <view class="time">{{item.createTime}}</view>
+        <view class="list">
+          <view class="item" v-for="(item, index) in remarkList" :key="index">
+            <view class="top">
+              <image :src="item.userPic ? (imageUrl + item.userPic) : require('@/static/common/logo.png')"></image>
+              <view class="user">
+                <view class="name">{{item.userName}}</view>
+                <view class="time">{{item.createTime}}</view>
+              </view>
             </view>
-          </view>
-          <view class="content">
-            <view class="left">{{item.message}}</view>
-            <view class="right" @tap="handelReply(item)"><text class="iconfont icon-bianji"></text><text>回复</text></view>
-          </view>
-          <view class="reply" v-if="item.goodsMessageList && item.goodsMessageList.length > 0">
-            <view class="it" v-for="(it, idx) in item.goodsMessageList" :key="idx" @tap="handelReply(it)">
-              <text class="name">{{it.userName}}</text>
-              <text class="text">回复</text>
-              <text class="name">{{it.replyNickName}}</text>:{{it.message}}
+            <view class="content">
+              <view class="left">{{item.message}}</view>
+              <view class="right" @tap="handelReply(item)"><text class="iconfont icon-bianji"></text><text>回复</text></view>
+            </view>
+            <view class="reply" v-if="item.goodsMessageList && item.goodsMessageList.length > 0">
+              <view class="it" v-for="(it, idx) in item.goodsMessageList" :key="idx" @tap="handelReply(it)">
+                <text class="name">{{it.userName}}</text>
+                <text class="text">回复</text>
+                <text class="name">{{it.replyNickName}}</text>:{{it.message}}
+              </view>
             </view>
           </view>
         </view>
+        
+        <Loading :type="2" :loadStatus="remarkLoadStatus" :dataList="remarkList" />
       </view>
 
       <template slot="footer">
@@ -163,7 +167,7 @@
         actionList: [],
         isShowActionDialog: false,
         replyId: '',
-
+        remarkLoadStatus: 0,
         isShowReportDialog: false,
         reportForm: {
           reason: '',
@@ -289,6 +293,9 @@
           pageSize: -1,
         }).then(res => {
           this.remarkList = res.data.records;
+          this.remarkLoadStatus = 0;
+        }).catch(res => {
+          this.remarkLoadStatus = 2;
         })
       },
 
@@ -335,6 +342,7 @@
           reportNote: this.reportForm.reason,
           url: this.reportForm.fileList,
         }).then(res => {
+          this.$successToast();
           this.cancelReportDialog();
           this.isShowRemarkDialog = false;
         })
@@ -557,7 +565,7 @@
   .item {
     padding: 30rpx 0;
     border-bottom: 1px solid #eaeaea;
-    &:last-child {
+    &:last-of-type {
       border: none;
     }
     .top {

+ 4 - 4
src/pages/index/index.vue

@@ -342,14 +342,14 @@
       }
 
       image {
-        width: 44rpx;
-        height: 44rpx;
+        width: 52rpx;
+        height: 52rpx;
       }
 
       .name {
         font-size: 28rpx;
-        margin-top: 16rpx;
+        margin-top: 12rpx;
       }
     }
   }
-</style>
+</style>