ソースを参照

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

张延森 5 年 前
コミット
50a8ca284b
共有44 個のファイルを変更した815 個の追加601 個の削除を含む
  1. 1
    1
      config/prod.js
  2. 29
    17
      src/app.js
  3. バイナリ
      src/assets/rulebg.png
  4. 0
    19
      src/components/achieveAvatar/index.js
  5. 8
    4
      src/components/achievePhone/index.js
  6. 16
    11
      src/components/authorize/index.js
  7. 39
    21
      src/pages/activity/detail/assemble.js
  8. 30
    20
      src/pages/activity/detail/assistance.js
  9. 16
    19
      src/pages/activity/detail/index.js
  10. 13
    10
      src/pages/agent/become/index.js
  11. 15
    7
      src/pages/agent/recommend/index.js
  12. 16
    18
      src/pages/card/fans/index.js
  13. 4
    4
      src/pages/card/index.js
  14. 2
    2
      src/pages/card/list/index.js
  15. 19
    31
      src/pages/checkin/index.js
  16. 6
    21
      src/pages/news/detail/index.js
  17. 15
    12
      src/pages/person/authorize/index.js
  18. 1
    1
      src/pages/person/customerAnalysis/followUpCustomer/index.js
  19. 9
    2
      src/pages/person/feedback/index.js
  20. 13
    4
      src/pages/person/index.js
  21. 12
    6
      src/pages/person/profile/detail/index.js
  22. 29
    17
      src/pages/person/profile/index.js
  23. 1
    3
      src/pages/policy/detail/index.js
  24. 14
    4
      src/pages/policy/index.js
  25. 1
    1
      src/pages/project/album/index.js
  26. 51
    37
      src/pages/project/detail/index.js
  27. 14
    3
      src/pages/project/detail/map.js
  28. 12
    2
      src/pages/project/floor/index.js
  29. 22
    32
      src/pages/project/h5Page.js
  30. 1
    1
      src/pages/project/index.js
  31. 16
    4
      src/pages/project/list/filter/index.js
  32. 20
    11
      src/pages/project/map/index.js
  33. 14
    10
      src/pages/report/login/index.js
  34. 23
    7
      src/pages/shop/detail/index.js
  35. 28
    11
      src/pages/shop/index.js
  36. 81
    71
      src/pages/shop/integralDetail/index.js
  37. 13
    4
      src/pages/shop/rule/index.js
  38. 18
    19
      src/pages/signin/index.js
  39. 125
    115
      src/pages/toolKit/calculateResult/index.js
  40. 1
    1
      src/pages/toolKit/index.js
  41. 7
    1
      src/services/user.js
  42. 7
    6
      src/utils/page.js
  43. 35
    0
      src/utils/ruleToast.js
  44. 18
    11
      src/utils/track.js

+ 1
- 1
config/prod.js ファイルの表示

@@ -9,7 +9,7 @@ module.exports = {
9 9
     WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    Version:'V3.5.5_2020-01-03'
12
+    Version:'V3.5.6_2020-01-08'
13 13
   },
14 14
   weapp: {},
15 15
   h5: {}

+ 29
- 17
src/app.js ファイルの表示

@@ -29,7 +29,7 @@ import {
29 29
 import { UPDATE_PRELOAD } from '@/constants/common'
30 30
 import ready from '@/utils/ready'
31 31
 import login from '@/utils/login'
32
-import store  from './store'
32
+import store from './store'
33 33
 import socket from '@/utils/im'
34 34
 
35 35
 // const store = configStore()
@@ -45,8 +45,6 @@ class App extends Component {
45 45
     pages: [
46 46
       'pages/project/index',
47 47
       'pages/project/h5Page',
48
-      // 'pages/person/customerAnalysis/followUpCustomer/index',
49
-      // 'pages/person/customerAnalysis/transactionCustomer/index',
50 48
       'pages/person/customerAnalysis/myCustomer',
51 49
       'pages/project/detail/map',
52 50
       'pages/person/myShare/accessRecord',
@@ -110,7 +108,7 @@ class App extends Component {
110 108
 
111 109
       'pages/checkin/index',
112 110
       'pages/checkin/checkinsuccess/index',
113
-     
111
+
114 112
 
115 113
     ],
116 114
     window: {
@@ -167,6 +165,20 @@ class App extends Component {
167 165
   }
168 166
 
169 167
   componentDidShow() {
168
+    // wx.setNavigationBarColor({
169
+    //   frontColor: '#ffffff',
170
+    //   backgroundColor: '#ff0000',
171
+    //   animation: {
172
+    //     duration: 400,
173
+    //     timingFunc: 'easeIn'
174
+    //   }
175
+    // })
176
+    // wx.setTabBarStyle({
177
+    //   color: '#FF0000',
178
+    //   selectedColor: '#00FF00',
179
+    //   backgroundColor: '#0000FF',
180
+    //   borderStyle: 'white'
181
+    // })
170 182
     // 埋点
171 183
     const t = setTimeout(() => {
172 184
       trackUserSource(this.$router.params).then(res => this.updateTrack = res)
@@ -225,20 +237,20 @@ class App extends Component {
225 237
     //     payload: res,
226 238
     //   })
227 239
     // })
228
-    // wx.setBackgroundFetchToken()
229
-    // wx.getBackgroundFetchData({
230
-    //   fetchType: 'pre',
231
-    //   success: (res) => {
232
-    //     console.log('[preload]: ', res)
233
-    //     store.dispatch({
234
-    //       type: UPDATE_PRELOAD,
235
-    //       payload: res.fetchedData,
236
-    //     })
237
-    //   }
238
-    // })
240
+    wx.setBackgroundFetchToken()
241
+    wx.getBackgroundFetchData({
242
+      fetchType: 'pre',
243
+      success: (res) => {
244
+        console.log('[preload]: ', res)
245
+        // store.dispatch({
246
+        //   type: UPDATE_PRELOAD,
247
+        //   payload: res.fetchedData,
248
+        // })
249
+      }
250
+    })
239 251
   }
240 252
 
241
-  initData () {
253
+  initData() {
242 254
     // console.info('app componentDidShow')
243 255
     console.info('router1', this.$router)
244 256
     console.info('ready status1', ready)
@@ -323,7 +335,7 @@ class App extends Component {
323 335
 
324 336
         resolve(router)
325 337
       }
326
-      
338
+
327 339
     })
328 340
   }
329 341
 

バイナリ
src/assets/rulebg.png ファイルの表示


+ 0
- 19
src/components/achieveAvatar/index.js ファイルの表示

@@ -34,7 +34,6 @@ export default class Index extends Component {
34 34
         // 用户信息保存至服务器
35 35
         dispatchUpdateUserInfo(payload).then(res => {
36 36
           console.log('更新信息')
37
-          // this.toPage(true)
38 37
           this.props.onSuccess();
39 38
         })
40 39
       },
@@ -46,27 +45,9 @@ export default class Index extends Component {
46 45
           icon: 'none'
47 46
         })
48 47
         return
49
-        // this.toPage(false)
50 48
       }
51 49
     })
52 50
   }
53
-  toPage(succed) {
54
-    const router = Taro.getStorageSync('router') || { query: {} }
55
-    const { query, path } = router
56
-
57
-    if (!succed && path === 'pages/signin/index') {
58
-      return
59
-    }
60
-    if (path === 'pages/project/index' || path === 'pages/shop/index' || path === 'pages/person/index') {
61
-      Taro.switchTab({
62
-        url: '/' + path
63
-      })
64
-      return
65
-    }
66
-    Taro.reLaunch({
67
-      url: `/${path}?${query.params}`
68
-    })
69
-  }
70 51
 
71 52
   renderMaskBanner() {
72 53
     return (

+ 8
- 4
src/components/achievePhone/index.js ファイルの表示

@@ -1,7 +1,7 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2 2
 import getUserPhone from '@/utils/getUserPhone'
3 3
 import './index.scss'
4
-
4
+import { rule as ruleToast } from '@/utils/ruleToast'
5 5
 const grantIcon = require('@/assets/helpgroup/shouquan.png')
6 6
 const logoImg = require('@/assets/index/logo.png')
7 7
 const bgImg = "https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/bg.png"
@@ -31,9 +31,13 @@ export default class Index extends Component {
31 31
 
32 32
         return
33 33
       } else {
34
-        if (typeof this.props.onSuccess === 'function') {
35
-          this.props.onSuccess(phoneNumber);
36
-        }
34
+        ruleToast('signup-agent')
35
+        setTimeout(() => {
36
+          if (typeof this.props.onSuccess === 'function') {
37
+            this.props.onSuccess(phoneNumber);
38
+          }
39
+        }, 1000)
40
+
37 41
       }
38 42
     })
39 43
   }

+ 16
- 11
src/components/authorize/index.js ファイルの表示

@@ -4,6 +4,7 @@ import * as actions from '@/actions/user'
4 4
 import './index.scss'
5 5
 import getUserPhone from '@/utils/getUserPhone'
6 6
 import { queryUserInfo, doUserSignin } from '@/services/user'
7
+import { rule as ruleToast } from '@/utils/ruleToast'
7 8
 
8 9
 @connect(state => state.user, { ...actions })
9 10
 export default class Index extends Component {
@@ -26,17 +27,21 @@ export default class Index extends Component {
26 27
         })
27 28
         return
28 29
       } else {
29
-        this.props.dispatchUpdateUserInfoNew(this.state.user.id)
30
-        console.log(this.props.from,"this.props.from")
31
-        if (this.props.from) {
32
-          Taro.reLaunch({
33
-            url: this.props.from
34
-          })
35
-        } else {
36
-          Taro.reLaunch({
37
-            url: '/pages/person/index'
38
-          })
39
-        }
30
+        ruleToast('signup-agent')
31
+        setTimeout(() => {
32
+          this.props.dispatchUpdateUserInfoNew(this.state.user.id)
33
+          console.log(this.props.from, "this.props.from")
34
+          if (this.props.from) {
35
+            Taro.reLaunch({
36
+              url: this.props.from
37
+            })
38
+          } else {
39
+            Taro.reLaunch({
40
+              url: '/pages/person/index'
41
+            })
42
+          }
43
+        }, 1000)
44
+
40 45
       }
41 46
     })
42 47
   }

+ 39
- 21
src/pages/activity/detail/assemble.js ファイルの表示

@@ -91,14 +91,6 @@ export default class Detail extends Component {
91 91
     this.stopTicker()
92 92
     this.state.pointRecordId && updatePoint(this.state.pointRecordId)
93 93
 
94
-    const router = Taro.getStorageSync('router') || { query: {} }
95
-    Taro.setStorageSync('router', {
96
-      ...router,
97
-      query: {
98
-        ...router.query,
99
-        consultant: undefined,
100
-      }
101
-    })
102 94
   }
103 95
 
104 96
   componentDidShow() {
@@ -116,9 +108,8 @@ export default class Detail extends Component {
116 108
   // 初始化页面数据
117 109
   initPageData = () => {
118 110
     if (!this.state.detail.groupActivityId) {
119
-      const router = Taro.getStorageSync('router') || { query: {} }
120
-      let id = this.$router.params.id || router.query.id
121
-      let recordId = this.$router.params.recordId || router.query.recordId
111
+      let id = this.$router.params.id
112
+      let recordId = this.$router.params.recordId
122 113
 
123 114
       if (this.$router.params.scene) {
124 115
         getQrCodeParams(this.$router.params.scene).then(res => {
@@ -213,6 +204,15 @@ export default class Detail extends Component {
213 204
       posterVisible: !posterVisible,
214 205
       actionSheetVisible: showActionSheet,
215 206
     })
207
+    savePoint({
208
+      event: 'poster',
209
+      eventType: 'activity',
210
+      targetType:'group',
211
+      propertyName: '生成拼团活动详情海报',
212
+      data: '{}'
213
+    }).then(res => {
214
+      console.log('生成拼团活动详情海报')
215
+    })
216 216
   }
217 217
 
218 218
   compActState = (startDate, endDate) => {
@@ -268,10 +268,9 @@ export default class Detail extends Component {
268 268
     const { userInfo } = this.props
269 269
 
270 270
     Taro.showLoading()
271
-    const router = Taro.getStorageSync('router') || { query: {} }
272
-    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
273
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
274
-    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
271
+    const consultant = this.$router.params.consultant || qrcodeParams.consultant
272
+    const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
273
+    const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
275 274
     getGroupDetail(id, recordId).then(res => {
276 275
       this.stopTicker()
277 276
 
@@ -308,7 +307,8 @@ export default class Detail extends Component {
308 307
 
309 308
       savePoint({
310 309
         event: 'detail',
311
-        eventType: 'group',
310
+        eventType: 'activity',
311
+        targetType:'group',
312 312
         propertyName: '拼团详情',
313 313
         buildingId: res.taShareActivity.buildingId,
314 314
         consultantId: consultantId,
@@ -334,8 +334,7 @@ export default class Detail extends Component {
334 334
 
335 335
   // 报备客户
336 336
   reportClientFn() {
337
-    const router = Taro.getStorageSync('router') || { query: {} }
338
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
337
+    const consultant = this.$router.params.consultant || ""
339 338
     const { userInfo: { person } } = this.props
340 339
 
341 340
     if (!this.state.reportedCustomer) {
@@ -379,7 +378,8 @@ export default class Detail extends Component {
379 378
 
380 379
     savePoint({
381 380
       event: 'share',
382
-      eventType: 'group',
381
+      eventType: 'activity',
382
+      targetType:'group',
383 383
       propertyName: '拼团详情分享',
384 384
       consultantId: consultantId,
385 385
       sharePersonId: personId,
@@ -444,7 +444,16 @@ export default class Detail extends Component {
444 444
                     recordId: res.taShareRecord.recordId,
445 445
                     groupState: res.taShareRecord.status,
446 446
                   })
447
-
447
+                  savePoint({
448
+                    event: 'enlist',
449
+                    eventType: 'activity',
450
+                    targetType:'group',
451
+                    propertyName: '拼团活动报名',
452
+                    data: '{}'
453
+
454
+                  }).then(res => {
455
+                    console.log('拼团活动报名 ')
456
+                  })
448 457
                   Taro.showToast({
449 458
                     title: '参团成功',
450 459
                     icon: 'success'
@@ -509,7 +518,16 @@ export default class Detail extends Component {
509 518
                     isStarter: true,
510 519
                     groupState: res.taShareRecord.status,
511 520
                   }, () => { that.cb && that.cb() })
512
-
521
+                  savePoint({
522
+                    event: 'enlist',
523
+                    eventType: 'activity',
524
+                    targetType:'group',
525
+                    propertyName: '拼团活动报名',
526
+                    data: '{}'
527
+
528
+                  }).then(res => {
529
+                    console.log('拼团活动报名 ')
530
+                  })
513 531
                 }).catch(err => {
514 532
                   console.log(err, '11111111111111')
515 533
                   Taro.showToast({

+ 30
- 20
src/pages/activity/detail/assistance.js ファイルの表示

@@ -93,14 +93,7 @@ export default class Detail extends Component {
93 93
     this.stopTicker()
94 94
     this.state.pointRecordId && updatePoint(this.state.pointRecordId)
95 95
 
96
-    const router = Taro.getStorageSync('router') || { query: {} }
97
-    Taro.setStorageSync('router', {
98
-      ...router,
99
-      query: {
100
-        ...router.query,
101
-        consultant: undefined,
102
-      }
103
-    })
96
+
104 97
   }
105 98
 
106 99
   componentDidShow() {
@@ -118,9 +111,8 @@ export default class Detail extends Component {
118 111
   // 初始化页面数据
119 112
   initPageData = () => {
120 113
     if (!this.state.detail.helpActivityId) {
121
-      const router = Taro.getStorageSync('router') || { query: {} }
122
-      let id = this.$router.params.id || router.query.id
123
-      let initiateId = this.$router.params.initiateId || router.query.initiateId
114
+      let id = this.$router.params.id
115
+      let initiateId = this.$router.params.initiateId
124 116
 
125 117
       if (this.$router.params.scene) {
126 118
         getQrCodeParams(this.$router.params.scene).then(res => {
@@ -215,6 +207,15 @@ export default class Detail extends Component {
215 207
       posterVisible: !posterVisible,
216 208
       actionSheetVisible: showActionSheet,
217 209
     })
210
+    savePoint({
211
+      event: 'poster',
212
+      eventType: 'activity',
213
+      targetType:'help',
214
+      propertyName: '生成助力活动详情海报',
215
+      data: '{}'
216
+    }).then(res => {
217
+      console.log('生成助力活动详情海报')
218
+    })
218 219
   }
219 220
 
220 221
   compActState = (startDate, endDate) => {
@@ -269,12 +270,10 @@ export default class Detail extends Component {
269 270
   loadDetail() {
270 271
     let { id, initiateId, ltTicker, qrcodeParams } = this.state
271 272
     const { userInfo } = this.props
272
-
273 273
     Taro.showLoading()
274
-    const router = Taro.getStorageSync('router') || { query: {} }
275
-    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
276
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
277
-    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
274
+    const consultant = this.$router.params.consultant || qrcodeParams.consultant
275
+    const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
276
+    const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
278 277
     getHelpDetail(id, initiateId).then(res => {
279 278
       this.stopTicker()
280 279
 
@@ -312,7 +311,8 @@ export default class Detail extends Component {
312 311
 
313 312
       savePoint({
314 313
         event: 'detail',
315
-        eventType: 'help',
314
+        eventType: 'activity',
315
+        targetType:'help',
316 316
         propertyName: '助力详情',
317 317
         buildingId: res.helpActivity.buildingId,
318 318
         consultantId: consultantId,
@@ -338,8 +338,8 @@ export default class Detail extends Component {
338 338
 
339 339
   // 报备客户
340 340
   reportClientFn() {
341
-    const router = Taro.getStorageSync('router') || { query: {} }
342
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
341
+
342
+    const consultant = this.$router.params.consultant || ""
343 343
     const { userInfo: { person } } = this.props
344 344
 
345 345
     if (!this.state.reportedCustomer) {
@@ -385,7 +385,8 @@ export default class Detail extends Component {
385 385
 
386 386
     savePoint({
387 387
       event: 'share',
388
-      eventType: 'help',
388
+      eventType: 'activity',
389
+      targetType:'help',
389 390
       propertyName: '助力详情分享',
390 391
       consultantId: consultantId,
391 392
       sharePersonId: personId,
@@ -498,6 +499,15 @@ export default class Detail extends Component {
498 499
             isStarter: true,
499 500
             helpState: res.helpInitiateRecord.status === undefined ? HelpInProcess : res.helpInitiateRecord.status,
500 501
           }, resolve)
502
+          savePoint({
503
+            event: 'enlist',
504
+            eventType: 'activity',
505
+            targetType:'help',
506
+            propertyName: '助力活动报名',
507
+            data: '{}'
508
+          }).then(res => {
509
+            console.log('助力活动报名 ')
510
+          })
501 511
         }).catch(err => {
502 512
           console.log('err:', err)
503 513
           Taro.showToast({

+ 16
- 19
src/pages/activity/detail/index.js ファイルの表示

@@ -13,6 +13,7 @@ import { getQrCodeParams } from '@/utils/qrcode'
13 13
 import { getCardDetail } from '@/services/card'
14 14
 import { ROLE_CODE } from '@/constants/user'
15 15
 import Consultant from '@/components/consultant'
16
+import { rule as ruleToast } from '@/utils/ruleToast'
16 17
 import {
17 18
   addActivityShareNum,
18 19
   signupActivity,
@@ -56,8 +57,7 @@ export default class Detail extends Component {
56 57
 
57 58
   componentWillMount() {
58 59
     ready.queue(() => {
59
-      const router = Taro.getStorageSync('router') || { query: {} }
60
-      const id = this.$router.params.id || router.query.id
60
+      const id = this.$router.params.id
61 61
       if (this.$router.params.scene) {
62 62
         getQrCodeParams(this.$router.params.scene).then(res => {
63 63
           this.setState({ id: res.id, qrcodeParams: res }, () => {
@@ -80,14 +80,6 @@ export default class Detail extends Component {
80 80
     const { recordId } = this.state
81 81
     recordId && updatePoint(recordId)
82 82
 
83
-    const router = Taro.getStorageSync('router') || { query: {} }
84
-    Taro.setStorageSync('router', {
85
-      ...router,
86
-      query: {
87
-        ...router.query,
88
-        consultant: undefined,
89
-      }
90
-    })
91 83
   }
92 84
 
93 85
   componentWillReceiveProps() {
@@ -97,10 +89,9 @@ export default class Detail extends Component {
97 89
   loadDetail() {
98 90
     const { id, qrcodeParams } = this.state
99 91
     Taro.showLoading()
100
-    const router = Taro.getStorageSync('router') || { query: {} }
101
-    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
102
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
103
-    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
92
+    const consultant = this.$router.params.consultant || qrcodeParams.consultant
93
+    const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
94
+    const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
104 95
 
105 96
     queryActivityDetail(id).then(res => {
106 97
       Taro.hideLoading()
@@ -109,6 +100,7 @@ export default class Detail extends Component {
109 100
       savePoint({
110 101
         event: 'detail',
111 102
         eventType: 'activity',
103
+        targetType: 'dynamic',
112 104
         propertyName: '活动详情',
113 105
         buildingId: res.buildingId,
114 106
         targetId: res.dynamicId,
@@ -156,8 +148,7 @@ export default class Detail extends Component {
156 148
 
157 149
   // 报备客户
158 150
   reportClientFn() {
159
-    const router = Taro.getStorageSync('router') || { query: {} }
160
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
151
+    const consultant = this.$router.params.consultant || ""
161 152
     const { userInfo: { person } } = this.props
162 153
 
163 154
     if (!this.state.reportedCustomer) {
@@ -178,6 +169,7 @@ export default class Detail extends Component {
178 169
     savePoint({
179 170
       event: 'share',
180 171
       eventType: 'activity',
172
+      targetType: 'dynamic',
181 173
       propertyName: '活动详情分享',
182 174
       consultantId: consultantId,
183 175
       sharePersonId: personId,
@@ -243,6 +235,7 @@ export default class Detail extends Component {
243 235
     savePoint({
244 236
       event: 'save',
245 237
       eventType: 'activity',
238
+      targetType: 'dynamic',
246 239
       propertyName: '活动详情收藏',
247 240
       data: '{}'
248 241
     }).then(res => {
@@ -253,7 +246,10 @@ export default class Detail extends Component {
253 246
   handleGetPhone(e) {
254 247
     getUserPhone(e, (phoneNumber) => {
255 248
       if (phoneNumber) {
256
-        this.handleSignup()
249
+        ruleToast('signup-agent')
250
+        setTimeout(() => {
251
+          this.handleSignup()
252
+        }, 1000)
257 253
       } else {
258 254
         Taro.showToast({
259 255
           title: '报名失败',
@@ -319,6 +315,7 @@ export default class Detail extends Component {
319 315
     savePoint({
320 316
       event: 'poster',
321 317
       eventType: 'activity',
318
+      targetType: 'dynamic',
322 319
       propertyName: '生成活动详情海报',
323 320
       data: '{}'
324 321
     }).then(res => {
@@ -385,6 +382,7 @@ export default class Detail extends Component {
385 382
     savePoint({
386 383
       event: 'enlist',
387 384
       eventType: 'activity',
385
+      targetType: 'dynamic',
388 386
       propertyName: '活动详情报名',
389 387
       data: '{}'
390 388
     }).then(res => {
@@ -399,11 +397,10 @@ export default class Detail extends Component {
399 397
   }
400 398
 
401 399
   render() {
402
-    const router = Taro.getStorageSync('router') || { query: {} }
403 400
     const { detail, loaded, isSaved, isSign, posterVisible, posterData, posterShow, consultData, consultShow } = this.state
404 401
     const { userInfo = {} } = this.props
405 402
     const { person: { phone, personId, nickname, name, tel } = {} } = userInfo
406
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
403
+    const consultant = this.$router.params.consultant || ""
407 404
 
408 405
     return (
409 406
       <Block>

+ 13
- 10
src/pages/agent/become/index.js ファイルの表示

@@ -1,6 +1,6 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2 2
 import './index.scss'
3
-
3
+import { rule as ruleToast } from '@/utils/ruleToast'
4 4
 import { registerAgent } from '@/services/agent'
5 5
 import { connect } from '@tarojs/redux'
6 6
 import * as actions from '@/actions/user'
@@ -21,12 +21,12 @@ export default class Index extends Component {
21 21
     isChannel: false,
22 22
     user: {}
23 23
   }
24
-  componentDidMount () {
24
+  componentDidMount() {
25 25
     this.loadUserInfo()
26 26
 
27 27
 
28 28
   }
29
-  putMessage () {
29
+  putMessage() {
30 30
     const { recommendAgentCode, channelCode } = this.state
31 31
     const payload = {
32 32
       recommendAgentCode: recommendAgentCode,
@@ -67,7 +67,7 @@ export default class Index extends Component {
67 67
 
68 68
   //   })
69 69
   // }
70
-  bindInfo (e) {
70
+  bindInfo(e) {
71 71
     console.log(e.currentTarget.dataset.id)
72 72
     switch (e.currentTarget.dataset.id) {
73 73
       case 'recommendAgentCode':
@@ -84,10 +84,14 @@ export default class Index extends Component {
84 84
         break;
85 85
     }
86 86
   }
87
-  getPhoneNumber (e) {
87
+  getPhoneNumber(e) {
88 88
     getUserPhone(e, (phoneNumber) => {
89 89
       if (phoneNumber) {
90
-        this.putMessage()
90
+        ruleToast('signup-agent')
91
+        setTimeout(() => {
92
+          this.putMessage()
93
+        }, 1000)
94
+
91 95
       } else {
92 96
         Taro.showToast({
93 97
           title: '授权电话失败',
@@ -96,15 +100,14 @@ export default class Index extends Component {
96 100
       }
97 101
     })
98 102
   }
99
-  loadUserInfo () {
103
+  loadUserInfo() {
100 104
     queryUserInfo().then(user => {
101 105
       this.setState({
102 106
         user,
103 107
         phone: user.phone
104 108
       }, () => {
105 109
         if (user.personType == ROLE_CODE['DRIFT'] || user.personType == ROLE_CODE['CUSTOMER']) {
106
-          const router = Taro.getStorageSync('router') || { query: {} }
107
-          const code = this.$router.params.agentCode || router.query.agentCode || ''
110
+          const code = this.$router.params.agentCode || ''
108 111
           this.setState({
109 112
             recommendAgentCode: code
110 113
           }, () => {
@@ -118,7 +121,7 @@ export default class Index extends Component {
118 121
       })
119 122
     })
120 123
   }
121
-  render () {
124
+  render() {
122 125
     const { isChannel, recommendAgentCode } = this.state
123 126
     const { userInfo: { person: { phone } } } = this.props
124 127
     return (

+ 15
- 7
src/pages/agent/recommend/index.js ファイルの表示

@@ -4,7 +4,7 @@ import { recommendClient, getTypeData } from '@/services/client'
4 4
 import { getItemList } from '@/services/item'
5 5
 import { getCardList } from '@/services/card'
6 6
 import { savePoint, updatePoint } from '@/services/common'
7
-
7
+import { rule as ruleToast } from '@/utils/ruleToast'
8 8
 import Authorize from '@/components/authorize'
9 9
 
10 10
 import { connect } from '@tarojs/redux'
@@ -165,7 +165,6 @@ export default class Index extends Component {
165 165
     })
166 166
   }
167 167
   BindInfo(e) {
168
-    console.log(e, "8888888888")
169 168
     console.log(e.currentTarget.dataset.id)
170 169
     switch (e.currentTarget.dataset.id) {
171 170
       case 'name':
@@ -278,12 +277,21 @@ export default class Index extends Component {
278 277
     }
279 278
     recommendClient(param).then(res => {
280 279
       // if (res) {
281
-      Taro.showToast({
282
-        title: '提交成功'
283
-      })
280
+      ruleToast('recommend-customer')
281
+      if (this.state.reType == 'projectDeatil') {
282
+        savePoint({
283
+          event: 'recommend',
284
+          eventType: 'building',
285
+          propertyName: '推荐客户',
286
+          data: '{}'
287
+        }).then(res => {
288
+          console.log('推荐客户')
289
+        })
290
+      }
291
+
284 292
       setTimeout(() => {
285
-        Taro.navigateTo({ url: '/pages/agent/client/index' })//测试用
286
-      }, 700)
293
+        Taro.navigateTo({ url: '/pages/agent/client/index' })
294
+      }, 1000)
287 295
       this.clearInputEvent()
288 296
       // }
289 297
     })

+ 16
- 18
src/pages/card/fans/index.js ファイルの表示

@@ -38,30 +38,14 @@ export default class Index extends Component {
38 38
       savePoint({
39 39
         event: 'fans',
40 40
         eventType: 'card',
41
-        propertyName: '粉丝访问记录',
41
+        propertyName: '粉丝访问记录列表',
42 42
         data: '{}'
43 43
       }).then(res => {
44 44
         this.setState({
45 45
           recordId: res.recordId
46 46
         })
47
-        console.log('粉丝访问记录')
47
+        console.log('粉丝访问记录列表')
48 48
       })
49
-
50
-    } else {
51
-      // 埋点
52
-      savePoint({
53
-        event: 'person',
54
-        eventType: 'building',
55
-        propertyName: '项目详情围观人数',
56
-        data: '{}'
57
-      }).then(res => {
58
-        this.setState({
59
-          recordId: res.recordId
60
-        })
61
-        console.log('项目详情围观人数')
62
-      })
63
-    }
64
-    if (type === "card") {
65 49
       queryCardFansList(id, payload).then(res => {
66 50
         const { records } = res
67 51
 
@@ -74,7 +58,20 @@ export default class Index extends Component {
74 58
         Taro.hideLoading()
75 59
         console.log(err, '我的主页')
76 60
       })
61
+
77 62
     } else {
63
+      // 埋点
64
+      savePoint({
65
+        event: 'person',
66
+        eventType: 'building',
67
+        propertyName: '查看围观列表',
68
+        data: '{}'
69
+      }).then(res => {
70
+        this.setState({
71
+          recordId: res.recordId
72
+        })
73
+        console.log('查看围观列表')
74
+      })
78 75
       queryItemFansList(id, payload).then(res => {
79 76
         const { records } = res
80 77
         this.setState({
@@ -87,6 +84,7 @@ export default class Index extends Component {
87 84
         console.log(err, '我的主页')
88 85
       })
89 86
     }
87
+
90 88
     // return type === "card" ? queryCardFansList(id, payload) : queryItemFansList(id, payload)
91 89
   }
92 90
   componentWillUnmount() {

+ 4
- 4
src/pages/card/index.js ファイルの表示

@@ -60,8 +60,8 @@ export default class Index extends Component {
60 60
     })
61 61
   }
62 62
   initPageData() {
63
-    const router = Taro.getStorageSync('router') || { query: {} }
64
-    const id = this.$router.params.id || router.query.id
63
+
64
+    const id = this.$router.params.id
65 65
 
66 66
     if (!id) {
67 67
       getQrCodeParams(this.$router.params.scene).then(res => {
@@ -141,11 +141,11 @@ export default class Index extends Component {
141 141
   }
142 142
 
143 143
   getLocation = () => {
144
-    const { cardInfo: { address, company,coordinate } } = this.props
144
+    const { cardInfo: { address, company, coordinate } } = this.props
145 145
     const coord = coordinate.split(',')
146 146
     const latitude = parseFloat(coord[0])
147 147
     const longitude = parseFloat(coord[1])
148
-    
148
+
149 149
     Taro.getLocation({ //返回可以用于Taro.openLocation的经纬度,官方提示bug: iOS 6.3.30 type 参数不生效,只会返回 wgs84 类型的坐标信息  
150 150
       success: function (res) {
151 151
         Taro.openLocation({

+ 2
- 2
src/pages/card/list/index.js ファイルの表示

@@ -24,8 +24,8 @@ export default class Index extends Component {
24 24
   componentWillMount() {
25 25
     savePoint({
26 26
       event: 'consultants',
27
-      eventType: 'card',
28
-      propertyName: '置业顾问列表',
27
+      eventType: 'building',
28
+      propertyName: '查看置业顾问列表',
29 29
       data: '{}'
30 30
     }).then(res => {
31 31
       this.setState({

+ 19
- 31
src/pages/checkin/index.js ファイルの表示

@@ -1,7 +1,8 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3
+import { getQrCodeParams } from '@/utils/qrcode'
3 4
 import { AtDivider, AtList, AtListItem, AtGrid, AtButton } from 'taro-ui'
4
-
5
+import { rule as ruleToast } from '@/utils/ruleToast'
5 6
 // import achievePhone from '@/components/achievePhone'
6 7
 import { checkinDetails, checkinActive } from '@/services/checkin'
7 8
 import {
@@ -19,17 +20,17 @@ export default class checkin extends Component {
19 20
     data: {},
20 21
   }
21 22
 
22
-  componentWillMount () {
23
+  componentDidShow() {
24
+  // componentWillMount() {
23 25
     ready.queue(() => {
24
-      const router = Taro.getStorageSync('router') || { query: {} }
25 26
 
26
-      const { id = router.query.id, type = router.query.type || '' } = parseQueryString(router.query.params)
27
-     
27
+      const id = this.$router.params.id
28
+      const type = this.$router.params.type || ''
29
+
28 30
       if (!id) {
29 31
         getQrCodeParams(this.$router.params.scene).then(res => {
30 32
           this.setState({ id: res.id, type: res.type }, () => {
31
-            this.setState({ id, type })
32
-            this.getcheckinDetails(id, type)
33
+            this.getcheckinDetails(this.state.id, this.state.type)
33 34
           })
34 35
         }).catch(err => {
35 36
           Taro.showToast({
@@ -63,22 +64,9 @@ export default class checkin extends Component {
63 64
 
64 65
     })
65 66
 
66
-
67
-
68 67
   }
69
-  // const router = Taro.getStorageSync('router') || { query: {} }
70
-
71 68
 
72
-
73
-  // const { id = router.query.id , type = router.query.type || '' } = parseQueryString(router.query.params)
74
-  // console.log(id, 'id-----')
75
-  // this.setState({ id, type })
76
-  componentDidShow () {
77
-    // const { id, type } = this.state
78
-    // this.getcheckinDetails(id, type)
79
-  }
80
-  // dynamicId
81
-  getcheckinDetails (id, type) {
69
+  getcheckinDetails(id, type) {
82 70
     Taro.showLoading()
83 71
 
84 72
     checkinDetails(id, type).then(res => {
@@ -90,16 +78,18 @@ export default class checkin extends Component {
90 78
     })
91 79
   }
92 80
 
93
-  checkinActive () {
81
+  checkinActive() {
94 82
     const enlistId = this.state.data.enlist.enlistId
95 83
     Taro.showLoading()
96 84
     checkinActive(enlistId).then(res => {
97 85
       Taro.hideLoading()
86
+      ruleToast('activity_checkin')
98 87
 
99
-      // TODO: 需要依据 type 跳转
100
-      Taro.navigateTo({
101
-        url: '/pages/checkin/checkinsuccess/index?addPoints=' + res.addPoints,
102
-      })
88
+      setTimeout(() => {
89
+        Taro.navigateTo({
90
+          url: '/pages/checkin/checkinsuccess/index?addPoints=' + res.addPoints,
91
+        })
92
+      }, 700)
103 93
 
104 94
     }).catch((err) => {
105 95
       Taro.showToast({
@@ -113,15 +103,13 @@ export default class checkin extends Component {
113 103
 
114 104
   toactivity = (id) => {
115 105
     Taro.navigateTo({
116
-      url: '/pages/activity/detail/index',
117
-      query: { id }
106
+      url: '/pages/activity/detail/index?id=' + id,
118 107
     })
119 108
   }
120 109
 
121
-  render () {
110
+  render() {
122 111
     const { dynamic = {}, enlist = {}, person = {} } = this.state.data || {}
123 112
     const { activityStatus } = dynamic || {}
124
-    // console.log(enlist, 'enlist')
125 113
     return (
126 114
       <View className="checkin" style="width:100vw;height:100vh;" >
127 115
 
@@ -170,7 +158,7 @@ export default class checkin extends Component {
170 158
         </View>
171 159
           }
172 160
 
173
-          {activityStatus===0 &&
161
+          {activityStatus === 0 &&
174 162
             <View>
175 163
               <View>
176 164
                 <Image className="img1" src={require('@/assets/checkin/noentry.png')} ></Image>

+ 6
- 21
src/pages/news/detail/index.js ファイルの表示

@@ -24,10 +24,8 @@ import {
24 24
   cancelFavorNews
25 25
 } from '@/services/news'
26 26
 import { connect } from '@tarojs/redux'
27
-import { withUtils } from '@/utils/page'
28 27
 
29 28
 @connect(state => state.user)
30
-// @withUtils()
31 29
 export default class NewsDetail extends Component {
32 30
   config = {
33 31
     navigationBarTitleText: '资讯详情'
@@ -51,8 +49,6 @@ export default class NewsDetail extends Component {
51 49
   componentWillMount(options) {
52 50
     console.info('=====news ========>', this)
53 51
     ready.queue(() => {
54
-      const router = Taro.getStorageSync('router') || { query: {} }
55
-      console.info('news-1:', router)
56 52
       console.info('news-2:', this.$router)
57 53
 
58 54
       const { person = {} } = this.props.userInfo || {}
@@ -62,7 +58,7 @@ export default class NewsDetail extends Component {
62 58
         return
63 59
       }
64 60
 
65
-      const newsId = this.$router.params.id || router.query.id
61
+      const newsId = this.$router.params.id
66 62
 
67 63
       if (this.$router.params.scene) {
68 64
         getQrCodeParams(this.$router.params.scene).then(res => {
@@ -103,21 +99,11 @@ export default class NewsDetail extends Component {
103 99
     const { recordId } = this.state
104 100
     recordId && updatePoint(recordId)
105 101
 
106
-    const router = Taro.getStorageSync('router') || { query: {} }
107
-    Taro.setStorageSync('router', {
108
-      ...router,
109
-      query: {
110
-        ...router.query,
111
-        consultant: undefined,
112
-      }
113
-    })
114 102
   }
115 103
 
116 104
   // 报备客户
117 105
   reportClientFn() {
118
-    const router = Taro.getStorageSync('router') || { query: {} }
119
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
120
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
106
+    const consultant = this.$router.params.consultant || ""
121 107
     const { userInfo: { person } } = this.props
122 108
 
123 109
     if (!this.state.reportedCustomer) {
@@ -150,7 +136,7 @@ export default class NewsDetail extends Component {
150 136
     }
151 137
     savePoint({
152 138
       event: 'save',
153
-      eventType: 'activity',
139
+      eventType: 'news',
154 140
       propertyName: '资讯详情收藏',
155 141
       data: '{}'
156 142
     }).then(res => {
@@ -222,10 +208,9 @@ export default class NewsDetail extends Component {
222 208
 
223 209
   loadDetail() {
224 210
     const { newsId, qrcodeParams } = this.state
225
-    const router = Taro.getStorageSync('router') || { query: {} }
226
-    const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
227
-    const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
228
-    const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
211
+    const consultant = this.$router.params.consultant || qrcodeParams.consultant
212
+    const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
213
+    const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
229 214
     Taro.showLoading()
230 215
     queryNewsDetail(newsId).then(res => {
231 216
       Taro.hideLoading()

+ 15
- 12
src/pages/person/authorize/index.js ファイルの表示

@@ -3,19 +3,19 @@ import { connect } from '@tarojs/redux'
3 3
 import * as actions from '@/actions/user'
4 4
 import './index.scss'
5 5
 import getUserPhone from '@/utils/getUserPhone'
6
-
6
+import { rule as ruleToast } from '@/utils/ruleToast'
7 7
 @connect(state => state.user, { ...actions })
8 8
 export default class Index extends Component {
9 9
   config = {
10 10
     navigationBarTitleText: '个人中心'
11 11
   }
12 12
   state = {
13
-  	person:''
13
+    person: ''
14 14
   }
15 15
   componentWillMount() {
16
-    const {userInfo:{person}} = this.props
16
+    const { userInfo: { person } } = this.props
17 17
     this.setState({
18
-    	person:person
18
+      person: person
19 19
     })
20 20
   }
21 21
 
@@ -28,26 +28,29 @@ export default class Index extends Component {
28 28
         })
29 29
         return
30 30
       }
31
-      Taro.reLaunch({
32
-        url: `/pages/project/index`
33
-      })
31
+      ruleToast('signup-agent')
32
+      setTimeout(() => {
33
+        Taro.reLaunch({
34
+          url: `/pages/project/index`
35
+        })
36
+      }, 1000)
34 37
     })
35 38
   }
36
-  
39
+
37 40
   handleLogin() {
38 41
     Taro.navigateTo({
39 42
       url: `/pages/person/login/index`
40 43
     })
41 44
   }
42
-  
45
+
43 46
   render() {
44
-  	const {person}=this.state
47
+    const { person } = this.state
45 48
 
46 49
     return (
47 50
       <View className='auth-page'>
48
-        <Image className="avatar_img" src={person.avatarurl}/>
51
+        <Image className="avatar_img" src={person.avatarurl} />
49 52
         <View className="user_name">{person.nickname}</View>
50
-        <Button  className='auth-btn' open-type="getPhoneNumber" onGetphonenumber={this.getPhoneNumber}>微信授权一键登录</Button>
53
+        <Button className='auth-btn' open-type="getPhoneNumber" onGetphonenumber={this.getPhoneNumber}>微信授权一键登录</Button>
51 54
         {/* <View className='adver-btn' onClick={this.handleLogin}><Text>我是置业顾问,立即登录~</Text></View> */}
52 55
       </View>
53 56
     )

+ 1
- 1
src/pages/person/customerAnalysis/followUpCustomer/index.js ファイルの表示

@@ -15,7 +15,7 @@ const phoneImg = require('@/assets/person/dianhua.png')
15 15
 const communicateImg = require('@/assets/person/communicate.png')
16 16
 
17 17
 @connect(({ user, city }) => ({ user, city }))
18
-export default class transactionCustomer extends Taro.Component {
18
+export default class followUpCustomer extends Taro.Component {
19 19
 
20 20
   config = {
21 21
     navigationBarTitleText: '跟进客户'

+ 9
- 2
src/pages/person/feedback/index.js ファイルの表示

@@ -1,7 +1,7 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2 2
 import { isChineseMobilePhoneNumber, isEmail } from '@/utils/tools'
3 3
 import './index.scss'
4
-
4
+import { savePoint, } from '@/services/common'
5 5
 import { submitFeedBack } from '@/services/feedBack'
6 6
 export default class FeedBack extends Component {
7 7
   state = {
@@ -49,7 +49,14 @@ export default class FeedBack extends Component {
49 49
           icon: 'success',
50 50
           duration: 2000
51 51
         })
52
-
52
+        savePoint({
53
+          event: 'feedback',
54
+          eventType: 'center',
55
+          propertyName: '提交反馈',
56
+          data: '{}'
57
+        }).then(res => {
58
+          console.log('提交反馈')
59
+        })
53 60
         setTimeout(() => {
54 61
           Taro.navigateBack({ delta: 1 })
55 62
         }, 1000)

+ 13
- 4
src/pages/person/index.js ファイルの表示

@@ -1,6 +1,5 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3
-
4 3
 import { ROLE_CODE } from '@/constants/user'
5 4
 import { queryUserInfo, doUserSignin } from '@/services/user'
6 5
 import { connect } from '@tarojs/redux'
@@ -9,9 +8,11 @@ import { getCodeMessage, putRegisterConsultant } from '@/services/getCode'
9 8
 import * as actions from '@/actions/user'
10 9
 import Authorize from '@/components/authorize'
11 10
 import { transferImage } from '@/utils/tools'
11
+import { savePoint, } from '@/services/common'
12 12
 import { menus } from './menus'
13 13
 import login from '@/utils/login'
14 14
 export const version = Version
15
+import { rule as ruleToast } from '@/utils/ruleToast'
15 16
 
16 17
 @connect(({ user, city }) => ({ user, city }), { ...actions })
17 18
 
@@ -58,8 +59,14 @@ export default class Person extends Component {
58 59
     }
59 60
 
60 61
     doUserSignin({ id }).then(res => {
61
-      Taro.showToast({
62
-        title: '签到成功'
62
+      ruleToast('checkin')
63
+      savePoint({
64
+        event: 'signin',
65
+        eventType: 'center',
66
+        propertyName: '签到',
67
+        data: '{}'
68
+      }).then(res => {
69
+        console.log('签到')
63 70
       })
64 71
       // this.setState({
65 72
       //   user: {
@@ -67,7 +74,9 @@ export default class Person extends Component {
67 74
       //   }
68 75
       // })
69 76
 
70
-      this.loadUserInfo()
77
+      setTimeout(() => {
78
+        this.loadUserInfo()
79
+      }, 500)
71 80
 
72 81
       // App.zhuge.track('签到成功')
73 82
     })

+ 12
- 6
src/pages/person/profile/detail/index.js ファイルの表示

@@ -1,15 +1,13 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3 3
 import { AtImagePicker } from 'taro-ui'
4
-import dayjs from 'dayjs'
5
-
6 4
 import { getProfileDetail, editDocumentVerify } from '@/services/user'
7
-
8 5
 import { uploadFiles } from '@/utils/request'
9 6
 import { transferImage } from '@/utils/tools'
10
-
11 7
 import "taro-ui/dist/style/components/image-picker.scss";
12 8
 import "taro-ui/dist/style/components/icon.scss";
9
+import { savePoint, } from '@/services/common'
10
+import { rule as ruleToast } from '@/utils/ruleToast'
13 11
 const add = require('@/assets/add.png')
14 12
 const closeImg = require('@/assets/close.png')
15 13
 
@@ -109,7 +107,15 @@ export default class Profile extends Component {
109 107
           imgList: res.imgList || [],
110 108
           documentTitle: res.documentTitle,
111 109
         })
112
-        Taro.showToast({ icon: 'none', title: '提交成功' });
110
+        ruleToast('document_verify')
111
+        savePoint({
112
+          event: 'material',
113
+          eventType: 'center',
114
+          propertyName: '提交资料',
115
+          data: '{}'
116
+        }).then(res => {
117
+          console.log('提交资料')
118
+        })
113 119
 
114 120
       }).catch((err) => {
115 121
         Taro.showToast({ icon: 'none', title: err.errMsg || '提交失败' });
@@ -190,7 +196,7 @@ export default class Profile extends Component {
190 196
           {
191 197
             detail.verifyStatus != 2 &&
192 198
             <View>
193
-              <View className="detail-title" >{detail.documentTitle || '资料审核'}</View>
199
+              <View className="detail-title" >{detail.documentTitle}</View>
194 200
               {
195 201
                 detail.verifyStatus == 1 && <View className="commit-text" >审核通过</View>
196 202
               }

+ 29
- 17
src/pages/person/profile/index.js ファイルの表示

@@ -4,7 +4,8 @@ import dayjs from 'dayjs'
4 4
 import { getDocumentVerify, commitDocumentVerify, getVerifyList } from '@/services/user'
5 5
 import { uploadFiles } from '@/utils/request'
6 6
 import { transferImage } from '@/utils/tools'
7
-
7
+import { savePoint, } from '@/services/common'
8
+import { rule as ruleToast } from '@/utils/ruleToast'
8 9
 const profileBg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/index/profile.png'
9 10
 const add = require('@/assets/add.png')
10 11
 const closeImg = require('@/assets/close.png')
@@ -25,7 +26,7 @@ export default class Profile extends Component {
25 26
 
26 27
   }
27 28
 
28
-  componentWillMount() {
29
+  componentDidShow() {
29 30
     this.getProfile()
30 31
   }
31 32
 
@@ -35,19 +36,19 @@ export default class Profile extends Component {
35 36
       this.setState({
36 37
         verfyList: res || []
37 38
       },
38
-      //  () => {
39
-      //   if (this.state.verfyList.length == 0) {
40
-      //     this.setState({
41
-      //       showWhich: true
42
-      //     })
43
-      //   } else {
44
-      //     this.setState({
45
-      //       showWhich: false
46
-      //     })
47
-      //   }
39
+        //  () => {
40
+        //   if (this.state.verfyList.length == 0) {
41
+        //     this.setState({
42
+        //       showWhich: true
43
+        //     })
44
+        //   } else {
45
+        //     this.setState({
46
+        //       showWhich: false
47
+        //     })
48
+        //   }
48 49
 
49
-      // }
50
-    )
50
+        // }
51
+      )
51 52
       Taro.hideLoading()
52 53
     }).catch((err) => {
53 54
       Taro.hideLoading()
@@ -143,8 +144,19 @@ export default class Profile extends Component {
143 144
           imgList: [],
144 145
           descVisible: false,
145 146
         })
146
-        Taro.showToast({ icon: 'none', title: '提交成功' });
147
-        this.getProfile()
147
+        ruleToast('document_verify')
148
+
149
+        setTimeout(() => {
150
+          savePoint({
151
+            event: 'material',
152
+            eventType: 'center',
153
+            propertyName: '提交资料',
154
+            data: '{}'
155
+          }).then(res => {
156
+            console.log('提交资料')
157
+          })
158
+          this.getProfile()
159
+        }, 1000)
148 160
 
149 161
       }).catch((err) => {
150 162
         Taro.showToast({ icon: 'none', title: err.errMsg || '提交失败' });
@@ -217,7 +229,7 @@ export default class Profile extends Component {
217 229
               </View>
218 230
             </View>
219 231
           }
220
-          {(verfyList.length||descVisible) &&
232
+          {(verfyList.length || descVisible) &&
221 233
             <View>
222 234
 
223 235
               {descVisible &&

+ 1
- 3
src/pages/policy/detail/index.js ファイルの表示

@@ -26,9 +26,7 @@ export default class PolicyDetail extends Component {
26 26
 
27 27
   componentWillMount() {
28 28
     ready.queue(() => {
29
-      const router = Taro.getStorageSync('router') || { query: {} }
30
-      const policyId = this.$router.params.id || router.query.id
31
-
29
+      const policyId = this.$router.params.id 
32 30
       this.setState({ policyId }, () => {
33 31
         this.loadDetail()
34 32
       })

+ 14
- 4
src/pages/policy/index.js ファイルの表示

@@ -5,9 +5,18 @@ import './index.scss'
5 5
 import { savePoint, updatePoint } from '@/services/common'
6 6
 import { queryPolicyList } from '@/services/policy'
7 7
 import { connect } from '@tarojs/redux'
8
+import { withDetail } from '@/utils/page'
8 9
 let pageIndex = 1
9 10
 
10 11
 @connect(state => state.city)
12
+@withDetail({
13
+  track: {
14
+    event: 'policy',
15
+    eventType: 'main',
16
+    propertyName: '查看购房百科',
17
+    data: '{}',
18
+  }
19
+})
11 20
 export default class Index extends Component {
12 21
 
13 22
   config = {
@@ -19,7 +28,7 @@ export default class Index extends Component {
19 28
     hasMore: true,
20 29
     isEmpty: false,
21 30
     recordId: null,
22
-    pageIndex:1
31
+    pageIndex: 1
23 32
   }
24 33
 
25 34
 
@@ -41,20 +50,21 @@ export default class Index extends Component {
41 50
       list,
42 51
       isEmpty: total == 0,
43 52
       hasMore: list.length >= total ? false : true,
44
-      pageIndex:1
53
+      pageIndex: 1
45 54
     })
55
+    this._$_dataReady()
46 56
     rest && rest()
47 57
   }
48 58
 
49 59
   onScrollToLower = async (fn) => {
50 60
     const { list } = this.state;
51 61
     pageIndex++
52
-    const { records, total } = await this.loadList(this.state.pageIndex+1);
62
+    const { records, total } = await this.loadList(this.state.pageIndex + 1);
53 63
     const policyList = list.concat(records)
54 64
     this.setState({
55 65
       list: policyList,
56 66
       hasMore: policyList.length >= total ? false : true,
57
-      pageIndex:this.state.pageIndex+1
67
+      pageIndex: this.state.pageIndex + 1
58 68
     });
59 69
     fn && fn();
60 70
   }

+ 1
- 1
src/pages/project/album/index.js ファイルの表示

@@ -40,7 +40,7 @@ export default class Index extends Component {
40 40
     savePoint({
41 41
       event: 'album',
42 42
       eventType: 'building',
43
-      propertyName: '相册信息',
43
+      propertyName: '查看相册',
44 44
       data: '{}'
45 45
     }).then(res => {
46 46
       this.setState({

+ 51
- 37
src/pages/project/detail/index.js ファイルの表示

@@ -87,10 +87,6 @@ export default class Index extends Component {
87 87
     console.log('-------trac2222----->', this)
88 88
     ready.queue(() => {
89 89
       // // 分享场景需要先授权手机, 再授权头像
90
-      // const options = wx.getLaunchOptionsSync()
91
-      // console.log('-------options----->', options)
92
-      // if (sceneInShare(options.scene)) {
93
-      const router = Taro.getStorageSync('router') || { query: {} }
94 90
       const { person = {} } = this.props.userInfo || {}
95 91
       console.log('-------person----->', person)
96 92
       if ((person.tel || person.phone) && (person.avatarurl || '').indexOf('wx.qlogo.cn') === -1) {
@@ -98,12 +94,12 @@ export default class Index extends Component {
98 94
         return
99 95
       }
100 96
 
101
-      const id = this.$router.params.id || router.query.id
97
+      const id = this.$router.params.id
102 98
 
103 99
       // 没有找到 id , 再重新找一次
104 100
       if (this.$router.params.scene) {
105 101
         getQrCodeParams(this.$router.params.scene).then(res => {
106
-          console.log(res,"扫码参数")
102
+          console.log(res, "扫码参数")
107 103
           this.setState({
108 104
             qrcodeParams: res
109 105
           })
@@ -124,14 +120,6 @@ export default class Index extends Component {
124 120
     const { recordId } = this.state
125 121
     recordId && updatePoint(recordId)
126 122
 
127
-    const router = Taro.getStorageSync('router') || { query: {} }
128
-    Taro.setStorageSync('router', {
129
-      ...router,
130
-      query: {
131
-        ...router.query,
132
-        consultant: undefined,
133
-      }
134
-    })
135 123
   }
136 124
 
137 125
   componentWillReceiveProps() {
@@ -140,8 +128,7 @@ export default class Index extends Component {
140 128
 
141 129
   // 报备客户
142 130
   reportClientFn() {
143
-    const router = Taro.getStorageSync('router') || { query: {} }
144
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
131
+    const consultant = this.$router.params.consultant || ""
145 132
     const { userInfo: { person } } = this.props
146 133
 
147 134
     if (!this.state.reportedCustomer) {
@@ -220,10 +207,9 @@ export default class Index extends Component {
220 207
       addItemUv(id)
221 208
       const { qrcodeParams } = this.state
222 209
       // 埋点
223
-      const router = Taro.getStorageSync('router') || { query: {} }
224
-      const consultant = this.$router.params.consultant || router.query.consultant || qrcodeParams.consultant
225
-      // const consultantId = this.$router.params.consultantId || router.query.consultantId || qrcodeParams.consultantId || ""
226
-      // const recommender = this.$router.params.recommender || router.query.recommender || qrcodeParams.recommender || ""
210
+      const consultant = this.$router.params.consultant || qrcodeParams.consultant
211
+      // const consultantId = this.$router.params.consultantId ||  qrcodeParams.consultantId || ""
212
+      // const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
227 213
       // savePoint({
228 214
       //   event: 'detail',
229 215
       //   eventType: 'building',
@@ -240,7 +226,6 @@ export default class Index extends Component {
240 226
       //   console.log('项目详情')
241 227
       // })
242 228
 
243
-      console.log('-------consultant--------->', this.$router.params, router.query)
244 229
 
245 230
       if (consultant) {
246 231
         getCardDetail(consultant).then(res => {
@@ -255,7 +240,7 @@ export default class Index extends Component {
255 240
     })
256 241
   }
257 242
 
258
-  _$_track () {
243
+  _$_track() {
259 244
     const sceneParams = this._$_scene || {}
260 245
     const id = this.$router.params.id || sceneParams.id
261 246
     const consultantId = this.$router.params.consultantId || sceneParams.consultantId
@@ -499,17 +484,25 @@ export default class Index extends Component {
499 484
           posterData
500 485
         })
501 486
       })
487
+
502 488
     } else {
503 489
       this.setState({
504 490
         posterStatus: !!flag
505 491
       })
506 492
     }
493
+    savePoint({
494
+      event: 'poster',
495
+      eventType: 'building',
496
+      propertyName: '生成项目详情海报',
497
+      data: '{}'
498
+    }).then(res => {
499
+      console.log('生成项目详情海报')
500
+    })
507 501
   }
508 502
 
509 503
   callPhone = () => {
510 504
     console.log(this.props, "this.props")
511
-    const router = Taro.getStorageSync('router') || { query: {} }
512
-    const consultant = this.$router.params.consultant || router.query.consultant
505
+    const consultant = this.$router.params.consultant
513 506
     if (consultant) {
514 507
       this.handleTelClick(this.state.consultData)
515 508
     } else {
@@ -518,6 +511,14 @@ export default class Index extends Component {
518 511
         Taro.makePhoneCall({
519 512
           phoneNumber: tel
520 513
         })
514
+        savePoint({
515
+          event: 'phone',
516
+          eventType: 'building',
517
+          propertyName: '拨打电话',
518
+          data: '{}'
519
+        }).then(res => {
520
+          console.log('拨打电话')
521
+        })
521 522
       } else {
522 523
         Taro.showToast({
523 524
           title: '暂无联系电话',
@@ -532,6 +533,14 @@ export default class Index extends Component {
532 533
     Taro.makePhoneCall({
533 534
       phoneNumber: item.phone || item.tel
534 535
     })
536
+    savePoint({
537
+      event: 'phone',
538
+      eventType: 'building',
539
+      propertyName: '拨打电话',
540
+      data: '{}'
541
+    }).then(res => {
542
+      console.log('拨打电话')
543
+    })
535 544
   }
536 545
 
537 546
   handleChatClick(item, e) {
@@ -548,10 +557,17 @@ export default class Index extends Component {
548 557
 
549 558
       },
550 559
       complete() {
551
-        // App.zhuge.track('查看置业顾问列表')
552 560
         Taro.navigateTo({
553 561
           url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.id}&receiverName=${encodeURIComponent(item.userName || item.name)}`
554 562
         })
563
+        savePoint({
564
+          event: 'communicate',
565
+          eventType: 'building',
566
+          propertyName: '在线沟通',
567
+          data: '{}'
568
+        }).then(res => {
569
+          console.log('在线沟通')
570
+        })
555 571
       }
556 572
     })
557 573
 
@@ -570,8 +586,7 @@ export default class Index extends Component {
570 586
     })
571 587
   }
572 588
   ChatOnlineClick() {
573
-    const router = Taro.getStorageSync('router') || { query: {} }
574
-    const consultant = this.$router.params.consultant || router.query.consultant
589
+    const consultant = this.$router.params.consultant
575 590
     if (consultant) {
576 591
       this.handleChatClick(this.state.consultData)
577 592
     } else {
@@ -640,6 +655,14 @@ export default class Index extends Component {
640 655
       current,
641 656
       urls
642 657
     })
658
+    savePoint({
659
+      event: 'apartment',
660
+      eventType: 'building',
661
+      propertyName: '查看户型',
662
+      data: '{}'
663
+    }).then(res => {
664
+      console.log('查看户型')
665
+    })
643 666
   }
644 667
 
645 668
   handleFavor() {
@@ -665,7 +688,7 @@ export default class Index extends Component {
665 688
     }
666 689
     savePoint({
667 690
       event: 'save',
668
-      eventType: 'project',
691
+      eventType: 'building',
669 692
       propertyName: '项目收藏',
670 693
       data: '{}'
671 694
     }).then(res => {
@@ -1316,11 +1339,6 @@ export default class Index extends Component {
1316 1339
                         <Text className="label">物业:</Text>
1317 1340
                         <Text>{projectDetail.serviceCompany || '暂无'}</Text>
1318 1341
                       </View>
1319
-
1320
-                      {/* <View className='row project__area'>
1321
-                        <Text className="label">销售状态:</Text>
1322
-                        <Text className="status">{projectDetail.marketStatus}</Text>
1323
-                      </View> */}
1324 1342
                       <View className='row-info'>
1325 1343
                         <View className='row'>
1326 1344
                           <Text className="label">车位比率:</Text>{projectDetail.parkingRate || '暂无'}</View>
@@ -1339,10 +1357,6 @@ export default class Index extends Component {
1339 1357
                           <Text className="label">物业费:</Text>{projectDetail.serviceFee || '暂无'}</View>
1340 1358
                       </View>
1341 1359
 
1342
-                      {/* <View className='row'>
1343
-                        <Text className="label">装修标准:</Text>{projectDetail.decoration || '暂无'}
1344
-                      </View> */}
1345
-
1346 1360
                       {/* 围观人数 */}
1347 1361
                       <View className='watch__people__num'>
1348 1362
                         <View className='top__txt'>{projectDetail.pvNum || 0}人围观</View>

+ 14
- 3
src/pages/project/detail/map.js ファイルの表示

@@ -6,12 +6,21 @@ import 'dayjs/locale/zh-cn' // 按需加载
6 6
 import ready from '@/utils/ready'
7 7
 import { connect } from '@tarojs/redux'
8 8
 import { dispatchProjectDetail } from '@/actions/project'
9
-
9
+import { withDetail } from '@/utils/page'
10 10
 
11 11
 @connect(
12 12
     ({ user, project }) => ({ ...user, ...project }),
13 13
     { dispatchProjectDetail }
14 14
 )
15
+@withDetail({
16
+    track: {
17
+        event: 'peripheral',
18
+        eventType: 'building',
19
+        propertyName: '查看周边配套',
20
+        data: '{}',
21
+    }
22
+})
23
+
15 24
 export default class Index extends Component {
16 25
     config = {
17 26
         navigationBarTitleText: '更多周边设施',
@@ -23,8 +32,7 @@ export default class Index extends Component {
23 32
 
24 33
     componentWillMount() {
25 34
         ready.queue(() => {
26
-            const router = Taro.getStorageSync('router') || { query: {} }
27
-            const id = this.$router.params.id || router.query.id
35
+            const id = this.$router.params.id
28 36
             this.initPageData(id)
29 37
 
30 38
         })
@@ -63,6 +71,9 @@ export default class Index extends Component {
63 71
                     })
64 72
                 }
65 73
             })
74
+
75
+            this._$_dataReady()
76
+
66 77
             Taro.hideToast()
67 78
         })
68 79
     }

+ 12
- 2
src/pages/project/floor/index.js ファイルの表示

@@ -4,11 +4,19 @@ import { connect } from '@tarojs/redux'
4 4
 import { dispatchProjectDetail } from '@/actions/project'
5 5
 import dayjs from 'dayjs'
6 6
 import 'dayjs/locale/zh-cn' // 按需加载
7
-import ready from '@/utils/ready'
7
+import { withDetail } from '@/utils/page'
8 8
 @connect(
9 9
   ({ user, card, project }) => ({ ...user, ...card, ...project }),
10 10
   { dispatchProjectDetail }
11 11
 )
12
+@withDetail({
13
+  track: {
14
+    event: 'more',
15
+    eventType: 'building',
16
+    propertyName: '查看更多楼盘信息',
17
+    data: '{}',
18
+  }
19
+})
12 20
 export default class Index extends Component {
13 21
   config = {
14 22
     navigationBarTitleText: '楼盘信息'
@@ -17,7 +25,9 @@ export default class Index extends Component {
17 25
   state = {
18 26
     statusOpts: ['待定', '在建', '在售'],
19 27
   }
20
-
28
+  componentWillMount() {
29
+    this._$_dataReady()
30
+  }
21 31
 
22 32
   render() {
23 33
     const { projectDetail } = this.props

+ 22
- 32
src/pages/project/h5Page.js ファイルの表示

@@ -10,10 +10,11 @@ import { ROLE_CODE } from '@/constants/user'
10 10
 import { getQrCodeParams } from '@/utils/qrcode'
11 11
 import { getMiniQrcode, savePoint, updatePoint } from '@/services/common'
12 12
 import { isEmpty } from '@/utils/tools'
13
-
13
+import { rule as ruleToast } from '@/utils/ruleToast'
14 14
 const bgImg = "https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/bg.png"
15 15
 
16 16
 @connect(state => state.user, { ...actions })
17
+
17 18
 export default class Index extends Component {
18 19
 
19 20
   state = {
@@ -32,26 +33,17 @@ export default class Index extends Component {
32 33
     recordId && updatePoint(recordId)
33 34
   }
34 35
 
35
-  // componentDidHide() {
36
-  //   this.setState({ pageHide: true });
37
-  // }
38
-
39
-  // componentDidShow() {
40
-  //   this.setState({ pageHide: false });
41
-  // }
42
-
43 36
   // 埋点
44 37
   success() {
45
-    const router = Taro.getStorageSync('router') || { query: {} }
46
-    const firstShare = this.$router.params.firstShare || router.query.firstShare || ""
47
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
48
-    const sharePersonId = this.$router.params.sharePersonId || router.query.sharePersonId || ""
49
-    const h5Id = this.state.h5Id || this.$router.params.id || router.query.id
38
+    const firstShare = this.$router.params.firstShare || ""
39
+    const consultant = this.$router.params.consultant || ""
40
+    const sharePersonId = this.$router.params.sharePersonId || ""
41
+    const h5Id = this.state.h5Id || this.$router.params.id
50 42
 
51 43
     savePoint({
52 44
       event: 'detail',
53 45
       eventType: 'h5',
54
-      propertyName: 'h5活动',
46
+      propertyName: 'h5详情',
55 47
       consultantId: consultant,
56 48
       sharePersonId: sharePersonId,
57 49
       targetId: h5Id,
@@ -106,11 +98,9 @@ export default class Index extends Component {
106 98
   currentPageAndParams() {
107 99
     const { userInfo: { person } } = this.props
108 100
     const { h5Id } = this.state
109
-    const router = Taro.getStorageSync('router') || { query: {} }
110 101
 
111
-    // const consultant = person.personType == ROLE_CODE['CONSULTANT'] ? person.personId : ""
112 102
     const consultantId = person.personType == ROLE_CODE['CONSULTANT'] ? person.userId : ""
113
-    const firstShare = this.$router.params.firstShare || router.query.firstShare || person.personId
103
+    const firstShare = this.$router.params.firstShare || person.personId
114 104
 
115 105
     let queryParams = [
116 106
       `sharePersonId=${person.personId}`,
@@ -160,8 +150,7 @@ export default class Index extends Component {
160 150
         })
161 151
       }
162 152
 
163
-      const router = Taro.getStorageSync('router') || { query: {} }
164
-      const hFiveId = this.$router.params.id || router.query.id
153
+      const hFiveId = this.$router.params.id
165 154
 
166 155
       if (!isEmpty(hFiveId)) {
167 156
         this.loadH5Profile(hFiveId)
@@ -267,7 +256,7 @@ export default class Index extends Component {
267 256
 
268 257
   // 授权用户信息
269 258
   getUserInfo() {
270
-  
259
+
271 260
     const { dispatchUpdateUserInfo } = this.props
272 261
     const sessionKey = Taro.getStorageSync('sessionKey')
273 262
 
@@ -314,21 +303,22 @@ export default class Index extends Component {
314 303
           icon: 'none'
315 304
         })
316 305
       } else {
317
-        console.log('授权手机成功')
318
-        this.success()
319
-        this.reportClient()
320
-        this.setState({
321
-          phoneVisible: false,
322
-          webViewVisible: true,
323
-        })
306
+        ruleToast('signup-agent')
307
+        setTimeout(() => {
308
+          this.success()
309
+          this.reportClient()
310
+          this.setState({
311
+            phoneVisible: false,
312
+            webViewVisible: true,
313
+          })
314
+        }, 1000)
324 315
       }
325 316
     })
326 317
   }
327 318
 
328 319
   // 报备客户
329 320
   reportClient() {
330
-    const router = Taro.getStorageSync('router') || { query: {} }
331
-    const consultant = this.$router.params.consultant || router.query.consultant || ""
321
+    const consultant = this.$router.params.consultant || ""
332 322
     const { userInfo: { person: { phone, tel, personId, userId, personType } } } = this.props
333 323
     const isConsultant = personType == ROLE_CODE['CONSULTANT']
334 324
 
@@ -370,11 +360,11 @@ export default class Index extends Component {
370 360
     )
371 361
   }
372 362
   render() {
373
-    const router = Taro.getStorageSync('router') || { query: {} }
363
+
374 364
     const { pageInfo, webViewVisible, codeParams, pageHide, h5Id } = this.state
375 365
     const { userInfo: { person } } = this.props
376 366
     const consultant = person.personType == ROLE_CODE['CONSULTANT'] ? person.userId : ""
377
-    const firstShare = this.$router.params.firstShare || router.query.firstShare || person.personId
367
+    const firstShare = this.$router.params.firstShare || person.personId
378 368
     const webUrlParams = [
379 369
       `personId=${person.personId}`,
380 370
       `h5id=${h5Id}`,

+ 1
- 1
src/pages/project/index.js ファイルの表示

@@ -230,7 +230,7 @@ export default class Index extends Component {
230 230
 
231 231
     const payload = {
232 232
       name: keywords,
233
-      pageSize: 999
233
+      pageSize: 10,
234 234
     }
235 235
     if (curCity.id) {
236 236
       payload.cityId = curCity.id

+ 16
- 4
src/pages/project/list/filter/index.js ファイルの表示

@@ -2,7 +2,7 @@ import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3 3
 import { deepClone } from '@/utils/tools'
4 4
 import { queryItemTypeList } from '@/services/item'
5
-
5
+import { savePoint } from '@/services/common'
6 6
 import { connect } from '@tarojs/redux'
7 7
 @connect(state => ({ ...state.city }))
8 8
 export default class Index extends Component {
@@ -130,10 +130,11 @@ export default class Index extends Component {
130 130
         return ''
131 131
       }
132 132
 
133
-      // 
133
+      // 
134 134
       if (tabIndex === 0) {
135
-        let val = selectedList.map(index => curTabList[index])
136
-        return val.join(',')
135
+        // let val = selectedList.map(index => curTabList[index])
136
+        // return val.join(',')
137
+        return selectedList.join(',')
137 138
       }
138 139
 
139 140
       // 价格 面积
@@ -166,6 +167,7 @@ export default class Index extends Component {
166 167
       }
167 168
     })
168 169
     console.log(values)
170
+
169 171
     let params = {
170 172
       name: keywords,
171 173
       houseType: values[0],
@@ -176,6 +178,16 @@ export default class Index extends Component {
176 178
     console.log(params)
177 179
     this.props.onFilter(params, () => {
178 180
       this.hideFilter()
181
+
182
+      savePoint({
183
+        event: 'search',
184
+        eventType: 'mian',
185
+        propertyName: '搜索',
186
+        data: '{}'
187
+      }).then(res => {
188
+        console.log('搜索')
189
+      })
190
+
179 191
     })
180 192
 
181 193
   }

+ 20
- 11
src/pages/project/map/index.js ファイルの表示

@@ -1,16 +1,24 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3
-
4 3
 import { connect } from '@tarojs/redux'
5 4
 import ListView from '@/components/ListView'
6 5
 import { dispatchProjectDetail } from '@/actions/project'
7 6
 import { getItemList } from '@/services/item'
8 7
 import ProjectItem from '../item'
9 8
 import { View, Image, Button } from '@tarojs/components';
9
+import { withDetail } from '@/utils/page'
10 10
 @connect(
11 11
   ({ user, card, project, city }) => ({ ...user, ...card, ...project, ...city }),
12 12
   { dispatchProjectDetail }
13 13
 )
14
+@withDetail({
15
+  track: {
16
+    event: 'map_house',
17
+    eventType: 'main',
18
+    propertyName: '地图看房',
19
+    data: '{}',
20
+  }
21
+})
14 22
 export default class Index extends Component {
15 23
   config = {
16 24
     navigationBarTitleText: '地图看房'
@@ -23,11 +31,11 @@ export default class Index extends Component {
23 31
     points: null,
24 32
     markers: [],
25 33
     isProject: 'none',
26
-    isShow:'none',
34
+    isShow: 'none',
27 35
     coordinate: null,
28 36
     buildingName: null,
29 37
     address: null,
30
-    navTop:'60%',
38
+    navTop: '60%',
31 39
   }
32 40
   componentWillMount() {
33 41
     const marker = [];
@@ -87,6 +95,7 @@ export default class Index extends Component {
87 95
         longitude: curCity.lng
88 96
       })
89 97
     }
98
+    this._$_dataReady()
90 99
     return getItemList(payload)
91 100
   }
92 101
   onViewDetail(item) {
@@ -104,11 +113,11 @@ export default class Index extends Component {
104 113
         _this.setState({
105 114
           projectDetail: val,
106 115
           isProject: 'block',
107
-          isShow:'block',
116
+          isShow: 'block',
108 117
           coordinate: val.coordinate,
109 118
           buildingName: val.buildingName,
110 119
           address: val.address,
111
-          navTop:'40%'
120
+          navTop: '40%'
112 121
         })
113 122
       }
114 123
     })
@@ -142,7 +151,7 @@ export default class Index extends Component {
142 151
   //   }
143 152
   // }
144 153
   render() {
145
-    const { markers, latitude, longitude, points, projectDetail, isProject,isShow,navTop } = this.state
154
+    const { markers, latitude, longitude, points, projectDetail, isProject, isShow, navTop } = this.state
146 155
     return (
147 156
       <View className='page'>
148 157
         <Map
@@ -161,13 +170,13 @@ export default class Index extends Component {
161 170
           <Text className="location-icon iconfont icon-daohangdizhi"></Text>
162 171
           <Text className="location-text">{curCity.id ? curCity.name : '正在定位'}</Text>
163 172
         </View>
164
-        <View className='btn-nav' style={{top:navTop}}>
165
-          <Button className='btn gotobtn'  onClick={this.openMap}  style={{ display: isShow }}>
166
-            <Image src={require('@/assets/qianw.png')} className='btn-img'  mode='widthFix'></Image>
173
+        <View className='btn-nav' style={{ top: navTop }}>
174
+          <Button className='btn gotobtn' onClick={this.openMap} style={{ display: isShow }}>
175
+            <Image src={require('@/assets/qianw.png')} className='btn-img' mode='widthFix'></Image>
167 176
             <Text>前往</Text>
168 177
           </Button>
169
-          <Button className='btn gotobtn' style={{ display: isShow }} open-type = 'share'>
170
-            <Image src={require('@/assets/zhuan.png')} className='btn-img'  mode='widthFix'></Image>
178
+          <Button className='btn gotobtn' style={{ display: isShow }} open-type='share'>
179
+            <Image src={require('@/assets/zhuan.png')} className='btn-img' mode='widthFix'></Image>
171 180
             <Text>转发</Text>
172 181
           </Button>
173 182
           <Button className='btn gotobtn' onClick={this.toHome} mode='widthFix'>

+ 14
- 10
src/pages/report/login/index.js ファイルの表示

@@ -2,6 +2,7 @@ import Taro, { Component } from '@tarojs/taro'
2 2
 import getUserPhone from '@/utils/getUserPhone'
3 3
 import { reportClient } from '@/services/report'
4 4
 import './index.scss'
5
+import { rule as ruleToast } from '@/utils/ruleToast'
5 6
 
6 7
 export default class Index extends Component {
7 8
   state = {
@@ -22,18 +23,21 @@ export default class Index extends Component {
22 23
     const { recommender, buildingId } = this.state
23 24
     getUserPhone(e, (phoneNumber) => {
24 25
       if (phoneNumber) {
25
-        const payload = {
26
-          realtyConsultant: recommender, //报备人 置业顾问
27
-          buildingId: buildingId,
28
-          phone: phoneNumber
29
-        }
30
-        reportClient(payload).then(res => {
31
-          Taro.redirectTo({
32
-            url: `/pages/card/index?id=${recommender}`
26
+        ruleToast('signup-agent')
27
+        
28
+        setTimeout(() => {
29
+          const payload = {
30
+            realtyConsultant: recommender, //报备人 置业顾问
31
+            buildingId: buildingId,
32
+            phone: phoneNumber
33
+          }
34
+          reportClient(payload).then(res => {
35
+            Taro.redirectTo({
36
+              url: `/pages/card/index?id=${recommender}`
37
+            })
33 38
           })
34
-        })
39
+        },1000)
35 40
 
36
-        
37 41
       } else {
38 42
         Taro.showToast({
39 43
           title: '授权失败,请重试',

+ 23
- 7
src/pages/shop/detail/index.js ファイルの表示

@@ -1,14 +1,22 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2 2
 import './index.scss'
3
-
4 3
 import { connect } from '@tarojs/redux'
5 4
 import * as actions from '@/actions/shop'
6 5
 import WxParse from '@/components/wxParse/wxParse'
7
-
8 6
 import { transferImage } from '@/utils/tools'
7
+import { withDetail } from '@/utils/page'
8
+import { savePoint, updatePoint } from '@/services/common'
9 9
 
10 10
 let hasClick = true
11 11
 @connect(state => state.shop, { ...actions })
12
+@withDetail({
13
+  track: {
14
+    event: 'detail',
15
+    eventType: 'mall',
16
+    propertyName: '查看商品详情',
17
+    data: '{}',
18
+  }
19
+})
12 20
 export default class Index extends Component {
13 21
   config = {
14 22
     navigationBarTitleText: '商品详情'
@@ -21,7 +29,7 @@ export default class Index extends Component {
21 29
     inventory: null
22 30
   }
23 31
 
24
-  componentWillMount () {
32
+  componentWillMount() {
25 33
     const { id, from } = this.$router.params
26 34
     this.setState({
27 35
       goodsId: id,
@@ -29,7 +37,7 @@ export default class Index extends Component {
29 37
     }, this.loadDetail)
30 38
   }
31 39
 
32
-  loadDetail () {
40
+  loadDetail() {
33 41
     const { goodsId } = this.state
34 42
     Taro.showLoading()
35 43
     this.props.dispatchGoodsDetail(goodsId).then(res => {
@@ -39,11 +47,12 @@ export default class Index extends Component {
39 47
       // })
40 48
 
41 49
       WxParse.wxParse('article', 'html', res.goodsDescription || '<p></p>', this.$scope, 0)
50
+      this._$_dataReady()
42 51
       Taro.hideLoading()
43 52
     })
44 53
   }
45 54
 
46
-  onExchange () {
55
+  onExchange() {
47 56
     const { goodsId } = this.state
48 57
     const { goodsDetail: { goodsName } } = this.props
49 58
     if (!hasClick) return
@@ -59,7 +68,14 @@ export default class Index extends Component {
59 68
       this.setState({
60 69
         inventory: res.inventory
61 70
       })
62
-
71
+      savePoint({
72
+        event: 'exchange',
73
+        eventType: 'mall',
74
+        propertyName: '兑换商品',
75
+        data: '{}'
76
+      }).then(res => {
77
+        console.log('兑换商品')
78
+      })
63 79
 
64 80
       // else{
65 81
       //   Taro.showToast({ title: '积分不足,请先获取积分' })
@@ -76,7 +92,7 @@ export default class Index extends Component {
76 92
     })
77 93
   }
78 94
 
79
-  render () {
95
+  render() {
80 96
     const { goodsDetail } = this.props
81 97
     const { inventory } = this.state
82 98
     return (

+ 28
- 11
src/pages/shop/index.js ファイルの表示

@@ -8,14 +8,14 @@ import { transferImage } from '@/utils/tools'
8 8
 import Banner from './banner'
9 9
 import ready from '@/utils/ready'
10 10
 import { ROLE_CODE } from '@/constants/user'
11
-import { queryBanners } from '@/services/common'
11
+import { queryBanners, savePoint } from '@/services/common'
12 12
 import { getGoodsBuilding, getGoodsList } from '@/services/item'
13 13
 import { connect } from '@tarojs/redux'
14 14
 import * as actions from '@/actions/shop'
15 15
 import { queryUserInfo, doUserSignin } from '@/services/user'
16
-
17 16
 // import getUserPhone from '@/utils/getUserPhone'
18 17
 import Authorize from '@/components/authorize'
18
+import { rule as ruleToast } from '@/utils/ruleToast'
19 19
 
20 20
 @connect(({ user, shop, city }) => ({ ...user, ...shop, ...city }), { ...actions })
21 21
 export default class Shop extends Component {
@@ -37,7 +37,9 @@ export default class Shop extends Component {
37 37
     goodsList: [],
38 38
     user: {},
39 39
     current: 0,
40
-    points: 0
40
+    points: 0,
41
+    cityId: (this.props.curCity || {}).id
42
+
41 43
   }
42 44
 
43 45
   componentDidShow() {
@@ -53,6 +55,16 @@ export default class Shop extends Component {
53 55
     Taro.hideLoading()
54 56
   }
55 57
 
58
+  componentWillReceiveProps(nextProps) {
59
+    if (this.state.cityId != nextProps.curCity.id) {
60
+      this.setState({
61
+        current: 0,
62
+        cityId: nextProps.curCity.id
63
+      })
64
+      console.log(nextProps.curCity.id, "nextPropsnextPropsnextPropsnextPropsnextPropsnextPropsnextProps")
65
+    }
66
+  }
67
+
56 68
   loadBannerList() {
57 69
     const payload = {
58 70
       showPosition: 'mall',
@@ -168,17 +180,22 @@ export default class Shop extends Component {
168 180
     }
169 181
 
170 182
     doUserSignin({ id }).then(res => {
171
-      Taro.showToast({
172
-        title: '签到成功'
183
+      ruleToast('checkin')
184
+      savePoint({
185
+        event: 'signin',
186
+        eventType: 'integral',
187
+        propertyName: '签到',
188
+        data: '{}'
189
+      }).then(res => {
190
+        console.log('签到')
173 191
       })
174
-      this.setState({
175
-
176
-        points: res.points
177
-
192
+      setTimeout(() => {
193
+        this.setState({
194
+          points: res.points
195
+        })
196
+        this.loadUserInfo()
178 197
       })
179 198
 
180
-      this.loadUserInfo()
181
-
182 199
       // App.zhuge.track('签到成功')
183 200
     })
184 201
   }

+ 81
- 71
src/pages/shop/integralDetail/index.js ファイルの表示

@@ -5,8 +5,17 @@ import EmptyPage from '@/components/empty-page'
5 5
 import { connect } from '@tarojs/redux'
6 6
 import * as actions from '@/actions/shop'
7 7
 import dayjs from 'dayjs'
8
+import { withDetail } from '@/utils/page'
8 9
 
9 10
 @connect(state => ({ ...state.shop, ...state.user }), { ...actions })
11
+@withDetail({
12
+  track: {
13
+    event: 'points_details',
14
+    eventType: 'integral',
15
+    propertyName: '查看积分明细',
16
+    data: '{}',
17
+  }
18
+})
10 19
 export default class Index extends Component {
11 20
 
12 21
   config = {
@@ -14,19 +23,19 @@ export default class Index extends Component {
14 23
   }
15 24
 
16 25
   state = {
17
-    choose:1,
18
-    recordAll:[],
19
-    record1:[],
20
-    record2:[],
21
-    records:[],
22
-    points:0
26
+    choose: 1,
27
+    recordAll: [],
28
+    record1: [],
29
+    record2: [],
30
+    records: [],
31
+    points: 0
23 32
   }
24 33
 
25 34
   componentWillMount() {
26 35
     const { points, from } = this.$router.params
27 36
     this.loadRecords()
28 37
     this.setState({
29
-      points:points
38
+      points: points
30 39
     })
31 40
   }
32 41
 
@@ -34,56 +43,57 @@ export default class Index extends Component {
34 43
     Taro.showLoading()
35 44
     this.props.dispatchPointsRecords().then(res => {
36 45
       this.checkChoose(res.records)
46
+      this._$_dataReady()
37 47
       Taro.hideLoading()
38 48
     })
39 49
   }
40 50
 
41
-  checkChoose(data){
42
-     const record1=[]
43
-     const record2=[]
44
-     data.forEach(function(val,index){
45
-       if(val.pointsAmount>0){
46
-         record1.push(val)
47
-       }else{
48
-          record2.push(val)
49
-       }
50
-     })
51
-     this.setState({
52
-       recordAll:data,
53
-       record1:record1,
54
-       record2:record2,
55
-       records:data
56
-     })
51
+  checkChoose(data) {
52
+    const record1 = []
53
+    const record2 = []
54
+    data.forEach(function (val, index) {
55
+      if (val.pointsAmount > 0) {
56
+        record1.push(val)
57
+      } else {
58
+        record2.push(val)
59
+      }
60
+    })
61
+    this.setState({
62
+      recordAll: data,
63
+      record1: record1,
64
+      record2: record2,
65
+      records: data
66
+    })
57 67
   }
58 68
 
59 69
   onViewDetail(item) {
60
-     this.setState({
61
-       choose:item,
62
-     })
63
-     if(item==1){
64
-       var records=this.state.recordAll
65
-       this.setState({
66
-         records:records
67
-       })
68
-     }
69
-     if(item==2){
70
-       var records=this.state.record1
71
-       this.setState({
72
-         records:records
73
-       })
74
-     }
75
-     if(item==3){
76
-       var records=this.state.record2
77
-       this.setState({
78
-         records:records
79
-       })
80
-     }
70
+    this.setState({
71
+      choose: item,
72
+    })
73
+    if (item == 1) {
74
+      var records = this.state.recordAll
75
+      this.setState({
76
+        records: records
77
+      })
78
+    }
79
+    if (item == 2) {
80
+      var records = this.state.record1
81
+      this.setState({
82
+        records: records
83
+      })
84
+    }
85
+    if (item == 3) {
86
+      var records = this.state.record2
87
+      this.setState({
88
+        records: records
89
+      })
90
+    }
81 91
     // Taro.navigateTo({
82 92
     //   url: `/pages/shop/detail/index?id=${item.targetId}&from=record`
83 93
     // })
84 94
   }
85 95
 
86
-  goRule(){
96
+  goRule() {
87 97
     Taro.navigateTo({
88 98
       url: `/pages/shop/rule/index`
89 99
     })
@@ -94,32 +104,32 @@ export default class Index extends Component {
94 104
     // const { pointsRecords: { records = [] } } = this.props,
95 105
 
96 106
     return (
97
-    <View>
98
-      <Image className="bg" src={require('@/assets/shop/bg.jpg')}/>
99
-      <View className='topBox'>
107
+      <View>
108
+        <Image className="bg" src={require('@/assets/shop/bg.jpg')} />
109
+        <View className='topBox'>
100 110
           <View className='jifen'>{points}</View>
101 111
           <View className='tip'>当前积分</View>
102 112
           <View onClick={this.goRule} className='ruleBtn'>
103
-              <Image className="lie" src={require('@/assets/shop/list.png')}/>
104
-              <View className='rule'>积分规则</View>
113
+            <Image className="lie" src={require('@/assets/shop/list.png')} />
114
+            <View className='rule'>积分规则</View>
105 115
           </View>
106
-      </View>
107
-      <View className='chooseBox'>
108
-         <Text onClick={this.onViewDetail.bind(this,1)} className={choose==1?'choose':''}>全部</Text>
109
-         <Text onClick={this.onViewDetail.bind(this,2)} className={choose==2?'choose':''}>积分收入</Text>
110
-         <Text onClick={this.onViewDetail.bind(this,3)} className={choose==3?'choose':''}>积分支出</Text>
111
-      </View>
112
-      <View className='line'></View>
113
-      <ScrollView
114
-        scrollY
115
-        scroll-with-animation
116
-        enable-back-to-top
117
-        className="list"
118
-        style={{
119
-          height: '65vh'
120
-        }}>
121
-        {
122
-          this.state.records.length === 0 ? '' : (
116
+        </View>
117
+        <View className='chooseBox'>
118
+          <Text onClick={this.onViewDetail.bind(this, 1)} className={choose == 1 ? 'choose' : ''}>全部</Text>
119
+          <Text onClick={this.onViewDetail.bind(this, 2)} className={choose == 2 ? 'choose' : ''}>积分收入</Text>
120
+          <Text onClick={this.onViewDetail.bind(this, 3)} className={choose == 3 ? 'choose' : ''}>积分支出</Text>
121
+        </View>
122
+        <View className='line'></View>
123
+        <ScrollView
124
+          scrollY
125
+          scroll-with-animation
126
+          enable-back-to-top
127
+          className="list"
128
+          style={{
129
+            height: '65vh'
130
+          }}>
131
+          {
132
+            this.state.records.length === 0 ? '' : (
123 133
               this.state.records.map(item => (
124 134
                 <View className="list-item" key={item.recId}>
125 135
                   <View className="top">
@@ -127,14 +137,14 @@ export default class Index extends Component {
127 137
                     <View className="title-time">{dayjs(item.createDate).format('YYYY-MM-DD HH:mm:ss')}</View>
128 138
                   </View>
129 139
                   <View className="bottom">
130
-                    <View className={item.pointsAmount>0?'coin1':'coin2'}>{item.pointsAmount>0?'+'+item.pointsAmount:item.pointsAmount}</View>
140
+                    <View className={item.pointsAmount > 0 ? 'coin1' : 'coin2'}>{item.pointsAmount > 0 ? '+' + item.pointsAmount : item.pointsAmount}</View>
131 141
                   </View>
132 142
                 </View>
133 143
               ))
134
-          )
135
-        }
144
+            )
145
+          }
136 146
 
137
-      </ScrollView>
147
+        </ScrollView>
138 148
       </View>
139 149
     );
140 150
   }

+ 13
- 4
src/pages/shop/rule/index.js ファイルの表示

@@ -7,10 +7,18 @@ import * as actions from '@/actions/shop'
7 7
 import { View } from '@tarojs/components';
8 8
 import { queryUserInfo, doUserSignin } from '@/services/user'
9 9
 import { ROLE_CODE } from '@/constants/user'
10
-
11
-const ruleBg = require('@/assets/rulebg.png')
10
+import { withDetail } from '@/utils/page'
11
+const ruleBg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/rulebg.png'
12 12
 
13 13
 @connect(state => ({ ...state.shop, ...state.user, ...state.city, }), { ...actions })
14
+@withDetail({
15
+  track: {
16
+    event: 'points_rule',
17
+    eventType: 'integral',
18
+    propertyName: '查看积分规则',
19
+    data: '{}',
20
+  }
21
+})
14 22
 export default class Shop extends Component {
15 23
   config = {
16 24
     navigationBarTitleText: '积分规则'
@@ -48,6 +56,7 @@ export default class Shop extends Component {
48 56
           pointRule: res.records || []
49 57
         })
50 58
       }
59
+      this._$_dataReady()
51 60
       Taro.hideLoading()
52 61
     })
53 62
   }
@@ -141,8 +150,8 @@ export default class Shop extends Component {
141 150
             pointRule.length === 0 ? '' : (
142 151
               pointRule.map(item => (
143 152
                 <View className='rule_item' key={item.ruleId}>
144
-                  <View className="item-name">{item.ruleName}<Text className="item-num">+{item.pointsAmount}</Text><Text className="jifen">积分</Text></View>
145
-                  <View className="item-rule">{item.remark}</View>
153
+                  <View className="item-name">{item.ruleName || " "}<Text className="item-num">+{item.pointsAmount || 0}</Text><Text className="jifen">积分</Text></View>
154
+                  <View className="item-rule">{item.remark || " "}</View>
146 155
                   <View className={(this.getBtnName(item.code) == '已签到' || this.getBtnName(item.code) == '已授权') ? 'yiqiandao' : "item-btn"} onClick={(this.getBtnName(item.code) == '已签到' || this.getBtnName(item.code) == '已授权') ? "" : this.handleItemClick.bind(this, item)}>{this.getBtnName(item.code)}</View>
147 156
                 </View>
148 157
               ))

+ 18
- 19
src/pages/signin/index.js ファイルの表示

@@ -4,6 +4,7 @@ import { dispatchSignin, dispatchSigninCheck } from '@/actions/activity'
4 4
 import { connect } from '@tarojs/redux'
5 5
 import './index.scss'
6 6
 import ready from '@/utils/ready'
7
+import { rule as ruleToast } from '@/utils/ruleToast'
7 8
 
8 9
 @connect(state => ({ ...state.user }), { dispatchSignin, dispatchSigninCheck })
9 10
 export default class Index extends Component {
@@ -42,27 +43,25 @@ export default class Index extends Component {
42 43
         })
43 44
         return
44 45
       }
46
+      ruleToast('signup-agent')
45 47
 
46
-      // App.zhuge.track('获取手机号', {
47
-      //   '手机号': phoneNumber
48
-      // })
49
-
50
-      this.props.dispatchSignin(1).then(res => {
51
-        // App.zhuge.track('签到成功', {
52
-        //   '活动主题': '悦见姑苏新营销之美'
53
-        // })
54
-        Taro.showToast({
55
-          title: '签到成功'
56
-        })
57
-        this.setState({
58
-          isSigned: true
59
-        })
60
-        setTimeout(() => {
61
-          Taro.switchTab({
62
-            url: `/pages/project/index`
48
+      setTimeout(() => {
49
+        this.props.dispatchSignin(1).then(res => {
50
+          Taro.showToast({
51
+            title: '签到成功'
63 52
           })
64
-        }, 3000)
65
-      })
53
+          this.setState({
54
+            isSigned: true
55
+          })
56
+          setTimeout(() => {
57
+            Taro.switchTab({
58
+              url: `/pages/project/index`
59
+            })
60
+          }, 2000)
61
+        })
62
+      }, 1000)
63
+
64
+
66 65
     })
67 66
   }
68 67
   render() {

+ 125
- 115
src/pages/toolKit/calculateResult/index.js ファイルの表示

@@ -1,7 +1,16 @@
1
-import Taro, {Component} from '@tarojs/taro';
2
-import {calcute} from '@/utils/calcute'
1
+import Taro, { Component } from '@tarojs/taro';
2
+import { calcute } from '@/utils/calcute'
3 3
 import ready from '@/utils/ready'
4
+import { withDetail } from '@/utils/page'
4 5
 import './index.scss'
6
+@withDetail({
7
+	track: {
8
+		event: 'calculator',
9
+		eventType: 'center',
10
+		propertyName: '计算房贷',
11
+		data: '{}',
12
+	}
13
+})
5 14
 
6 15
 export default class Index extends Component {
7 16
 	config = {
@@ -10,54 +19,55 @@ export default class Index extends Component {
10 19
 	state = {
11 20
 		current: 0,
12 21
 		choose: true,
13
-		lixi1:{},
14
-		lixi2:{},
15
-		shuju1:'',
16
-		shuju2:'',
17
-		allPay:0,
18
-		bili:0
22
+		lixi1: {},
23
+		lixi2: {},
24
+		shuju1: '',
25
+		shuju2: '',
26
+		allPay: 0,
27
+		bili: 0
19 28
 	}
20 29
 	componentDidMount() {
21
-      const shuju1=(Taro.getStorageSync('shuju1')).split(',')
22
-      const shuju2=(Taro.getStorageSync('shuju2')).split(',')
23
-      this.setState({
24
-				shuju1,
25
-				shuju2,
26
-      	allPay:Taro.getStorageSync('allPay'),
27
-      	bili:Taro.getStorageSync('bili')
28
-      })
29
-			 
30
-   		if(shuju1[0]>0&&shuju2[0]>0){
31
-   			var a=calcute.zuhe(1,shuju2[0],shuju1[0],shuju2[1],shuju1[1],shuju2[2],shuju1[2])
32
-   			var b=calcute.zuhe(2,shuju2[0],shuju1[0],shuju2[1],shuju1[1],shuju2[2],shuju1[2])
33
-   			this.setState({
34
-   				lixi1:a,
35
-   				lixi2:b
36
-   			})
37
-   			console.log(a)
38
-   			console.log(b)
39
-   		}else{
40
-			if(shuju1[0]>0){
41
-				var a=calcute.singleDk(1,shuju1[0],shuju1[1],shuju1[2])
42
-				var b=calcute.singleDk(2,shuju1[0],shuju1[1],shuju1[2])
30
+		const shuju1 = (Taro.getStorageSync('shuju1')).split(',')
31
+		const shuju2 = (Taro.getStorageSync('shuju2')).split(',')
32
+		this.setState({
33
+			shuju1,
34
+			shuju2,
35
+			allPay: Taro.getStorageSync('allPay'),
36
+			bili: Taro.getStorageSync('bili')
37
+		})
38
+
39
+		if (shuju1[0] > 0 && shuju2[0] > 0) {
40
+			var a = calcute.zuhe(1, shuju2[0], shuju1[0], shuju2[1], shuju1[1], shuju2[2], shuju1[2])
41
+			var b = calcute.zuhe(2, shuju2[0], shuju1[0], shuju2[1], shuju1[1], shuju2[2], shuju1[2])
42
+			this.setState({
43
+				lixi1: a,
44
+				lixi2: b
45
+			})
46
+			console.log(a)
47
+			console.log(b)
48
+		} else {
49
+			if (shuju1[0] > 0) {
50
+				var a = calcute.singleDk(1, shuju1[0], shuju1[1], shuju1[2])
51
+				var b = calcute.singleDk(2, shuju1[0], shuju1[1], shuju1[2])
43 52
 				this.setState({
44
-					lixi1:a,
45
-					lixi2:b
53
+					lixi1: a,
54
+					lixi2: b
46 55
 				})
47
-			}else{
48
-				var a=calcute.singleDk(1,shuju2[0],shuju2[1],shuju2[2])
49
-				var b=calcute.singleDk(2,shuju2[0],shuju2[1],shuju2[2])
56
+			} else {
57
+				var a = calcute.singleDk(1, shuju2[0], shuju2[1], shuju2[2])
58
+				var b = calcute.singleDk(2, shuju2[0], shuju2[1], shuju2[2])
50 59
 				this.setState({
51
-					lixi1:a,
52
-					lixi2:b
60
+					lixi1: a,
61
+					lixi2: b
53 62
 				})
54 63
 			}
55
-   			console.log(a+','+b)
56
-   		}
57
-  }
58
-	
64
+			console.log(a + ',' + b)
65
+		}
66
+		this._$_dataReady()
67
+	}
68
+
59 69
 	handleClick = (index) => (e) => {
60
-		if(index == 1) {
70
+		if (index == 1) {
61 71
 			this.setState({
62 72
 				choose: true
63 73
 			})
@@ -68,90 +78,90 @@ export default class Index extends Component {
68 78
 		}
69 79
 	}
70 80
 	render() {
71
-		return(
81
+		return (
72 82
 			<View className='page'>
73
-					<View className='btn_box'>
74
-							<View className='btn' onClick={this.handleClick(1)}>
75
-								<Text className={this.state.choose?'choose1':''}>等额本息</Text>
76
-								<Text className={this.state.choose?'choose1':''}>每月还款相同</Text>
83
+				<View className='btn_box'>
84
+					<View className='btn' onClick={this.handleClick(1)}>
85
+						<Text className={this.state.choose ? 'choose1' : ''}>等额本息</Text>
86
+						<Text className={this.state.choose ? 'choose1' : ''}>每月还款相同</Text>
87
+					</View>
88
+					<View className='btn' onClick={this.handleClick(2)}>
89
+						<Text className={this.state.choose ? '' : 'choose1'}>等额本金</Text>
90
+						<Text className={this.state.choose ? '' : 'choose1'}>还款逐月减少</Text>
91
+					</View>
92
+				</View>
93
+				<View className={this.state.choose ? 'content show' : 'content hide'}>
94
+					<Image className='bg' src={require('../../../assets/calculate/1.png')}></Image>
95
+					<View className='numberAll'>
96
+						<Text className='word1'>月供</Text>
97
+						<Text className='word2'>{parseInt(this.state.lixi1.yuegong)}<Text className='word2_1'>元</Text></Text>
98
+						<Text className='word3'>共支付利息{((this.state.lixi1.totalLixi) / 10000).toFixed(2)}万元</Text>
99
+						<View className='word4_box'>
100
+							<View className='word4_1'>
101
+								<Text className='word5'>房款总额</Text>
102
+								<Text className='word6'>{this.state.allPay}万元</Text>
77 103
 							</View>
78
-							<View className='btn' onClick={this.handleClick(2)}>
79
-								<Text className={this.state.choose?'':'choose1'}>等额本金</Text>
80
-								<Text className={this.state.choose?'':'choose1'}>还款逐月减少</Text>
104
+							<View className='word4_1'>
105
+								<Text className='word5'>{this.state.bili}</Text>
106
+								<Text className='word6'>{this.state.allPay * parseInt(this.state.bili) / 100}万元</Text>
81 107
 							</View>
82
-					</View>
83
-					<View className={this.state.choose?'content show':'content hide'}>
84
-						<Image className='bg' src={require('../../../assets/calculate/1.png')}></Image>
85
-						<View className='numberAll'>
86
-							<Text className='word1'>月供</Text>
87
-							<Text className='word2'>{parseInt(this.state.lixi1.yuegong)}<Text className='word2_1'>元</Text></Text>
88
-							<Text className='word3'>共支付利息{((this.state.lixi1.totalLixi)/10000).toFixed(2)}万元</Text>
89
-							<View className='word4_box'>
90
-									<View className='word4_1'>
91
-										<Text className='word5'>房款总额</Text>
92
-										<Text className='word6'>{this.state.allPay}万元</Text>
93
-									</View>
94
-									<View className='word4_1'>
95
-										<Text className='word5'>{this.state.bili}</Text>
96
-										<Text className='word6'>{this.state.allPay*parseInt(this.state.bili)/100}万元</Text>
97
-									</View>
98
-									<View className='word4_1'>
99
-										<Text className='word5'>贷款总额</Text>
100
-										<Text className='word6'>{this.state.allPay-this.state.allPay*parseInt(this.state.bili)/100}万元</Text>
101
-									</View>
108
+							<View className='word4_1'>
109
+								<Text className='word5'>贷款总额</Text>
110
+								<Text className='word6'>{this.state.allPay - this.state.allPay * parseInt(this.state.bili) / 100}万元</Text>
102 111
 							</View>
103 112
 						</View>
104 113
 					</View>
105
-					<View className={this.state.choose?'content hide':'content show'}>
106
-						<Image className='bg' src={require('../../../assets/calculate/2.png')}></Image>
107
-						<View className='numberAll'>
108
-							<Text className='word1'>月供</Text>
109
-							<Text className='word2'>{parseInt(this.state.lixi2.yuegong)}<Text className='word2_1'>元</Text></Text>
110
-							<Text className='word3'>共支付利息{((this.state.lixi2.totalLixi)/10000).toFixed(2)}万元,之后每月递减{(parseFloat(this.state.lixi2.yuegongdijian)).toFixed(2)}元</Text>
111
-							<View className='word4_box'>
112
-									<View className='word4_1'>
113
-										<Text className='word5'>房款总额</Text>
114
-										<Text className='word6'>{this.state.allPay}万元</Text>
115
-									</View>
116
-									<View className='word4_1'>
117
-										<Text className='word5'>{this.state.bili}</Text>
118
-										<Text className='word6'>{this.state.allPay*parseInt(this.state.bili)/100}万元</Text>
119
-									</View>
120
-									<View className='word4_1'>
121
-										<Text className='word5'>贷款总额</Text>
122
-										<Text className='word6'>{this.state.allPay-this.state.allPay*parseInt(this.state.bili)/100}万元</Text>
123
-									</View>
114
+				</View>
115
+				<View className={this.state.choose ? 'content hide' : 'content show'}>
116
+					<Image className='bg' src={require('../../../assets/calculate/2.png')}></Image>
117
+					<View className='numberAll'>
118
+						<Text className='word1'>月供</Text>
119
+						<Text className='word2'>{parseInt(this.state.lixi2.yuegong)}<Text className='word2_1'>元</Text></Text>
120
+						<Text className='word3'>共支付利息{((this.state.lixi2.totalLixi) / 10000).toFixed(2)}万元,之后每月递减{(parseFloat(this.state.lixi2.yuegongdijian)).toFixed(2)}元</Text>
121
+						<View className='word4_box'>
122
+							<View className='word4_1'>
123
+								<Text className='word5'>房款总额</Text>
124
+								<Text className='word6'>{this.state.allPay}万元</Text>
125
+							</View>
126
+							<View className='word4_1'>
127
+								<Text className='word5'>{this.state.bili}</Text>
128
+								<Text className='word6'>{this.state.allPay * parseInt(this.state.bili) / 100}万元</Text>
129
+							</View>
130
+							<View className='word4_1'>
131
+								<Text className='word5'>贷款总额</Text>
132
+								<Text className='word6'>{this.state.allPay - this.state.allPay * parseInt(this.state.bili) / 100}万元</Text>
124 133
 							</View>
125 134
 						</View>
126 135
 					</View>
127
-					<View className='list_box2'></View>
128
-					<View className='list_box1'>
129
-							<View><Text className='word1'>公积金贷款</Text><Text className='word1'>{this.state.shuju1[0]}万元</Text></View>
130
-							<View>
131
-							<Text className='word2'>
132
-									<Text className='word1'>贷款年限:</Text>
133
-									<Text className='word1'>{this.state.shuju1[1]}年</Text>
134
-							</Text>
135
-							<Text className='word2'>
136
-									<Text className='word1'>贷款年利率:</Text>
137
-									<Text className='word1'>{((this.state.shuju1[2])*100).toFixed(2)}%</Text>
138
-							</Text>
139
-							</View>
136
+				</View>
137
+				<View className='list_box2'></View>
138
+				<View className='list_box1'>
139
+					<View><Text className='word1'>公积金贷款</Text><Text className='word1'>{this.state.shuju1[0]}万元</Text></View>
140
+					<View>
141
+						<Text className='word2'>
142
+							<Text className='word1'>贷款年限:</Text>
143
+							<Text className='word1'>{this.state.shuju1[1]}年</Text>
144
+						</Text>
145
+						<Text className='word2'>
146
+							<Text className='word1'>贷款年利率:</Text>
147
+							<Text className='word1'>{((this.state.shuju1[2]) * 100).toFixed(2)}%</Text>
148
+						</Text>
140 149
 					</View>
141
-					<View className='list_box2'></View>
142
-					<View className={this.state.shuju2[0]>0?'list_box1 show':'list_box1 hide'}>
143
-							<View><Text className='word1'>商业贷款</Text><Text className='word1'>{this.state.shuju2[0]}万元</Text></View>
144
-							<View>
145
-							<Text className='word2'>
146
-									<Text className='word1'>贷款年限:</Text>
147
-									<Text className='word1'>{this.state.shuju2[1]}年</Text>
148
-							</Text>
149
-							<Text className='word2'>
150
-									<Text className='word1'>贷款年利率:</Text>
151
-									<Text className='word1'>{((this.state.shuju2[2])*100).toFixed(2)}%</Text>
152
-							</Text>
153
-							</View>
150
+				</View>
151
+				<View className='list_box2'></View>
152
+				<View className={this.state.shuju2[0] > 0 ? 'list_box1 show' : 'list_box1 hide'}>
153
+					<View><Text className='word1'>商业贷款</Text><Text className='word1'>{this.state.shuju2[0]}万元</Text></View>
154
+					<View>
155
+						<Text className='word2'>
156
+							<Text className='word1'>贷款年限:</Text>
157
+							<Text className='word1'>{this.state.shuju2[1]}年</Text>
158
+						</Text>
159
+						<Text className='word2'>
160
+							<Text className='word1'>贷款年利率:</Text>
161
+							<Text className='word1'>{((this.state.shuju2[2]) * 100).toFixed(2)}%</Text>
162
+						</Text>
154 163
 					</View>
164
+				</View>
155 165
 			</View>
156 166
 		);
157 167
 	}

+ 1
- 1
src/pages/toolKit/index.js ファイルの表示

@@ -25,7 +25,7 @@ export default class Index extends Component {
25 25
   componentWillMount() {
26 26
     savePoint({
27 27
       event: 'calculator',
28
-      eventType: 'main',
28
+      eventType: 'center',
29 29
       propertyName: '房贷计算器',
30 30
       data:'{}'
31 31
     }).then(res => {

+ 7
- 1
src/services/user.js ファイルの表示

@@ -8,7 +8,8 @@ import {
8 8
   API_QUERY_DOCUMENTVERIFY,
9 9
   API_QUERY_DOCUMENTVERIFY_list,
10 10
   API_QUERY_TADRAINGE,
11
-  API_TACUSTOMIMG
11
+  API_TACUSTOMIMG,
12
+  API_POINTS_RULE
12 13
 } from '@/constants/api'
13 14
 
14 15
 /**
@@ -73,4 +74,9 @@ export const getHFiveDetail = payload => fetch({ url:`${API_QUERY_TADRAINGE}/${p
73 74
  * @param {*} payload
74 75
  */
75 76
 export const getIndexShare = payload => fetch({ url:API_TACUSTOMIMG, payload  })
77
+/**
78
+ * 获取积分规则
79
+ * @param {*} payload
80
+ */
81
+export const getPointsRule = payload => fetch({ url:API_POINTS_RULE, payload  })
76 82
 

+ 7
- 6
src/utils/page.js ファイルの表示

@@ -8,7 +8,7 @@ function isFunction(fn) {
8 8
 }
9 9
 
10 10
 export function withDetail(opts = {}) {
11
-  return function (OrigComp) {  
11
+  return function (OrigComp) {
12 12
     class WrapperComponent extends OrigComp {
13 13
       // 数据详情加载
14 14
       // _$_dataReady 被透传到父组件,  父组件加载完数据之后需要调用 this._$_dataReady()
@@ -27,7 +27,7 @@ export function withDetail(opts = {}) {
27 27
 
28 28
         // 执行埋点
29 29
         this._$_dataLoadPromise.then(this._track.bind(this))
30
-  
30
+
31 31
         if (super.componentWillMount) {
32 32
           super.componentWillMount();
33 33
         }
@@ -57,7 +57,8 @@ export function withDetail(opts = {}) {
57 57
         }
58 58
       }
59 59
 
60
-      async _track () {
60
+      async _track() {
61
+    
61 62
         // 埋点
62 63
         let trackPayload = opts.track || {}
63 64
 
@@ -66,10 +67,10 @@ export function withDetail(opts = {}) {
66 67
             ...trackPayload,
67 68
             ...this._$_track(),
68 69
           }
69
-          const { recordId } = await savePoint(trackPayload)
70
-
71
-          this._$_trackOverFn = () => updatePoint(recordId)
72 70
         }
71
+        const { recordId } = await savePoint(trackPayload)
72
+
73
+        this._$_trackOverFn = () => updatePoint(recordId)
73 74
       }
74 75
     }
75 76
 

+ 35
- 0
src/utils/ruleToast.js ファイルの表示

@@ -0,0 +1,35 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+import { getPointsRule } from '@/services/user'
3
+
4
+/**
5
+ * 积分提示
6
+ * @param {*} code
7
+ */
8
+export function rule(code) {
9
+
10
+    return new Promise((resolve, reject) => {
11
+        getPointsRule().then(res => {
12
+            const rule = (res.records || []).filter(item => item.code == code)[0]
13
+            switch (code) {
14
+                case 'checkin':
15
+                    return rule.pointsAmount > 0 ? Taro.showToast({ title: `签到成功,获取${rule.pointsAmount}积分`, icon: 'none' }) : Taro.showToast({ title: '签到成功!' })
16
+                // case 'share-poster':
17
+                //     return rule.pointsAmount > 0 ? Taro.showToast({ title: `签到成功,获取${rule.pointsAmount}积分`, icon: 'none' }) : Taro.showToast({ title: '签到成功!', icon: 'none' })
18
+                case 'recommend-customer':
19
+                    return rule.pointsAmount > 0 ? Taro.showToast({ title: `后台审核通过后您将获得${rule.pointsAmount}积分`, icon: 'none' }) : Taro.showToast({ title: '提交成功' })
20
+                case 'signup-agent':
21
+                    return rule.pointsAmount > 0 ? Taro.showToast({ title: `授权成功,获取${rule.pointsAmount}积分`, icon: 'none' }) : Taro.showToast({ title: '授权成功!' })
22
+                case 'document_verify':
23
+                    return rule.pointsAmount > 0 ? Taro.showToast({ title: `后台审核通过后您将获得${rule.pointsAmount}积分`, icon: 'none' }) : Taro.showToast({ title: '提交成功!' })
24
+                case 'activity_checkin':
25
+                    return rule.pointsAmount > 0 ? Taro.showToast({ title: `签到成功,获取${rule.pointsAmount}积分`, icon: 'none' }) : Taro.showToast({ title: '签到成功!' })
26
+                default:
27
+                    return
28
+            }
29
+        }).catch(err => {
30
+            console.error(err)
31
+            reject(err.message || err)
32
+        })
33
+    })
34
+
35
+}

+ 18
- 11
src/utils/track.js ファイルの表示

@@ -4,13 +4,13 @@ import { savePoint, updatePoint } from '@/services/common'
4 4
 const pathEventTypeMap = {
5 5
   // '' : 'agent',  // 暂时不需要
6 6
   // '' : 'info',  // 暂时不需要
7
-  'pages/activity/detail/index' : { type: 'activity', desc: '活动' },
8
-  'pages/activity/detail/assistance' : { type: 'activity', desc: '活动' },
9
-  'pages/activity/detail/assemble' : { type: 'activity', desc: '活动' },
10
-  'pages/project/detail/index' : { type: 'building', desc: '项目' },
11
-  'pages/card/index' : { type: 'card', desc: '名片' },
12
-  'pages/project/index' : { type: 'main', desc: '首页' },
13
-  'pages/news/detail/index' : { type: 'news', desc: '资讯' },
7
+  'pages/activity/detail/index': { type: 'activity', desc: '活动' },
8
+  'pages/activity/detail/assistance': { type: 'activity', desc: '活动' },
9
+  'pages/activity/detail/assemble': { type: 'activity', desc: '活动' },
10
+  'pages/project/detail/index': { type: 'building', desc: '项目' },
11
+  'pages/card/index': { type: 'card', desc: '名片' },
12
+  'pages/project/index': { type: 'main', desc: '首页' },
13
+  'pages/news/detail/index': { type: 'news', desc: '资讯' },
14 14
   'pages/project/h5Page': { type: 'h5', desc: 'H5' },
15 15
 }
16 16
 
@@ -21,7 +21,7 @@ const pathEventTypeMap = {
21 21
 export async function trackUserSource(router) {
22 22
   const { path, query, scene } = router || {}
23 23
 
24
-  const pageInfo = pathEventTypeMap['path'] || { type: '', desc: '其他' }
24
+  const pageInfo = pathEventTypeMap[path] || { type: '', desc: '其他' }
25 25
 
26 26
   const trackPayload = {
27 27
     event: 'start',
@@ -32,14 +32,21 @@ export async function trackUserSource(router) {
32 32
     sceneId: scene,
33 33
     sharePersonId: (query || {}).recommender,
34 34
   }
35
+  console.log(trackPayload, "trackPayloadtrackPayloadtrackPayload")
36
+  console.log(trackPayload.sceneId, "sceneIdsceneIdsceneIdsceneIdsceneId")
37
+  console.log(trackPayload.eventType, "eventTypeeventTypeeventTypeeventTypeeventType")
35 38
 
36 39
   try {
40
+    const sceneList = [1005, 1006, 1053, 1042, 1007, 1008, 1011, 1012, 1013, 1045, 1046, 1047, 1048, 1058, 1067, 1000]
41
+    if (sceneList.indexOf(trackPayload.sceneId) != -1) {
37 42
 
38
-    const { recordId } = await savePoint(trackPayload)
39
-    return function () { updatePoint(recordId); }
43
+      const { recordId } = await savePoint(trackPayload)
44
+      return function () { updatePoint(recordId); }
45
+
46
+    }
40 47
 
41 48
   } catch (e) {
42 49
     console.error('进入小程序埋点出错:', e);
43
-    return function(){}
50
+    return function () { }
44 51
   }
45 52
 }