|
@@ -0,0 +1,143 @@
|
|
1
|
+import Taro, { Component } from '@tarojs/taro';
|
|
2
|
+import './index.scss'
|
|
3
|
+import AchievePhone from '@/components/achievePhone'
|
|
4
|
+import AchieveAvatar from '@/components/achieveAvatar'
|
|
5
|
+import { connect } from '@tarojs/redux'
|
|
6
|
+import ready from '@/utils/ready'
|
|
7
|
+
|
|
8
|
+@connect(
|
|
9
|
+ ({ user }) => ({ ...user })
|
|
10
|
+)
|
|
11
|
+
|
|
12
|
+export default class Index extends Component {
|
|
13
|
+ config = {
|
|
14
|
+ navigationBarTitleText: '房源详情',
|
|
15
|
+ }
|
|
16
|
+
|
|
17
|
+ state = {
|
|
18
|
+ grantPhoneVisible: false, // 授权电话
|
|
19
|
+ grantAvatarVisible: false, // 授权头像
|
|
20
|
+ }
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+ componentWillMount() {
|
|
25
|
+
|
|
26
|
+ ready.queue(() => {
|
|
27
|
+ // 分享场景需要先授权手机, 再授权头像
|
|
28
|
+ if (this.toggleGrantPhone()) {
|
|
29
|
+ this.toggleGrantAvatar()
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+ })
|
|
34
|
+ }
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+ // 调起授权电话
|
|
39
|
+ toggleGrantPhone = () => {
|
|
40
|
+ const { userInfo: { person: { phone, tel } } } = this.props
|
|
41
|
+ if (!phone && !tel) {
|
|
42
|
+ this.setState({ grantPhoneVisible: true })
|
|
43
|
+ return false
|
|
44
|
+ }
|
|
45
|
+ console.log('phone:', phone, 'tel:', tel, '!!!!!')
|
|
46
|
+ console.log(this.props, 'this.propsphone!!!!!')
|
|
47
|
+
|
|
48
|
+ return true
|
|
49
|
+ }
|
|
50
|
+
|
|
51
|
+ // 调起授权头像
|
|
52
|
+ toggleGrantAvatar = () => {
|
|
53
|
+ const { userInfo: { person: { avatarurl } } } = this.props
|
|
54
|
+
|
|
55
|
+ if (!avatarurl || avatarurl.indexOf('wx.qlogo.cn') === -1) {
|
|
56
|
+ this.setState({ grantAvatarVisible: true })
|
|
57
|
+ return false
|
|
58
|
+ }
|
|
59
|
+
|
|
60
|
+ console.log(avatarurl, "avatarurl")
|
|
61
|
+ console.log(this.props.userInfo, "this.props")
|
|
62
|
+ return true
|
|
63
|
+ }
|
|
64
|
+ chooseBtn() {
|
|
65
|
+ Taro.navigateTo({
|
|
66
|
+ url: '/onlineSelling/pages/detail/resultPage'
|
|
67
|
+ })
|
|
68
|
+ }
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+ render() {
|
|
72
|
+ const { grantPhoneVisible, grantAvatarVisible } = this.state
|
|
73
|
+ const { userInfo = { person: {} } } = this.props
|
|
74
|
+
|
|
75
|
+ return (
|
|
76
|
+ <Block>
|
|
77
|
+ {
|
|
78
|
+ grantPhoneVisible &&
|
|
79
|
+ <AchievePhone user={userInfo.person} onSuccess={this.toggleGrantAvatar}></AchievePhone>
|
|
80
|
+ }
|
|
81
|
+ {
|
|
82
|
+ grantAvatarVisible &&
|
|
83
|
+ <AchieveAvatar user={userInfo.person} onSuccess={() => { this.setState({ grantAvatarVisible: false }) }} ></AchieveAvatar>
|
|
84
|
+ }
|
|
85
|
+
|
|
86
|
+ <View className='detail'>
|
|
87
|
+ <View className='detail-top'>
|
|
88
|
+ <Image className="norecord-img" mode="aspectFill" src={require('../../assets/norecord.png')}></Image>
|
|
89
|
+ <View className="norecord-text">暂无户型信息</View>
|
|
90
|
+ {/* <Image className="cover-img" mode="aspectFill" src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1581369637322&di=6065c2aee90f790b00d0c815f465ebc5&imgtype=0&src=http%3A%2F%2Fcyzs97.com%2FUploads%2FEditor%2FPicture%2F2018-10-18%2F5bc8330f2d06f.jpg"></Image> */}
|
|
91
|
+ </View>
|
|
92
|
+ <ScrollView
|
|
93
|
+ enableBackToTop
|
|
94
|
+ className="wrap"
|
|
95
|
+ scrollY>
|
|
96
|
+ <View className='detail__main'>
|
|
97
|
+ <View style="padding: 0 30rpx;">
|
|
98
|
+
|
|
99
|
+ <View className="title">
|
|
100
|
+ <View className="name">A户型</View>
|
|
101
|
+ <View className="btn">询问优惠</View>
|
|
102
|
+ </View>
|
|
103
|
+ <View className="price">
|
|
104
|
+ 现价:234万
|
|
105
|
+ </View>
|
|
106
|
+ <View className="area">
|
|
107
|
+ <Text> 建面<Text style="color:#FE1C1C">270</Text>m²</Text>
|
|
108
|
+ <Text style="margin-left:20rpx"> 套内<Text style="color:#FE1C1C">270</Text>m²</Text>
|
|
109
|
+ </View>
|
|
110
|
+ <View className="address">
|
|
111
|
+ <Image className="location-icon" src={require('../../assets/location.png')}></Image> XX嘉园1号楼2单元3楼303号
|
|
112
|
+ </View>
|
|
113
|
+ <View className="date">
|
|
114
|
+ 预选时间:2/12 12:23:33--2/13 12:23:34
|
|
115
|
+ </View>
|
|
116
|
+ <View className="date">
|
|
117
|
+ 认筹时间:2/12 12:23:33--2/13 12:23:34
|
|
118
|
+ </View>
|
|
119
|
+ </View>
|
|
120
|
+ <View className="num">
|
|
121
|
+ 已有12人预选此房源,快快预选认筹~
|
|
122
|
+ </View>
|
|
123
|
+ <View style="padding: 0 30rpx;">
|
|
124
|
+ <View className="choose-btn" onClick={()=>this.chooseBtn()}>
|
|
125
|
+ 预选此房源
|
|
126
|
+ </View>
|
|
127
|
+ <View className="close-btn">
|
|
128
|
+ 认筹功能未开放
|
|
129
|
+ </View>
|
|
130
|
+ </View>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+ </View>
|
|
134
|
+ </ScrollView>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+ </View>
|
|
139
|
+
|
|
140
|
+ </Block>
|
|
141
|
+ );
|
|
142
|
+ }
|
|
143
|
+}
|