许静 5 年之前
父節點
當前提交
2c6c70155e

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

@@ -21,6 +21,27 @@ export default class active extends Component {
21 21
 
22 22
   state = {
23 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 47
   handleClick(value) {

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

@@ -63,6 +63,7 @@ export default class Detail extends Component {
63 63
     posterVisible: false, // 海报分享
64 64
     grantPhoneVisible: false, // 授权电话
65 65
     grantAvatarVisible: false, // 授权头像
66
+    pointRecordId: undefined, // 埋点ID
66 67
   }
67 68
 
68 69
   componentWillMount() {
@@ -76,6 +77,7 @@ export default class Detail extends Component {
76 77
 
77 78
   componentWillUnmount() {
78 79
     this.clearTicker()
80
+    this.state.pointRecordId && updatePoint(pointRecordId)
79 81
   }
80 82
 
81 83
   // 初始化页面数据
@@ -218,7 +220,9 @@ export default class Detail extends Component {
218 220
         buildingId: res.taShareActivity.buildingId,
219 221
         targetId: id,
220 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,6 +62,7 @@ export default class Detail extends Component {
62 62
     grantPhoneVisible: false, // 授权电话
63 63
     grantAvatarVisible: false, // 授权头像
64 64
     handleHelpBtn: true, // 立即助力好友
65
+    pointRecordId: undefined, // 埋点ID
65 66
   }
66 67
 
67 68
   componentWillMount() {
@@ -75,6 +76,7 @@ export default class Detail extends Component {
75 76
 
76 77
   componentWillUnmount() {
77 78
     this.clearTicker()
79
+    this.state.pointRecordId && updatePoint(pointRecordId)
78 80
   }
79 81
 
80 82
   // 初始化页面数据
@@ -220,7 +222,9 @@ export default class Detail extends Component {
220 222
         buildingId: res.helpActivity.buildingId,
221 223
         targetId: id,
222 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,7 +44,7 @@ export default class Index extends Component {
44 44
   
45 45
   componentWillUnmount() {
46 46
     const { recordId } = this.state
47
-    updatePoint(recordId)
47
+    recordId && updatePoint(recordId)
48 48
   }
49 49
 
50 50
   loadList(pageNumber) {

+ 10
- 14
src/pages/checkin/index.js 查看文件

@@ -71,9 +71,7 @@ export default class checkin extends Component {
71 71
   }
72 72
 
73 73
   render () {
74
-    const { data, style } = this.props
75
-
76
-
74
+    const { data = { person: {}, dynamic: {} }, style } = this.props
77 75
 
78 76
     return (
79 77
       <View className="checkin" style="width:100vw;height:100vh;" >
@@ -81,13 +79,13 @@ export default class checkin extends Component {
81 79
         {/* <checkinsuccess></checkinsuccess> */}
82 80
         {/* <achievePhone></achievePhone> */}
83 81
         <View>
84
-          <Image className="img" src={this.state.data.dynamic.imgUrl}  ></Image>
82
+          <Image className="img" src={data.dynamic.imgUrl}  ></Image>
85 83
         </View>
86 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 86
         </View >
89 87
 
90
-        {this.state.data.enlist != null && <View>
88
+        {data.enlist != null && <View>
91 89
           <View style="text-align: center;">
92 90
             <Text className="line">- - - - - - - - - </Text>
93 91
             <Text className="text2">活动报名信息</Text>
@@ -97,24 +95,22 @@ export default class checkin extends Component {
97 95
           <View className="text3">
98 96
             <View className='at-row'>
99 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 99
             </View>
102 100
             <View className='at-row'>
103 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 103
             </View>
106 104
             <View className='at-row'>
107 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 107
             </View>
110 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 112
         </View>}
117
-        {this.state.data.enlist == null && <View className="unregistered">
113
+        {data.enlist == null && <View className="unregistered">
118 114
           <View>
119 115
             <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
120 116
           </View>

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

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

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

@@ -279,7 +279,7 @@ export default class Index extends Component {
279 279
     getUserPhone(e, (phoneNumber) => {
280 280
       const { userInfo: { person: { personId, nickname, name } } } = this.props
281 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
   }

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

@@ -7,7 +7,7 @@ import ActivityItem from '../activity/item'
7 7
 
8 8
 import ready from '@utils/ready'
9 9
 
10
-import { queryBanners, savePoint } from '@services/common'
10
+import { queryBanners, savePoint, updatePoint } from '@services/common'
11 11
 import { queryNewsList, queryHelpGroup } from '@services/news'
12 12
 import { queryActivityList } from '@services/activity'
13 13
 import { dispatchCitySelected } from '@actions/city'
@@ -66,6 +66,7 @@ export default class Index extends Component {
66 66
       })
67 67
     })
68 68
   }
69
+
69 70
   componentDidShow() {
70 71
     if (this.props.curCity.id) {
71 72
       ready.queue(() => {
@@ -74,6 +75,11 @@ export default class Index extends Component {
74 75
     }
75 76
   }
76 77
 
78
+  componentWillUnmount() {
79
+    const { recordId } = this.state
80
+    recordId && updatePoint(recordId)
81
+  }
82
+
77 83
   getLocation() {
78 84
     const { cityList } = this.props
79 85
     Taro.getLocation().then(location => {

+ 18
- 7
src/pages/shop/index.js 查看文件

@@ -12,7 +12,7 @@ import { queryBanners } from '@services/common'
12 12
 import { getGoodsBuilding, getGoodsList } from '@services/item'
13 13
 import { connect } from '@tarojs/redux'
14 14
 import * as actions from '@actions/shop'
15
-// import { queryUserInfo, doUserSignin } from '@services/user'
15
+import { queryUserInfo, doUserSignin } from '@services/user'
16 16
 
17 17
 // import getUserPhone from '@utils/getUserPhone'
18 18
 import Authorize from '@components/authorize'
@@ -32,10 +32,10 @@ export default class Shop extends Component {
32 32
       'https://estateagents.oss-cn-shanghai.aliyuncs.com/images/banner/4.jpg',
33 33
       'https://estateagents.oss-cn-shanghai.aliyuncs.com/images/banner/5.jpg'
34 34
     ],
35
-    user: {},
36 35
     cityName: '',
37 36
     goodsBuilding: [],
38 37
     goodsList: [],
38
+    user: {},
39 39
   }
40 40
 
41 41
   componentDidShow() {
@@ -46,7 +46,7 @@ export default class Shop extends Component {
46 46
       this.loadGoodsBuilding()
47 47
 
48 48
       //    this.loadCity()
49
-      // this.loadUserInfo()
49
+      this.loadUserInfo()
50 50
     })
51 51
     Taro.hideLoading()
52 52
   }
@@ -169,7 +169,14 @@ export default class Shop extends Component {
169 169
       // App.zhuge.track('签到成功')
170 170
     })
171 171
   }
172
-
172
+  
173
+  loadUserInfo() {
174
+    // debugger
175
+    queryUserInfo().then(user => {
176
+      // debugger
177
+      this.setState({ user })
178
+    })
179
+  }
173 180
 
174 181
   renderLogin() {
175 182
     return <Authorize></Authorize>
@@ -248,9 +255,9 @@ export default class Shop extends Component {
248 255
   }
249 256
 
250 257
   renderDetail() {
251
-    // const { user } = this.state
258
+    const { user } = this.state
252 259
     const { userInfo: { person }, curCity } = this.props
253
-    const { bannerList } = this.state
260
+    const { bannerList = [] } = this.state
254 261
     return (
255 262
       <View className="page">
256 263
         {/* <Search placeholder="请输入要搜索的商品名称" onSearch={this.onSearch} /> */}
@@ -267,7 +274,11 @@ export default class Shop extends Component {
267 274
               <Image className="bg" src={require('@assets/shop/background.jpg')} ></Image>
268 275
               <Image className="user__left__headimg" src={person.avatarurl} />
269 276
               <View className='user__left__name'>{person.nickname}</View>
270
-              <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
+              }
271 282
               <View className='message'>
272 283
                 <View className='message__left'>
273 284
                   <View className='user__jifen'>