Pārlūkot izejas kodu

Merge branch 'v3.5.1' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into v3.5.1

张延森 5 gadus atpakaļ
vecāks
revīzija
b43b9eebf6

+ 4
- 4
config/dev.js Parādīt failu

@@ -5,12 +5,12 @@ module.exports = {
5 5
   defineConstants: {
6 6
     // HOST: '"http://47.101.36.130:8085"',//测试
7 7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    HOST:  '"https://dev.jinchengjiaye.com"',//测试
9
-    WSS_HOST: '"wss://dev.jinchengjiaye.com"',
8
+    // HOST:  '"https://dev.jinchengjiaye.com"',//测试
9
+    // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    // HOST: '"http://192.168.0.84:8080"',
13
-    // WSS_HOST: '"ws://192.168.0.84:8080"',
12
+    HOST: '"http://192.168.0.218:8080"',
13
+    WSS_HOST: '"ws://192.168.0.218:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 1
- 1
project.config.json Parādīt failu

@@ -2,7 +2,7 @@
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "mini-chengjiao",
4 4
 	"description": "知与行联调",
5
-	"appid": "wxd9ee3a9480a4e544",
5
+	"appid": "wxda1f84b79b3edeb3",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,

Binārs
src/assets/person/nothing.png Parādīt failu


+ 2
- 0
src/constants/api.js Parādīt failu

@@ -47,6 +47,8 @@ export const API_ITEMS_LIST = resolvePath('building/list')
47 47
 export const API_ITEMS_DETAIL = resolvePath('buildingSelectId')
48 48
 export const API_ITEMS_TYPE = resolvePath('tdBuildingType')
49 49
 export const API_ACTIVITY_GROUP = resolvePath('helpActivityAndGroup')
50
+export const API_LOCATION_CITYP = resolvePath('location/city')
51
+// /wx/location/city?location=lon,lat
50 52
 
51 53
 
52 54
 // shop

+ 3
- 1
src/constants/project.js Parādīt failu

@@ -1,2 +1,4 @@
1 1
 export const PROJECT_LIST = 'PROJECT_LIST'
2
-export const PROJECT_DETAIL = 'PROJECT_DETAIL'
2
+export const PROJECT_DETAIL = 'PROJECT_DETAIL'
3
+
4
+export const LOCATION_CITY = 'LOCATION_CITY'

+ 2
- 1
src/pages/agent/become/index.js Parādīt failu

@@ -43,7 +43,8 @@ export default class Index extends Component {
43 43
     else {
44 44
       console.log('11111')
45 45
       Taro.showToast({
46
-        title: '请输入渠道码'
46
+        title: '请输入渠道码',
47
+        icon: 'none'
47 48
       })
48 49
     }
49 50
   }

+ 3
- 3
src/pages/card/index.js Parādīt failu

@@ -432,10 +432,10 @@ export default class Index extends Component {
432 432
             <ScrollView scrollY>
433 433
               <View className='mycard__user__info'>
434 434
                 <View className='mycard__user__imgox'>
435
-                  <Image className='mycard__user__img' src={picture} mode="aspectFill"></Image>
435
+                  <Image className='mycard__user__img' src={picture} mode="widthFix"></Image>
436 436
                   <Image src={picture} mode="aspectFill" className='head__img'></Image>
437 437
                 </View>
438
-                <Image src={require('@assets/person/top.png')} className='top-img' mode="aspectFill"></Image>
438
+                <Image src={require('@assets/person/top.png')} className='top-img' mode="widthFix"></Image>
439 439
               </View>
440 440
 
441 441
               <View className='mycard__user__information'>
@@ -464,7 +464,7 @@ export default class Index extends Component {
464 464
 
465 465
                 </View>
466 466
                 <View className='row medal'>
467
-                  <Image mode="aspectFill" className="img" src={require('@assets/person/jinpai.png')}></Image>
467
+                  <Image mode="widthFix" className="img" src={require('@assets/person/jinpai.png')}></Image>
468 468
                   <Text>金牌置业顾问</Text>
469 469
                 </View>
470 470
 

+ 7
- 2
src/pages/card/index.scss Parādīt failu

@@ -49,11 +49,16 @@
49 49
 
50 50
   &__imgox {
51 51
     width: 100%;
52
-    height: 550px;
52
+    height: 750px;
53 53
     overflow: hidden;
54 54
     position: relative;
55
-  }
56 55
 
56
+    
57
+  }
58
+&__img {
59
+     width: 750px;
60
+     height: 750px;
61
+    }
57 62
   &__info {
58 63
     width: 100%;
59 64
     position: relative;

+ 121
- 61
src/pages/person/customerAnalysis/analysis.js Parādīt failu

@@ -10,6 +10,7 @@ import { savePoint, updatePoint } from '@services/common'
10 10
 import { querySexInfo, getEchartDailyInfo, getEchartMonthInfo } from '@services/person'
11 11
 import { connect } from '@tarojs/redux'
12 12
 import LineChart from "../../../components/charts/Line";
13
+const nothing = require('@assets/person/nothing.png')
13 14
 
14 15
 
15 16
 @connect(({ user, city }) => ({ user, city }))
@@ -136,7 +137,7 @@ export default class analysis extends Taro.Component {
136 137
       } else if (params == 'follow') {
137 138
         getEchartMonthInfo(params).then(res => {
138 139
           this.setState({
139
-            chartInfo2:  res.map(x => ({ name: `${x.month.substr(4)}月`, value: x.customerNum })) || []
140
+            chartInfo2: res.map(x => ({ name: `${x.month.substr(4)}月`, value: x.customerNum })) || []
140 141
           })
141 142
         })
142 143
       } else {
@@ -165,77 +166,136 @@ export default class analysis extends Taro.Component {
165 166
         <AtTabs className="tab-bar" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable="false">
166 167
           <AtTabsPane current={current} index={0} >
167 168
             <View>
168
-              <View style="height:40rpx;position: relative;margin-top:20rpx">
169
-                <View className="daily-month" >
170
-                  {
171
-                    dailyMonth.map((item, index) => (
172
-                      <View key={index + 'daily'} className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
173
-                        {item}
174
-                      </View>))
175
-                  }
169
+              {
170
+                chartInfo.length &&
171
+                <View>
172
+                  <View style="height:40rpx;position: relative;margin-top:20rpx">
173
+                    <View className="daily-month" >
174
+                      {
175
+                        dailyMonth.map((item, index) => (
176
+                          <View key={index + 'daily'} className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
177
+                            {item}
178
+                          </View>))
179
+                      }
180
+                    </View>
181
+                  </View>
182
+                  <View style="width:100vw;height:530rpx;position: relative;">
183
+                    <LineChart source={chartInfo} />
184
+                  </View>
176 185
                 </View>
177
-              </View>
178
-              <View style="width:100vw;height:530rpx;position: relative;">
179
-                <LineChart source={chartInfo} />
180
-              </View>
181
-              <View style="height:20rpx;background:#f5f5f5;"> </View>
182
-              <View style="padding: 40rpx;">
183
-                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
184
-                {sexInfo.map((item, index) => (
185
-                  <View key={index + 'sex1'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
186
-                ))
187
-                }
188
-              </View>
186
+              }
187
+              {
188
+                !chartInfo.length &&
189
+                <View >
190
+                  <Image style="width: 320rpx;height: 260rpx;margin: 60rpx auto 20rpx auto;display:block" src={nothing} />
191
+                  <View style="text-align:center;color:#999;font-size:30rpx;margin-bottom:100rpx;">
192
+                    暂无数据展示
193
+                </View>
194
+                </View>
195
+              }
196
+
197
+              {
198
+                sexInfo.length &&
199
+                <View>
200
+                  <View style="height:20rpx;background:#f5f5f5;"> </View>
201
+                  <View style="padding: 40rpx;">
202
+                    <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
203
+                    {sexInfo.map((item, index) => (
204
+                      <View key={index + 'sex1'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
205
+                    ))
206
+                    }
207
+                  </View>
208
+                </View>
209
+              }
210
+
189 211
             </View>
190 212
           </AtTabsPane>
191 213
           <AtTabsPane current={current} index={1}>
192 214
             <View>
193
-              <View style="height:40rpx;position: relative;margin-top:20rpx">
194
-                <View className="daily-month" >
195
-                  {
196
-                    dailyMonth.map((item, index) => (
197
-                      <View key={index + 'month'} className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
198
-                        {item}
199
-                      </View>))
200
-                  }
215
+              {chartInfo2.length &&
216
+                <View>
217
+                  <View style="height:40rpx;position: relative;margin-top:20rpx">
218
+                    <View className="daily-month" >
219
+                      {
220
+                        dailyMonth.map((item, index) => (
221
+                          <View key={index + 'month'} className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
222
+                            {item}
223
+                          </View>))
224
+                      }
225
+                    </View>
226
+                  </View>
227
+                  <View style="width:100vw;height:530rpx;position: relative;">
228
+                    <LineChart source={chartInfo2} />
229
+                  </View>
230
+                </View>
231
+              }
232
+              {
233
+                !chartInfo2.length &&
234
+                <View >
235
+                  <Image style="width: 320rpx;height: 260rpx;margin: 60rpx auto 20rpx auto;display:block" src={nothing} />
236
+                  <View style="text-align:center;color:#999;font-size:30rpx;margin-bottom:100rpx;">
237
+                    暂无数据展示
201 238
                 </View>
202
-              </View>
203
-              <View style="width:100vw;height:530rpx;position: relative;">
204
-                <LineChart source={chartInfo2} />
205
-              </View>
206
-              <View style="height:20rpx;background:#f5f5f5;"> </View>
207
-              <View style="padding: 40rpx;">
208
-                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
209
-                {sexInfo.map((item, index) => (
210
-                  <View key={index + 'sex2'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
211
-                ))
212
-                }
213
-              </View>
239
+                </View>
240
+              }
241
+
242
+              {
243
+                sexInfo.length &&
244
+                <View>
245
+                  <View style="height:20rpx;background:#f5f5f5;"> </View>
246
+                  <View style="padding: 40rpx;">
247
+                    <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
248
+                    {sexInfo.map((item, index) => (
249
+                      <View key={index + 'sex2'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
250
+                    ))
251
+                    }
252
+                  </View>
253
+                </View>
254
+              }
214 255
             </View>
215 256
           </AtTabsPane>
216 257
           <AtTabsPane current={current} index={2}>
217 258
             <View>
218
-              <View style="height:40rpx;position: relative;margin-top:20rpx">
219
-                <View className="daily-month" >
220
-                  {
221
-                    dailyMonth.map((item, index) => (
222
-                      <View key={index + 'day'} className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
223
-                        {item}
224
-                      </View>))
225
-                  }
259
+              {
260
+                chartInfo3.length &&
261
+                <View>
262
+                  <View style="height:40rpx;position: relative;margin-top:20rpx">
263
+                    <View className="daily-month" >
264
+                      {
265
+                        dailyMonth.map((item, index) => (
266
+                          <View key={index + 'day'} className={checkedWhich == index ? 'checked' : 'item'} onClick={this.changeDailyMonth.bind(this, index)}>
267
+                            {item}
268
+                          </View>))
269
+                      }
270
+                    </View>
271
+                  </View>
272
+                  <View style="width:100vw;height:530rpx;position: relative;">
273
+                    <LineChart source={chartInfo3} />
274
+                  </View>
275
+                </View>
276
+              }
277
+              {
278
+                !chartInfo3.length &&
279
+                <View >
280
+                  <Image style="width: 320rpx;height: 260rpx;margin: 60rpx auto 20rpx auto;display:block" src={nothing} />
281
+                  <View style="text-align:center;color:#999;font-size:30rpx;margin-bottom:100rpx;">
282
+                    暂无数据展示
283
+                </View>
284
+                </View>
285
+              }
286
+              {
287
+                sexInfo.length &&
288
+                <View>
289
+                  <View style="height:20rpx;background:#f5f5f5;"> </View>
290
+                  <View style="padding: 40rpx;">
291
+                    <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
292
+                    {sexInfo.map((item, index) => (
293
+                      <View key={index + 'sex3'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
294
+                    ))
295
+                    }
296
+                  </View>
226 297
                 </View>
227
-              </View>
228
-              <View style="width:100vw;height:530rpx;position: relative;">
229
-                <LineChart source={chartInfo3} />
230
-              </View>
231
-              <View style="height:20rpx;background:#f5f5f5;"> </View>
232
-              <View style="padding: 40rpx;">
233
-                <View style="font-size: 36rpx;color: #666;margin-bottom:20rpx;">性别</View>
234
-                {sexInfo.map((item, index) => (
235
-                  <View key={index + 'sex3'} style="display: flex;align-items: center;"><View style="font-size: 32rpx;color: #666;min-width:80rpx">{item.genderType == 1 ? '男' : item.genderType == 2 ? '女' : '未知'}</View><AtProgress percent={(item.percentage * 100).toFixed(2)} strokeWidth={6} color={item.genderType == 1 ? '#BB9C79' : item.genderType == 2 ? '#F6B61D' : '#A2A2A2'} /></View>
236
-                ))
237
-                }
238
-              </View>
298
+              }
239 299
             </View>
240 300
           </AtTabsPane>
241 301
         </AtTabs>

+ 8
- 8
src/pages/person/menus.js Parādīt failu

@@ -146,14 +146,14 @@ const menus = [
146 146
     },
147 147
   ],
148 148
   [
149
-    {
150
-      name: '成为专业经纪人',
151
-      url: '/pages/agent/become/index',
152
-      icon: icons.development,
153
-      extends: undefined,
154
-      userTypes: [CUSTOMER, ESTATE_AGENT],
155
-      style: { color: '#888888' },
156
-    },
149
+    // {
150
+    //   name: '成为专业经纪人',
151
+    //   url: '/pages/agent/become/index',
152
+    //   icon: icons.development,
153
+    //   extends: undefined,
154
+    //   userTypes: [CUSTOMER, ESTATE_AGENT],
155
+    //   style: { color: '#888888' },
156
+    // },
157 157
     {
158 158
       name: '成为置业顾问',
159 159
       url: '',

+ 6
- 4
src/pages/project/album/index.js Parādīt failu

@@ -73,18 +73,20 @@ export default class Index extends Component {
73 73
                 const { apartmentName } = item || {}
74 74
                 const buildingImgList = item.buildingImgList
75 75
 
76
-                console.log(imgList, '22333333222')
77
-                return (
76
+                console.log(item, '22333333222')
77
+                return (<View>
78
+                  {buildingImgList.length>0&&
78 79
                   <View
79
-                    style={{ width: '100px' }}
80
+                    style={{ padding: '0 20px ' }}
80 81
                     key={current}
81 82
                     className={`around-tab__item ${current === index ? 'active' : ''}`}
82 83
                     onClick={() => this.setState({ current: index })}
83 84
                   >
84 85
 
85 86
                     <View>
86
-                      <View style={{ width: '100px', textAlign: 'center' }}>  {`${apartmentName}(${buildingImgList.length})`} </View>
87
+                      <View style={{  textAlign: 'center' }}>  {`${apartmentName}(${buildingImgList.length})`} </View>
87 88
                     </View>
89
+                  </View>}
88 90
                   </View>
89 91
                 )
90 92
               })}

+ 88
- 78
src/pages/project/detail/index.js Parādīt failu

@@ -58,7 +58,7 @@ export default class Index extends Component {
58 58
     videoPlayShow: 'flex',
59 59
   }
60 60
 
61
-  componentWillMount() {
61
+  componentWillMount () {
62 62
     // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
63 63
 
64 64
     ready.queue(() => {
@@ -92,12 +92,12 @@ export default class Index extends Component {
92 92
     })
93 93
   }
94 94
 
95
-  componentWillUnmount() {
95
+  componentWillUnmount () {
96 96
     const { recordId } = this.state
97 97
     recordId && updatePoint(recordId)
98 98
   }
99 99
 
100
-  loadHelpGroupList() {
100
+  loadHelpGroupList () {
101 101
     const { buildingId } = this.state
102 102
 
103 103
     queryHelpGroup({ buildingId: buildingId }).then(res => {
@@ -119,7 +119,7 @@ export default class Index extends Component {
119 119
     )
120 120
   }
121 121
 
122
-  loadDetail() {
122
+  loadDetail () {
123 123
     const { buildingId } = this.state
124 124
     const { dispatchProjectDetail } = this.props
125 125
     this.setState({
@@ -147,7 +147,7 @@ export default class Index extends Component {
147 147
     })
148 148
   }
149 149
 
150
-  loadActivityData() {
150
+  loadActivityData () {
151 151
     const { buildingId } = this.state
152 152
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
153 153
     queryActivityList(payload).then(res => {
@@ -157,7 +157,7 @@ export default class Index extends Component {
157 157
     })
158 158
   }
159 159
 
160
-  loadNewsData() {
160
+  loadNewsData () {
161 161
     const { buildingId } = this.state
162 162
     const payload = { pageSize: 2, pageNumber: 1, buildingId }
163 163
     queryNewsList(payload).then(res => {
@@ -167,11 +167,11 @@ export default class Index extends Component {
167 167
     })
168 168
   }
169 169
 
170
-  navigateTo(url) {
170
+  navigateTo (url) {
171 171
     Taro.navigateTo({ url: url })
172 172
   }
173 173
   // 海报预览图
174
-  previewImage(arr) {
174
+  previewImage (arr) {
175 175
     // console.log('arr:' + arr)
176 176
     if (arr[0].length > 1) {
177 177
       Taro.previewImage({
@@ -198,7 +198,7 @@ export default class Index extends Component {
198 198
     })
199 199
   }
200 200
 
201
-  openMap() {
201
+  openMap () {
202 202
     const {
203 203
       buildingName,
204 204
       address,
@@ -225,12 +225,12 @@ export default class Index extends Component {
225 225
     })
226 226
   }
227 227
 
228
-  toViewAlbum() {
228
+  toViewAlbum () {
229 229
     const { buildingId } = this.state
230 230
     this.navigateTo(`/pages/project/album/index?id=${buildingId}`)
231 231
   }
232 232
 
233
-  onViewFans() {
233
+  onViewFans () {
234 234
     const { buildingId } = this.state
235 235
     this.navigateTo('/pages/card/fans/index?type=item&id=' + buildingId)
236 236
   }
@@ -259,7 +259,7 @@ export default class Index extends Component {
259 259
     }
260 260
   }
261 261
 
262
-  getPhoneNumber(e, item) {
262
+  getPhoneNumber (e, item) {
263 263
     getUserPhone(e, (phoneNumber) => {
264 264
       const { userInfo: { person: { personId, nickname, name } } } = this.props
265 265
       Taro.navigateTo({
@@ -268,7 +268,7 @@ export default class Index extends Component {
268 268
     })
269 269
   }
270 270
 
271
-  getPosterData() {
271
+  getPosterData () {
272 272
     return new Promise(resolve => {
273 273
       const { posterData } = this.state
274 274
       if (posterData.qrcode) {
@@ -339,14 +339,14 @@ export default class Index extends Component {
339 339
     })
340 340
   }
341 341
 
342
-  handleTelClick(item, e) {
342
+  handleTelClick (item, e) {
343 343
     e.stopPropagation()
344 344
     Taro.makePhoneCall({
345 345
       phoneNumber: item.phone
346 346
     })
347 347
   }
348 348
 
349
-  handleChatClick(item, e) {
349
+  handleChatClick (item, e) {
350 350
     e.stopPropagation()
351 351
     const { userInfo: { person: { personId, nickname, name } } } = this.props
352 352
     Taro.navigateTo({
@@ -354,24 +354,24 @@ export default class Index extends Component {
354 354
     })
355 355
   }
356 356
 
357
-  handleConsuItemClick(item) {
357
+  handleConsuItemClick (item) {
358 358
     Taro.navigateTo({
359 359
       url: `/pages/card/index?id=${item.id}`
360 360
     })
361 361
   }
362 362
 
363
-  handleMoreClick() {
363
+  handleMoreClick () {
364 364
     // App.zhuge.track('查看置业顾问列表')
365 365
     Taro.navigateTo({
366 366
       url: `/pages/card/list/index?buildingId=${this.state.buildingId}`
367 367
     })
368 368
   }
369 369
 
370
-  handleStopPropagation(e) {
370
+  handleStopPropagation (e) {
371 371
     e.stopPropagation()
372 372
   }
373 373
 
374
-  toRecomonedPage() {
374
+  toRecomonedPage () {
375 375
     const {
376 376
       userInfo: { person: { personType } }
377 377
     } = this.props
@@ -387,50 +387,50 @@ export default class Index extends Component {
387 387
     }
388 388
   }
389 389
 
390
-  toHome() {
390
+  toHome () {
391 391
     Taro.switchTab({
392 392
       url: `/pages/project/index`
393 393
     })
394 394
   }
395 395
 
396
-  HandleCircumTabClick(id) {
396
+  HandleCircumTabClick (id) {
397 397
     this.setState({
398 398
       curTab: id
399 399
     })
400 400
   }
401 401
 
402
-  handleNewsMoreClick() {
402
+  handleNewsMoreClick () {
403 403
     Taro.navigateTo({
404 404
       url: `/pages/news/index?buildingId=` + this.state.buildingId
405 405
     })
406 406
   }
407 407
 
408
-  handNewsItemClick(id) {
408
+  handNewsItemClick (id) {
409 409
     Taro.navigateTo({
410 410
       url: '/pages/news/detail/index?id=' + id
411 411
     })
412 412
   }
413 413
 
414
-  handleActivityMoreClick() {
414
+  handleActivityMoreClick () {
415 415
     Taro.navigateTo({
416 416
       url: `/pages/activity/index?buildingId=` + this.state.buildingId
417 417
     })
418 418
   }
419 419
 
420
-  handActivityItemClick(id) {
420
+  handActivityItemClick (id) {
421 421
     Taro.navigateTo({
422 422
       url: '/pages/activity/detail/index?id=' + id
423 423
     })
424 424
   }
425 425
 
426
-  handlePreviewHxImage(current, urls) {
426
+  handlePreviewHxImage (current, urls) {
427 427
     Taro.previewImage({
428 428
       current,
429 429
       urls
430 430
     })
431 431
   }
432 432
 
433
-  handleFavor() {
433
+  handleFavor () {
434 434
     const { buildingId, isSaved } = this.state
435 435
     if (isSaved) {
436 436
       cancelFavorProject(buildingId).then(res => {
@@ -460,18 +460,18 @@ export default class Index extends Component {
460 460
       console.log('活动项目收藏')
461 461
     })
462 462
   }
463
-  handleToolsClick() {
463
+  handleToolsClick () {
464 464
     Taro.navigateTo({
465 465
       url: `/pages/toolKit/index`
466 466
     })
467 467
   }
468
-  moreFloor() {
468
+  moreFloor () {
469 469
     Taro.navigateTo({
470 470
       url: `/pages/project/floor/index`
471 471
     })
472 472
   }
473 473
 
474
-  renderBottomMenu() {
474
+  renderBottomMenu () {
475 475
     const { userInfo: { person: { personType } } } = this.props
476 476
     const { posterShow } = this.state
477 477
     return (
@@ -506,14 +506,14 @@ export default class Index extends Component {
506 506
     )
507 507
   }
508 508
 
509
-  previewHouseImage(current, urls) {
509
+  previewHouseImage (current, urls) {
510 510
     Taro.previewImage({
511 511
       current,
512 512
       urls
513 513
     })
514 514
   }
515 515
 
516
-  renderBuildingProjectTypeList() {
516
+  renderBuildingProjectTypeList () {
517 517
     const { statusOpts } = this.state
518 518
     const { projectDetail: { buildingProjectType = [], status, marketStatus } } = this.props
519 519
     return (
@@ -573,22 +573,22 @@ export default class Index extends Component {
573 573
   }
574 574
 
575 575
 
576
-  renderPhotoAlbum() {
576
+  renderPhotoAlbum () {
577 577
     const { projectDetail: { buildingApartment } } = this.props
578 578
     const list = buildingApartment.filter(item => item.apartmentType === 'photo')
579
-    const imgList = list.reduce((prev, cur) => {
580
-      prev = prev.concat(cur.buildingImgList)
581
-      return prev
582
-    }, [])
579
+    // const imgList = list.reduce((prev, cur) => {
580
+    //   prev = prev.concat(cur.buildingImgList)
581
+    //   return prev
582
+    // }, [])
583
+
583 584
 
584
-    const { albumCurrent } = this.state
585 585
 
586 586
 
587 587
 
588 588
     return (
589 589
 
590 590
 
591
-      <Block>
591
+      <Block> {console.log(list, 'list')}
592 592
         {list.length > 0 &&
593 593
           (
594 594
             <View className='photos__type'>
@@ -598,22 +598,32 @@ export default class Index extends Component {
598 598
 
599 599
                   <View className="around-tab">
600 600
                     {list.map((item, index) => {
601
-                      const { apartmentName } = item || {}
602
-                      const buildingImgList = item.buildingImgList
603
-
604
-
605
-                      return (
606
-                        <View
607
-                          style={{ marginRight: '8px' }}
608
-                        >
609
-                          {/* {`${label}(${num})`} */}
610
-                          <View>
611
-                            <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} ></Image>
612
-                            <View style={{ textAlign: 'center' }}>  {`${apartmentName}(${buildingImgList.length})`} </View>
613
-                          </View>
614
-                        </View>
615
-                      )
616
-                    })}
601
+                      const { apartmentName } = item
602
+                      const buildingImgList = item.buildingImgList 
603
+                      const buildingImgUrl = buildingImgList.length > 0 ? buildingImgList[0].url : null
604
+
605
+                      console.log(buildingImgUrl, 'buildingImgUrl')
606
+
607
+                      // if (buildingImgUrl != null) {
608
+                        return (<View>
609
+                         {buildingImgUrl != null&& (<View
610
+                            style={{ marginRight: '8px' }}
611
+                          >
612
+
613
+                            <View>
614
+                              <Image className='albumimg' src={getThumbnail(buildingImgList[0].url)} ></Image>
615
+                              <View style={{ textAlign: 'center', width: '218rpx', display: 'flex' }}>
616
+                                <View style={{ textAlign: 'center', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}> {apartmentName}  </View>
617
+
618
+                                <View>({buildingImgList.length})</View>
619
+                              </View>
620
+                            </View>
621
+                          </View>)}</View>
622
+                        )
623
+                      // }
624
+
625
+                    })
626
+                    }
617 627
                   </View>
618 628
                 </View>
619 629
               </ScrollView>
@@ -623,7 +633,7 @@ export default class Index extends Component {
623 633
       </Block>
624 634
     )
625 635
   }
626
-  rendercircum() {
636
+  rendercircum () {
627 637
     const building = {
628 638
       ...this.props.projectDetail
629 639
     }
@@ -640,7 +650,7 @@ export default class Index extends Component {
640 650
     )
641 651
   }
642 652
 
643
-  renderConsuler() {
653
+  renderConsuler () {
644 654
     const { userInfo: { person: { phone } } } = this.props
645 655
     const { projectDetail: { consultants = [] } } = this.props
646 656
     return (
@@ -694,7 +704,7 @@ export default class Index extends Component {
694 704
     )
695 705
   }
696 706
 
697
-  renderStatement() {
707
+  renderStatement () {
698 708
     return (
699 709
       <View className='statement'>
700 710
         免责条款:以上价格仅供参考,具体一房一价的信息以售楼处展示为准。本网显示房屋位置、交通、医疗、教育、商业等配套信息,来源于第三方网络数据,不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。<br></br>本平台对项目周边文化教育的介绍旨在提供相关信息,并不意味着信息发布方对就学安排作出承诺。相关教育资源就学信息存在调整的可能,应以政府教育主管部门及办学颁布的政策规定为准。
@@ -703,7 +713,7 @@ export default class Index extends Component {
703 713
   }
704 714
 
705 715
 
706
-  renderHelp() {
716
+  renderHelp () {
707 717
     const { helpList } = this.state
708 718
     return (
709 719
       <Block>
@@ -724,17 +734,17 @@ export default class Index extends Component {
724 734
     )
725 735
   }
726 736
 
727
-  handleHelpClick(item) {
737
+  handleHelpClick (item) {
728 738
     Taro.navigateTo({
729 739
       url: '/pages/activity/detail/assistance?id=' + item.activityId
730 740
     })
731 741
   }
732
-  handleGroupClick(item) {
742
+  handleGroupClick (item) {
733 743
     Taro.navigateTo({
734 744
       url: '/pages/activity/detail/assemble?id=' + item.activityId
735 745
     })
736 746
   }
737
-  renderGroup() {
747
+  renderGroup () {
738 748
     const { groupList } = this.state
739 749
     return (
740 750
       <Block>
@@ -757,7 +767,7 @@ export default class Index extends Component {
757 767
     )
758 768
   }
759 769
 
760
-  renderHouseTypeList() {
770
+  renderHouseTypeList () {
761 771
     const { statusOpts } = this.state
762 772
     const { projectDetail: { buildingApartment } } = this.props
763 773
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
@@ -874,7 +884,7 @@ export default class Index extends Component {
874 884
       </Block>
875 885
     )
876 886
   }
877
-  renderNews() {
887
+  renderNews () {
878 888
     const { newsList } = this.state
879 889
     return (
880 890
       <Block>
@@ -915,21 +925,21 @@ export default class Index extends Component {
915 925
     videoContext.play()
916 926
   }
917 927
 
918
-  onPlay() {
919
-    console.log()
920
-    this.setState({
921
-      videoPlayShow: 'none'
922
-    })
923
-  }
928
+  // onPlay () {
929
+  //   console.log()
930
+  //   this.setState({
931
+  //     videoPlayShow: 'none'
932
+  //   })
933
+  // }
924 934
 
925
-  onPause() {
926
-    this.setState({
927
-      videoPlayShow: 'flex'
928
-    })
929
-  }
935
+  // onPause() {
936
+  //   this.setState({
937
+  //     videoPlayShow: 'flex'
938
+  //   })
939
+  // }
930 940
 
931 941
 
932
-  renderVideo() {
942
+  renderVideo () {
933 943
     const { videoPlayShow } = this.state
934 944
     const { projectDetail } = this.props
935 945
     const { videoImage } = projectDetail
@@ -978,13 +988,13 @@ export default class Index extends Component {
978 988
     )
979 989
   }
980 990
 
981
-  changeCurrent(current) {
991
+  changeCurrent (current) {
982 992
     this.setState({
983 993
       current: current + 1
984 994
     })
985 995
   }
986 996
 
987
-  render() {
997
+  render () {
988 998
     const { posterStatus, posterData, loaded, btnstate } = this.state
989 999
     const { projectDetail } = this.props
990 1000
     const { uvList = {} } = projectDetail

+ 53
- 24
src/pages/project/index.js Parādīt failu

@@ -8,6 +8,7 @@ import ActivityItem from '../activity/item'
8 8
 
9 9
 
10 10
 import ready from '@utils/ready'
11
+import { getLocationCity } from '@services/map'
11 12
 
12 13
 import { queryBanners, savePoint, updatePoint } from '@services/common'
13 14
 import { queryNewsList, queryHelpGroup } from '@services/news'
@@ -95,42 +96,69 @@ export default class Index extends Component {
95 96
     Taro.getLocation().then(location => {
96 97
       Taro.setStorageSync('lat', location.latitude)
97 98
       Taro.setStorageSync('lon', location.longitude)
99
+      console.log(location, 'location')
98 100
 
101
+      const payload = { location: `${location.longitude},${location.latitude}` }
102
+      console.log(payload, 'payload')
99 103
 
100
-      this.qqmapsdk.reverseGeocoder({
101
-        location,
102
-        success: (res) => {
103
-          // debugger
104
-          let city = res.result.address_component.city
104
+      getLocationCity(payload).then(res => {
105
+        let cityId = res.id
106
+        let curCity = cityList.filter(item => {
107
+          return item.id == cityId
108
+        })
109
+
110
+        Taro.showToast({
111
+          title: `当前定位城市:${res.name}`,
112
+          icon: 'none',
113
+        })
114
+
115
+        this.updateCity(curCity[0] || defaultCity[0])
116
+        console.log(curCity, 'location')
117
+
118
+
119
+        // this.qqmapsdk.getLocationCity({
120
+
121
+
122
+        //   location,
123
+        //   success: (res) => {
124
+        //     // debugger
125
+        //     let city = res.result.address_component.city
105 126
 
106
-          console.log('-----city-->', city)
107
-          console.log('-----cityList-->', cityList)
127
+        //     console.log('-----city-->', city)
128
+        //     console.log('-----cityList-->', cityList)
108 129
 
109 130
 
110
-          let curCity = cityList.filter(item => {
111
-            return item.name == city
112
-          })
131
+        //     let curCity = cityList.filter(item => {
132
+        //       return item.name == city
133
+        //     })
113 134
 
114 135
 
115 136
 
116 137
 
117
-          Taro.showToast({
118
-            title: `当前定位城市:${(curCity[0] || {}).name}`,
119
-            icon: 'none',
120
-          })
138
+        //     Taro.showToast({
139
+        //       title: `当前定位城市:${(curCity[0] || {}).name}`,
140
+        //       icon: 'none',
141
+        //     })
121 142
 
122
-          this.updateCity(curCity[0] || defaultCity[0])
123
-        },
124
-        fail: (error) => {
143
+        //     this.updateCity(curCity[0] || defaultCity[0])
144
+        //   },
145
+        //   fail: (error) => {
125 146
 
126 147
 
127
-          Taro.showToast({
128
-            title: `定位错误: ${error.message}`,
129
-            icon: 'none',
130
-          })
131
-          console.error(err)
132
-          this.updateCity(defaultCity[0])
133
-        },
148
+        //     Taro.showToast({
149
+        //       title: `定位错误: ${error.message}`,
150
+        //       icon: 'none',
151
+        //     })
152
+        //     console.error(err)
153
+        //     this.updateCity(defaultCity[0])
154
+        //   },
155
+      }).catch(err=>{
156
+               Taro.showToast({
157
+              title: `定位错误: ${error.message}`,
158
+              icon: 'none',
159
+            })
160
+            console.error(err)
161
+            this.updateCity(defaultCity[0])
134 162
       })
135 163
     }).catch(err => {
136 164
       if (err.errMsg === 'getLocation:fail auth deny') {
@@ -185,6 +213,7 @@ export default class Index extends Component {
185 213
   }
186 214
   loadBannerList () {
187 215
     const { curCity } = this.props
216
+    console.log(this.props,'this.props')
188 217
     // 获取首页banner
189 218
     const payload = {
190 219
       showPosition: 'index'

+ 14
- 0
src/services/map.js Parādīt failu

@@ -0,0 +1,14 @@
1
+
2
+
3
+import { fetch } from '@utils/request'
4
+import {
5
+  API_LOCATION_CITYP
6
+
7
+} from '@constants/api'
8
+
9
+
10
+/**
11
+ * 获取名片列表
12
+ * @param {*} payload 
13
+ */
14
+export const getLocationCity = payload => fetch({ url: API_LOCATION_CITYP, payload })

+ 1
- 1
src/utils/request.js Parādīt failu

@@ -28,7 +28,7 @@ export const setStorage = function (key, data) {
28 28
  */
29 29
 export const fetch = async (options) => {
30 30
   const { url, payload, method = 'GET', showToast = true, autoLogin = true } = options
31
-
31
+  console.log(Taro.getStorageSync('token'),'----token---')
32 32
   return Taro.request({
33 33
     url,
34 34
     method,