许成详 il y a 6 ans
Parent
révision
80bcee3825
2 fichiers modifiés avec 6 ajouts et 5 suppressions
  1. 5
    4
      pages/ActivityDetail/index.js
  2. 1
    1
      pages/ActivityDetail/index.wxml

+ 5
- 4
pages/ActivityDetail/index.js Voir le fichier

@@ -209,7 +209,7 @@ Page({
209 209
             FloorUserName: item.customerName,
210 210
             CreateDate: item.createDate,
211 211
             Content: item.commentContent,
212
-            ImgList: item.commentImgList,
212
+            ImgList: item.commentImgList || [],
213 213
             LikeNum: '0',
214 214
             ParentId: item.parentId,
215 215
             Childs: []
@@ -221,7 +221,7 @@ Page({
221 221
               CreateDate: subItem.createDate,
222 222
               Content: subItem.commentContent,
223 223
               LikeNum: '0',
224
-              ImgList: subItem.commentImgList
224
+              ImgList: subItem.commentImgList || []
225 225
             })
226 226
           })
227 227
           CommentList[index].Childs = aChild
@@ -245,14 +245,15 @@ Page({
245 245
   CheckBigImg(e) { // 查看大图
246 246
     // console.log(e.target.dataset)
247 247
     if (e.target.dataset.type - 0 === 1) { // 评论大图
248
+      // console.log(this.data.CommentList[e.target.dataset.mainindex].ImgList)
248 249
       this.setData({
249
-        CurrentImgList: this.data.CommentList[e.target.dataset.mainIndex].ImgList,
250
+        CurrentImgList: this.data.CommentList[e.target.dataset.mainindex].ImgList,
250 251
         CurrentIndex: e.target.dataset.index,
251 252
         ShowMaxSwiper: true
252 253
       })
253 254
     } else { // 回复大图
254 255
       this.setData({
255
-        CurrentImgList: this.data.CommentList[e.target.dataset.mainIndex].Childs[e.target.dataset.subIndex].ImgList,
256
+        CurrentImgList: this.data.CommentList[e.target.dataset.mainindex].Childs[e.target.dataset.subindex].ImgList,
256 257
         CurrentIndex: e.target.dataset.index,
257 258
         ShowMaxSwiper: true
258 259
       })

+ 1
- 1
pages/ActivityDetail/index.wxml Voir le fichier

@@ -127,7 +127,7 @@
127 127
       <block wx:for="{{CurrentImgList}}" wx:for-item="item" wx:for-index="index" wx:key="key">
128 128
         <swiper-item>
129 129
           <view class="swiper-item">
130
-            <image mode="aspectFit" src="{{item.url}}" class="centerLabel contain" bindtap="CloseMaxSwiper"></image>
130
+            <image mode="aspectFit" src="{{item.imgUrl}}" class="centerLabel contain" bindtap="CloseMaxSwiper"></image>
131 131
           </view>
132 132
         </swiper-item>
133 133
       </block>