|
@@ -4,9 +4,13 @@ import { AtDivider, AtList, AtListItem, AtGrid, AtButton } from 'taro-ui'
|
4
|
4
|
|
5
|
5
|
// import achievePhone from '@components/achievePhone'
|
6
|
6
|
import { checkinDetails, checkinActive } from '@services/checkin'
|
7
|
|
-import { parseQueryString } from '@utils/tools'
|
8
|
|
-import { NONAME } from 'dns';
|
|
7
|
+import {
|
|
8
|
+ getCodeScene,
|
9
|
9
|
|
|
10
|
+} from '@services/common'
|
|
11
|
+import { parseQueryString, getQueryString } from '@utils/tools'
|
|
12
|
+import { NONAME } from 'dns';
|
|
13
|
+import ready from '@utils/ready'
|
10
|
14
|
export default class checkin extends Component {
|
11
|
15
|
|
12
|
16
|
state = {
|
|
@@ -16,26 +20,47 @@ export default class checkin extends Component {
|
16
|
20
|
}
|
17
|
21
|
|
18
|
22
|
componentWillMount () {
|
19
|
|
-
|
|
23
|
+ ready.queue(() => {
|
|
24
|
+ const router = Taro.getStorageSync('router')
|
|
25
|
+
|
|
26
|
+ const { id = router.query.id, type = router.query.type || '' } = parseQueryString(router.query.params)
|
|
27
|
+ console.log(id, 'id-----')
|
|
28
|
+ this.setState({ id, type })
|
|
29
|
+ this.getcheckinDetails(id, type)
|
|
30
|
+
|
|
31
|
+ // const routers = wx.getLaunchOptionsSync()
|
20
|
32
|
|
|
33
|
+ // const { query: { scene } } = routers
|
|
34
|
+ // console.log(routers, 'routers-----')
|
21
|
35
|
|
22
|
|
- const router = Taro.getStorageSync('router')
|
23
|
|
- console.log('router---', parseQueryString)
|
24
|
|
- console.log(router)
|
25
|
|
- // const id = router.query.paramsId
|
26
|
|
- // const type = router.query.type || ''
|
27
|
36
|
|
28
|
|
- const { id = router.query.id , type = router.query.type || '' } = parseQueryString(router.query.params)
|
29
|
|
- console.log(id, 'id-----')
|
30
|
|
- this.setState({ id, type })
|
31
|
|
-
|
|
37
|
+ // console.log(scene, 'query-----')
|
|
38
|
+ // getCodeScene(scene).then(res => {
|
|
39
|
+
|
|
40
|
+ // let params = JSON.parse(res).scene
|
|
41
|
+
|
|
42
|
+ // let id = getQueryString(params, 'id')
|
|
43
|
+ // let type = getQueryString(params, 'type')
|
|
44
|
+
|
|
45
|
+ // this.setState({ id, type })
|
|
46
|
+ // this.getcheckinDetails(id, type)
|
|
47
|
+ // })
|
|
48
|
+
|
|
49
|
+ })
|
|
50
|
+
|
32
|
51
|
|
33
|
52
|
|
34
|
53
|
}
|
|
54
|
+ // const router = Taro.getStorageSync('router')
|
35
|
55
|
|
36
|
|
- componentDidShow(){
|
37
|
|
- const { id , type } = this.state
|
38
|
|
-this.getcheckinDetails(id, type)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+ // const { id = router.query.id , type = router.query.type || '' } = parseQueryString(router.query.params)
|
|
59
|
+ // console.log(id, 'id-----')
|
|
60
|
+ // this.setState({ id, type })
|
|
61
|
+ componentDidShow () {
|
|
62
|
+ const { id, type } = this.state
|
|
63
|
+ // this.getcheckinDetails(id, type)
|
39
|
64
|
}
|
40
|
65
|
// dynamicId
|
41
|
66
|
getcheckinDetails (id, type) {
|
|
@@ -66,7 +91,7 @@ this.getcheckinDetails(id, type)
|
66
|
91
|
title: `失败: ${err.message}`,
|
67
|
92
|
icon: 'none'
|
68
|
93
|
})
|
69
|
|
-
|
|
94
|
+
|
70
|
95
|
console.error(err)
|
71
|
96
|
})
|
72
|
97
|
}
|
|
@@ -80,7 +105,7 @@ this.getcheckinDetails(id, type)
|
80
|
105
|
|
81
|
106
|
render () {
|
82
|
107
|
const { dynamic = {}, enlist = {}, person = {} } = this.state.data || {}
|
83
|
|
- const { activityStatus } = dynamic || {}
|
|
108
|
+ const { activityStatus } = dynamic || {}
|
84
|
109
|
console.log(enlist, 'enlist')
|
85
|
110
|
return (
|
86
|
111
|
<View className="checkin" style="width:100vw;height:100vh;" >
|
|
@@ -130,7 +155,7 @@ this.getcheckinDetails(id, type)
|
130
|
155
|
</View>
|
131
|
156
|
}
|
132
|
157
|
|
133
|
|
- {!activityStatus &&
|
|
158
|
+ {activityStatus===0 &&
|
134
|
159
|
<View>
|
135
|
160
|
<View>
|
136
|
161
|
<Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
|