xujing 5 years ago
parent
commit
45d2ebaca1

+ 4
- 4
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    // HOST: '"https://dev.fangdeal.cn"', //测试
7
-    // WSS_HOST: '"wss://dev.fangdeal.cn"',
6
+    HOST: '"https://dev.fangdeal.cn"', //测试
7
+    WSS_HOST: '"wss://dev.fangdeal.cn"',
8
     // HOST: '"http://192.168.0.195:8080"', //魏超
8
     // HOST: '"http://192.168.0.195:8080"', //魏超
9
     // WSS_HOST: '"ws://192.168.0.195:8080"',
9
     // WSS_HOST: '"ws://192.168.0.195:8080"',
10
     // HOST: '"http://192.168.0.144:8080"', //顾邵勇
10
     // HOST: '"http://192.168.0.144:8080"', //顾邵勇
11
     // WSS_HOST: '"ws://192.168.0.144:8080"',
11
     // WSS_HOST: '"ws://192.168.0.144:8080"',
12
-    HOST: '"http://192.168.0.190:8080"', //傅行帆
13
-    WSS_HOST: '"ws://192.168.0.190:8080"',
12
+    // HOST: '"http://192.168.0.190:8080"', //傅行帆
13
+    // WSS_HOST: '"ws://192.168.0.190:8080"',
14
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
14
     OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
15
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
15
     OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
16
     Version: "V3.5.28"
16
     Version: "V3.5.28"

+ 2
- 1
src/pages/activity/detail/assemble.js View File

358
         this.setState({ pointRecordId: res.recordId })
358
         this.setState({ pointRecordId: res.recordId })
359
       })
359
       })
360
     })
360
     })
361
+    const notSelf = userInfo.person.personId != consultant
361
 
362
 
362
-    if (consultant) {
363
+    if (notSelf && consultant) {
363
       getCardDetail(consultant).then(res => {
364
       getCardDetail(consultant).then(res => {
364
         this.setState({
365
         this.setState({
365
           consultData: res,
366
           consultData: res,

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

359
         this.setState({ pointRecordId: res.recordId })
359
         this.setState({ pointRecordId: res.recordId })
360
       })
360
       })
361
     })
361
     })
362
-
363
-    if (consultant) {
362
+    const notSelf = userInfo.person.personId != consultant
363
+    if (notSelf && consultant) {
364
       getCardDetail(consultant).then(res => {
364
       getCardDetail(consultant).then(res => {
365
         this.setState({
365
         this.setState({
366
           consultData: res,
366
           consultData: res,

+ 3
- 2
src/pages/activity/detail/index.js View File

154
       })
154
       })
155
       WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
155
       WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
156
     })
156
     })
157
-
158
-    if (consultant) {
157
+    const { userInfo = {} } = this.props
158
+    const notSelf = userInfo.person.personId != consultant
159
+    if (notSelf && consultant) {
159
       getCardDetail(consultant).then(res => {
160
       getCardDetail(consultant).then(res => {
160
         this.setState({
161
         this.setState({
161
           consultData: res,
162
           consultData: res,

+ 8
- 3
src/pages/person/index.js View File

13
 import login from '@/utils/login'
13
 import login from '@/utils/login'
14
 export const version = Version
14
 export const version = Version
15
 import { rule as ruleToast } from '@/utils/ruleToast'
15
 import { rule as ruleToast } from '@/utils/ruleToast'
16
+import { Loading } from '@/components/Loading'
16
 
17
 
17
 @connect(({ user, city }) => ({ user, city }), { ...actions })
18
 @connect(({ user, city }) => ({ user, city }), { ...actions })
18
 
19
 
30
     menus: [],
31
     menus: [],
31
     roleName: '普通用户',
32
     roleName: '普通用户',
32
     pageVisible: false,
33
     pageVisible: false,
34
+    loading: true,
33
   }
35
   }
34
 
36
 
35
   componentDidShow() {
37
   componentDidShow() {
42
   loadUserInfo() {
44
   loadUserInfo() {
43
     queryUserInfo().then(users => {
45
     queryUserInfo().then(users => {
44
       const [roleSetting, roleName] = this.getRoleName(users.personType)
46
       const [roleSetting, roleName] = this.getRoleName(users.personType)
45
-
46
       this.setState({
47
       this.setState({
47
         users,
48
         users,
48
         phone: users.phone,
49
         phone: users.phone,
50
+        loading: false,
49
         pageVisible: !users.phone && !users.tel,
51
         pageVisible: !users.phone && !users.tel,
50
         menus: menus.map(group => group.filter(x => x.userTypes.indexOf(users.personType) > -1)),
52
         menus: menus.map(group => group.filter(x => x.userTypes.indexOf(users.personType) > -1)),
51
         roleName,
53
         roleName,
303
   }
305
   }
304
 
306
 
305
   render() {
307
   render() {
306
-    const { phone, tel } = this.state.users
307
-    const { pageVisible } = this.state
308
+    // const { phone, tel } = this.state.users
309
+    const { loading, pageVisible } = this.state
310
+    if (loading) {
311
+      return <View style="margin: 80px auto;"><Loading color="#BB9C79" size={100} /></View>
312
+    }
308
     return (
313
     return (
309
       <View className='wrap'>
314
       <View className='wrap'>
310
         {/* {(phone || tel) && this.renderDetail()} */}
315
         {/* {(phone || tel) && this.renderDetail()} */}

+ 4
- 4
src/pages/project/detail/index.js View File

193
       projectDetail: { buildingId },
193
       projectDetail: { buildingId },
194
       userInfo: { person: { personId, personType, userId } }
194
       userInfo: { person: { personId, personType, userId } }
195
     } = this.props
195
     } = this.props
196
-    const { sceneParams } = this.state
196
+    const sceneParams = this._$_scene || {}
197
     const consultant1 = this.$router.params.consultant || sceneParams.consultant || Taro.getStorageSync('consultantId') || ''
197
     const consultant1 = this.$router.params.consultant || sceneParams.consultant || Taro.getStorageSync('consultantId') || ''
198
     const consultantId1 = this.$router.params.consultantId || sceneParams.consultantId || ''
198
     const consultantId1 = this.$router.params.consultantId || sceneParams.consultantId || ''
199
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : consultant1
199
     const consultant = personType == ROLE_CODE['CONSULTANT'] ? personId : consultant1
200
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : consultantId1
200
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : consultantId1
201
-
202
     const queryParams = [
201
     const queryParams = [
203
       `id=${buildingId}`,
202
       `id=${buildingId}`,
204
       'from=building_share',
203
       'from=building_share',
218
       projectDetail: { shareContents, buildingName, buildingId, poster = '' },
217
       projectDetail: { shareContents, buildingName, buildingId, poster = '' },
219
       userInfo: { person: { personId, personType, userId } }
218
       userInfo: { person: { personId, personType, userId } }
220
     } = this.props
219
     } = this.props
221
-    const { sceneParams } = this.state
220
+    const sceneParams = this._$_scene || {}
222
     const consultantId1 = this.$router.params.consultantId || sceneParams.consultantId || ''
221
     const consultantId1 = this.$router.params.consultantId || sceneParams.consultantId || ''
223
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : consultantId1
222
     const consultantId = personType == ROLE_CODE['CONSULTANT'] ? userId : consultantId1
224
     // 分享埋点
223
     // 分享埋点
257
       addItemUv(id)
256
       addItemUv(id)
258
       const { qrcodeParams } = this.state
257
       const { qrcodeParams } = this.state
259
       // 埋点
258
       // 埋点
260
-      const consultant = Taro.getStorageSync('consultantId') || ''
259
+      const consultant = this.$router.params.consultant || sceneParams.consultant || Taro.getStorageSync('consultantId') || ''
261
       // const consultant = this.$router.params.consultant || qrcodeParams.consultant
260
       // const consultant = this.$router.params.consultant || qrcodeParams.consultant
262
       // const consultantId = this.$router.params.consultantId ||  qrcodeParams.consultantId || ""
261
       // const consultantId = this.$router.params.consultantId ||  qrcodeParams.consultantId || ""
263
       // const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
262
       // const recommender = this.$router.params.recommender || qrcodeParams.recommender || ""
351
       title: '正在加载数据',
350
       title: '正在加载数据',
352
       icon: 'loading'
351
       icon: 'loading'
353
     })
352
     })
353
+    console.log('项目详情项目详情项目详情项目详情项目详情项目详情项目详情')
354
     dispatchProjectDetail(buildingId, queryInfo, { header: { ['x-consultant']: consultant, ['x-recommender']: recommender } }).then(res => {
354
     dispatchProjectDetail(buildingId, queryInfo, { header: { ['x-consultant']: consultant, ['x-recommender']: recommender } }).then(res => {
355
       const connectId = (res.extendContent || [])[0] ? (res.extendContent || [])[0].contentId : null
355
       const connectId = (res.extendContent || [])[0] ? (res.extendContent || [])[0].contentId : null
356
       const extendContentList = Taro.getStorageSync('extendContent') || []
356
       const extendContentList = Taro.getStorageSync('extendContent') || []

+ 13
- 6
src/pages/project/index.js View File

17
 import { transferImage } from '@/utils/tools'
17
 import { transferImage } from '@/utils/tools'
18
 import Notice from '@/components/Notice'
18
 import Notice from '@/components/Notice'
19
 import NavIcons from './NavIcons'
19
 import NavIcons from './NavIcons'
20
+import { ROLE_CODE } from '@/constants/user'
20
 import { share as shareSavePoint } from '@/utils/shareSavePoint'
21
 import { share as shareSavePoint } from '@/utils/shareSavePoint'
21
 
22
 
22
 @connect(
23
 @connect(
62
       this.loadData({ curCity: city })
63
       this.loadData({ curCity: city })
63
 
64
 
64
       this.getIndexShareInfo()
65
       this.getIndexShareInfo()
65
-      
66
-      const consultant = this.$router.params.consultant || Taro.getStorageSync('consultantId') || ''
67
-      const recommender = this.$router.params.recommender || Taro.getStorageSync('recommender') || ''
68
-      reportIndexCustomer({ ['x-consultant']: consultant, ['x-recommender']: recommender }).then(res => {
69
-
70
-      })
71
 
66
 
72
       savePoint({
67
       savePoint({
73
         event: 'index',
68
         event: 'index',
136
     this.loadList(props)
131
     this.loadList(props)
137
     this.loadExtContents(props)
132
     this.loadExtContents(props)
138
     this.getIndexIcons()
133
     this.getIndexIcons()
134
+    console.log('首页分享绑定客户!!!!!!!!!')
135
+    this.report()
136
+  }
137
+  report() {
138
+    const consultant = this.$router.params.consultant || Taro.getStorageSync('consultantId') || ''
139
+    const recommender = this.$router.params.recommender || Taro.getStorageSync('recommender') || ''
140
+    console.log(consultant, "consultantconsultant")
141
+    console.log(recommender, "recommenderrecommenderrecommenderrecommender")
142
+    const loadOptions = wx.getLaunchOptionsSync()
143
+    reportIndexCustomer({ channelId: '', qrCodeId: '', scene: loadOptions.scene, showToast: false }, { ['x-consultant']: consultant, ['x-recommender']: recommender })
144
+
139
   }
145
   }
140
 
146
 
141
   loadExtContents(props) {
147
   loadExtContents(props) {
247
     }, 'main').then(res => {
253
     }, 'main').then(res => {
248
       console.log('首页分享')
254
       console.log('首页分享')
249
     })
255
     })
256
+    console.log('Indexrouter--->', `/pages/project/index?from=share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}&id=index`)
250
     return {
257
     return {
251
       title: this.state.imgDocument || ` 精准获客—上${this.props.userInfo.miniApp.name || '橙蕉'},买好房`,//分享内容
258
       title: this.state.imgDocument || ` 精准获客—上${this.props.userInfo.miniApp.name || '橙蕉'},买好房`,//分享内容
252
       path: `/pages/project/index?from=share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}&id=index`,//分享地址
259
       path: `/pages/project/index?from=share&recommender=${personId}&consultant=${consultant}&consultantId=${consultantId}&id=index`,//分享地址

+ 1
- 1
src/services/project.js View File

27
  * 首页绑定私客
27
  * 首页绑定私客
28
  * @param {*} payload
28
  * @param {*} payload
29
  */
29
  */
30
-export const reportIndexCustomer = (header) => fetch({ url: API_INDEX_CUSTOMER, header, method: 'POST' })
30
+export const reportIndexCustomer = (payload, header) => fetch({ url: API_INDEX_CUSTOMER, payload, header, method: 'POST' })
31
 /**
31
 /**
32
  * 获取房源列表
32
  * 获取房源列表
33
  * @param {*} payload
33
  * @param {*} payload