Browse Source

sharepersonid

xujing 5 years ago
parent
commit
f07276cd56

+ 1
- 1
config/prod.js View File

@@ -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.4_2019-12-182140'
12
+    Version:'V3.5.4_2019-12-191441'
13 13
   },
14 14
   weapp: {},
15 15
   h5: {}

+ 1
- 1
project.config.json View File

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

BIN
src/assets/mine/share.png View File


+ 18
- 11
src/pages/activity/detail/assistance.js View File

@@ -257,6 +257,10 @@ export default class Detail extends Component {
257 257
     const { userInfo } = this.props
258 258
 
259 259
     Taro.showLoading()
260
+    const router = Taro.getStorageSync('router')
261
+    const consultant = this.$router.params.consultant || router.query.consultant
262
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
263
+    const recommender = this.$router.params.recommender || router.query.recommender || ""
260 264
     getHelpDetail(id, initiateId).then(res => {
261 265
       this.stopTicker()
262 266
 
@@ -297,14 +301,15 @@ export default class Detail extends Component {
297 301
         eventType: 'help',
298 302
         propertyName: '助力详情',
299 303
         buildingId: res.helpActivity.buildingId,
304
+        consultantId: consultantId,
305
+        sharePersonId: recommender,
300 306
         targetId: id,
301 307
         data: '{"initiateId":"' + initiateId + '"}'
302 308
       }).then((res) => {
303 309
         this.setState({ pointRecordId: res.recordId })
304 310
       })
305 311
     })
306
-    const router = Taro.getStorageSync('router')
307
-    const consultant = this.$router.params.consultant || router.query.consultant
312
+
308 313
     if (consultant) {
309 314
       this.reportClientFn()
310 315
       getCardDetail(consultant).then(res => {
@@ -339,14 +344,16 @@ export default class Detail extends Component {
339 344
 
340 345
   currentPageAndParams() {
341 346
     const { id, initiateId } = this.state
342
-    const { userInfo: { person: { personId, personType } } } = this.props
347
+    const { userInfo: { person: { personId, personType, userId } } } = this.props
343 348
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
349
+    const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
344 350
 
345 351
     let queryParams = [
346 352
       `id=${id}`,
347 353
       `from=help_share`,
348 354
       `recommender=${personId}`,
349 355
       `consultant=${consultant}`,
356
+      `&consultantId=${consultantId}`,
350 357
     ]
351 358
     if (initiateId) {
352 359
       queryParams.push(`initiateId=${initiateId}`)
@@ -396,7 +403,7 @@ export default class Detail extends Component {
396 403
   handleHelp = () => {
397 404
     const { userInfo: { miniApp: { tpls } } } = this.props
398 405
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
399
-    const that=this
406
+    const that = this
400 407
     wx.requestSubscribeMessage({
401 408
       tmplIds: [tplId],
402 409
       success(res) {
@@ -412,7 +419,7 @@ export default class Detail extends Component {
412 419
         that.setState({ submitting: true }, () => {
413 420
           const { detail, initiateDetail } = that.state
414 421
           const person = that.props.userInfo.person
415
-    
422
+
416 423
           giveFriendHelp({
417 424
             buildingId: detail.buildingId,
418 425
             helpActivityId: detail.helpActivityId,
@@ -425,7 +432,7 @@ export default class Detail extends Component {
425 432
             Taro.hideLoading()
426 433
             const helpList = that.state.helpList || []
427 434
             helpList.push(res.helpRecord)
428
-    
435
+
429 436
             that.setState({
430 437
               submitting: false,
431 438
               helpList,
@@ -433,16 +440,16 @@ export default class Detail extends Component {
433 440
               initiateId: res.helpInitiateRecord.helpRecordInitiateId,
434 441
               helpState: res.helpInitiateRecord.status === undefined ? HelpInProcess : res.helpInitiateRecord.status,
435 442
             })
436
-    
443
+
437 444
             Taro.showToast({
438 445
               title: '助力成功',
439 446
               icon: 'success'
440 447
             })
441
-    
448
+
442 449
           }).catch(err => {
443 450
             console.log('err:', err)
444 451
             Taro.hideLoading()
445
-    
452
+
446 453
             Taro.showToast({
447 454
               title: '失败: ' + err.message,
448 455
               icon: 'none'
@@ -455,7 +462,7 @@ export default class Detail extends Component {
455 462
         })
456 463
       }
457 464
     })
458
-   
465
+
459 466
   }
460 467
 
461 468
   // 发起我的助力
@@ -501,7 +508,7 @@ export default class Detail extends Component {
501 508
   askForHelp = () => {
502 509
     const { userInfo: { miniApp: { tpls } } } = this.props
503 510
     const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HELP && x.isSubscribe == true))[0].tplId
504
-    const that=this
511
+    const that = this
505 512
     wx.requestSubscribeMessage({
506 513
       tmplIds: [tplId],
507 514
       success(res) {

+ 14
- 9
src/pages/activity/detail/index.js View File

@@ -81,6 +81,10 @@ export default class Detail extends Component {
81 81
   loadDetail() {
82 82
     const { id } = this.state
83 83
     Taro.showLoading()
84
+    const router = Taro.getStorageSync('router')
85
+    const consultant = this.$router.params.consultant || router.query.consultant
86
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
87
+    const recommender = this.$router.params.recommender || router.query.recommender || ""
84 88
     queryActivityDetail(id).then(res => {
85 89
       Taro.hideLoading()
86 90
       const { isSaved, isSign } = res
@@ -107,6 +111,8 @@ export default class Detail extends Component {
107 111
         propertyName: '活动详情',
108 112
         buildingId: res.buildingId,
109 113
         targetId: res.dynamicId,
114
+        consultantId: consultantId,
115
+        sharePersonId: recommender,
110 116
         data: '{}'
111 117
       }).then(res1 => {
112 118
         this.setState({
@@ -115,8 +121,7 @@ export default class Detail extends Component {
115 121
         console.log('活动详情')
116 122
       })
117 123
     })
118
-    const router = Taro.getStorageSync('router')
119
-    const consultant = this.$router.params.consultant || router.query.consultant
124
+
120 125
     if (consultant) {
121 126
       this.reportClientFn()
122 127
       getCardDetail(consultant).then(res => {
@@ -149,7 +154,7 @@ export default class Detail extends Component {
149 154
     }
150 155
   }
151 156
   onShareAppMessage = () => {
152
-    const { detail: { shareContents, title, dynamicId, url } } = this.state
157
+    const { detail: { shareContents, title, dynamicId, imgUrl } } = this.state
153 158
     const { userInfo: { person: { personId, personType, userId } } } = this.props
154 159
     console.log(dynamicId, "path")
155 160
     console.log(personId, "personId")
@@ -170,11 +175,10 @@ export default class Detail extends Component {
170 175
     })
171 176
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
172 177
     return {
173
-      title: shareContents[0].shareContentTitle,
174
-      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}`,//分享地址
175
-      imageUrl: shareContents[0].shareContentImg
178
+      title: shareContents[0].shareContentTitle || title,
179
+      path: `/pages/activity/detail/index?id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`,//分享地址
180
+      imageUrl: shareContents[0].shareContentImg || imgUrl
176 181
     }
177
-
178 182
   }
179 183
 
180 184
   handleSignup() {
@@ -246,13 +250,14 @@ export default class Detail extends Component {
246 250
       }
247 251
 
248 252
       const { userInfo: { person, miniApp } } = this.props
249
-      const { avatarurl, nickname, personId, personType, phone, tel } = person
253
+      const { avatarurl, nickname, personId, personType, phone, tel, userId } = person
250 254
       const { detail: { dynamicId, posters, createDate } } = this.state
251 255
       const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
256
+      const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
252 257
       const phoneNum = phone || tel
253 258
 
254 259
       const payload = {
255
-        "scene": `id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}`,
260
+        "scene": `id=${dynamicId}&from=dynamic_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}&consultantId=${consultantId}`,
256 261
         "page": 'pages/activity/detail/index',
257 262
       }
258 263
 

+ 16
- 10
src/pages/news/detail/index.js View File

@@ -41,8 +41,9 @@ export default class NewsDetail extends Component {
41 41
     consultShow: false  // 置业顾问悬浮框显示隐藏
42 42
   }
43 43
 
44
-  componentWillMount() {
45
-    console.log(this.$router,"this.$router")
44
+  componentWillMount(routerProps) {
45
+    console.log(routerProps,"routerProps")
46
+
46 47
     console.info('ready status3', ready)
47 48
     ready.queue(() => {
48 49
       const router = Taro.getStorageSync('router')
@@ -156,15 +157,18 @@ export default class NewsDetail extends Component {
156 157
     console.log(`/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}`, "path")
157 158
 
158 159
     return {
159
-      title: shareContents[0].shareContentTitle,
160
-      path: `/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}`,//分享地址
161
-      imageUrl: shareContents[0].shareContentImg
160
+      title: shareContents[0].shareContentTitle || newsName,
161
+      path: `/pages/news/detail/index?id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}`,//分享地址
162
+      imageUrl: shareContents[0].shareContentImg || newsImg
162 163
     }
163
-
164 164
   }
165 165
 
166 166
   loadDetail() {
167 167
     const { newsId } = this.state
168
+    const router = Taro.getStorageSync('router')
169
+    const consultant = this.$router.params.consultant || router.query.consultant
170
+    const consultantId = this.$router.params.consultantId || router.query.consultantId || ""
171
+    const recommender = this.$router.params.recommender || router.query.recommender || ""
168 172
     Taro.showLoading()
169 173
     queryNewsDetail(newsId).then(res => {
170 174
       Taro.hideLoading()
@@ -189,6 +193,8 @@ export default class NewsDetail extends Component {
189 193
         propertyName: '资讯详情',
190 194
         buildingId: res.buildingId,
191 195
         targetId: res.newsId,
196
+        consultantId: consultantId,
197
+        sharePersonId: recommender,
192 198
         data: '{}'
193 199
       }).then(res => {
194 200
         this.setState({
@@ -197,8 +203,7 @@ export default class NewsDetail extends Component {
197 203
         console.info('资讯详情')
198 204
       })
199 205
     })
200
-    const router = Taro.getStorageSync('router')
201
-    const consultant = this.$router.params.consultant || router.query.consultant
206
+
202 207
     if (consultant) {
203 208
       this.reportClientFn()
204 209
       getCardDetail(consultant).then(res => {
@@ -217,12 +222,13 @@ export default class NewsDetail extends Component {
217 222
         return
218 223
       }
219 224
       const { userInfo: { person, miniApp } } = this.props
220
-      const { avatarurl, nickname, personId, personType, phone, tel } = person
225
+      const { avatarurl, nickname, personId, personType, phone, tel, userId } = person
221 226
       const { newsId, detail: { posters, newsName, createDate } } = this.state
222 227
       const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : ""
228
+      const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : ""
223 229
       const phoneNum = phone || tel
224 230
       const payload = {
225
-        "scene": `id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}`,
231
+        "scene": `id=${newsId}&from=news_share&recommender=${personId}&consultant=${consultant}&phoneNum=${phoneNum}&consultantId=${consultantId}`,
226 232
         "page": 'pages/news/detail/index',
227 233
       }
228 234
       const _avatarurl = getDownloadURL(avatarurl, 'avatar');

+ 1
- 1
src/pages/person/menus.js View File

@@ -17,7 +17,7 @@ const icons = {
17 17
   consultant: require('@assets/mine/consultant.png'),
18 18
   customerAnalysis: require('@assets/mine/customerAnalysis.png'),
19 19
   fenxi: require('@assets/mine/fenxi.png'),
20
-  share: require('@assets/mine/accessrecord.png'),
20
+  share: require('@assets/mine/share.png'),
21 21
 }
22 22
 
23 23
 const DRIFT = ROLE_CODE['DRIFT']