许成详 il y a 6 ans
Parent
révision
3465d8030e

+ 29
- 3
pages/ActivityDetail/index.js Voir le fichier

@@ -36,6 +36,7 @@ Page({
36 36
     }
37 37
   },
38 38
   data: {
39
+    ShowMaxSwiper: false,
39 40
     HasSignUp: false,
40 41
     UserInfo: app.globalData.UserInfo,
41 42
     Id: null,
@@ -54,12 +55,19 @@ Page({
54 55
       CreateDate: '',
55 56
       Content: ''
56 57
     },
57
-    CommentList: []
58
+    CommentList: [],
59
+    CurrentImgList: []
58 60
   },
59 61
   onReady() {
60 62
 
61 63
   },
62
-  PageReset() {
64
+  CloseMaxSwiper() { // 关闭大图
65
+    this.setData({
66
+      ShowMaxSwiper: false,
67
+      CurrentIndex: 0
68
+    })
69
+  },
70
+  PageReset() { // 页面数据重置
63 71
     this.setData({
64 72
       ActivityDetail: {
65 73
         Title: '',
@@ -69,7 +77,8 @@ Page({
69 77
       },
70 78
       CommentList: [],
71 79
       SubmitOff: true,
72
-      ShowPopup: false
80
+      ShowPopup: false,
81
+      CurrentIndex: 0
73 82
     })
74 83
   },
75 84
   GetSignUpList() { // 获取报名情况
@@ -229,9 +238,26 @@ Page({
229 238
         this.setData({
230 239
           CommentList: CommentList
231 240
         })
241
+        console.log(this.data.CommentList)
232 242
       }
233 243
     })
234 244
   },
245
+  CheckBigImg(e) { // 查看大图
246
+    // console.log(e.target.dataset)
247
+    if (e.target.dataset.type - 0 === 1) { // 评论大图
248
+      this.setData({
249
+        CurrentImgList: this.data.CommentList[e.target.dataset.mainIndex].ImgList,
250
+        CurrentIndex: e.target.dataset.index,
251
+        ShowMaxSwiper: true
252
+      })
253
+    } else { // 回复大图
254
+      this.setData({
255
+        CurrentImgList: this.data.CommentList[e.target.dataset.mainIndex].Childs[e.target.dataset.subIndex].ImgList,
256
+        CurrentIndex: e.target.dataset.index,
257
+        ShowMaxSwiper: true
258
+      })
259
+    }
260
+  },
235 261
   GetActivityDetail() { // 获取活动详情
236 262
     fetch({
237 263
       url: $api.activity.detail.url.replace(':id', this.data.Id),

+ 14
- 3
pages/ActivityDetail/index.wxml Voir le fichier

@@ -52,7 +52,7 @@
52 52
                 <!-- 评论图片列表 -->
53 53
                 <view class="imgList">
54 54
                   <view wx:for="{{item.ImgList}}" wx:for-item="subItem" wx:for-index="subIdx" wx:key="subKey">
55
-                    <image mode="aspectFit" src="{{subItem.imgUrl}}" class="centerLabel contain"></image>
55
+                    <image mode="aspectFit" src="{{subItem.imgUrl}}" class="centerLabel contain" data-type="1" data-mainIndex="{{idx}}" data-index="{{subIdx}}" bindtap="CheckBigImg"></image>
56 56
                   </view>
57 57
                 </view>
58 58
 
@@ -70,10 +70,10 @@
70 70
                     </view>
71 71
                     <text class="floorContent">{{subItem.Content}}</text>
72 72
 
73
-                    <!-- 评论图片列表 -->
73
+                    <!-- 回复图片列表 -->
74 74
                     <view class="imgList">
75 75
                       <view wx:for="{{subItem.ImgList}}" wx:for-item="dSubItem" wx:for-index="dSubIdx" wx:key="dSubKey">
76
-                        <image mode="aspectFit" src="{{dSubItem.imgUrl}}" class="centerLabel contain"></image>
76
+                        <image mode="aspectFit" src="{{dSubItem.imgUrl}}" class="centerLabel contain" data-type="2" data-mainIndex="{{idx}}" data-subIndex="{{subIdx}}" data-index="{{dSubIdx}}" bindtap="CheckBigImg"></image>
77 77
                       </view>
78 78
                     </view>
79 79
 
@@ -122,4 +122,15 @@
122 122
       </view>
123 123
     </view>
124 124
   </view>
125
+  <view class="maxSwiper" hidden="{{!ShowMaxSwiper}}">
126
+    <swiper autoplay="{{false}}" indicator-dots="{{false}}" current="{{CurrentIndex}}">
127
+      <block wx:for="{{CurrentImgList}}" wx:for-item="item" wx:for-index="index" wx:key="key">
128
+        <swiper-item>
129
+          <view class="swiper-item">
130
+            <image mode="aspectFit" src="{{item.url}}" class="centerLabel contain" bindtap="CloseMaxSwiper"></image>
131
+          </view>
132
+        </swiper-item>
133
+      </block>
134
+    </swiper>
135
+  </view>
125 136
 </view>

+ 15
- 0
pages/ActivityDetail/index.wxss Voir le fichier

@@ -1,6 +1,21 @@
1 1
 /**index.wxss**/
2 2
 @import '../../app.wxss';
3 3
 
4
+.maxSwiper {
5
+  width: 100%;
6
+  position: absolute;
7
+  left: 0;
8
+  top: 0;
9
+  bottom: 0;
10
+  z-index: 1000;
11
+  background: #000;
12
+}
13
+
14
+.maxSwiper > swiper {
15
+  width: 100%;
16
+  height: 100%;
17
+}
18
+
4 19
 .SignUp {
5 20
   width: 100%;
6 21
   position: absolute;

+ 27
- 3
pages/EstateDetail/index.js Voir le fichier

@@ -32,7 +32,14 @@ Page({
32 32
         method: $api.building.detail.method,
33 33
       }).then((data) => {
34 34
         const dicts = app.globalData.Dict
35
-        const apart = data.data.buildingApartment.map(x => {
35
+        const apart = data.data.buildingApartment.filter(x => x.apartmentType === 'apart').map(x => {
36
+          return {
37
+            ...x,
38
+            imgUrl: (x.buildingImgList[0] || {}).url,
39
+            marketStatus: (dicts.filter(d => d.id == x.marketStatus)[0] || {}).name
40
+          }
41
+        })
42
+        const photo = data.data.buildingApartment.filter(x => x.apartmentType === 'photo').map(x => {
36 43
           return {
37 44
             ...x,
38 45
             imgUrl: (x.buildingImgList[0] || {}).url,
@@ -52,9 +59,12 @@ Page({
52 59
             openingDate: data.data.openingDate.split(' ')[0],
53 60
             propertyType: propertyType,
54 61
             buildingApartment: apart,
55
-            IsCollect: (_that.data.Collects.filter(x => x.buildingId == data.data.buildingId).length > 0 ? true : false)
62
+            IsCollect: (_that.data.Collects.filter(x => x.buildingId == data.data.buildingId).length > 0 ? true : false),
63
+            Photos: photo || []
56 64
           }
57 65
         })
66
+        console.log(_that.data.EstateDetail.buildingApartment)
67
+        console.log(_that.data.EstateDetail.Photos)
58 68
       })
59 69
     })
60 70
   },
@@ -62,7 +72,21 @@ Page({
62 72
     UserInfo: app.globalData.UserInfo,
63 73
     ScreenBottomHeight: app.globalData.ScreenBottomHeight,
64 74
     EstateDetail: {},
65
-    Collects: []
75
+    Collects: [],
76
+    ShowMaxSwiper: false,
77
+    CurrentImgList: []
78
+  },
79
+  CloseMaxSwiper() { // 关闭大图
80
+    this.setData({
81
+      ShowMaxSwiper: false
82
+    })
83
+  },
84
+  CheckMaxImg(e) { // 查看大图
85
+    // console.log(e.target.dataset)
86
+    this.setData({
87
+      CurrentImgList: this.data.EstateDetail[e.target.dataset.type][e.target.dataset.index].buildingImgList,
88
+      ShowMaxSwiper: true
89
+    })
66 90
   },
67 91
   MakeAnAppointment() { // 预约看房
68 92
     wx.navigateTo({

+ 37
- 2
pages/EstateDetail/index.wxml Voir le fichier

@@ -56,17 +56,40 @@
56 56
         <view class="list">
57 57
           <view class="item" wx:for="{{EstateDetail.buildingApartment}}" wx:for-item="item" wx:for-index="idx" wx:key="key">
58 58
             <view class="img">
59
-              <image mode="aspectFill" src="{{item.imgUrl}}" class="centerLabel cover"></image>
59
+              <image mode="aspectFit" src="{{item.imgUrl}}" class="centerLabel contain" data-type="buildingApartment" data-index="{{idx}}" bindtap="CheckMaxImg"></image>
60 60
             </view>
61 61
             <view class="info">
62 62
               <text>{{item.apartmentName}}</text>
63
-              <text>{{item.remark}}</text>
63
+              <!-- <text>{{item.remark}}</text> -->
64 64
             </view>
65 65
             <text>{{item.marketStatus}}</text>
66 66
           </view>
67 67
         </view>
68 68
       </view>
69 69
 
70
+      <!-- 相册 -->
71
+      <view class="roomType subContent" hidden="{{!EstateDetail.Photos.length}}">
72
+        <text class="title">相册({{EstateDetail.Photos.length}})</text>
73
+        <view class="list">
74
+          <view class="item" wx:for="{{EstateDetail.Photos}}" wx:for-item="item" wx:for-index="idx" wx:key="key">
75
+            <view class="img">
76
+              <image mode="aspectFit" src="{{item.imgUrl}}" class="centerLabel contain" data-type="Photos" data-index="{{idx}}" bindtap="CheckMaxImg"></image>
77
+            </view>
78
+            <view class="info">
79
+              <text>{{item.apartmentName}}</text>
80
+            </view>
81
+          </view>
82
+        </view>
83
+      </view>
84
+
85
+      <!-- 周边配套 -->
86
+      <view class="roomType subContent">
87
+        <text class="title">周边配套</text>
88
+        <view style="padding: 0 40rpx;position:relative;overflow:hidden;">
89
+          <rich-text nodes="{{EstateDetail.remark}}"></rich-text>
90
+        </view>
91
+      </view>
92
+
70 93
     </view>
71 94
   </view>
72 95
 
@@ -87,4 +110,16 @@
87 110
     </view>
88 111
   </view>
89 112
 
113
+  <view class="maxSwiper" hidden="{{!ShowMaxSwiper}}">
114
+    <swiper autoplay="{{false}}" indicator-dots="{{false}}">
115
+      <block wx:for="{{CurrentImgList}}" wx:for-item="item" wx:for-index="index" wx:key="key">
116
+        <swiper-item>
117
+          <view class="swiper-item">
118
+            <image mode="aspectFit" src="{{item.url}}" class="centerLabel contain" bindtap="CloseMaxSwiper"></image>
119
+          </view>
120
+        </swiper-item>
121
+      </block>
122
+    </swiper>
123
+  </view>
124
+
90 125
 </view>

+ 15
- 0
pages/EstateDetail/index.wxss Voir le fichier

@@ -1,6 +1,21 @@
1 1
 /**index.wxss**/
2 2
 @import '../../app.wxss';
3 3
 
4
+.maxSwiper {
5
+  width: 100%;
6
+  position: absolute;
7
+  left: 0;
8
+  top: 0;
9
+  bottom: 0;
10
+  z-index: 1000;
11
+  background: #000;
12
+}
13
+
14
+.maxSwiper > swiper {
15
+  width: 100%;
16
+  height: 100%;
17
+}
18
+
4 19
 .container > .flex-item {
5 20
   position: relative;
6 21
   overflow: hidden;