|
@@ -10,7 +10,7 @@ import { checkinDetails, checkinActive } from '@services/checkin'
|
10
|
10
|
export default class checkin extends Component {
|
11
|
11
|
|
12
|
12
|
state = {
|
13
|
|
- id:'',
|
|
13
|
+ id: '',
|
14
|
14
|
// ischeck:''
|
15
|
15
|
// isLogin: false,
|
16
|
16
|
// user: {},
|
|
@@ -21,10 +21,12 @@ export default class checkin extends Component {
|
21
|
21
|
}
|
22
|
22
|
|
23
|
23
|
componentWillMount () {
|
24
|
|
- console.log(this.$router.params,'22222')
|
|
24
|
+ console.log(this.$router.params, '22222')
|
25
|
25
|
|
26
|
26
|
const { id, type } = this.$router.params
|
27
|
|
-
|
|
27
|
+ this.setState({
|
|
28
|
+ id: id
|
|
29
|
+ })
|
28
|
30
|
console.log(id, type)
|
29
|
31
|
this.getcheckinDetails(id, type)
|
30
|
32
|
// this.getcheckinDetails()
|
|
@@ -33,14 +35,14 @@ export default class checkin extends Component {
|
33
|
35
|
// dynamicId
|
34
|
36
|
getcheckinDetails (id, type) {
|
35
|
37
|
console.log('1111')
|
36
|
|
- // const id = '39a0e51e6fea9cb758abed08dd7fb16b'
|
|
38
|
+ // const aid = '39a0e51e6fea9cb758abed08dd7fb16b'
|
37
|
39
|
Taro.showLoading()
|
38
|
40
|
checkinDetails(id, type).then(res => {
|
39
|
41
|
Taro.hideLoading()
|
40
|
42
|
this.setState({
|
41
|
43
|
data: res
|
42
|
44
|
})
|
43
|
|
- console.log('1111', res)
|
|
45
|
+ console.log('1111', res.enlist.attendNum)
|
44
|
46
|
})
|
45
|
47
|
}
|
46
|
48
|
|
|
@@ -52,7 +54,8 @@ export default class checkin extends Component {
|
52
|
54
|
checkinActive(enlistId).then(res => {
|
53
|
55
|
Taro.hideLoading()
|
54
|
56
|
Taro.navigateTo({
|
55
|
|
- url: '/pages/checkin/checkinsuccess/index'
|
|
57
|
+ url: '/pages/checkin/checkinsuccess/index?addPoints=' + res.addPoints,
|
|
58
|
+
|
56
|
59
|
})
|
57
|
60
|
}).catch((err) => {
|
58
|
61
|
console.log('签到失败')
|
|
@@ -63,54 +66,68 @@ export default class checkin extends Component {
|
63
|
66
|
|
64
|
67
|
|
65
|
68
|
}
|
66
|
|
-
|
67
|
|
- toactivity () {
|
|
69
|
+ // toshop () {
|
|
70
|
+ // wx.switchTab({
|
|
71
|
+ // url: '/pages/shop/index'
|
|
72
|
+ // });
|
|
73
|
+ // }
|
|
74
|
+ toactivity = (id) => {
|
|
75
|
+
|
|
76
|
+ // console.log("this.state.data.dynamic.dynamicId")
|
|
77
|
+ console.log(id)
|
|
78
|
+ console.log(this.state.data.dynamic.dynamicId)
|
68
|
79
|
Taro.navigateTo({
|
69
|
|
- // url: '/pages/checkin/checkinsuccess/index'
|
|
80
|
+ // url: '/pages/activity/detail/index?id=' + item.id`/pages/card/list/index?buildingId=${this.$router.params.buildingId}`
|
|
81
|
+ url: '/pages/activity/detail/index',
|
|
82
|
+ query: {
|
|
83
|
+ id: id
|
|
84
|
+ }
|
70
|
85
|
})
|
71
|
86
|
}
|
72
|
87
|
|
73
|
88
|
render () {
|
74
|
|
- const { data = { person: {}, dynamic: {} }, style } = this.props
|
75
|
89
|
|
|
90
|
+ // const { data = { person: {}, dynamic: {} }, style } = this.props
|
|
91
|
+ // console.log("data" ,this.data)
|
76
|
92
|
return (
|
77
|
93
|
<View className="checkin" style="width:100vw;height:100vh;" >
|
78
|
94
|
|
79
|
95
|
{/* <checkinsuccess></checkinsuccess> */}
|
80
|
96
|
{/* <achievePhone></achievePhone> */}
|
81
|
97
|
<View>
|
82
|
|
- <Image className="img" src={data.dynamic.imgUrl} ></Image>
|
|
98
|
+ <Image className="img" src={this.state.data.dynamic.imgUrl} ></Image>
|
83
|
99
|
</View>
|
84
|
100
|
<View style="margin-bottom:20px" >
|
85
|
|
- <View className="text1"> <Text>{data.dynamic.title}</Text></View>
|
|
101
|
+ <View className="text1"> <Text>{this.state.data.dynamic.title}</Text></View>
|
86
|
102
|
</View >
|
87
|
103
|
|
88
|
|
- {data.enlist != null && <View>
|
89
|
|
- <View style="text-align: center;">
|
90
|
|
- <Text className="line">- - - - - - - - - </Text>
|
91
|
|
- <Text className="text2">活动报名信息</Text>
|
92
|
|
- <Text className="line">- - - - - - - - - </Text>
|
|
104
|
+ {this.state.data.enlist.enlistId != null && <View>
|
|
105
|
+ <View style="text-align: center;display:inline-block;width:100vw;">
|
|
106
|
+ <View style="text-align: center;display:inline-block;" className="line">- - - - - - - - - - - - - - </View>
|
|
107
|
+ <View style="display:inline-block;" className="text2">活动报名信息</View>
|
|
108
|
+ <View style="text-align: center;display:inline-block;" className="line">- - - - - - - - - - - - - </View>
|
93
|
109
|
</View>
|
94
|
110
|
|
95
|
111
|
<View className="text3">
|
96
|
112
|
<View className='at-row'>
|
97
|
113
|
<View className='at-col at-col-3'>用户名:</View>
|
98
|
|
- <View className='at-col at-col-9'>{data.person.name || data.person.nickname}</View>
|
|
114
|
+ <View className='at-col at-col-9'>{this.state.data.person.name || this.state.data.person.nickname}</View>
|
99
|
115
|
</View>
|
100
|
116
|
<View className='at-row'>
|
101
|
117
|
<View className='at-col at-col-3'>手机号:</View>
|
102
|
|
- <View className='at-col at-col-9'>{data.person.tel || data.person.phone}</View>
|
|
118
|
+ <View className='at-col at-col-9'>{this.state.data.person.tel || this.state.data.person.phone}</View>
|
103
|
119
|
</View>
|
104
|
120
|
<View className='at-row'>
|
105
|
121
|
<View className='at-col at-col-3'>参与人数:</View>
|
106
|
|
- <View className='at-col at-col-9'>{(data.enlist || {}).attendNum}</View>
|
|
122
|
+ <View className='at-col at-col-9'>{(this.state.data.enlist.attendNum || 1)}人</View>
|
107
|
123
|
</View>
|
108
|
124
|
</View>
|
109
|
125
|
|
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>}
|
|
126
|
+ {this.state.data.enlist.isCheckin === 0 && <Image className="checkinImg" src={require('@assets/checkin/checkin.png')} onClick={this.checkinActive} ></Image>}
|
|
127
|
+ {this.state.data.enlist.isCheckin === 1 && <Image className="checkinImg" src={require('@assets/checkin/checkined.png')}></Image>}
|
|
128
|
+ {/* {console.log(data.person.status)} */}
|
112
|
129
|
</View>}
|
113
|
|
- {data.enlist == null && <View className="unregistered">
|
|
130
|
+ {this.state.data.enlist.enlistId == null && <View className="unregistered">
|
114
|
131
|
<View>
|
115
|
132
|
<Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
|
116
|
133
|
</View>
|
|
@@ -118,8 +135,8 @@ export default class checkin extends Component {
|
118
|
135
|
<Text className="messageText" >您还未报名当前活动,请先前往活动报名页报名成功后再进行扫码签到~ </Text>
|
119
|
136
|
|
120
|
137
|
</View>
|
121
|
|
-
|
122
|
|
- <AtButton type='primary' className="toactivebutton">立即前往</AtButton>
|
|
138
|
+{console.log(this.state.data.dynamic.dynamicId)}
|
|
139
|
+ <AtButton type='primary' className="toactivebutton" onClick={() => { this.toactivity(this.state.data.dynamic.dynamicId) }}>立即前往</AtButton>
|
123
|
140
|
{/* <Image src={require('@assets/checkin/checkin.png')} style="position: absolute; width:110px;height:110px ;bottom:12vh;left:132.5px" ></Image> */}
|
124
|
141
|
</View>}
|
125
|
142
|
</View>
|