|
@@ -17,10 +17,16 @@ Page({
|
17
|
17
|
const _that = this
|
18
|
18
|
|
19
|
19
|
fetch({
|
20
|
|
- url: $api.collection.getByUser.replace(':openid', app.globalData.UserInfo.openid),
|
21
|
|
- method: $api.collection.getByUser.method
|
|
20
|
+ url: $api.collection.getByUser.url.replace(':openid', app.globalData.UserInfo.openid),
|
|
21
|
+ method: $api.collection.getByUser.method,
|
|
22
|
+ data: {
|
|
23
|
+ pageNum: 1,
|
|
24
|
+ pageSize: 100
|
|
25
|
+ }
|
22
|
26
|
}).then((collects) => {
|
23
|
|
- console.log(collects)
|
|
27
|
+ _that.setData({
|
|
28
|
+ Collects: collects.data.records
|
|
29
|
+ })
|
24
|
30
|
fetch({
|
25
|
31
|
url: $api.building.detail.url.replace(':id', id),
|
26
|
32
|
method: $api.building.detail.method,
|
|
@@ -41,7 +47,12 @@ Page({
|
41
|
47
|
}
|
42
|
48
|
})
|
43
|
49
|
_that.setData({
|
44
|
|
- EstateDetail: { ...data.data, propertyType: propertyType, buildingApartment: apart }
|
|
50
|
+ EstateDetail: {
|
|
51
|
+ ...data.data,
|
|
52
|
+ propertyType: propertyType,
|
|
53
|
+ buildingApartment: apart,
|
|
54
|
+ IsCollect: (_that.data.Collects.filter(x => x.buildingId == data.data.buildingId).length>0? true:false)
|
|
55
|
+ }
|
45
|
56
|
})
|
46
|
57
|
})
|
47
|
58
|
})
|
|
@@ -49,7 +60,8 @@ Page({
|
49
|
60
|
data: {
|
50
|
61
|
UserInfo: app.globalData.UserInfo,
|
51
|
62
|
ScreenBottomHeight: app.globalData.ScreenBottomHeight,
|
52
|
|
- EstateDetail: {}
|
|
63
|
+ EstateDetail: {},
|
|
64
|
+ Collects: []
|
53
|
65
|
},
|
54
|
66
|
MakeAnAppointment() { // 预约看房
|
55
|
67
|
wx.navigateTo({
|
|
@@ -57,7 +69,7 @@ Page({
|
57
|
69
|
})
|
58
|
70
|
},
|
59
|
71
|
MakeCollect() {
|
60
|
|
- app.globalData.UserInfo.openid
|
|
72
|
+ const _that = this
|
61
|
73
|
fetch({
|
62
|
74
|
url: $api.collection.save.url.replace(':openid', app.globalData.UserInfo.openid) + '?buildingId=' + this.data.EstateDetail.buildingId,
|
63
|
75
|
method: $api.collection.save.method,
|
|
@@ -65,6 +77,9 @@ Page({
|
65
|
77
|
wx.showToast({
|
66
|
78
|
title: '收藏成功!'
|
67
|
79
|
})
|
|
80
|
+ _that.setData({
|
|
81
|
+ EstateDetail: { ..._that.data.EstateDetail, IsCollect:true}
|
|
82
|
+ })
|
68
|
83
|
})
|
69
|
84
|
},
|
70
|
85
|
OpenPhone() { // 电话咨询
|