|
@@ -22,6 +22,7 @@ export default class Index extends Component {
|
22
|
22
|
grantPhoneVisible: false, // 授权电话
|
23
|
23
|
grantAvatarVisible: false, // 授权头像
|
24
|
24
|
houseDetail: null,
|
|
25
|
+ popVisiable: false,
|
25
|
26
|
}
|
26
|
27
|
|
27
|
28
|
|
|
@@ -76,17 +77,16 @@ export default class Index extends Component {
|
76
|
77
|
console.log(this.props.userInfo, "this.props")
|
77
|
78
|
return true
|
78
|
79
|
}
|
79
|
|
- chooseBtn(id, buildingId) {
|
80
|
|
- Taro.navigateTo({
|
81
|
|
- url: `/onlineSelling/pages/detail/resultPage?type=add&id=${id}&buildingId=${buildingId}`
|
82
|
|
- })
|
83
|
|
- }
|
84
|
|
- cancelChooseBtn(id, buildingId) {
|
|
80
|
+
|
|
81
|
+ chooseBtn(type) {
|
|
82
|
+ const { houseDetail: { houseId, buildingId } } = this.state
|
85
|
83
|
Taro.navigateTo({
|
86
|
|
- url: `/onlineSelling/pages/detail/resultPage?type=cancel&id=${id}&buildingId=${buildingId}`
|
|
84
|
+ url: `/onlineSelling/pages/detail/resultPage?type=${type}&id=${houseId}&buildingId=${buildingId}`
|
87
|
85
|
})
|
|
86
|
+ this.setState({ popVisiable: false })
|
88
|
87
|
}
|
89
|
88
|
|
|
89
|
+
|
90
|
90
|
handleChat(buildingId) {
|
91
|
91
|
Taro.navigateTo({
|
92
|
92
|
url: `/pages/card/list/index?buildingId=${buildingId}`
|
|
@@ -95,8 +95,8 @@ export default class Index extends Component {
|
95
|
95
|
|
96
|
96
|
|
97
|
97
|
render() {
|
98
|
|
- const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList } = this.state
|
99
|
|
- const { userInfo = { person: {} } } = this.props
|
|
98
|
+ const { grantPhoneVisible, grantAvatarVisible, houseDetail, buildingImgList, popVisiable } = this.state
|
|
99
|
+ const { userInfo } = this.props
|
100
|
100
|
const address = `${houseDetail.buildingName || ''}${houseDetail.termName || ''}${houseDetail.blockName || ''}${houseDetail.unitName || ''}${houseDetail.floorName || ''}${houseDetail.roomName || ''}`
|
101
|
101
|
|
102
|
102
|
return (
|
|
@@ -109,6 +109,11 @@ export default class Index extends Component {
|
109
|
109
|
grantAvatarVisible &&
|
110
|
110
|
<AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
|
111
|
111
|
}
|
|
112
|
+ {popVisiable && <View className="pop-box">
|
|
113
|
+ <View className="title" >{!houseDetail.isPreselect ? `确认使用手机号${userInfo.person.phone || userInfo.person.tel}预选此房源?` : '确认取消预选此房源?'}</View>
|
|
114
|
+ <View className="sure" onClick={!houseDetail.isPreselect ? () => this.chooseBtn('add') : () => this.chooseBtn('cancel')}>确定</View>
|
|
115
|
+ <View className="cancel" onClick={() => this.setState({ popVisiable: false })}>取消</View>
|
|
116
|
+ </View>}
|
112
|
117
|
|
113
|
118
|
<View className='detail'>
|
114
|
119
|
<View className='detail-top'>
|
|
@@ -150,9 +155,9 @@ export default class Index extends Component {
|
150
|
155
|
</View>
|
151
|
156
|
<View style="padding: 0 30rpx;">
|
152
|
157
|
{!houseDetail.isPreselect ?
|
153
|
|
- <View className="choose-btn" onClick={() => this.chooseBtn(houseDetail.houseId, houseDetail.buildingId)}>
|
|
158
|
+ <View className="choose-btn" onClick={() => this.setState({ popVisiable: true })}>
|
154
|
159
|
预选此房源
|
155
|
|
- </View> : <View className="choose-btn" onClick={() => this.cancelChooseBtn(houseDetail.houseId, houseDetail.buildingId)}>
|
|
160
|
+ </View> : <View className="choose-btn" onClick={() => this.setState({ popVisiable: true })}>
|
156
|
161
|
取消预选
|
157
|
162
|
</View>
|
158
|
163
|
}
|