Bladeren bron

sharesavepoint

xujing 5 jaren geleden
bovenliggende
commit
8a829e4acc

+ 4
- 4
config/dev.js Bestand weergeven

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

+ 3
- 0
src/constants/api.js Bestand weergeven

@@ -92,6 +92,9 @@ export const API_NEWS_LIKE = resolvePath('news/like')
92 92
 export const API_CARDS_SHARE = resolvePath('consultant/share')
93 93
 export const API_ITEMS_SHARE = resolvePath('project/share')
94 94
 export const API_ACTIVITY_SHARE = resolvePath('activity/share')
95
+export const API_HELP_SHARE = resolvePath('help/share')
96
+export const API_GROUP_SHARE = resolvePath('group/share')
97
+export const API_HFIVE_SHARE = resolvePath('h5/share')
95 98
 export const API_NEWS_SHARE = resolvePath('news/share')
96 99
 
97 100
 export const API_ACTIVITY_FAVOR = resolvePath('activity/save')

+ 34
- 11
src/pages/activity/detail/assemble.js Bestand weergeven

@@ -26,6 +26,7 @@ import { ROLE_CODE } from '@/constants/user'
26 26
 import Consultant from '@/components/consultant'
27 27
 import * as noticeType from '@/constants/common.js'
28 28
 import { report as reportCustomer } from '@/utils/customer'
29
+import { share as shareSavePoint } from '@/utils/shareSavePoint'
29 30
 
30 31
 const waitImg = require('@/assets/helpgroup/wait.png')
31 32
 const memberImg = require('@/assets/helpgroup/group/member.png')
@@ -204,15 +205,26 @@ export default class Detail extends Component {
204 205
       posterVisible: !posterVisible,
205 206
       actionSheetVisible: showActionSheet,
206 207
     })
207
-    savePoint({
208
+    const { detail: { groupActivityId } } = this.state
209
+
210
+
211
+    shareSavePoint({
208 212
       event: 'poster',
209 213
       eventType: 'activity',
210
-      targetType:'group',
214
+      targetType: 'group',
211 215
       propertyName: '生成拼团活动详情海报',
216
+      targetId: groupActivityId,
212 217
       data: '{}'
213
-    }).then(res => {
214
-      console.log('生成拼团活动详情海报')
215
-    })
218
+    }, 'group')
219
+    // savePoint({
220
+    //   event: 'poster',
221
+    //   eventType: 'activity',
222
+    //   targetType:'group',
223
+    //   propertyName: '生成拼团活动详情海报',
224
+    //   data: '{}'
225
+    // }).then(res => {
226
+    //   console.log('生成拼团活动详情海报')
227
+    // })
216 228
   }
217 229
 
218 230
   compActState = (startDate, endDate) => {
@@ -308,7 +320,7 @@ export default class Detail extends Component {
308 320
       savePoint({
309 321
         event: 'detail',
310 322
         eventType: 'activity',
311
-        targetType:'group',
323
+        targetType: 'group',
312 324
         propertyName: '拼团详情',
313 325
         buildingId: res.taShareActivity.buildingId,
314 326
         consultantId: consultantId,
@@ -376,16 +388,27 @@ export default class Detail extends Component {
376 388
     const { userInfo: { person: { personId, personType, userId } } } = this.props
377 389
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
378 390
 
379
-    savePoint({
391
+    shareSavePoint({
380 392
       event: 'share',
381 393
       eventType: 'activity',
382
-      targetType:'group',
394
+      targetType: 'group',
383 395
       propertyName: '拼团详情分享',
384 396
       consultantId: consultantId,
385 397
       sharePersonId: personId,
386 398
       targetId: groupActivityId,
387 399
       data: '{}'
388
-    })
400
+    }, 'group')
401
+
402
+    // savePoint({
403
+    //   event: 'share',
404
+    //   eventType: 'activity',
405
+    //   targetType: 'group',
406
+    //   propertyName: '拼团详情分享',
407
+    //   consultantId: consultantId,
408
+    //   sharePersonId: personId,
409
+    //   targetId: groupActivityId,
410
+    //   data: '{}'
411
+    // })
389 412
     const shareData = shares && shares.length ? shares[0] : { shareContentTitle: activityName, shareContentImg: mainImg };
390 413
 
391 414
     // if (!shares || !shares.length) {
@@ -447,7 +470,7 @@ export default class Detail extends Component {
447 470
                   savePoint({
448 471
                     event: 'enlist',
449 472
                     eventType: 'activity',
450
-                    targetType:'group',
473
+                    targetType: 'group',
451 474
                     propertyName: '拼团活动报名',
452 475
                     data: '{}'
453 476
 
@@ -521,7 +544,7 @@ export default class Detail extends Component {
521 544
                   savePoint({
522 545
                     event: 'enlist',
523 546
                     eventType: 'activity',
524
-                    targetType:'group',
547
+                    targetType: 'group',
525 548
                     propertyName: '拼团活动报名',
526 549
                     data: '{}'
527 550
 

+ 32
- 11
src/pages/activity/detail/assistance.js Bestand weergeven

@@ -27,6 +27,7 @@ import { ROLE_CODE } from '@/constants/user'
27 27
 import Consultant from '@/components/consultant'
28 28
 import * as noticeType from '@/constants/common.js'
29 29
 import { report as reportCustomer } from '@/utils/customer'
30
+import { share as shareSavePoint } from '@/utils/shareSavePoint'
30 31
 
31 32
 const successImg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/help/success2.png'
32 33
 const failImg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/help/help%20failure.png'
@@ -207,15 +208,25 @@ export default class Detail extends Component {
207 208
       posterVisible: !posterVisible,
208 209
       actionSheetVisible: showActionSheet,
209 210
     })
210
-    savePoint({
211
+    const { id } = this.state
212
+
213
+    shareSavePoint({
211 214
       event: 'poster',
212 215
       eventType: 'activity',
213
-      targetType:'help',
216
+      targetType: 'help',
214 217
       propertyName: '生成助力活动详情海报',
218
+      targetId: id,
215 219
       data: '{}'
216
-    }).then(res => {
217
-      console.log('生成助力活动详情海报')
218
-    })
220
+    }, 'help')
221
+    // savePoint({
222
+    //   event: 'poster',
223
+    //   eventType: 'activity',
224
+    //   targetType:'help',
225
+    //   propertyName: '生成助力活动详情海报',
226
+    //   data: '{}'
227
+    // }).then(res => {
228
+    //   console.log('生成助力活动详情海报')
229
+    // })
219 230
   }
220 231
 
221 232
   compActState = (startDate, endDate) => {
@@ -312,7 +323,7 @@ export default class Detail extends Component {
312 323
       savePoint({
313 324
         event: 'detail',
314 325
         eventType: 'activity',
315
-        targetType:'help',
326
+        targetType: 'help',
316 327
         propertyName: '助力详情',
317 328
         buildingId: res.helpActivity.buildingId,
318 329
         consultantId: consultantId,
@@ -382,17 +393,27 @@ export default class Detail extends Component {
382 393
     const currentPage = `/${this.currentPageAndParams(res.from).join('?')}`
383 394
     const { userInfo: { person: { personId, personType, userId } } } = this.props
384 395
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
385
-
386
-    savePoint({
396
+    shareSavePoint({
387 397
       event: 'share',
388 398
       eventType: 'activity',
389
-      targetType:'help',
399
+      targetType: 'help',
390 400
       propertyName: '助力详情分享',
391 401
       consultantId: consultantId,
392 402
       sharePersonId: personId,
393 403
       targetId: id,
394 404
       data: '{}'
395
-    })
405
+    }, 'help')
406
+
407
+    // savePoint({
408
+    //   event: 'share',
409
+    //   eventType: 'activity',
410
+    //   targetType: 'help',
411
+    //   propertyName: '助力详情分享',
412
+    //   consultantId: consultantId,
413
+    //   sharePersonId: personId,
414
+    //   targetId: id,
415
+    //   data: '{}'
416
+    // })
396 417
     const shareData = shares && shares.length ? shares[0] : { shareContentTitle: title, shareContentImg: img };
397 418
 
398 419
     // if (!shares || !shares.length) {
@@ -502,7 +523,7 @@ export default class Detail extends Component {
502 523
           savePoint({
503 524
             event: 'enlist',
504 525
             eventType: 'activity',
505
-            targetType:'help',
526
+            targetType: 'help',
506 527
             propertyName: '助力活动报名',
507 528
             data: '{}'
508 529
           }).then(res => {

+ 34
- 12
src/pages/activity/detail/index.js Bestand weergeven

@@ -15,7 +15,7 @@ import { ROLE_CODE } from '@/constants/user'
15 15
 import Consultant from '@/components/consultant'
16 16
 import { rule as ruleToast } from '@/utils/ruleToast'
17 17
 import {
18
-  addActivityShareNum,
18
+  // addActivityShareNum,
19 19
   signupActivity,
20 20
   favorActivity,
21 21
   cancelFavorActivity,
@@ -28,6 +28,7 @@ import {
28 28
 } from '@/services/common'
29 29
 import { connect } from '@tarojs/redux'
30 30
 import { report as reportCustomer } from '@/utils/customer'
31
+import { share as shareSavePoint } from '@/utils/shareSavePoint'
31 32
 
32 33
 @connect(state => state.user)
33 34
 export default class Detail extends Component {
@@ -162,11 +163,9 @@ export default class Detail extends Component {
162 163
     const { userInfo: { person: { personId, personType, userId } } } = this.props
163 164
     console.log(dynamicId, "path")
164 165
     console.log(personId, "personId")
165
-
166
-    addActivityShareNum(dynamicId)
167
-
168 166
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
169
-    savePoint({
167
+
168
+    shareSavePoint({
170 169
       event: 'share',
171 170
       eventType: 'activity',
172 171
       targetType: 'dynamic',
@@ -175,9 +174,22 @@ export default class Detail extends Component {
175 174
       sharePersonId: personId,
176 175
       targetId: dynamicId,
177 176
       data: '{}'
178
-    }).then(res => {
179
-      console.log('活动详情分享')
180
-    })
177
+    }, 'activity')
178
+
179
+    // addActivityShareNum(dynamicId)
180
+
181
+    // savePoint({
182
+    //   event: 'share',
183
+    //   eventType: 'activity',
184
+    //   targetType: 'dynamic',
185
+    //   propertyName: '活动详情分享',
186
+    //   consultantId: consultantId,
187
+    //   sharePersonId: personId,
188
+    //   targetId: dynamicId,
189
+    //   data: '{}'
190
+    // }).then(res => {
191
+    //   console.log('活动详情分享')
192
+    // })
181 193
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
182 194
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: title, shareContentImg: imgUrl };
183 195
     console.log(`/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`)
@@ -312,15 +324,25 @@ export default class Detail extends Component {
312 324
         posterVisible: !!flag
313 325
       })
314 326
     }
315
-    savePoint({
327
+    const { detail: { dynamicId } } = this.state
328
+    shareSavePoint({
316 329
       event: 'poster',
317 330
       eventType: 'activity',
318 331
       targetType: 'dynamic',
319 332
       propertyName: '生成活动详情海报',
333
+      targetId: dynamicId,
320 334
       data: '{}'
321
-    }).then(res => {
322
-      console.log('生成活动详情海报')
323
-    })
335
+    }, 'activity')
336
+
337
+    // savePoint({
338
+    //   event: 'poster',
339
+    //   eventType: 'activity',
340
+    //   targetType: 'dynamic',
341
+    //   propertyName: '生成活动详情海报',
342
+    //   data: '{}'
343
+    // }).then(res => {
344
+    //   console.log('生成活动详情海报')
345
+    // })
324 346
   }
325 347
 
326 348
   handleMoreClick() {

+ 32
- 12
src/pages/card/index.js Bestand weergeven

@@ -9,11 +9,15 @@ import ready from '@/utils/ready'
9 9
 import AchievePhone from '@/components/achievePhone'
10 10
 import { sceneInShare } from '@/utils/tools'
11 11
 import { ROLE_CODE } from '@/constants/user'
12
-import { addCardUv, addCardShareNum, favorCard, cancelFavorCard } from '@/services/card'
12
+import {
13
+  addCardUv,
14
+  //  addCardShareNum,
15
+  favorCard, cancelFavorCard
16
+} from '@/services/card'
13 17
 import { getMiniQrcode, savePoint, updatePoint } from '@/services/common'
14 18
 import { connect } from '@tarojs/redux'
15 19
 import { reportClient } from '@/services/report'
16
-
20
+import { share as shareSavePoint } from '@/utils/shareSavePoint'
17 21
 import * as actions from '@/actions/card'
18 22
 import { dispatchProjectDetail } from '@/actions/project'
19 23
 
@@ -195,15 +199,22 @@ export default class Index extends Component {
195 199
     // const isReport = btnId === 'reportBtn'
196 200
 
197 201
     // 分享埋点
198
-    addCardShareNum(id)
199
-    savePoint({
202
+    shareSavePoint({
200 203
       event: 'share',
201 204
       eventType: 'card',
202 205
       propertyName: '置业顾问卡片分享',
206
+      targetId: id,
203 207
       data: '{}'
204
-    }).then(res => {
205
-      console.log('置业顾问卡片分享')
206
-    })
208
+    }, 'consultant')
209
+    // addCardShareNum(id)
210
+    // savePoint({
211
+    //   event: 'share',
212
+    //   eventType: 'card',
213
+    //   propertyName: '置业顾问卡片分享',
214
+    //   data: '{}'
215
+    // }).then(res => {
216
+    //   console.log('置业顾问卡片分享')
217
+    // })
207 218
 
208 219
     return {
209 220
       title: isSelf ? `欢迎访问${name}个人主页` : `${name}邀请您成为TA的客户`,//分享内容
@@ -323,14 +334,23 @@ export default class Index extends Component {
323 334
         makePosterStatus: !!flag
324 335
       })
325 336
     }
326
-    savePoint({
337
+    const { cardInfo: { id } } = this.props
338
+    shareSavePoint({
327 339
       event: 'poster',
328 340
       eventType: 'card',
329
-      propertyName: '生成海报',
341
+      propertyName: '生成个人主页海报',
342
+      targetId: id,
330 343
       data: '{}'
331
-    }).then(res => {
332
-      console.log('生成海报')
333
-    })
344
+    }, 'consultant')
345
+
346
+    // savePoint({
347
+    //   event: 'poster',
348
+    //   eventType: 'card',
349
+    //   propertyName: '生成海报',
350
+    //   data: '{}'
351
+    // }).then(res => {
352
+    //   console.log('生成海报')
353
+    // })
334 354
   }
335 355
 
336 356
   getPhoneNumber(e) {

+ 32
- 14
src/pages/news/detail/index.js Bestand weergeven

@@ -19,11 +19,12 @@ import AchievePhone from '@/components/achievePhone'
19 19
 import {
20 20
   addNewsUv,
21 21
   favorNews,
22
-  addNewsShareNum,
22
+  // addNewsShareNum,
23 23
   queryNewsDetail,
24 24
   cancelFavorNews
25 25
 } from '@/services/news'
26 26
 import { connect } from '@tarojs/redux'
27
+import { share as shareSavePoint } from '@/utils/shareSavePoint'
27 28
 
28 29
 @connect(state => state.user)
29 30
 export default class NewsDetail extends Component {
@@ -177,8 +178,10 @@ export default class NewsDetail extends Component {
177 178
     const { userInfo: { person: { personId, personType, userId } } } = this.props
178 179
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
179 180
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
181
+    const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: newsName, shareContentImg: newsImg };
180 182
 
181
-    savePoint({
183
+    // 分享埋点
184
+    shareSavePoint({
182 185
       event: 'share',
183 186
       eventType: 'news',
184 187
       propertyName: '资讯详情分享',
@@ -186,14 +189,20 @@ export default class NewsDetail extends Component {
186 189
       sharePersonId: personId,
187 190
       targetId: newsId,
188 191
       data: '{}'
189
-    }).then(res => {
190
-      console.info('资讯详情分享')
191
-    })
192
-
193
-    const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: newsName, shareContentImg: newsImg };
194
-
195
-    // 分享埋点
196
-    addNewsShareNum(newsId)
192
+    }, 'news')
193
+
194
+    // addNewsShareNum(newsId)
195
+    // savePoint({
196
+    //   event: 'share',
197
+    //   eventType: 'news',
198
+    //   propertyName: '资讯详情分享',
199
+    //   consultantId: consultantId,
200
+    //   sharePersonId: personId,
201
+    //   targetId: newsId,
202
+    //   data: '{}'
203
+    // }).then(res => {
204
+    //   console.info('资讯详情分享')
205
+    // })
197 206
 
198 207
     const [path, params] = this.currentPageAndParams();
199 208
 
@@ -310,14 +319,23 @@ export default class NewsDetail extends Component {
310 319
         posterVisible: !!flag
311 320
       })
312 321
     }
313
-    savePoint({
322
+    const { newsId } = this.state
323
+    shareSavePoint({
314 324
       event: 'poster',
315 325
       eventType: 'news',
316 326
       propertyName: '生成资讯详情海报',
327
+      targetId: newsId,
317 328
       data: '{}'
318
-    }).then(res => {
319
-      console.info('生成资讯详情海报')
320
-    })
329
+    }, 'news')
330
+
331
+    // savePoint({
332
+    //   event: 'poster',
333
+    //   eventType: 'news',
334
+    //   propertyName: '生成资讯详情海报',
335
+    //   data: '{}'
336
+    // }).then(res => {
337
+    //   console.info('生成资讯详情海报')
338
+    // })
321 339
   }
322 340
 
323 341
   render() {

+ 34
- 12
src/pages/project/detail/index.js Bestand weergeven

@@ -9,7 +9,7 @@ import BackHomeBtn from '@/components/BackHomeBtn'
9 9
 import AchievePhone from '@/components/achievePhone'
10 10
 import {
11 11
   addItemUv,
12
-  addItemShareNum,
12
+  // addItemShareNum,
13 13
   favorProject,
14 14
   cancelFavorProject
15 15
 } from '@/services/item'
@@ -31,6 +31,7 @@ import Consultant from '@/components/consultant'
31 31
 import { report as reportCustomer } from '@/utils/customer'
32 32
 import * as noticeType from '@/constants/common.js'
33 33
 import { withDetail } from '@/utils/page'
34
+import { share as shareSavePoint } from '@/utils/shareSavePoint'
34 35
 
35 36
 const buildBg = 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/buildbg.png'
36 37
 const dotImg = require('@/assets/dot.png')
@@ -168,8 +169,7 @@ export default class Index extends Component {
168 169
     } = this.props
169 170
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
170 171
     // 分享埋点
171
-    addItemShareNum(buildingId)
172
-    savePoint({
172
+    shareSavePoint({
173 173
       event: 'share',
174 174
       eventType: 'building',
175 175
       propertyName: '项目详情分享',
@@ -177,9 +177,20 @@ export default class Index extends Component {
177 177
       sharePersonId: personId,
178 178
       targetId: buildingId,
179 179
       data: '{}'
180
-    }).then(res => {
181
-      console.log('项目详情分享')
182
-    })
180
+    }, 'project')
181
+
182
+    // addItemShareNum(buildingId)
183
+    // savePoint({
184
+    //   event: 'share',
185
+    //   eventType: 'building',
186
+    //   propertyName: '项目详情分享',
187
+    //   consultantId: consultantId,
188
+    //   sharePersonId: personId,
189
+    //   targetId: buildingId,
190
+    //   data: '{}'
191
+    // }).then(res => {
192
+    //   console.log('项目详情分享')
193
+    // })
183 194
 
184 195
     const [page, params] = this.currentPageAndParams()
185 196
 
@@ -334,7 +345,7 @@ export default class Index extends Component {
334 345
     Taro.navigateTo({ url: url })
335 346
   }
336 347
 
337
-  // 海报预览
348
+  // 查看大
338 349
   previewImage(arr) {
339 350
     // console.log('arr:' + arr)
340 351
     if (arr[0].length > 1) {
@@ -490,14 +501,25 @@ export default class Index extends Component {
490 501
         posterStatus: !!flag
491 502
       })
492 503
     }
493
-    savePoint({
504
+    // 分享埋点
505
+    const { projectDetail: { buildingId } } = this.props
506
+    shareSavePoint({
494 507
       event: 'poster',
495 508
       eventType: 'building',
496 509
       propertyName: '生成项目详情海报',
497
-      data: '{}'
498
-    }).then(res => {
499
-      console.log('生成项目详情海报')
500
-    })
510
+      data: '{}',
511
+      targetId: buildingId
512
+    }, 'project')
513
+
514
+    // addItemShareNum(buildingId)
515
+    // savePoint({
516
+    //   event: 'poster',
517
+    //   eventType: 'building',
518
+    //   propertyName: '生成项目详情海报',
519
+    //   data: '{}'
520
+    // }).then(res => {
521
+    //   console.log('生成项目详情海报')
522
+    // })
501 523
   }
502 524
 
503 525
   callPhone = () => {

+ 17
- 7
src/pages/project/h5Page.js Bestand weergeven

@@ -11,6 +11,8 @@ 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
+import { share as shareSavePoint } from '@/utils/shareSavePoint'
15
+
14 16
 const bgImg = "https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/images/helpgroup/bg.png"
15 17
 
16 18
 @connect(state => state.user, { ...actions })
@@ -60,14 +62,13 @@ export default class Index extends Component {
60 62
   onShareAppMessage = () => {
61 63
     const { pageInfo } = this.state
62 64
     const currentPage = `/${this.currentPageAndParams().join('?')}`
63
-
64
-
65 65
     const { userInfo: { person: { personId, personType, userId } } } = this.props
66
-
67 66
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
68 67
     const { h5Id } = this.state
68
+
69 69
     console.log(currentPage)
70
-    savePoint({
70
+
71
+    shareSavePoint({
71 72
       event: 'share',
72 73
       eventType: 'h5',
73 74
       propertyName: 'h5详情分享',
@@ -75,9 +76,18 @@ export default class Index extends Component {
75 76
       sharePersonId: personId,
76 77
       targetId: h5Id,
77 78
       data: '{}'
78
-    }).then(res => {
79
-      console.info('h5详情分享')
80
-    })
79
+    }, 'h5')
80
+    // savePoint({
81
+    //   event: 'share',
82
+    //   eventType: 'h5',
83
+    //   propertyName: 'h5详情分享',
84
+    //   consultantId: consultantId,
85
+    //   sharePersonId: personId,
86
+    //   targetId: h5Id,
87
+    //   data: '{}'
88
+    // }).then(res => {
89
+    //   console.info('h5详情分享')
90
+    // })
81 91
     return {
82 92
       title: pageInfo.shareTitle,
83 93
       path: currentPage,

+ 1
- 1
src/pages/project/item/index.js Bestand weergeven

@@ -38,7 +38,7 @@ export default class Index extends Component {
38 38
           </View>
39 39
 
40 40
           <View className='item__right__region row'><Text className="location-icon iconfont icon-daohangdizhi"></Text>{data.buildingArea || ''}</View>
41
-          {buildingTag.length > 0 && (
41
+          {buildingTag && buildingTag.length > 0 && (
42 42
             <View className="item__tags row">
43 43
               {buildingTag.slice(0, 3).map(tag => <View className='tag' key={tag.tagId}>{tag.tagName}</View>)}
44 44
             </View>

+ 19
- 1
src/services/activity.js Bestand weergeven

@@ -7,6 +7,9 @@ import {
7 7
   API_ACTIVITY_SAVE,
8 8
   API_ACTIVITY_UV,
9 9
   API_ACTIVITY_SHARE,
10
+  API_HELP_SHARE,
11
+  API_GROUP_SHARE,
12
+  API_HFIVE_SHARE,
10 13
   API_ACTNEW_LIST,
11 14
   API_HELP_DETAIL,
12 15
   API_HELP_CREATE,
@@ -26,10 +29,25 @@ export const addActivityUv = id => fetch({ url: `${API_ACTIVITY_UV}/${id}`, meth
26 29
 
27 30
 
28 31
 /**
29
- * 项目分享埋点
32
+ * 普通活动分享埋点
30 33
  * @param {*} id  名片id
31 34
  */
32 35
 export const addActivityShareNum = id => fetch({ url: `${API_ACTIVITY_SHARE}/${id}`, method: 'POST' })
36
+/**
37
+ * 助力分享埋点
38
+ * @param {*} id  名片id
39
+ */
40
+export const addHelpShareNum = id => fetch({ url: `${API_HELP_SHARE}/${id}`, method: 'POST' })
41
+/**
42
+ * 拼团分享埋点
43
+ * @param {*} id  名片id
44
+ */
45
+export const addGroupShareNum = id => fetch({ url: `${API_GROUP_SHARE}/${id}`, method: 'POST' })
46
+/**
47
+ * h5分享埋点
48
+ * @param {*} id  名片id
49
+ */
50
+export const addHFiveShareNum = id => fetch({ url: `${API_HFIVE_SHARE}/${id}`, method: 'POST' })
33 51
 
34 52
 /**
35 53
  * 获取活动列表

+ 49
- 0
src/utils/shareSavePoint.js Bestand weergeven

@@ -0,0 +1,49 @@
1
+import { savePoint } from '@/services/common'
2
+import { addItemShareNum } from '@/services/item'
3
+import { addActivityShareNum, addHelpShareNum, addGroupShareNum, addHFiveShareNum } from '@/services/activity'
4
+import { addCardShareNum } from '@/services/card'
5
+import { addNewsShareNum } from '@/services/news'
6
+/**
7
+ * 积分提示
8
+ * @param {*} options
9
+ * @param {*} type
10
+ */
11
+export function share(options, type) {
12
+
13
+    return new Promise((resolve, reject) => {
14
+        switch (type) {
15
+            case 'project':
16
+                addItemShareNum(options.targetId)
17
+                savePoint(options)
18
+                break;
19
+            case 'activity':
20
+                addActivityShareNum(options.targetId)
21
+                savePoint(options)
22
+                break;
23
+            case 'consultant':
24
+                addCardShareNum(options.targetId)
25
+                savePoint(options)
26
+                break;
27
+            case 'news':
28
+                addNewsShareNum(options.targetId)
29
+                savePoint(options)
30
+                break;
31
+            case 'help':
32
+                addHelpShareNum(options.targetId)
33
+                savePoint(options)
34
+                break;
35
+            case 'group':
36
+                addGroupShareNum(options.targetId)
37
+                savePoint(options)
38
+                break;
39
+            case 'h5':
40
+                addHFiveShareNum(options.targetId)
41
+                savePoint(options)
42
+                break;
43
+            default:
44
+                return
45
+        }
46
+
47
+    })
48
+
49
+}