|
@@ -0,0 +1,133 @@
|
|
1
|
+import Taro, { Component } from '@tarojs/taro';
|
|
2
|
+import './index.scss'
|
|
3
|
+import { AtDivider, AtList, AtListItem, AtGrid, AtButton } from 'taro-ui'
|
|
4
|
+
|
|
5
|
+import achievePhone from '@components/achievePhone'
|
|
6
|
+import { checkinDetails, checkinActive } from '@services/checkin'
|
|
7
|
+
|
|
8
|
+// import { checkinActive } from '@services/checkin'
|
|
9
|
+
|
|
10
|
+export default class checkin extends Component {
|
|
11
|
+
|
|
12
|
+ state = {
|
|
13
|
+ id:'',
|
|
14
|
+ // ischeck:''
|
|
15
|
+ // isLogin: false,
|
|
16
|
+ // user: {},
|
|
17
|
+ // isAgent: false,//经纪人
|
|
18
|
+ // consultant: false,//置业顾问
|
|
19
|
+ // tourist: false,//普通用户
|
|
20
|
+ data: {},
|
|
21
|
+ }
|
|
22
|
+
|
|
23
|
+ componentWillMount () {
|
|
24
|
+ console.log(this.$router.params,'22222')
|
|
25
|
+
|
|
26
|
+ const { id, type } = this.$router.params
|
|
27
|
+
|
|
28
|
+ console.log(id, type)
|
|
29
|
+ this.getcheckinDetails(id, type)
|
|
30
|
+ // this.getcheckinDetails()
|
|
31
|
+
|
|
32
|
+ }
|
|
33
|
+ // dynamicId
|
|
34
|
+ getcheckinDetails (id, type) {
|
|
35
|
+ console.log('1111')
|
|
36
|
+ // const id = '39a0e51e6fea9cb758abed08dd7fb16b'
|
|
37
|
+ Taro.showLoading()
|
|
38
|
+ checkinDetails(id, type).then(res => {
|
|
39
|
+ Taro.hideLoading()
|
|
40
|
+ this.setState({
|
|
41
|
+ data: res
|
|
42
|
+ })
|
|
43
|
+ console.log('1111', res)
|
|
44
|
+ })
|
|
45
|
+ }
|
|
46
|
+
|
|
47
|
+ checkinActive () {
|
|
48
|
+
|
|
49
|
+ // alert('签到成功')
|
|
50
|
+ const enlistId = this.state.data.enlist.enlistId
|
|
51
|
+ Taro.showLoading()
|
|
52
|
+ checkinActive(enlistId).then(res => {
|
|
53
|
+ Taro.hideLoading()
|
|
54
|
+ Taro.navigateTo({
|
|
55
|
+ url: '/pages/checkin/checkinsuccess/index'
|
|
56
|
+ })
|
|
57
|
+ }).catch((err) => {
|
|
58
|
+ console.log('签到失败')
|
|
59
|
+ // Taro.navigateTo({
|
|
60
|
+ // url: '/pages/checkin/checkinsuccess/index'
|
|
61
|
+ // })
|
|
62
|
+ })
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+ }
|
|
66
|
+
|
|
67
|
+ toactivity () {
|
|
68
|
+ Taro.navigateTo({
|
|
69
|
+ // url: '/pages/checkin/checkinsuccess/index'
|
|
70
|
+ })
|
|
71
|
+ }
|
|
72
|
+
|
|
73
|
+ render () {
|
|
74
|
+ const { data, style } = this.props
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+ return (
|
|
79
|
+ <View className="checkin" style="width:100vw;height:100vh;" >
|
|
80
|
+
|
|
81
|
+ {/* <checkinsuccess></checkinsuccess> */}
|
|
82
|
+ {/* <achievePhone></achievePhone> */}
|
|
83
|
+ <View>
|
|
84
|
+ <Image className="img" src={this.state.data.dynamic.imgUrl} ></Image>
|
|
85
|
+ </View>
|
|
86
|
+ <View style="margin-bottom:20px" >
|
|
87
|
+ <View className="text1"> <Text>{this.state.data.dynamic.title}</Text></View>
|
|
88
|
+ </View >
|
|
89
|
+
|
|
90
|
+ {this.state.data.enlist != null && <View>
|
|
91
|
+ <View style="text-align: center;">
|
|
92
|
+ <Text className="line">- - - - - - - - - </Text>
|
|
93
|
+ <Text className="text2">活动报名信息</Text>
|
|
94
|
+ <Text className="line">- - - - - - - - - </Text>
|
|
95
|
+ </View>
|
|
96
|
+
|
|
97
|
+ <View className="text3">
|
|
98
|
+ <View className='at-row'>
|
|
99
|
+ <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>
|
|
101
|
+ </View>
|
|
102
|
+ <View className='at-row'>
|
|
103
|
+ <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>
|
|
105
|
+ </View>
|
|
106
|
+ <View className='at-row'>
|
|
107
|
+ <View className='at-col at-col-3'>参与人数:</View>
|
|
108
|
+ <View className='at-col at-col-9'>{this.state.data.enlist.attendNum}</View>
|
|
109
|
+ </View>
|
|
110
|
+ </View>
|
|
111
|
+
|
|
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>}
|
|
116
|
+ </View>}
|
|
117
|
+ {this.state.data.enlist == null && <View className="unregistered">
|
|
118
|
+ <View>
|
|
119
|
+ <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
|
|
120
|
+ </View>
|
|
121
|
+ <View className="message">
|
|
122
|
+ <Text className="messageText" >您还未报名当前活动,请先前往活动报名页报名成功后再进行扫码签到~ </Text>
|
|
123
|
+
|
|
124
|
+ </View>
|
|
125
|
+
|
|
126
|
+ <AtButton type='primary' className="toactivebutton">立即前往</AtButton>
|
|
127
|
+ {/* <Image src={require('@assets/checkin/checkin.png')} style="position: absolute; width:110px;height:110px ;bottom:12vh;left:132.5px" ></Image> */}
|
|
128
|
+ </View>}
|
|
129
|
+ </View>
|
|
130
|
+
|
|
131
|
+ );
|
|
132
|
+ }
|
|
133
|
+}
|