xujing 5 年前
父节点
当前提交
11fa8c510d

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

@@ -202,9 +202,13 @@ class App extends Component {
202 202
   initData() {
203 203
     console.info('router1', this.$router)
204 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 213
     // queryCityList().then(payload => {
210 214
     //   store.dispatch({ type: CITY_LIST, payload })
@@ -214,7 +218,7 @@ class App extends Component {
214 218
       // 获取router参数
215 219
       this.getRouterParams().then(router => {
216 220
         Taro.setStorageSync('router', router)
217
-        console.info('router2:', router)
221
+        console.info('router2:', JSON.stringify(router))
218 222
         console.info('-----------')
219 223
         const { query: payload } = router
220 224
 
@@ -238,13 +242,13 @@ class App extends Component {
238 242
             Taro.removeStorageSync('clinchPageIndex')
239 243
             // Taro.removeStorageSync('extendContent')
240 244
             Taro.setStorageSync('extendContent', [])
245
+            // Taro.setStorageSync('recommender', payload.recommender)
246
+            // Taro.setStorageSync('consultantId', payload.consultant)
241 247
             // 获取分享人
242 248
             this._mounted = true
243 249
           }
244
-
245 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,7 +304,8 @@ class App extends Component {
300 304
             targetId: id,
301 305
             ...left,
302 306
           })
303
-
307
+          Taro.setStorageSync('recommender', router.query.recommender)
308
+          Taro.setStorageSync('consultantId', router.query.consultant)
304 309
           resolve(router)
305 310
         })
306 311
       } else {

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

@@ -191,8 +191,9 @@ export default class HouseList extends Component {
191 191
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ""
192 192
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
193 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 197
       getCardDetail(consultant).then(res => {
197 198
         this.setState({
198 199
           consultData: res,

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

@@ -123,8 +123,9 @@ export default class livePage extends Component {
123 123
     let { qrcodeParams, queryInfo } = this.state
124 124
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ''
125 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 129
       getCardDetail(consultant).then(res => {
129 130
         this.setState({
130 131
           consultData: res,
@@ -234,7 +235,7 @@ export default class livePage extends Component {
234 235
     this.setState({ showShareMenu: false })
235 236
     const id = this.$router.params.id || this.state.liveDetail.liveActivityId
236 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 239
     const consultantId1 = this.$router.params.consultantId || qrcodeParams.consultantId || ''
239 240
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : consultantId1
240 241
     const shareData = shareContents && shareContents.length ? shareContents[0] : { shareContentTitle: '精彩直播', shareContentImg: null };

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

@@ -251,7 +251,7 @@ export default class NewsDetail extends Component {
251 251
     const consultant = this.$router.params.consultant || qrcodeParams.consultant || Taro.getStorageSync('consultantId') || ''
252 252
     const consultantId = this.$router.params.consultantId || qrcodeParams.consultantId || ""
253 253
     const recommender = this.$router.params.recommender || qrcodeParams.recommender || Taro.getStorageSync('recommender') || ''
254
-    const { dispatchProjectDetail } = this.props
254
+    const { dispatchProjectDetail, userInfo = {} } = this.props
255 255
     Taro.showLoading()
256 256
     console.log(newsId, "newsIdnewsIdnewsIdnewsIdnewsId")
257 257
     queryNewsDetail(newsId, queryInfo, { ['x-consultant']: consultant, ['x-recommender']: recommender }).then(res => {
@@ -289,12 +289,10 @@ export default class NewsDetail extends Component {
289 289
           })
290 290
         }
291 291
       })
292
-
293 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 296
       getCardDetail(consultant).then(res => {
299 297
         this.setState({
300 298
           consultData: res,

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

@@ -254,7 +254,7 @@ export default class Index extends Component {
254 254
       this.loadHelpGroupList()
255 255
 
256 256
       addItemUv(id)
257
-      const { qrcodeParams } = this.state
257
+      const { sceneParams = {} } = this.state
258 258
       // 埋点
259 259
       const consultant = this.$router.params.consultant || sceneParams.consultant || Taro.getStorageSync('consultantId') || ''
260 260
       // const consultant = this.$router.params.consultant || qrcodeParams.consultant
@@ -275,8 +275,9 @@ export default class Index extends Component {
275 275
       //   })
276 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 281
         getCardDetail(consultant).then(res => {
281 282
           this.setState({
282 283
             consultData: res,