张延森 5 年前
父节点
当前提交
ab3aef82cd

+ 21
- 0
src/pages/activity/activity.js 查看文件

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) {

+ 5
- 1
src/pages/activity/detail/assemble.js 查看文件

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
 

+ 5
- 1
src/pages/activity/detail/assistance.js 查看文件

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
 

+ 1
- 1
src/pages/activity/index.js 查看文件

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) {

+ 0
- 4
src/pages/person/index.js 查看文件

97
       case ROLE_CODE['CONSULTANT']:
97
       case ROLE_CODE['CONSULTANT']:
98
         this.setState({ consultant: true })
98
         this.setState({ consultant: true })
99
         return '置业顾问'
99
         return '置业顾问'
100
-        break;
101
       case ROLE_CODE['ESTATE_AGENT']:
100
       case ROLE_CODE['ESTATE_AGENT']:
102
         this.setState({ isAgent: true })
101
         this.setState({ isAgent: true })
103
         return '独立经纪人'
102
         return '独立经纪人'
104
-        break;
105
       case ROLE_CODE['CHANNEL_AGENT']:
103
       case ROLE_CODE['CHANNEL_AGENT']:
106
         this.setState({ isAgent: true })
104
         this.setState({ isAgent: true })
107
         return '渠道经纪人'
105
         return '渠道经纪人'
108
-        break;
109
       default:
106
       default:
110
         return '普通用户'
107
         return '普通用户'
111
-        break;
112
     }
108
     }
113
   }
109
   }
114
 
110
 

+ 7
- 1
src/pages/project/index.js 查看文件

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 => {

+ 17
- 6
src/pages/shop/index.js 查看文件

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() {
45
       this.loadGoodsBuilding()
45
       this.loadGoodsBuilding()
46
 
46
 
47
       //    this.loadCity()
47
       //    this.loadCity()
48
-      // this.loadUserInfo()
48
+      this.loadUserInfo()
49
     })
49
     })
50
     Taro.hideLoading()
50
     Taro.hideLoading()
51
   }
51
   }
161
       // App.zhuge.track('签到成功')
161
       // App.zhuge.track('签到成功')
162
     })
162
     })
163
   }
163
   }
164
-
164
+  
165
+  loadUserInfo() {
166
+    // debugger
167
+    queryUserInfo().then(user => {
168
+      // debugger
169
+      this.setState({ user })
170
+    })
171
+  }
165
 
172
 
166
   renderLogin() {
173
   renderLogin() {
167
     return <Authorize></Authorize>
174
     return <Authorize></Authorize>
240
   }
247
   }
241
 
248
 
242
   renderDetail() {
249
   renderDetail() {
243
-    // const { user } = this.state
250
+    const { user } = this.state
244
     const { userInfo: { person }, curCity } = this.props
251
     const { userInfo: { person }, curCity } = this.props
245
     const { bannerList = [] } = this.state
252
     const { bannerList = [] } = this.state
246
     return (
253
     return (
259
               <Image className="bg" src={require('@assets/shop/background.jpg')} ></Image>
266
               <Image className="bg" src={require('@assets/shop/background.jpg')} ></Image>
260
               <Image className="user__left__headimg" src={person.avatarurl} />
267
               <Image className="user__left__headimg" src={person.avatarurl} />
261
               <View className='user__left__name'>{person.nickname}</View>
268
               <View className='user__left__name'>{person.nickname}</View>
262
-              <View className="qiandao__btn" onClick={this.doSign}>签到</View>
269
+              {
270
+                user.havaSigned ?
271
+                (<View className="qiandao__btn">已签到</View>) :
272
+                (<View className="qiandao__btn" onClick={this.doSign}>签到</View>)
273
+              }
263
               <View className='message'>
274
               <View className='message'>
264
                 <View className='message__left'>
275
                 <View className='message__left'>
265
                   <View className='user__jifen'>
276
                   <View className='user__jifen'>