周立森 5 years ago
parent
commit
1477b90748

+ 1
- 1
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-		// HOST: '"http://47.101.36.130:8085"',//测试
6
+    // HOST: '"http://47.101.36.130:8085"',//测试
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
8
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
9
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
9
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',

+ 1
- 1
project.config.json View File

2
 	"miniprogramRoot": "dist/",
2
 	"miniprogramRoot": "dist/",
3
 	"projectname": "mini-chengjiao",
3
 	"projectname": "mini-chengjiao",
4
 	"description": "dev环境",
4
 	"description": "dev环境",
5
-	"appid": "wxda1f84b79b3edeb3",
5
+	"appid": "wxd9ee3a9480a4e544",
6
 	"setting": {
6
 	"setting": {
7
 		"urlCheck": false,
7
 		"urlCheck": false,
8
 		"es6": false,
8
 		"es6": false,

+ 21
- 0
src/pages/activity/activity.js View File

21
 
21
 
22
   state = {
22
   state = {
23
     current: 0,
23
     current: 0,
24
+    recordId: undefined, // 埋点ID
25
+  }
26
+  
27
+  componentWillMount() {
28
+    // App.zhuge.track('查看活动列表页面')
29
+    savePoint({
30
+      event: 'list',
31
+      eventType: 'activity',
32
+      propertyName: '活动列表',
33
+      data: '{}'
34
+    }).then(res => {
35
+      this.setState({
36
+        recordId: res.recordId
37
+      })
38
+      console.log('活动列表')
39
+    })
40
+  }
41
+
42
+  componentWillUnmount() {
43
+    const { recordId } = this.state
44
+    recordId && updatePoint(recordId)
24
   }
45
   }
25
 
46
 
26
   handleClick(value) {
47
   handleClick(value) {

+ 9
- 5
src/pages/activity/detail/assemble.js View File

63
     posterVisible: false, // 海报分享
63
     posterVisible: false, // 海报分享
64
     grantPhoneVisible: false, // 授权电话
64
     grantPhoneVisible: false, // 授权电话
65
     grantAvatarVisible: false, // 授权头像
65
     grantAvatarVisible: false, // 授权头像
66
+    pointRecordId: undefined, // 埋点ID
66
   }
67
   }
67
 
68
 
68
   componentWillMount() {
69
   componentWillMount() {
76
 
77
 
77
   componentWillUnmount() {
78
   componentWillUnmount() {
78
     this.clearTicker()
79
     this.clearTicker()
80
+    this.state.pointRecordId && updatePoint(pointRecordId)
79
   }
81
   }
80
 
82
 
81
   // 初始化页面数据
83
   // 初始化页面数据
218
         buildingId: res.taShareActivity.buildingId,
220
         buildingId: res.taShareActivity.buildingId,
219
         targetId: id,
221
         targetId: id,
220
         data: '{"recordId":"' + recordId + '"}'
222
         data: '{"recordId":"' + recordId + '"}'
221
-      }).then(() => { })
223
+      }).then((res) => {
224
+        this.setState({ pointRecordId: res.recordId })
225
+      })
222
     })
226
     })
223
   }
227
   }
224
 
228
 
334
           avatarurl: person.avatarurl,
338
           avatarurl: person.avatarurl,
335
         }).then(res => {
339
         }).then(res => {
336
           this.setState({
340
           this.setState({
337
-            recordDetail: res,
338
-            recordId: res.recordId,
339
-            memberList: [],
341
+            recordDetail: res.taShareRecord,
342
+            recordId: res.taShareRecord.recordId,
343
+            memberList: res.shareChildRecordList || [],
340
             isStarter: true,
344
             isStarter: true,
341
-            groupState: GroupInProcess,
345
+            groupState: res.taShareRecord.status === undefined ? GroupInProcess : res.taShareRecord.status,
342
           }, resolve)
346
           }, resolve)
343
         }).catch(err => {
347
         }).catch(err => {
344
           console.log('err:', err)
348
           console.log('err:', err)

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

62
     grantPhoneVisible: false, // 授权电话
62
     grantPhoneVisible: false, // 授权电话
63
     grantAvatarVisible: false, // 授权头像
63
     grantAvatarVisible: false, // 授权头像
64
     handleHelpBtn: true, // 立即助力好友
64
     handleHelpBtn: true, // 立即助力好友
65
+    pointRecordId: undefined, // 埋点ID
65
   }
66
   }
66
 
67
 
67
   componentWillMount() {
68
   componentWillMount() {
75
 
76
 
76
   componentWillUnmount() {
77
   componentWillUnmount() {
77
     this.clearTicker()
78
     this.clearTicker()
79
+    this.state.pointRecordId && updatePoint(pointRecordId)
78
   }
80
   }
79
 
81
 
80
   // 初始化页面数据
82
   // 初始化页面数据
220
         buildingId: res.helpActivity.buildingId,
222
         buildingId: res.helpActivity.buildingId,
221
         targetId: id,
223
         targetId: id,
222
         data: '{"initiateId":"' + initiateId + '"}'
224
         data: '{"initiateId":"' + initiateId + '"}'
223
-      }).then(() => { })
225
+      }).then((res) => {
226
+        this.setState({ pointRecordId: res.recordId })
227
+      })
224
     })
228
     })
225
   }
229
   }
226
 
230
 
337
           avatarurl: person.avatarurl,
341
           avatarurl: person.avatarurl,
338
         }).then(res => {
342
         }).then(res => {
339
           this.setState({
343
           this.setState({
340
-            initiateDetail: res,
341
-            initiateId: res.helpRecordInitiateId,
342
-            // helpList: res.helpRecordList,  // bug #5282
343
-            helpList: [],
344
+            initiateDetail: res.helpInitiateRecord,
345
+            initiateId: res.helpInitiateRecord.helpRecordInitiateId,
346
+            helpList: res.helpRecordList,
344
             isStarter: true,
347
             isStarter: true,
345
-            helpState: HelpInProcess,
348
+            helpState: res.helpInitiateRecord.status === undefined ? HelpInProcess : res.helpInitiateRecord.status,
346
           }, resolve)
349
           }, resolve)
347
         }).catch(err => {
350
         }).catch(err => {
348
           console.log('err:', err)
351
           console.log('err:', err)

+ 29
- 28
src/pages/activity/detail/index.js View File

317
               <ScrollView
317
               <ScrollView
318
                 scrollY
318
                 scrollY
319
                 className="detail-wrap">
319
                 className="detail-wrap">
320
-              <View className="detail">
321
-                {detail.isEnlist == 0 &&
322
-                  <View className="detail-sign__num">不需要报名</View>
323
-                }
324
-                {detail.isEnlist != 0 &&
325
-                  <View className="detail-sign__num">{detail.enlisted || 0}人已报名</View>
326
-                }
327
-                <View class="detail-title">{detail.title}</View>
328
-                <View className="detail-top">
329
-                  <View className="detail-top__row">
330
-                    <Text className="row-label">活动时间:</Text>
331
-                    <Text className="row-content">{dayjs(detail.startDate).format('YYYY-MM-DD HH:mm:ss')}</Text>
332
-                  </View>
333
-                  <View className="detail-top__row">
334
-                    <Text className="row-label">活动地址:</Text>
335
-                    <Text className="row-content">{detail.address}</Text>
336
-                  </View>
337
-                  <View className="detail-top__row">
338
-                    <Text className="row-label">报名截止:</Text>
339
-                    {detail.enlistEnd &&
340
-                      <Text className="row-content">{dayjs(detail.enlistEnd).format('YYYY-MM-DD HH:mm:ss')}</Text>
320
+                <View className="detail">
321
+                  {detail.isEnlist == 0 &&
322
+                    <View className="detail-sign__num">不需要报名</View>
323
+                  }
324
+                  {detail.isEnlist != 0 &&
325
+                    <View className="detail-sign__num">{detail.enlisted || 0}人已报名</View>
326
+                  }
327
+                  <View class="detail-title">{detail.title}</View>
328
+                  <View className="detail-top">
329
+                    <View className="detail-top__row">
330
+                      <Text className="row-label">活动时间:</Text>
331
+                      <Text className="row-content">{dayjs(detail.startDate).format('YYYY-MM-DD HH:mm:ss')}</Text>
332
+                    </View>
333
+                    <View className="detail-top__row">
334
+                      <Text className="row-label">活动地址:</Text>
335
+                      <Text className="row-content">{detail.address}</Text>
336
+                    </View>
337
+                    {detail.isEnlist != 0 &&
338
+                      <View className="detail-top__row">
339
+                        <Text className="row-label">报名截止:</Text>
340
+                        {detail.enlistEnd &&
341
+                          <Text className="row-content">{dayjs(detail.enlistEnd).format('YYYY-MM-DD HH:mm:ss')}</Text>
342
+                        }
343
+                      </View>
341
                     }
344
                     }
342
-
345
+                  </View>
346
+                  <View className="detail-con">
347
+                    <View className="detail-con__title">活动详情</View>
348
+                    <import src='../../../components/wxParse/wxParse.wxml' />
349
+                    <template is='wxParse' data='{{wxParseData:article.nodes}}' />
343
                   </View>
350
                   </View>
344
                 </View>
351
                 </View>
345
-                <View className="detail-con">
346
-                  <View className="detail-con__title">活动详情</View>
347
-                  <import src='../../../components/wxParse/wxParse.wxml' />
348
-                  <template is='wxParse' data='{{wxParseData:article.nodes}}' />
349
-                </View>
350
-              </View>
351
               </ScrollView>
352
               </ScrollView>
352
 
353
 
353
               <View className="chat-entrance" onClick={this.handleMoreClick}>
354
               <View className="chat-entrance" onClick={this.handleMoreClick}>

+ 1
- 1
src/pages/activity/index.js View File

44
   
44
   
45
   componentWillUnmount() {
45
   componentWillUnmount() {
46
     const { recordId } = this.state
46
     const { recordId } = this.state
47
-    updatePoint(recordId)
47
+    recordId && updatePoint(recordId)
48
   }
48
   }
49
 
49
 
50
   loadList(pageNumber) {
50
   loadList(pageNumber) {

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

40
             {data.endDate &&
40
             {data.endDate &&
41
               <View className="time">参与截止时间:{`${dayjs(data.endDate).format('YYYY年MM月DD日 HH:mm:ss')}`}</View>
41
               <View className="time">参与截止时间:{`${dayjs(data.endDate).format('YYYY年MM月DD日 HH:mm:ss')}`}</View>
42
             }
42
             }
43
-            {!data.endDate &&
44
-              <View className="time">参与截止时间:</View>
43
+            {!data.endDate  &&
44
+              <View className="time">{data.type != 'dynamic'?'参与截止时间:':''}</View>
45
             }
45
             }
46
             <View className={data.activityStatus == 0 ? "btn jionin " : data.activityStatus == 1 ? "btn nostart" : data.activityStatus == 2 ? "btn jioned" : "btn"}>{data.activityStatus == 0 ? "立即参与" : data.activityStatus == 1 ? "未开始" : data.activityStatus == 2 ? "已结束" : "已参与"}</View>
46
             <View className={data.activityStatus == 0 ? "btn jionin " : data.activityStatus == 1 ? "btn nostart" : data.activityStatus == 2 ? "btn jioned" : "btn"}>{data.activityStatus == 0 ? "立即参与" : data.activityStatus == 1 ? "未开始" : data.activityStatus == 2 ? "已结束" : "已参与"}</View>
47
           </View>
47
           </View>

+ 3
- 0
src/pages/agent/client/index.scss View File

124
 
124
 
125
 .phone{
125
 .phone{
126
   line-height:50px;
126
   line-height:50px;
127
+  width: 480px;
128
+  @include text-ellipsis; 
129
+
127
 }
130
 }
128
 
131
 
129
 .time{
132
 .time{

+ 3
- 3
src/pages/card/index.js View File

470
 
470
 
471
                 {/* 职位 */}
471
                 {/* 职位 */}
472
                 <View className='mycard__work'>
472
                 <View className='mycard__work'>
473
-                  <View className='row mycard__work-department'>{cardInfo.department}<Text className='txt'>部门</Text></View>
474
-                  <View className='row mycard__work-position'>{cardInfo.post}<Text className='txt'>职位</Text></View>
475
-                  <View className='row mycard__work-company'>{projectDetail.buildingName}<Text className='txt'>楼盘</Text></View>
473
+                  <View className='row mycard__work-department'>{cardInfo.department || ''}<Text className='txt'>部门</Text></View>
474
+                  <View className='row mycard__work-position'>{cardInfo.post || ''}<Text className='txt'>职位</Text></View>
475
+                  <View className='row mycard__work-company'>{projectDetail.buildingName || ''}<Text className='txt'>楼盘</Text></View>
476
                 </View>
476
                 </View>
477
 
477
 
478
                 {/* 人气 */}
478
                 {/* 人气 */}

+ 10
- 14
src/pages/checkin/index.js View File

71
   }
71
   }
72
 
72
 
73
   render () {
73
   render () {
74
-    const { data, style } = this.props
75
-
76
-
74
+    const { data = { person: {}, dynamic: {} }, style } = this.props
77
 
75
 
78
     return (
76
     return (
79
       <View className="checkin" style="width:100vw;height:100vh;" >
77
       <View className="checkin" style="width:100vw;height:100vh;" >
81
         {/* <checkinsuccess></checkinsuccess> */}
79
         {/* <checkinsuccess></checkinsuccess> */}
82
         {/* <achievePhone></achievePhone> */}
80
         {/* <achievePhone></achievePhone> */}
83
         <View>
81
         <View>
84
-          <Image className="img" src={this.state.data.dynamic.imgUrl}  ></Image>
82
+          <Image className="img" src={data.dynamic.imgUrl}  ></Image>
85
         </View>
83
         </View>
86
         <View style="margin-bottom:20px"  >
84
         <View style="margin-bottom:20px"  >
87
-          <View className="text1"> <Text>{this.state.data.dynamic.title}</Text></View>
85
+          <View className="text1"> <Text>{data.dynamic.title}</Text></View>
88
         </View >
86
         </View >
89
 
87
 
90
-        {this.state.data.enlist != null && <View>
88
+        {data.enlist != null && <View>
91
           <View style="text-align: center;">
89
           <View style="text-align: center;">
92
             <Text className="line">- - - - - - - - - </Text>
90
             <Text className="line">- - - - - - - - - </Text>
93
             <Text className="text2">活动报名信息</Text>
91
             <Text className="text2">活动报名信息</Text>
97
           <View className="text3">
95
           <View className="text3">
98
             <View className='at-row'>
96
             <View className='at-row'>
99
               <View className='at-col at-col-3'>用户名:</View>
97
               <View className='at-col at-col-3'>用户名:</View>
100
-              <View className='at-col at-col-9'>{this.state.data.person.name || this.state.data.person.nickname}</View>
98
+              <View className='at-col at-col-9'>{data.person.name || data.person.nickname}</View>
101
             </View>
99
             </View>
102
             <View className='at-row'>
100
             <View className='at-row'>
103
               <View className='at-col at-col-3'>手机号:</View>
101
               <View className='at-col at-col-3'>手机号:</View>
104
-              <View className='at-col at-col-9'>{this.state.data.person.tel || this.state.data.person.phone}</View>
102
+              <View className='at-col at-col-9'>{data.person.tel || data.person.phone}</View>
105
             </View>
103
             </View>
106
             <View className='at-row'>
104
             <View className='at-row'>
107
               <View className='at-col at-col-3'>参与人数:</View>
105
               <View className='at-col at-col-3'>参与人数:</View>
108
-              <View className='at-col at-col-9'>{this.state.data.enlist.attendNum}</View>
106
+              <View className='at-col at-col-9'>{(data.enlist || {}).attendNum}</View>
109
             </View>
107
             </View>
110
           </View>
108
           </View>
111
 
109
 
112
-
113
-
114
-          {!this.state.data.person.status && <Image className="checkinImg" src={require('@assets/checkin/checkin.png')} onClick={this.checkinActive}   ></Image>}
115
-          {this.state.data.person.status && <Image className="checkinImg" src={require('@assets/checkin/checkined.png')}></Image>}
110
+          {!data.person.status && <Image className="checkinImg" src={require('@assets/checkin/checkin.png')} onClick={this.checkinActive}   ></Image>}
111
+          {data.person.status && <Image className="checkinImg" src={require('@assets/checkin/checkined.png')}></Image>}
116
         </View>}
112
         </View>}
117
-        {this.state.data.enlist == null && <View className="unregistered">
113
+        {data.enlist == null && <View className="unregistered">
118
           <View>
114
           <View>
119
             <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
115
             <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
120
           </View>
116
           </View>

+ 1
- 1
src/pages/city/index.scss View File

23
 
23
 
24
   .search-list {
24
   .search-list {
25
     position: absolute;
25
     position: absolute;
26
-    top: 136px;
26
+    top: 114px;
27
     width: 100%;
27
     width: 100%;
28
     background: white;
28
     background: white;
29
     min-height: 100vh;
29
     min-height: 100vh;

+ 0
- 3
src/pages/im/index.js View File

375
     // 发送消息
375
     // 发送消息
376
     socket.sendNotice(payload, res => {
376
     socket.sendNotice(payload, res => {
377
       console.log('发送成功')
377
       console.log('发送成功')
378
-      this.setState({
379
-        inputText:'',
380
-      })
381
       this.appendData(payload)
378
       this.appendData(payload)
382
     })
379
     })
383
   }
380
   }

+ 25
- 31
src/pages/person/index.js View File

75
     })
75
     })
76
   }
76
   }
77
 
77
 
78
-  toClientPage() {
79
-    const { user: { customerNum } } = this.state
80
-
81
-    if (customerNum <= 0) {
82
-      Taro.showToast({ title: '暂无客户', icon: 'none' })
83
-      return
78
+  redirectTo = (url) => {
79
+    if (typeof url === 'function') {
80
+      Taro.navigateTo({ url: url(this.state.user) })
81
+    } else {
82
+      Taro.navigateTo({ url })
84
     }
83
     }
85
-
86
-    Taro.navigateTo({
87
-      url: '/pages/person/myGuest/index'
88
-    })
89
-  }
90
-
91
-  redirectTo(url) {
92
-    Taro.navigateTo({ url })
93
   }
84
   }
94
 
85
 
95
   getRoleName(type) {
86
   getRoleName(type) {
97
       case ROLE_CODE['CONSULTANT']:
88
       case ROLE_CODE['CONSULTANT']:
98
         this.setState({ consultant: true })
89
         this.setState({ consultant: true })
99
         return '置业顾问'
90
         return '置业顾问'
100
-        break;
101
       case ROLE_CODE['ESTATE_AGENT']:
91
       case ROLE_CODE['ESTATE_AGENT']:
102
         this.setState({ isAgent: true })
92
         this.setState({ isAgent: true })
103
         return '独立经纪人'
93
         return '独立经纪人'
104
-        break;
105
       case ROLE_CODE['CHANNEL_AGENT']:
94
       case ROLE_CODE['CHANNEL_AGENT']:
106
         this.setState({ isAgent: true })
95
         this.setState({ isAgent: true })
107
         return '渠道经纪人'
96
         return '渠道经纪人'
108
-        break;
109
       default:
97
       default:
110
         return '普通用户'
98
         return '普通用户'
111
-        break;
112
     }
99
     }
113
   }
100
   }
114
 
101
 
125
   }
112
   }
126
 
113
 
127
   goPersonDetail() {
114
   goPersonDetail() {
115
+
128
     const { user: { personType } } = this.state
116
     const { user: { personType } } = this.state
129
-    if (personType == ROLE_CODE['CHANNEL_AGENT'] || personType == ROLE_CODE['ESTATE_AGENT']) {
130
-      Taro.navigateTo({
131
-        url: '/pages/person/personDetail/index'
132
-      })
133
-    }
117
+
118
+    // if (personType == ROLE_CODE['CHANNEL_AGENT'] || personType == ROLE_CODE['ESTATE_AGENT']) {
119
+    Taro.navigateTo({
120
+      url: '/pages/person/personDetail/index'
121
+    })
122
+    // }
134
 
123
 
135
   }
124
   }
136
 
125
 
140
 
129
 
141
   renderDetail() {
130
   renderDetail() {
142
     const { user, menus, isAgent, consultant, tourist } = this.state
131
     const { user, menus, isAgent, consultant, tourist } = this.state
132
+    const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
143
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
133
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
144
     // const isConsultant = user.personType
134
     // const isConsultant = user.personType
145
     return (
135
     return (
155
               </View>
145
               </View>
156
 
146
 
157
               <View className="info-text" onClick={this.goPersonDetail}>
147
               <View className="info-text" onClick={this.goPersonDetail}>
158
-                <View className="info-text__name">{user.name ? user.name : user.nickname} {/* <Text className="iconfont icon-more"></Text> */}</View>
148
+                <View className="info-text__name">{user.name ? user.name : user.nickname}</View>
159
                 <View className="info-text__intro">积分 {user.points || 0}</View>
149
                 <View className="info-text__intro">积分 {user.points || 0}</View>
160
               </View>
150
               </View>
161
-              <Navigator url={`/pages/person/spread/index`} className="tuiguang">
162
-                <Image style="width:40px;height:36px" src={require('@assets/mine/tuiguangma.png')} ></Image>
163
-                <View className="info-text__intro" style="margin:4px 0 0 4px">推广码</View>
164
-              </Navigator>
151
+              {
152
+                showQRCode && (
153
+                  <Navigator url={`/pages/person/spread/index`} className="tuiguang">
154
+                    <Image style="width:40px;height:36px" src={require('@assets/mine/tuiguangma.png')} ></Image>
155
+                    <View className="info-text__intro" style="margin:4px 0 0 4px">推广码</View>
156
+                  </Navigator>
157
+                )
158
+              }
165
             </View>
159
             </View>
166
             {/* <View
160
             {/* <View
167
               className={`sign__btn ${user.havaSigned && 'signed'}`}
161
               className={`sign__btn ${user.havaSigned && 'signed'}`}
171
           </View>
165
           </View>
172
           <View className='qiandao-con'>
166
           <View className='qiandao-con'>
173
             <Text className='qiandao-text'>签到得积分,积分兑好礼,马上去签到吧!</Text>
167
             <Text className='qiandao-text'>签到得积分,积分兑好礼,马上去签到吧!</Text>
174
-            <View className={user.havaSigned?'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{user.havaSigned ? '已签到' : '签到'}</View>
168
+            <View className={user.havaSigned ? 'reday-qiandao-btn' : 'qiandao-btn'} onClick={this.doSign}>{user.havaSigned ? '已签到' : '签到'}</View>
175
 
169
 
176
             {/* <Text className='integral-cont_btn' onClick={this.goShop}>去兑换</Text> */}
170
             {/* <Text className='integral-cont_btn' onClick={this.goShop}>去兑换</Text> */}
177
 
171
 
190
                           <View className="menu-maintext">
184
                           <View className="menu-maintext">
191
                             <Text className="menu-name">{menu.name}</Text>
185
                             <Text className="menu-name">{menu.name}</Text>
192
                             <Text className="right-icon"></Text>
186
                             <Text className="right-icon"></Text>
193
-                          </View>        
187
+                          </View>
194
                         </View>
188
                         </View>
195
                       )
189
                       )
196
                     })
190
                     })
210
     return (
204
     return (
211
       <View className='wrap'>
205
       <View className='wrap'>
212
         {(phone || tel) && this.renderDetail()}
206
         {(phone || tel) && this.renderDetail()}
213
-        {!phone && !tel  && this.renderLogin()}
207
+        {!phone && !tel && this.renderLogin()}
214
       </View>
208
       </View>
215
     )
209
     )
216
   }
210
   }

+ 16
- 2
src/pages/person/menus.js View File

28
       url: '/pages/agent/index',
28
       url: '/pages/agent/index',
29
       icon: icons.homepage,
29
       icon: icons.homepage,
30
       extends: undefined,
30
       extends: undefined,
31
-      userTypes: [CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
31
+      userTypes: [ESTATE_AGENT, CHANNEL_AGENT],
32
+    },
33
+    {
34
+      name: '我的主页',
35
+      url: ({id}) => `/pages/card/index?id=${id}`,
36
+      icon: icons.homepage,
37
+      extends: undefined,
38
+      userTypes: [CONSULTANT],
32
     },
39
     },
33
     {
40
     {
34
       name: '成为经纪人',
41
       name: '成为经纪人',
53
     },
60
     },
54
   ],
61
   ],
55
   [
62
   [
63
+    {
64
+      name: '我的客户',
65
+      url: '/pages/person/myGuest/index',
66
+      icon: icons.activities,
67
+      extends: undefined,
68
+      userTypes: [CONSULTANT],
69
+    },
56
     {
70
     {
57
       name: '我的活动',
71
       name: '我的活动',
58
       url: '/pages/activity/myActivity?from=mine',
72
       url: '/pages/activity/myActivity?from=mine',
88
       url: '/pages/person/profile/index',
102
       url: '/pages/person/profile/index',
89
       icon: icons.profile,
103
       icon: icons.profile,
90
       extends: undefined,
104
       extends: undefined,
91
-      userTypes: [CUSTOMER, ESTATE_AGENT, CHANNEL_AGENT],
105
+      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
92
     },
106
     },
93
     {
107
     {
94
       name: '兑换记录',
108
       name: '兑换记录',

+ 11
- 7
src/pages/person/personDetail/index.js View File

11
     userName: '用户名',
11
     userName: '用户名',
12
     phone: '电话号码',
12
     phone: '电话号码',
13
     manType: '经纪人类型',
13
     manType: '经纪人类型',
14
-    user:{}
14
+    user: {}
15
   }
15
   }
16
   config = {
16
   config = {
17
     navigationBarTitleText: '个人资料',
17
     navigationBarTitleText: '个人资料',
72
             <Image src={require('@assets/person/arrow2.png')} mode="widthFix"></Image>
72
             <Image src={require('@assets/person/arrow2.png')} mode="widthFix"></Image>
73
           </View>
73
           </View>
74
         </View>
74
         </View>
75
-        <View className='col_box' onClick={this.goEdit.bind(this)}>
76
-          <Text>{manType}</Text>
77
-          <View className='col_right'>
78
-            <Text>{this.getRoleName(user.personType)}</Text>
79
-            <Image src={require('@assets/person/arrow2.png')} mode="widthFix"></Image>
75
+        {
76
+          (user.personType == ROLE_CODE['CHANNEL_AGENT'] || user.personType == ROLE_CODE['ESTATE_AGENT']) &&
77
+
78
+          <View className='col_box' onClick={this.goEdit.bind(this)}>
79
+            <Text>{manType}</Text>
80
+            <View className='col_right'>
81
+              <Text>{this.getRoleName(user.personType)}</Text>
82
+              <Image src={require('@assets/person/arrow2.png')} mode="widthFix"></Image>
83
+            </View>
80
           </View>
84
           </View>
81
-        </View>
85
+        }
82
       </View>
86
       </View>
83
     )
87
     )
84
   }
88
   }

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

42
       getProfileDetail(id).then(res => {
42
       getProfileDetail(id).then(res => {
43
         this.setState({
43
         this.setState({
44
           detail: res,
44
           detail: res,
45
-          imgList: res.imgList,
45
+          imgList: res.imgList || [],
46
           documentTitle: res.documentTitle,
46
           documentTitle: res.documentTitle,
47
         })
47
         })
48
       })
48
       })
66
           this.setState({
66
           this.setState({
67
             marginTop: 0,
67
             marginTop: 0,
68
             messageType: 'image',
68
             messageType: 'image',
69
-            imgList: imgList
69
+            imgList: imgList|| []
70
           }, this.onSendMsg)
70
           }, this.onSendMsg)
71
         })
71
         })
72
       }
72
       }
78
     const imgList = this.state.imgList;
78
     const imgList = this.state.imgList;
79
     imgList.splice(inx, 1);
79
     imgList.splice(inx, 1);
80
     this.setState({
80
     this.setState({
81
-      imgList: imgList
81
+      imgList: imgList || []
82
     })
82
     })
83
   }
83
   }
84
 
84
 
100
       editDocumentVerify(payload).then(res => {
100
       editDocumentVerify(payload).then(res => {
101
         this.setState({
101
         this.setState({
102
           detail: res,
102
           detail: res,
103
-          imgList: res.imgList,
103
+          imgList: res.imgList || [],
104
           documentTitle: res.documentTitle,
104
           documentTitle: res.documentTitle,
105
         })
105
         })
106
         Taro.showToast({ icon: 'none', title: '提交成功' });
106
         Taro.showToast({ icon: 'none', title: '提交成功' });

+ 24
- 12
src/pages/person/profile/index.js View File

14
   }
14
   }
15
 
15
 
16
   state = {
16
   state = {
17
-    files: [],
18
-    auditStatus: 0,
17
+   
19
     documentVerifyId: '',
18
     documentVerifyId: '',
20
     imgList: [],
19
     imgList: [],
21
     documentTitle: '',
20
     documentTitle: '',
22
     verfyList: [], // 审核列表
21
     verfyList: [], // 审核列表
23
     descVisible: false,
22
     descVisible: false,
23
+    showWhich: true,
24
 
24
 
25
   }
25
   }
26
 
26
 
32
     Taro.showLoading()
32
     Taro.showLoading()
33
     getVerifyList().then(res => {
33
     getVerifyList().then(res => {
34
       this.setState({
34
       this.setState({
35
-        verfyList: res
35
+        verfyList: res || []
36
+      }, () => {
37
+        if (this.state.verfyList.length == 0) {
38
+          this.setState({
39
+            showWhich: true
40
+          })
41
+        } else {
42
+          this.setState({
43
+            showWhich: false
44
+          })
45
+        }
46
+
36
       })
47
       })
37
       Taro.hideLoading()
48
       Taro.hideLoading()
38
     }).catch((err) => {
49
     }).catch((err) => {
47
   // 选择图片
58
   // 选择图片
48
   bindAlbumClick(e) {
59
   bindAlbumClick(e) {
49
     this.setState({
60
     this.setState({
50
-      descVisible: true
61
+      descVisible: true,
62
+      showWhich: false
51
     })
63
     })
52
     e.stopPropagation()
64
     e.stopPropagation()
53
     Taro.chooseImage({
65
     Taro.chooseImage({
63
           this.setState({
75
           this.setState({
64
             marginTop: 0,
76
             marginTop: 0,
65
             messageType: 'image',
77
             messageType: 'image',
66
-            imgList: imgList
78
+            imgList: imgList || []
67
           }, this.onSendMsg)
79
           }, this.onSendMsg)
68
         })
80
         })
69
       }
81
       }
75
     const imgList = this.state.imgList;
87
     const imgList = this.state.imgList;
76
     imgList.splice(inx, 1);
88
     imgList.splice(inx, 1);
77
     this.setState({
89
     this.setState({
78
-      imgList: imgList
90
+      imgList: imgList || []
79
     })
91
     })
80
   }
92
   }
81
   toProfileDetail(item) {
93
   toProfileDetail(item) {
99
   }
111
   }
100
   // 提交资料审核
112
   // 提交资料审核
101
   commitBtn() {
113
   commitBtn() {
102
-    console.log(this.state.auditStatus, "this.state.auditStatus")
114
+
103
     if (this.state.imgList.length == 0) {
115
     if (this.state.imgList.length == 0) {
104
       Taro.showToast({ icon: 'none', title: '请先上传图片' });
116
       Taro.showToast({ icon: 'none', title: '请先上传图片' });
105
     } else if (this.state.documentTitle == "") {
117
     } else if (this.state.documentTitle == "") {
174
 
186
 
175
 
187
 
176
   render() {
188
   render() {
177
-    const { imgList, documentTitle, verfyList, descVisible } = this.state
189
+    const { imgList, documentTitle, verfyList, descVisible,showWhich } = this.state
178
 
190
 
179
     return (
191
     return (
180
       <View className="profile-page" style={`background: url(${profileBg}) no-repeat top;background-size: 100% 100%;`}>
192
       <View className="profile-page" style={`background: url(${profileBg}) no-repeat top;background-size: 100% 100%;`}>
181
         <ScrollView scrollY scrollWithAnimation style="height: 100vh">
193
         <ScrollView scrollY scrollWithAnimation style="height: 100vh">
182
 
194
 
183
-          {!verfyList.length &&
195
+          {(!verfyList.length && showWhich) &&
184
             <View className="up-images">
196
             <View className="up-images">
185
               {this.renderUpImages()}
197
               {this.renderUpImages()}
186
 
198
 
187
               <View className="tip">
199
               <View className="tip">
188
                 建议上传相关购房资格等相关资料,审核
200
                 建议上传相关购房资格等相关资料,审核
189
-          </View>
201
+              </View>
190
               <View className="tip">
202
               <View className="tip">
191
                 通过后将获取更多积分、兑换好礼~
203
                 通过后将获取更多积分、兑换好礼~
192
-          </View>
204
+              </View>
193
             </View>
205
             </View>
194
           }
206
           }
195
-          {verfyList.length &&
207
+          {(verfyList.length || !showWhich) &&
196
             <View>
208
             <View>
197
 
209
 
198
               {descVisible &&
210
               {descVisible &&

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

279
     getUserPhone(e, (phoneNumber) => {
279
     getUserPhone(e, (phoneNumber) => {
280
       const { userInfo: { person: { personId, nickname, name } } } = this.props
280
       const { userInfo: { person: { personId, nickname, name } } } = this.props
281
       Taro.navigateTo({
281
       Taro.navigateTo({
282
-        url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.id}&receiverName=${encodeURIComponent(item.name)}`
282
+        url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.id}&receiverName=${encodeURIComponent(item.userName)}`
283
       })
283
       })
284
     })
284
     })
285
   }
285
   }

+ 14
- 7
src/pages/project/index.js View File

7
 
7
 
8
 import ready from '@utils/ready'
8
 import ready from '@utils/ready'
9
 
9
 
10
-import { queryBanners, savePoint } from '@services/common'
10
+import { queryBanners, savePoint, updatePoint } from '@services/common'
11
 import { queryNewsList, queryHelpGroup } from '@services/news'
11
 import { queryNewsList, queryHelpGroup } from '@services/news'
12
 import { queryActivityList } from '@services/activity'
12
 import { queryActivityList } from '@services/activity'
13
 import { dispatchCitySelected } from '@actions/city'
13
 import { dispatchCitySelected } from '@actions/city'
66
       })
66
       })
67
     })
67
     })
68
   }
68
   }
69
+
69
   componentDidShow() {
70
   componentDidShow() {
70
     if (this.props.curCity.id) {
71
     if (this.props.curCity.id) {
71
       ready.queue(() => {
72
       ready.queue(() => {
74
     }
75
     }
75
   }
76
   }
76
 
77
 
78
+  componentWillUnmount() {
79
+    const { recordId } = this.state
80
+    recordId && updatePoint(recordId)
81
+  }
82
+
77
   getLocation() {
83
   getLocation() {
78
     const { cityList } = this.props
84
     const { cityList } = this.props
79
     Taro.getLocation().then(location => {
85
     Taro.getLocation().then(location => {
255
     })
261
     })
256
   }
262
   }
257
 
263
 
258
-  handleBannerClick(item) {
264
+  handleBannerClick=(item) =>{
265
+    console.log(this,"this")
259
     this.redirectTo(item)
266
     this.redirectTo(item)
260
   }
267
   }
261
 
268
 
262
-  redirectTo({ contentId, contentType, buildingId } = {}) {
269
+  redirectTo({ targetId, contentType, buildingId } = {}) {
263
     switch (contentType) {
270
     switch (contentType) {
264
       // 项目
271
       // 项目
265
       case 'project':
272
       case 'project':
271
       // 活动
278
       // 活动
272
       case 'activity':
279
       case 'activity':
273
         Taro.navigateTo({
280
         Taro.navigateTo({
274
-          url: '/pages/activity/detail/index?id=' + contentId
281
+          url: '/pages/activity/detail/index?id=' + targetId
275
         })
282
         })
276
         return;
283
         return;
277
 
284
 
278
       // 助力
285
       // 助力
279
       case 'help':
286
       case 'help':
280
         Taro.navigateTo({
287
         Taro.navigateTo({
281
-          url: '/pages/activity/detail/assistance?id=' + contentId
288
+          url: '/pages/activity/detail/assistance?id=' + targetId
282
         })
289
         })
283
         return;
290
         return;
284
 
291
 
285
       // 拼团
292
       // 拼团
286
       case 'group':
293
       case 'group':
287
         Taro.navigateTo({
294
         Taro.navigateTo({
288
-          url: '/pages/activity/detail/assemble?id=' + contentId
295
+          url: '/pages/activity/detail/assemble?id=' + targetId
289
         })
296
         })
290
         return;
297
         return;
291
 
298
 
292
       // 资讯
299
       // 资讯
293
       case 'news':
300
       case 'news':
294
         Taro.navigateTo({
301
         Taro.navigateTo({
295
-          url: 'pages/news/detail/index?id=' + contentId
302
+          url: 'pages/news/detail/index?id=' + targetId
296
         })
303
         })
297
         return;
304
         return;
298
 
305
 

+ 36
- 16
src/pages/shop/index.js View File

12
 import { getGoodsBuilding, getGoodsList } from '@services/item'
12
 import { getGoodsBuilding, getGoodsList } from '@services/item'
13
 import { connect } from '@tarojs/redux'
13
 import { connect } from '@tarojs/redux'
14
 import * as actions from '@actions/shop'
14
 import * as actions from '@actions/shop'
15
-// import { queryUserInfo, doUserSignin } from '@services/user'
15
+import { queryUserInfo, doUserSignin } from '@services/user'
16
 
16
 
17
 // import getUserPhone from '@utils/getUserPhone'
17
 // import getUserPhone from '@utils/getUserPhone'
18
 import Authorize from '@components/authorize'
18
 import Authorize from '@components/authorize'
32
       'https://estateagents.oss-cn-shanghai.aliyuncs.com/images/banner/4.jpg',
32
       'https://estateagents.oss-cn-shanghai.aliyuncs.com/images/banner/4.jpg',
33
       'https://estateagents.oss-cn-shanghai.aliyuncs.com/images/banner/5.jpg'
33
       'https://estateagents.oss-cn-shanghai.aliyuncs.com/images/banner/5.jpg'
34
     ],
34
     ],
35
-    user: {},
36
     cityName: '',
35
     cityName: '',
37
     goodsBuilding: [],
36
     goodsBuilding: [],
38
     goodsList: [],
37
     goodsList: [],
38
+    user: {},
39
   }
39
   }
40
 
40
 
41
   componentDidShow() {
41
   componentDidShow() {
42
+
42
     Taro.showLoading()
43
     Taro.showLoading()
43
     ready.queue(() => {
44
     ready.queue(() => {
44
       this.loadBannerList()
45
       this.loadBannerList()
45
       this.loadGoodsBuilding()
46
       this.loadGoodsBuilding()
46
 
47
 
47
       //    this.loadCity()
48
       //    this.loadCity()
48
-      // this.loadUserInfo()
49
+      this.loadUserInfo()
49
     })
50
     })
50
     Taro.hideLoading()
51
     Taro.hideLoading()
51
   }
52
   }
63
 
64
 
64
   loadList() {
65
   loadList() {
65
 
66
 
67
+
66
     Taro.showLoading()
68
     Taro.showLoading()
67
     const params = {
69
     const params = {
68
       pageNum: '1',
70
       pageNum: '1',
69
       pageSize: '9999',
71
       pageSize: '9999',
70
-      buildingId: this.state.goodsBuilding[0].buildingId
72
+      buildingId: this.state.goodsBuilding[0].buildingId,
73
+      cityId: this.props.curCity.id
71
     }
74
     }
72
 
75
 
73
-    console.log(params, "params")
74
     getGoodsList(params).then(res => {
76
     getGoodsList(params).then(res => {
75
       this.setState({
77
       this.setState({
76
         goodsList: res.records || []
78
         goodsList: res.records || []
83
   }
85
   }
84
 
86
 
85
   loadGoodsBuilding() {
87
   loadGoodsBuilding() {
86
-    getGoodsBuilding().then(res => {
88
+    const payload = {
89
+
90
+      cityId: this.props.curCity.id
91
+    }
92
+
93
+    console.log(payload, "999999999999")
94
+    getGoodsBuilding(payload).then(res => {
87
       res.map(item => {
95
       res.map(item => {
88
         item.title = item.buildingName
96
         item.title = item.buildingName
89
       })
97
       })
108
     const payload = {
116
     const payload = {
109
       pageNum: '1',
117
       pageNum: '1',
110
       pageSize: '9999',
118
       pageSize: '9999',
111
-      buildingId: this.state.goodsBuilding[value].buildingId
119
+      buildingId: this.state.goodsBuilding[value].buildingId,
120
+      cityId: this.props.curCity.id
112
     }
121
     }
113
     getGoodsList(payload).then(res => {
122
     getGoodsList(payload).then(res => {
114
-      console.log(res.records, "22222222222222222222222222222222")
115
       this.setState({
123
       this.setState({
116
         goodsList: res.records || []
124
         goodsList: res.records || []
117
       })
125
       })
144
       url: `/pages/city/index`
152
       url: `/pages/city/index`
145
     })
153
     })
146
   }
154
   }
155
+
147
   doSign() {
156
   doSign() {
148
     const { user: { id, havaSigned } } = this.state
157
     const { user: { id, havaSigned } } = this.state
149
     if (havaSigned) {
158
     if (havaSigned) {
150
-      Taro.showToast({
151
-        title: '你已经签到过了',
152
-        icon: 'none'
153
-      })
154
       return
159
       return
155
     }
160
     }
156
 
161
 
161
 
166
 
162
       this.loadUserInfo()
167
       this.loadUserInfo()
163
 
168
 
169
+      // App.zhuge.track('签到成功')
170
+    })
171
+  }
172
+  
173
+  loadUserInfo() {
174
+    // debugger
175
+    queryUserInfo().then(user => {
176
+      // debugger
177
+      this.setState({ user })
164
     })
178
     })
165
   }
179
   }
166
-
167
 
180
 
168
   renderLogin() {
181
   renderLogin() {
169
     return <Authorize></Authorize>
182
     return <Authorize></Authorize>
242
   }
255
   }
243
 
256
 
244
   renderDetail() {
257
   renderDetail() {
245
-    // const { user } = this.state
258
+    const { user } = this.state
246
     const { userInfo: { person }, curCity } = this.props
259
     const { userInfo: { person }, curCity } = this.props
260
+    const { bannerList = [] } = this.state
247
     return (
261
     return (
248
       <View className="page">
262
       <View className="page">
249
         {/* <Search placeholder="请输入要搜索的商品名称" onSearch={this.onSearch} /> */}
263
         {/* <Search placeholder="请输入要搜索的商品名称" onSearch={this.onSearch} /> */}
260
               <Image className="bg" src={require('@assets/shop/background.jpg')} ></Image>
274
               <Image className="bg" src={require('@assets/shop/background.jpg')} ></Image>
261
               <Image className="user__left__headimg" src={person.avatarurl} />
275
               <Image className="user__left__headimg" src={person.avatarurl} />
262
               <View className='user__left__name'>{person.nickname}</View>
276
               <View className='user__left__name'>{person.nickname}</View>
263
-              <View className="qiandao__btn" onClick={this.doSign}>签到</View>
277
+              {
278
+                user.havaSigned ?
279
+                (<View className="qiandao__btn">已签到</View>) :
280
+                (<View className="qiandao__btn" onClick={this.doSign}>签到</View>)
281
+              }
264
               <View className='message'>
282
               <View className='message'>
265
                 <View className='message__left'>
283
                 <View className='message__left'>
266
                   <View className='user__jifen'>
284
                   <View className='user__jifen'>
285
           </View>
303
           </View>
286
 
304
 
287
 
305
 
306
+          {bannerList.length > 0 &&
307
+            <Banner list={bannerList} indicatorDots={false}></Banner>
308
+          }
288
 
309
 
289
-          <Banner list={this.state.bannerList} indicatorDots={false}></Banner>
290
 
310
 
291
           {this.renderGoods()}
311
           {this.renderGoods()}
292
         </ScrollView>
312
         </ScrollView>