xujing 5 年之前
父節點
當前提交
11fa8c510d

+ 12
- 7
src/app.js 查看文件

202
   initData() {
202
   initData() {
203
     console.info('router1', this.$router)
203
     console.info('router1', this.$router)
204
     console.info('ready status1', ready)
204
     console.info('ready status1', ready)
205
-    // 清空全局置业顾问Id
206
-    Taro.removeStorageSync('consultantId')
205
+    const enterOptions = wx.getEnterOptionsSync()
206
+    console.log(enterOptions, "enterOptionsenterOptionsenterOptionsenterOptionsenterOptions")
207
 
207
 
208
+    if (Object.keys(enterOptions.query).indexOf('recommender') > -1) {
209
+      Taro.setStorageSync('recommender', enterOptions.query.recommender)
210
+      Taro.setStorageSync('consultantId', enterOptions.query.consultant)
211
+    }
208
     // 获取城市列表
212
     // 获取城市列表
209
     // queryCityList().then(payload => {
213
     // queryCityList().then(payload => {
210
     //   store.dispatch({ type: CITY_LIST, payload })
214
     //   store.dispatch({ type: CITY_LIST, payload })
214
       // 获取router参数
218
       // 获取router参数
215
       this.getRouterParams().then(router => {
219
       this.getRouterParams().then(router => {
216
         Taro.setStorageSync('router', router)
220
         Taro.setStorageSync('router', router)
217
-        console.info('router2:', router)
221
+        console.info('router2:', JSON.stringify(router))
218
         console.info('-----------')
222
         console.info('-----------')
219
         const { query: payload } = router
223
         const { query: payload } = router
220
 
224
 
238
             Taro.removeStorageSync('clinchPageIndex')
242
             Taro.removeStorageSync('clinchPageIndex')
239
             // Taro.removeStorageSync('extendContent')
243
             // Taro.removeStorageSync('extendContent')
240
             Taro.setStorageSync('extendContent', [])
244
             Taro.setStorageSync('extendContent', [])
245
+            // Taro.setStorageSync('recommender', payload.recommender)
246
+            // Taro.setStorageSync('consultantId', payload.consultant)
241
             // 获取分享人
247
             // 获取分享人
242
             this._mounted = true
248
             this._mounted = true
243
           }
249
           }
244
-
245
           console.log(payload, "payloadpayloadpayloadpayloadpayloadpayloadpayload啦啦啦啦啦")
250
           console.log(payload, "payloadpayloadpayloadpayloadpayloadpayloadpayload啦啦啦啦啦")
246
-          Taro.setStorageSync('recommender', payload.recommender)
247
-          Taro.setStorageSync('consultantId', payload.consultant)
251
+
248
 
252
 
249
 
253
 
250
           // 获取未读消息
254
           // 获取未读消息
300
             targetId: id,
304
             targetId: id,
301
             ...left,
305
             ...left,
302
           })
306
           })
303
-
307
+          Taro.setStorageSync('recommender', router.query.recommender)
308
+          Taro.setStorageSync('consultantId', router.query.consultant)
304
           resolve(router)
309
           resolve(router)
305
         })
310
         })
306
       } else {
311
       } else {

+ 3
- 2
src/onlineSelling/pages/houseList/index.js 查看文件

191
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ""
191
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ""
192
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
192
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
193
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
193
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
194
-
195
-    if (consultant) {
194
+    const { userInfo: { person: { personId } } } = this.props
195
+    const notSelf = personId != consultant
196
+    if (notSelf && consultant) {
196
       getCardDetail(consultant).then(res => {
197
       getCardDetail(consultant).then(res => {
197
         this.setState({
198
         this.setState({
198
           consultData: res,
199
           consultData: res,

+ 4
- 3
src/onlineSelling/pages/live/index.js 查看文件

123
     let { qrcodeParams, queryInfo } = this.state
123
     let { qrcodeParams, queryInfo } = this.state
124
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ''
124
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ''
125
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || Taro.getStorageSync('recommender') || ''
125
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || Taro.getStorageSync('recommender') || ''
126
-
127
-    if (consultant) {
126
+    const { userInfo: { person: { personId } } } = this.props
127
+    const notSelf = personId != consultant
128
+    if (notSelf && consultant) {
128
       getCardDetail(consultant).then(res => {
129
       getCardDetail(consultant).then(res => {
129
         this.setState({
130
         this.setState({
130
           consultData: res,
131
           consultData: res,
234
     this.setState({ showShareMenu: false })
235
     this.setState({ showShareMenu: false })
235
     const id = this.$router.params.id || this.state.liveDetail.liveActivityId
236
     const id = this.$router.params.id || this.state.liveDetail.liveActivityId
236
     const { userInfo: { person: { personId, personType, userId } } } = this.props
237
     const { userInfo: { person: { personId, personType, userId } } } = this.props
237
-    const { liveDetail: { shareContents, buildingId },qrcodeParams } = this.state
238
+    const { liveDetail: { shareContents, buildingId }, qrcodeParams } = this.state
238
     const consultantId1 = this.$router.params.consultantId || qrcodeParams.consultantId || ''
239
     const consultantId1 = this.$router.params.consultantId || qrcodeParams.consultantId || ''
239
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : consultantId1
240
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : consultantId1
240
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: '精彩直播', shareContentImg: null };
241
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: '精彩直播', shareContentImg: null };

+ 3
- 5
src/pages/news/detail/index.js 查看文件

251
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ''
251
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ''
252
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
252
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
253
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || Taro.getStorageSync('recommender') || ''
253
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || Taro.getStorageSync('recommender') || ''
254
-    const { dispatchProjectDetail } = this.props
254
+    const { dispatchProjectDetail, userInfo = {} } = this.props
255
     Taro.showLoading()
255
     Taro.showLoading()
256
     console.log(newsId, "newsIdnewsIdnewsIdnewsIdnewsId")
256
     console.log(newsId, "newsIdnewsIdnewsIdnewsIdnewsId")
257
     queryNewsDetail(newsId, queryInfo, { ['x-consultant']: consultant, ['x-recommender']: recommender }).then(res => {
257
     queryNewsDetail(newsId, queryInfo, { ['x-consultant']: consultant, ['x-recommender']: recommender }).then(res => {
289
           })
289
           })
290
         }
290
         }
291
       })
291
       })
292
-
293
       WxParse.wxParse('article', 'html', res.newsDetail, this.$scope, 0)
292
       WxParse.wxParse('article', 'html', res.newsDetail, this.$scope, 0)
294
-
295
     })
293
     })
296
-
297
-    if (consultant) {
294
+    const notSelf = userInfo.person.personId != consultant
295
+    if (notSelf && consultant) {
298
       getCardDetail(consultant).then(res => {
296
       getCardDetail(consultant).then(res => {
299
         this.setState({
297
         this.setState({
300
           consultData: res,
298
           consultData: res,

+ 4
- 3
src/pages/project/detail/index.js 查看文件

254
       this.loadHelpGroupList()
254
       this.loadHelpGroupList()
255
 
255
 
256
       addItemUv(id)
256
       addItemUv(id)
257
-      const { qrcodeParams } = this.state
257
+      const { sceneParams = {} } = this.state
258
       // 埋点
258
       // 埋点
259
       const consultant = this.$router.params.consultant || sceneParams.consultant || Taro.getStorageSync('consultantId') || ''
259
       const consultant = this.$router.params.consultant || sceneParams.consultant || Taro.getStorageSync('consultantId') || ''
260
       // const consultant = this.$router.params.consultant || qrcodeParams.consultant
260
       // const consultant = this.$router.params.consultant || qrcodeParams.consultant
275
       //   })
275
       //   })
276
       //   console.log('项目详情')
276
       //   console.log('项目详情')
277
       // })
277
       // })
278
-
279
-      if (consultant) {
278
+      const { userInfo: { person: { personId } } } = this.props
279
+      const notSelf = personId != consultant
280
+      if (notSelf && consultant) {
280
         getCardDetail(consultant).then(res => {
281
         getCardDetail(consultant).then(res => {
281
           this.setState({
282
           this.setState({
282
             consultData: res,
283
             consultData: res,