|
@@ -17,22 +17,28 @@ export default class checkin extends Component {
|
17
|
17
|
|
18
|
18
|
componentWillMount () {
|
19
|
19
|
const router = Taro.getStorageSync('router')
|
20
|
|
- console.log('router---',router)
|
21
|
|
- console.log('props---',this.props)
|
22
|
|
- const { id, type } = parseQueryString(router.query.params)
|
23
|
|
- console.log('props---',id)
|
|
20
|
+ console.log('router---', parseQueryString)
|
|
21
|
+ console.log(router)
|
|
22
|
+ // const id = router.query.paramsId
|
|
23
|
+ // const type = router.query.type || ''
|
|
24
|
+
|
|
25
|
+ const { id = router.query.paramsId, type = router.query.type || '' } = parseQueryString(router.query.params)
|
|
26
|
+ console.log(id, 'id-----')
|
24
|
27
|
this.setState({ id, type })
|
25
|
28
|
this.getcheckinDetails(id, type)
|
|
29
|
+
|
|
30
|
+
|
26
|
31
|
}
|
27
|
32
|
// dynamicId
|
28
|
33
|
getcheckinDetails (id, type) {
|
29
|
34
|
Taro.showLoading()
|
30
|
35
|
|
31
|
36
|
checkinDetails(id, type).then(res => {
|
|
37
|
+ console.log('data:', res)
|
32
|
38
|
Taro.hideLoading()
|
33
|
39
|
this.setState({
|
34
|
40
|
data: res,
|
35
|
|
- })
|
|
41
|
+ })
|
36
|
42
|
})
|
37
|
43
|
}
|
38
|
44
|
|
|
@@ -44,7 +50,7 @@ export default class checkin extends Component {
|
44
|
50
|
|
45
|
51
|
// TODO: 需要依据 type 跳转
|
46
|
52
|
Taro.navigateTo({
|
47
|
|
- url: '/pages/checkin/checkinsuccess/index?addPoints=' + res.addPoints,
|
|
53
|
+ url: '/pages/checkin/checkinsuccess/index?addPoints=' + res.addPoints,
|
48
|
54
|
})
|
49
|
55
|
|
50
|
56
|
}).catch((err) => {
|
|
@@ -66,7 +72,8 @@ export default class checkin extends Component {
|
66
|
72
|
|
67
|
73
|
render () {
|
68
|
74
|
const { dynamic = {}, enlist = {}, person = {} } = this.state.data || {}
|
69
|
|
-
|
|
75
|
+ const { activityStatus } = dynamic || {}
|
|
76
|
+ console.log(enlist, 'enlist')
|
70
|
77
|
return (
|
71
|
78
|
<View className="checkin" style="width:100vw;height:100vh;" >
|
72
|
79
|
|
|
@@ -106,16 +113,16 @@ export default class checkin extends Component {
|
106
|
113
|
{/* {console.log(data.person.status)} */}
|
107
|
114
|
</View>}
|
108
|
115
|
{enlist.enlistId == null && <View className="unregistered">
|
109
|
|
- {dynamic.activityStatus === 1 && <View style="text-align: center;color:#666666">
|
110
|
|
- 活动未开始
|
|
116
|
+ {activityStatus === 1 && <View style="text-align: center;color:#666666">
|
|
117
|
+ 活动未开始
|
111
|
118
|
</View>
|
112
|
119
|
}
|
113
|
|
- {dynamic.activityStatus === 2 && <View style="text-align: center;color:#666666">
|
114
|
|
- 活动已结束
|
|
120
|
+ {activityStatus === 2 && <View style="text-align: center;color:#666666">
|
|
121
|
+ 活动已结束
|
115
|
122
|
</View>
|
116
|
123
|
}
|
117
|
124
|
|
118
|
|
- {!dynamic.activityStatus &&
|
|
125
|
+ {!activityStatus &&
|
119
|
126
|
<View>
|
120
|
127
|
<View>
|
121
|
128
|
<Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
|
|
@@ -127,9 +134,9 @@ export default class checkin extends Component {
|
127
|
134
|
|
128
|
135
|
<AtButton type='primary' className="toactivebutton" onClick={() => { this.toactivity(dynamic.dynamicId) }}>立即前往</AtButton>
|
129
|
136
|
</View>
|
130
|
|
- }
|
|
137
|
+ }
|
131
|
138
|
</View>
|
132
|
|
- }
|
|
139
|
+ }
|
133
|
140
|
</View>
|
134
|
141
|
|
135
|
142
|
);
|