周立森 5 年前
父节点
当前提交
eaa551404e

+ 2
- 1
.gitignore 查看文件

@@ -3,4 +3,5 @@ dist/
3 3
 .rn_temp/
4 4
 node_modules/
5 5
 .DS_Store
6
-*.rar
6
+*.rar
7
+*.zip

+ 4
- 4
config/dev.js 查看文件

@@ -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.172:8080"',
13
-    // WSS_HOST: '"ws://192.168.0.172:8080"',
12
+    // HOST: '"http://192.168.0.84:8080"',
13
+    // WSS_HOST: '"ws://192.168.0.84:8080"',
14 14
   },
15 15
   weapp: {},
16 16
   h5: {}

+ 6
- 2
src/app.js 查看文件

@@ -164,6 +164,10 @@ class App extends Component {
164 164
         console.info('router2:', router)
165 165
         console.info('-----------')
166 166
         const { query: payload } = router
167
+
168
+        payload.path = router.path
169
+        payload.scene = router.scene
170
+
167 171
         // login
168 172
         login(payload, res => {
169 173
           // 获取未读消息
@@ -209,8 +213,8 @@ class App extends Component {
209 213
   componentDidMount() {
210 214
     console.info('app componentDidMount')
211 215
   }
212
-  componentWillMount() {
213
-    console.info('app componentWillMount')
216
+  componentWillMount(params) {
217
+    console.info('app componentWillMount', params)
214 218
   }
215 219
 
216 220
   getRouterParams() {

+ 1
- 2
src/components/charts/Line.js 查看文件

@@ -163,9 +163,8 @@ export default class LineChart extends Component {
163 163
 
164 164
   render() {
165 165
     // this.refreshChart(this.props.source)
166
-
167 166
     return (
168
-      <View style="width:100vw;height:530rpx;position: relative;">
167
+      <View style="width:100vw;height:480rpx;position: relative;">
169 168
         <View className="map-container">
170 169
           <ec-canvas ref={this.handleEcComponent} ec={this.state.ec}></ec-canvas>
171 170
         </View>

+ 6
- 5
src/components/charts/style.scss 查看文件

@@ -1,9 +1,10 @@
1 1
 .map-container {
2
-  position: absolute;
3
-  top: 80px;
4
-  bottom: 0;
5
-  left: 0;
6
-  right: 0;
2
+  // position: absolute;
3
+  // top: 80px;
4
+  // bottom: 0;
5
+  // left: 0;
6
+  // right: 0;
7
+  margin-top: 60px;
7 8
   width:100vw;
8 9
   height:400px;
9 10
   display: flex;

+ 1
- 3
src/pages/activity/detail/assemble.js 查看文件

@@ -402,8 +402,6 @@ export default class Detail extends Component {
402 402
               phone: person.tel || person.phone,
403 403
               avatarurl: person.avatarurl,
404 404
             }).then(res => {
405
-              console.log(res,'888888')
406
-              if(res){
407 405
                 this.setState({
408 406
                   recordDetail: res.taShareRecord,
409 407
                   recordId: res.taShareRecord.recordId,
@@ -411,7 +409,7 @@ export default class Detail extends Component {
411 409
                   isStarter: true,
412 410
                   groupState: res.taShareRecord.status,
413 411
                 }, () => cb && cb())
414
-              }
412
+              
415 413
             }).catch(err => {
416 414
               console.log(err,'11111111111111')
417 415
               Taro.showToast({

+ 0
- 8
src/pages/activity/detail/assistance.js 查看文件

@@ -614,14 +614,6 @@ export default class Detail extends Component {
614 614
                       </View>
615 615
                     )
616 616
                   }
617
-                  <View className="btn-box" style="padding:25px 0;">
618
-
619
-                    <View className="set-btn" style="border:none">
620
-                      <FormIdCollector>
621
-                        <Button className= "set-btn" onClick={this.startMine}>发起我的助力</Button>
622
-                      </FormIdCollector>
623
-                    </View>
624
-                  </View>
625 617
                 </View>
626 618
                 <View className="assistance-text"><Text className="acitivty-desc">活动说明</Text>-------------------------------------------------------------- </View>
627 619
                 <View style="padding:0 40rpx">

+ 14
- 15
src/pages/activity/detail/index.js 查看文件

@@ -280,19 +280,18 @@ export default class Detail extends Component {
280 280
     }
281 281
 
282 282
     signupActivity(payload).then(res => {
283
-      if (res) {
284
-        Taro.showToast({
285
-          title: '报名成功'
286
-        })
287
-        this.setState({
288
-          isSign: true,
289
-          canChoose: 'none'
290
-        })
291
-      }else{
292
-        this.setState({
293
-          canChoose: 'none'
294
-        })
295
-      }
283
+
284
+      Taro.showToast({
285
+        title: '报名成功'
286
+      })
287
+      this.setState({
288
+        isSign: true,
289
+        canChoose: 'none'
290
+      })
291
+      setTimeout(() => {
292
+        this.loadDetail()
293
+      }, 500)
294
+
296 295
     })
297 296
 
298 297
     savePoint({
@@ -328,7 +327,7 @@ export default class Detail extends Component {
328 327
               </View>
329 328
               <ScrollView
330 329
                 scrollY
331
-                className="detail-wrap">
330
+                className="detail-wrap" style="margin-top:-40rpx">
332 331
                 <View className="detail bottom-box">
333 332
                   {detail.isEnlist == 0 &&
334 333
                     <View className="detail-sign__num">不需要报名</View>
@@ -397,7 +396,7 @@ export default class Detail extends Component {
397 396
                     ))))
398 397
                 }
399 398
                 {detail.activityStatus == 2 &&
400
-                  <Button disabled='true' className='submit-btn hasSigned' >立即报名</Button>
399
+                  <Button disabled='true' className='submit-btn hasSigned' >{isSign ? '已报名' : '立即报名'}</Button>
401 400
                 }
402 401
 
403 402
                 {/* {phone ? (

+ 8
- 8
src/pages/activity/detail/index.scss 查看文件

@@ -90,11 +90,11 @@
90 90
 }
91 91
 .detail {
92 92
   background: white;
93
-  border-top-left-radius: 28px;
94
-  border-top-right-radius: 28px;
93
+  border-radius: 28px 28px 0 0;
95 94
   padding: 30px 40px 0 40px;
96 95
   position: relative;
97 96
   overflow: hidden;
97
+  
98 98
 
99 99
   .status__img{
100 100
     width: 176px;
@@ -154,21 +154,20 @@
154 154
     top: -22px;
155 155
     right: -18px;
156 156
     width: 200px;
157
-    height: 88px;
157
+    height: 74px;
158 158
     display: flex;
159 159
     justify-content: center;
160 160
     align-items: center;
161 161
     background: rgba(255, 237, 237, 0.85);
162 162
     border-radius: 36px;
163 163
     color: #FF5757;
164
-    font-size: 28px;
165
-    padding-top: 17px;
164
+    font-size: 26px;
165
+    padding-top: 14px;
166 166
   }
167 167
 
168 168
   &-title {
169 169
     font-size: $font-size-title-large;
170
-    line-height: 1.5;
171
-    margin-bottom: 20px;
170
+    margin-top: 20px;
172 171
   }
173 172
 
174 173
   &-top {
@@ -180,11 +179,12 @@
180 179
 
181 180
       .row-label {
182 181
         font-size: 32px;
182
+        color:#999;
183 183
       }
184 184
 
185 185
       .row-content {
186 186
         padding-left: 10px;
187
-        color: $text-color-lighter;
187
+        color: #333;
188 188
       }
189 189
     }
190 190
   }

+ 2
- 2
src/pages/activity/detail/poster.js 查看文件

@@ -67,7 +67,7 @@ export default class Index extends Component {
67 67
         fontSize: 30,
68 68
         color: 'black',
69 69
         baseLine: 'middle',
70
-        lineNum: 2,
70
+        lineNum: 1,
71 71
         lineHeight: 48,
72 72
         // textAlign: 'center',
73 73
         width: 560,
@@ -80,7 +80,7 @@ export default class Index extends Component {
80 80
         fontSize: 28,
81 81
         color: '#999',
82 82
         baseLine: 'middle',
83
-        lineNum: 2,
83
+        lineNum: 1,
84 84
         lineHeight: 48,
85 85
         width: 560,
86 86
         zIndex: 999

+ 11
- 12
src/pages/agent/recommend/index.js 查看文件

@@ -271,16 +271,15 @@ export default class Index extends Component {
271 271
       status: 1
272 272
     }
273 273
     recommendClient(param).then(res => {
274
-      if (res) {
275
-        Taro.showToast({
276
-          title: '提交成功'
277
-        })
278
-        setTimeout(() => {
279
-          Taro.navigateTo({ url: '/pages/agent/client/index' })//测试用
280
-        }, 700)
281
-        this.clearInputEvent()
282
-      }
283
-
274
+      // if (res) {
275
+      Taro.showToast({
276
+        title: '提交成功'
277
+      })
278
+      setTimeout(() => {
279
+        Taro.navigateTo({ url: '/pages/agent/client/index' })//测试用
280
+      }, 700)
281
+      this.clearInputEvent()
282
+      // }
284 283
     })
285 284
   }
286 285
   // 性别
@@ -446,7 +445,7 @@ export default class Index extends Component {
446 445
             <Text className='customers__txt'>意向楼盘</Text>
447 446
             {
448 447
               reType == 'index' ? (<Picker className='input customers__name' onChange={this.bindFloorChange} value={this.state.floorID} range={this.state.floorArray} range-key="buildingName">
449
-                <View class="picker" style={this.state.floorColor}>
448
+                <View class="picker overtext" style={this.state.floorColor}>
450 449
                   {this.state.floorArray[this.state.floorID].buildingName}
451 450
                 </View>
452 451
               </Picker>) : (<Input className="input customers__name" style='color:#999;' disabled='disabled' name="name" value={this.state.intention} onInput={this.bindFloorChange.bind(this)} placeholder="" />)
@@ -456,7 +455,7 @@ export default class Index extends Component {
456 455
           <View className='info info__4__1'>
457 456
             <Text className='customers__txt'>置业顾问</Text>
458 457
             <Picker className='input customers__adviser' onChange={this.bindAdviserChange} value={this.state.adviserID} range={this.state.adviserArray} range-key="name">
459
-              <View class="picker" style={this.state.adviserColor}>
458
+              <View class="picker overtext" style={this.state.adviserColor}>
460 459
                 {this.state.adviserArray[this.state.adviserID].name}
461 460
               </View>
462 461
             </Picker>

+ 4
- 0
src/pages/agent/recommend/index.scss 查看文件

@@ -2,6 +2,10 @@
2 2
 .ani {
3 3
   position: absolute;
4 4
 }
5
+.overtext{
6
+  max-width: 100%;
7
+  @include text-ellipsis;
8
+}
5 9
 
6 10
 .recommend__customers {
7 11
   position: relative;

+ 58
- 14
src/pages/card/index.js 查看文件

@@ -6,7 +6,9 @@ import Poster from './poster'
6 6
 import ProjectItem from '../project/item'
7 7
 import BackHomeBtn from '@components/BackHomeBtn'
8 8
 import getUserPhone from '@utils/getUserPhone'
9
+import AchievePhone from '@components/achievePhone'
9 10
 import ready from '@utils/ready'
11
+import { sceneInShare } from '@utils/tools'
10 12
 
11 13
 import { ROLE_CODE } from '@constants/user'
12 14
 import { addCardUv, addCardShareNum, favorCard, cancelFavorCard } from '@services/card'
@@ -36,33 +38,61 @@ export default class Index extends Component {
36 38
     recordId: null,
37 39
     isSave: false,
38 40
     modalStatus: false,
41
+    grantPhoneVisible: false, // 授权手机弹框
39 42
   }
40 43
 
41 44
   componentWillMount() {
42 45
     ready.queue(() => {
43
-      const router = Taro.getStorageSync('router')
44
-      const id = this.$router.params.id || router.query.id || '4604a792d575eb8187711625bd88832c'
45 46
 
46
-      if (router.query.id) {
47
-        this.setState({
48
-          cardId: id,
49
-          modalStatus: true
50
-        }, this.loadCardDetail)
51
-      } else {
47
+      // 分享场景需要先授权手机, 再授权头像
48
+      const options = wx.getLaunchOptionsSync()
49
+      if (sceneInShare(options.scene)) {
50
+        const { person = {} } = this.props.userInfo || {}
51
+        if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
52
+          Taro.reLaunch({ url: '/pages/auth/index' })
53
+          return
54
+        }
55
+
52 56
         this.setState({
53
-          cardId: id,
54
-          modalStatus: false
55
-        }, this.loadCardDetail)
57
+          grantPhoneVisible: true,
58
+        })
56 59
       }
57 60
 
58
-      addCardUv(id)
61
+      this.initPageData()
59 62
     })
60 63
   }
64
+  initPageData() {
65
+    const router = Taro.getStorageSync('router')
66
+    const id = this.$router.params.id || router.query.id
67
+
68
+    if (router.query.id) {
69
+      this.setState({
70
+        cardId: id,
71
+        modalStatus: true
72
+      }, this.loadCardDetail)
73
+    } else {
74
+      this.setState({
75
+        cardId: id,
76
+        modalStatus: false
77
+      }, this.loadCardDetail)
78
+    }
61 79
 
80
+    addCardUv(id)
81
+  }
62 82
   componentWillUnmount() {
63 83
     const { recordId } = this.state
64 84
     recordId && updatePoint(recordId)
65 85
   }
86
+  componentDidMount() {
87
+    const options = wx.getLaunchOptionsSync()
88
+    const sceneList = [ 1011, 1012, 1013, 1031, 1032, 1036, 1047, 1048]
89
+
90
+    if (sceneList.indexOf(options.scene) != -1) {
91
+      this.setState({
92
+        grantPhoneVisible: true,
93
+      })
94
+    }
95
+  }
66 96
 
67 97
   loadCardDetail() {
68 98
     const { cardId } = this.state
@@ -388,8 +418,19 @@ export default class Index extends Component {
388 418
       modalStatus: false
389 419
     })
390 420
   }
421
+  
422
+  handleAuthPhoneSuccess = () => {
423
+    const { person = {} } = this.props.userInfo || {}
424
+    if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
425
+      Taro.reLaunch({ url: '/pages/auth/index' })
426
+      return
427
+    }
428
+
429
+    this.initPageData()
430
+  }
431
+
391 432
   render() {
392
-    const { makePosterStatus, posterData, modalStatus } = this.state
433
+    const { makePosterStatus, posterData, modalStatus, grantPhoneVisible } = this.state
393 434
     const { userInfo, cardInfo, projectDetail } = this.props
394 435
     const { person: { personType, personId, phone, tel } } = userInfo
395 436
     const { unReadNum, picture, visitors, id, isReport } = cardInfo
@@ -407,7 +448,10 @@ export default class Index extends Component {
407 448
       <Block>
408 449
         {/* 生成海报 */}
409 450
         {makePosterStatus && (<Poster data={posterData} toggle={this.toggleVisiblePoster}></Poster>)}
410
-
451
+        {
452
+          (grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone) &&
453
+          <AchievePhone user={userInfo.person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
454
+        }
411 455
         {
412 456
           visibleConfirmModal && (
413 457
             <View className="modal">

+ 28
- 19
src/pages/im/index.js 查看文件

@@ -7,12 +7,13 @@ import FormIdCollector from '@components/formIdCollector'
7 7
 import BackHomeBtn from '@components/BackHomeBtn'
8 8
 
9 9
 import { queryChatHistory } from '@services/chat'
10
-import { uploadFiles } from '@utils/request'
10
+import { uploadFiles, fetch } from '@utils/request'
11 11
 import { deepClone } from '@utils/tools'
12 12
 
13 13
 import { savePoint, updatePoint } from '@services/common'
14 14
 import { connect } from '@tarojs/redux'
15 15
 import { ROLE_CODE } from '@constants/user'
16
+import { API_QUERY_USERINFO_BYID } from '@constants/api'
16 17
 import { dispatchCardInfo } from '@actions/card'
17 18
 
18 19
 // import { dispatchUserPhone } from '@actions/user'
@@ -114,7 +115,7 @@ export default class Chat extends Component {
114 115
         return;
115 116
       }
116 117
 
117
-      const chatting = {
118
+      let chatting = {
118 119
         personId: sendId === mineId ? receiverId : sendId,
119 120
         nickname: sendId === mineId ? decodeURIComponent(receiverName) : decodeURIComponent(sendName),
120 121
         avatarurl: null,
@@ -124,22 +125,29 @@ export default class Chat extends Component {
124 125
       // 设置页面 title
125 126
       Taro.setNavigationBarTitle({ title: chatting.nickname || '聊天' })
126 127
 
127
-      this.setState({ chatting, me }, () => {
128
-        this.loadList(res => {
129
-          this.toBottom()
130
-
131
-          const { records } = res
132
-          const newMsg = records[0]
133
-          const isCardMsg = newMsg && newMsg.messageType === MESSAGETYPE.CARD
134
-
135
-          // 如果最新一条消息不是卡片类型 则自动发送卡片信息
136
-          if (!isCardMsg) {
137
-            setTimeout(() => {
138
-              this.sendCardMsg()
139
-            }, 500)
140
-          }
128
+      // 获取聊天对象信息
129
+      fetch({ url: `${API_QUERY_USERINFO_BYID}/${chatting.personId}` }).then(res => {
130
+        // res 为 person 信息
131
+        chatting.avatarurl = res.avatarurl
132
+        chatting.personType = res.personType
133
+
134
+        this.setState({ chatting, me }, () => {
135
+          this.loadList(res => {
136
+            this.toBottom()
137
+  
138
+            const { records } = res
139
+            const newMsg = records[0]
140
+            const isCardMsg = newMsg && newMsg.messageType === MESSAGETYPE.CARD
141
+  
142
+            // 如果最新一条消息不是卡片类型 则自动发送卡片信息
143
+            if (!isCardMsg) {
144
+              setTimeout(() => {
145
+                this.sendCardMsg()
146
+              }, 500)
147
+            }
148
+          });
141 149
         });
142
-      });
150
+      })
143 151
 
144 152
       socket.wss.onMessage(res => {    
145 153
         const data = JSON.parse(res.data)
@@ -364,7 +372,7 @@ export default class Chat extends Component {
364 372
  
365 373
     this.setState({
366 374
       inputText: '',
367
-      msgList: list
375
+      // msgList: list
368 376
     }, this.toBottom)
369 377
   }
370 378
 
@@ -386,6 +394,8 @@ export default class Chat extends Component {
386 394
         list: [data]
387 395
       })
388 396
     }
397
+
398
+    this.setState({ msgList: list })
389 399
   }
390 400
 
391 401
   handleIssueClick = (message, e) => {
@@ -407,7 +417,6 @@ export default class Chat extends Component {
407 417
   }
408 418
 
409 419
   bindTextInput = (e) => {
410
-    console.log('--------->', e)
411 420
     this.setState({
412 421
       inputText: e.detail.value
413 422
     })

+ 2
- 2
src/pages/news/detail/poster.js 查看文件

@@ -67,7 +67,7 @@ export default class Index extends Component {
67 67
         fontSize: 30,
68 68
         color: 'black',
69 69
         baseLine: 'middle',
70
-        lineNum: 2,
70
+        lineNum: 1,
71 71
         lineHeight: 48,
72 72
         // textAlign: 'center',
73 73
         width: 560,
@@ -80,7 +80,7 @@ export default class Index extends Component {
80 80
         fontSize: 28,
81 81
         color: '#999',
82 82
         baseLine: 'middle',
83
-        lineNum: 2,
83
+        lineNum: 1,
84 84
         lineHeight: 48,
85 85
         width: 560,
86 86
         zIndex: 999

+ 0
- 7
src/pages/person/customerAnalysis/analysis.js 查看文件

@@ -179,9 +179,7 @@ export default class analysis extends Taro.Component {
179 179
               </View>
180 180
               {
181 181
                 chartInfo.length &&
182
-
183 182
                 <LineChart source={chartInfo} />
184
-
185 183
               }
186 184
               {
187 185
                 !chartInfo.length &&
@@ -192,7 +190,6 @@ export default class analysis extends Taro.Component {
192 190
                 </View>
193 191
                 </View>
194 192
               }
195
-
196 193
               {
197 194
                 sexInfo.length &&
198 195
                 <View>
@@ -206,7 +203,6 @@ export default class analysis extends Taro.Component {
206 203
                   </View>
207 204
                 </View>
208 205
               }
209
-
210 206
             </View>
211 207
           </AtTabsPane>
212 208
           <AtTabsPane current={current} index={1}>
@@ -222,9 +218,7 @@ export default class analysis extends Taro.Component {
222 218
                 </View>
223 219
               </View>
224 220
               {chartInfo2.length &&
225
-
226 221
                 <LineChart source={chartInfo2} />
227
-
228 222
               }
229 223
               {
230 224
                 !chartInfo2.length &&
@@ -235,7 +229,6 @@ export default class analysis extends Taro.Component {
235 229
                 </View>
236 230
                 </View>
237 231
               }
238
-
239 232
               {
240 233
                 sexInfo.length &&
241 234
                 <View>

+ 1
- 1
src/pages/person/customerAnalysis/index.js 查看文件

@@ -62,7 +62,7 @@ export default class customer extends Taro.Component {
62 62
     const tabList = [{ title: '客户分析' }, { title: '我的客户' }]
63 63
     const { customerNum, current } = this.state
64 64
     return (
65
-      <AtTabs className="tab-box" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
65
+      <AtTabs  className="tab-box overflow-tab" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
66 66
         <AtTabsPane current={current} index={0} >
67 67
           <View >
68 68
             {

+ 6
- 1
src/pages/person/customerAnalysis/index.scss 查看文件

@@ -113,6 +113,11 @@
113 113
     }
114 114
   }
115 115
 }
116
+.overflow-tab{
117
+  .at-tabs-pane{
118
+    overflow-y: hidden;
119
+  }
120
+}
116 121
 .empty{
117 122
   width:100%;
118 123
   height:40vh;
@@ -250,7 +255,7 @@
250 255
       }
251 256
     }
252 257
     .tab-pane3{
253
-      padding: 20px 40px;
258
+      padding: 20px 30px;
254 259
     }
255 260
   }
256 261
   .tab-pane4{

+ 1
- 0
src/pages/person/customerAnalysis/item/index.scss 查看文件

@@ -15,6 +15,7 @@
15 15
   width: 98%;
16 16
   margin: 0 1%;
17 17
   position: relative;
18
+  margin-bottom: 16px ;
18 19
   .type{
19 20
     position: absolute;
20 21
     left:0;

+ 13
- 10
src/pages/person/customerAnalysis/myCustomer.js 查看文件

@@ -59,6 +59,9 @@ export default class myCustomer extends Taro.Component {
59 59
     if (value == 1) {
60 60
       this.queryVisitRecord(1);
61 61
     } else if (value == 2) {
62
+      this.setState({
63
+        activityList: []
64
+      })
62 65
       this.queryActivityList(1);
63 66
     } else if (value == 3) {
64 67
       this.queryFollowRecord(1);
@@ -461,7 +464,7 @@ export default class myCustomer extends Taro.Component {
461 464
           </View>
462 465
           <View onClick={this.handleTelClick.bind(this, customerDetail)} className='user__left__phone'>{customerDetail.phone}<Image style="width:36rpx;height:36rpx;margin-left:20rpx;" src={phoneImg} /></View>
463 466
         </View>
464
-        <AtTabs height="calc(100vh - 320rpx)" className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
467
+        <AtTabs height="calc(100vh - 300rpx)" className="my-tab" current={this.state.current} tabList={tabList} onClick={this.handleClick.bind(this)}>
465 468
           <AtTabsPane current={this.state.current} index={0} >
466 469
             <View className="tab-pane1 pane">
467 470
               <View className="status">{customerDetail.status == 1 ? '报备' : customerDetail.status == 2 ? '到访' : customerDetail.status == 3 ? '认筹' : '签约'}</View>
@@ -477,7 +480,7 @@ export default class myCustomer extends Taro.Component {
477 480
             <View className="tab-pane2 pane">
478 481
               <ListView
479 482
                 className="wrap"
480
-                style="height:calc(100vh - 320rpx)"
483
+                style="height:calc(100vh - 300rpx)"
481 484
                 needInit
482 485
                 isEmpty={isEmpty}
483 486
                 emptyText="暂无访问记录~"
@@ -513,7 +516,7 @@ export default class myCustomer extends Taro.Component {
513 516
             <View className="tab-pane3 pane">
514 517
               <ListView
515 518
                 className="wrap"
516
-                style="height:calc(100vh - 320rpx)"
519
+                style="height:calc(100vh - 300rpx)"
517 520
                 needInit
518 521
                 isEmpty={isEmpty2}
519 522
                 emptyText="暂无活动信息~"
@@ -528,13 +531,13 @@ export default class myCustomer extends Taro.Component {
528 531
                   <View className="empty__text">暂无活动信息~</View> */}
529 532
                     </View>
530 533
                   }
531
-                  {activityList.length &&
532
-                    activityList.map(item => (
533
-                      <ActivityItem
534
-                        data={item}
535
-                        key={item.id + 'activity'}>
536
-                      </ActivityItem>
537
-                    ))
534
+                  {activityList.length && activityList.map(item => (
535
+                    <ActivityItem
536
+                      data={item}
537
+                      key={item.id + 'activity'}
538
+                    >
539
+                    </ActivityItem>
540
+                  ))
538 541
                   }
539 542
                 </View>
540 543
               </ListView>

+ 1
- 1
src/pages/person/profile/index.js 查看文件

@@ -24,7 +24,7 @@ export default class Profile extends Component {
24 24
 
25 25
   }
26 26
 
27
-  componentDidShow() {
27
+  componentWillMount() {
28 28
     this.getProfile()
29 29
   }
30 30
 

+ 3
- 3
src/pages/project/detail/Around/Pannel.js 查看文件

@@ -41,7 +41,7 @@ export default class Pannel extends Component {
41 41
     let currentMarkerPos = undefined
42 42
 
43 43
     if (props.active !== undefined && props.active != (this.state.currentMarker || {}).id) {
44
-      for (let i = 0; i < markerList.length; i ++) {
44
+      for (let i = 0; i < markerList.length; i++) {
45 45
         if (markerList[i].id === props.active) {
46 46
           activeIndex = i;
47 47
           break;
@@ -73,7 +73,7 @@ export default class Pannel extends Component {
73 73
     console.log(e)
74 74
   }
75 75
 
76
-  render () {  
76
+  render() {
77 77
     const { manualData = [] } = this.props.dataset || {}
78 78
     const activeKey = this.props.active
79 79
 
@@ -87,7 +87,7 @@ export default class Pannel extends Component {
87 87
               const { id, name, distance } = item || {}
88 88
               const dist = distance >= 1000 ? `${Number(distance / 1000).toFixed(1)}km` : `${distance}m`
89 89
               const active = activeKey === id
90
-  
90
+
91 91
               return (
92 92
                 <View className={`around-cell ${active ? 'active' : ''}`} key={`auto-${id}`} id={id} onClick={this.setCurrent(item)}>
93 93
                   <View className="around-cell__body">{`${index + 1}、${name}`}</View>

+ 65
- 38
src/pages/project/detail/index.js 查看文件

@@ -7,6 +7,7 @@ import Poster from './poster'
7 7
 import PoiAround from '@components/amap/PoiAround'
8 8
 import Around from './Around'
9 9
 import BackHomeBtn from '@components/BackHomeBtn'
10
+import AchievePhone from '@components/achievePhone'
10 11
 import {
11 12
   addItemUv,
12 13
   addItemShareNum,
@@ -20,7 +21,7 @@ import dayjs from 'dayjs'
20 21
 import 'dayjs/locale/zh-cn' // 按需加载
21 22
 import ready from '@utils/ready'
22 23
 import Notice from '@components/Notice'
23
-import { getDownloadURL, getThumbnail } from '@utils/tools'
24
+import { getDownloadURL, getThumbnail, sceneInShare } from '@utils/tools'
24 25
 import { connect } from '@tarojs/redux'
25 26
 import { dispatchProjectDetail } from '@actions/project'
26 27
 import getUserPhone from '@utils/getUserPhone'
@@ -57,39 +58,27 @@ export default class Index extends Component {
57 58
     btnstate: 1,// 1显示视频 0显示图片
58 59
     albumCurrent: 0,
59 60
     videoPlayShow: 'flex',
61
+    grantPhoneVisible: false, // 授权手机弹框
60 62
   }
61 63
 
62 64
   componentWillMount() {
63
-    // const { id = '78c3dd489791dc1d29472fa344b08c45' } = this.$router.params
64
-
65 65
     ready.queue(() => {
66
-      const router = Taro.getStorageSync('router')
67
-      const id = this.$router.params.id || router.query.id
68
-      // const id='82b54f4a1f5b981df572253792afbfa1' 
69
-      this.setState({
70
-        buildingId: id
71
-      }, () => {
72
-        this.loadDetail()
73
-        this.loadNewsData()
74
-        this.loadActivityData()
75
-        this.loadHelpGroupList()
76
-
77
-        addItemUv(id)
78
-        // 埋点
79
-        savePoint({
80
-          event: 'detail',
81
-          eventType: 'building',
82
-          propertyName: '项目详情',
83
-          targetId: id,
84
-          buildingId: id,
85
-          data: '{}'
86
-        }).then(res => {
87
-          this.setState({
88
-            recordId: res.recordId
89
-          })
90
-          console.log('项目详情')
66
+    
67
+      // 分享场景需要先授权手机, 再授权头像
68
+      const options = wx.getLaunchOptionsSync()
69
+      if (sceneInShare(options.scene)) {
70
+        const { person = {} } = this.props.userInfo || {}
71
+        if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
72
+          Taro.reLaunch({ url: '/pages/auth/index' })
73
+          return
74
+        }
75
+
76
+        this.setState({
77
+          grantPhoneVisible: true,
91 78
         })
92
-      })
79
+      }
80
+
81
+      this.initPageData()
93 82
     })
94 83
   }
95 84
 
@@ -97,10 +86,34 @@ export default class Index extends Component {
97 86
     const { recordId } = this.state
98 87
     recordId && updatePoint(recordId)
99 88
   }
100
-  componentDidMount() {
101
-    const options = wx.getLaunchOptionsSync()
102
-    console.log(options, "-------------options---------")
103
-    // if()
89
+  initPageData() {
90
+    const router = Taro.getStorageSync('router')
91
+    const id = this.$router.params.id || router.query.id
92
+    // const id='82b54f4a1f5b981df572253792afbfa1' 
93
+    this.setState({
94
+      buildingId: id
95
+    }, () => {
96
+      this.loadDetail()
97
+      this.loadNewsData()
98
+      this.loadActivityData()
99
+      this.loadHelpGroupList()
100
+
101
+      addItemUv(id)
102
+      // 埋点
103
+      savePoint({
104
+        event: 'detail',
105
+        eventType: 'building',
106
+        propertyName: '项目详情',
107
+        targetId: id,
108
+        buildingId: id,
109
+        data: '{}'
110
+      }).then(res => {
111
+        this.setState({
112
+          recordId: res.recordId
113
+        })
114
+        console.log('项目详情')
115
+      })
116
+    })
104 117
   }
105 118
 
106 119
   loadHelpGroupList() {
@@ -157,7 +170,7 @@ export default class Index extends Component {
157 170
     const { buildingId } = this.state
158 171
     const payload = { pageSize: 999, pageNumber: 1, buildingId }
159 172
     queryActivityList(payload).then(res => {
160
-      console.log(res,'Activity')
173
+      console.log(res, 'Activity')
161 174
       this.setState({
162 175
         activityList: res.list || []
163 176
       })
@@ -479,6 +492,16 @@ export default class Index extends Component {
479 492
     })
480 493
   }
481 494
 
495
+  handleAuthPhoneSuccess = () => {
496
+    const { person = {} } = this.props.userInfo || {}
497
+    if ((person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
498
+      Taro.reLaunch({ url: '/pages/auth/index' })
499
+      return
500
+    }
501
+
502
+    this.initPageData()
503
+  }
504
+
482 505
   renderBottomMenu() {
483 506
     const { userInfo: { person: { personType } } } = this.props
484 507
     const { posterShow } = this.state
@@ -795,7 +818,7 @@ export default class Index extends Component {
795 818
     )
796 819
   }
797 820
 
798
-  renderHouseTypeList () {
821
+  renderHouseTypeList() {
799 822
     const { statusOpts, statusBgColors } = this.state
800 823
     const { projectDetail: { buildingApartment } } = this.props
801 824
     const list = buildingApartment.filter(item => item.apartmentType === 'apart')
@@ -991,14 +1014,18 @@ export default class Index extends Component {
991 1014
   }
992 1015
 
993 1016
   render() {
994
-    const { posterStatus, posterData, loaded, btnstate } = this.state
995
-    const { projectDetail } = this.props
1017
+    const { posterStatus, posterData, loaded, btnstate, grantPhoneVisible } = this.state
1018
+    const { projectDetail, userInfo } = this.props
996 1019
     const { uvList = {} } = projectDetail
997 1020
     const { total = 0, records = [] } = uvList
998 1021
     const openDate = projectDetail.openingDate ? dayjs(projectDetail.openingDate).locale('zh-cn').format('YYYY年M月D日') : '暂无'
999 1022
 
1000 1023
     return (
1001 1024
       <Block>
1025
+        {
1026
+          (grantPhoneVisible && userInfo.person.personId && !userInfo.person.phone) &&
1027
+          <AchievePhone user={userInfo.person} onSuccess={this.handleAuthPhoneSuccess}></AchievePhone>
1028
+        }
1002 1029
         {
1003 1030
           loaded && (
1004 1031
             <View className='detail'>
@@ -1101,7 +1128,7 @@ export default class Index extends Component {
1101 1128
 
1102 1129
                       {/* 围观人数 */}
1103 1130
                       <View className='watch__people__num'>
1104
-                        <View className='top__txt'>{total}人围观</View>
1131
+                        <View className='top__txt'>{projectDetail.pvNum || 0}人围观</View>
1105 1132
                         <View className='bottom__img' onClick={this.onViewFans.bind(this)}>
1106 1133
                           <View className="records">
1107 1134
                             {records.slice(0, 9).map(item => <Image src={item.photoOravatar} className='user__img' key={item.personId} />)}

+ 2
- 3
src/pages/project/detail/index.scss 查看文件

@@ -610,13 +610,12 @@
610 610
 
611 611
       .top__txt {
612 612
         font-size: 26px;
613
-        width: 20%;
613
+        width: 30%;
614 614
         color: rgba(0, 0, 0, 0.37);
615 615
       }
616 616
 
617 617
       .bottom__img {
618
-        margin-top: 20px;
619
-        width: 80%;
618
+        width: 70%;
620 619
         display: flex;
621 620
         align-items: center;
622 621
         margin-left: 5px;

+ 2
- 1
src/pages/project/detail/poster.js 查看文件

@@ -70,7 +70,7 @@ export default class Index extends Component {
70 70
         fontSize: 28,
71 71
         color: '#999',
72 72
         baseLine: 'middle',
73
-        lineNum: 2,
73
+        lineNum: 1,
74 74
         lineHeight: 48,
75 75
         // textAlign: 'center',
76 76
         width: 560,
@@ -117,6 +117,7 @@ export default class Index extends Component {
117 117
         color: '#999',
118 118
         baseLine: 'middle',
119 119
         lineHeight: 48,
120
+        lineNum: 1,
120 121
         width: 150,
121 122
         zIndex: 11
122 123
       },

+ 3
- 5
src/pages/project/item/index.js 查看文件

@@ -25,7 +25,7 @@ export default class Index extends Component {
25 25
     return (
26 26
       <View className='item' onClick={onClick.bind(this, data)}>
27 27
         <View className='item__top'>
28
-          {console.log(data,'data')}
28
+          {console.log(data, 'data')}
29 29
           <Image className='item__img' mode="aspectFill" src={getThumbnail(imgSrc)}></Image>
30 30
           {data.marketStatus &&
31 31
             <View className={data.marketStatus == '在售' ? 'item__status sale' : data.marketStatus == '售罄' ? 'item__status soldout' : 'item__status waitsale'}>{data.marketStatus}</View>}
@@ -38,7 +38,7 @@ export default class Index extends Component {
38 38
             </View>
39 39
           </View>
40 40
 
41
-          <View className='item__right__region row'><Text className="location-icon iconfont icon-daohangdizhi"></Text>{data.buildingArea||''}</View>
41
+          <View className='item__right__region row'><Text className="location-icon iconfont icon-daohangdizhi"></Text>{data.buildingArea || ''}</View>
42 42
           {buildingTag.length > 0 && (
43 43
             <View className="item__tags row">
44 44
               {buildingTag.slice(0, 3).map(tag => <View className='tag' key={tag.tagId}>{tag.tagName}</View>)}
@@ -54,13 +54,11 @@ export default class Index extends Component {
54 54
 
55 55
           {total > 0 && (
56 56
             <View className='item__bottom__right'>
57
-              <Text className='item__bottom__seenum'>{total}人围观</Text>
58
-
57
+              <Text className='item__bottom__seenum'>{data.pvNum || 0}人围观</Text>
59 58
               <View className='see__img'>
60 59
                 {records.slice(0, 4).map(item => <Image className='userImg' key={item.uvId} src={getThumbnail(item.photoOravatar)}></Image>)}
61 60
                 {records.length > 4 && <Image className="dot-img" src={getThumbnail(dotImg)}></Image>}
62 61
               </View>
63
-
64 62
             </View>
65 63
           )}
66 64
         </View>

+ 0
- 1
src/pages/signin/index.js 查看文件

@@ -31,7 +31,6 @@ export default class Index extends Component {
31 31
         }
32 32
       })
33 33
     })
34
-
35 34
   }
36 35
 
37 36
   getPhoneNumber(e) {

+ 17
- 4
src/utils/login.js 查看文件

@@ -2,9 +2,12 @@ import Taro from '@tarojs/taro';
2 2
 import { getStore } from '@tarojs/redux'
3 3
 import { USER_INFO } from '@constants/user'
4 4
 import { wxLogin } from '@services/login'
5
+import { sceneInShare } from '@utils/tools'
5 6
 import ready from '@utils/ready'
6 7
 let loading = false
7
-export default function (params, callback) {
8
+export default function (payload, callback) {
9
+  const { path, scene, ...params } = payload
10
+
8 11
   if (loading) {
9 12
     return
10 13
   }
@@ -34,9 +37,19 @@ export default function (params, callback) {
34 37
           callback && callback(data)
35 38
 
36 39
         } else {
37
-          Taro.reLaunch({
38
-            url: '/pages/auth/index'
39
-          })
40
+
41
+          // 非扫码进入项目详情或者卡片主页, 跳转到授权头像
42
+          // 否则不跳
43
+          const noAuthPages = [
44
+            'pages/project/detail/index',
45
+            'pages/card/index',
46
+          ]
47
+
48
+          if (noAuthPages.indexOf(path) === -1 || !sceneInShare(scene)) {
49
+            Taro.reLaunch({
50
+              url: '/pages/auth/index'
51
+            })
52
+          }
40 53
         }
41 54
         ready.open()
42 55
 

+ 1
- 1
src/utils/request.js 查看文件

@@ -81,7 +81,7 @@ export const fetch = async (options) => {
81 81
   }).catch((err) => {
82 82
     
83 83
     let errMessage = `请求失败: ${err.errMsg}`
84
-    if (err.errMsg === 'request:fail timeout') {
84
+    if (err.errMsg) {
85 85
       errMessage = '请检查网络'
86 86
     }
87 87
 

+ 12
- 0
src/utils/tools.js 查看文件

@@ -1,5 +1,17 @@
1 1
 import Taro from '@tarojs/taro';
2 2
 
3
+/**
4
+ * 是否分享场景(含扫码)
5
+ * @param {*} scene 
6
+ */
7
+export function sceneInShare(scene) {
8
+  return [1011, 1012, 1013, 1031, 1032, 1036, 1047, 1048].indexOf(scene) > -1
9
+}
10
+
11
+/**
12
+ * 造空数组
13
+ * @param {int}} n 
14
+ */
3 15
 export function times(n) {
4 16
   return n > 0 ? '*'.repeat(n - 1).split('*') : []
5 17
 }