Browse Source

Merge branch 'v3.5.1' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into v3.5.1

许静 5 years ago
parent
commit
c6d8f3552e
2 changed files with 46 additions and 20 deletions
  1. 3
    2
      src/app.js
  2. 43
    18
      src/pages/checkin/index.js

+ 3
- 2
src/app.js View File

102
 
102
 
103
       'pages/checkin/index',
103
       'pages/checkin/index',
104
       'pages/checkin/checkinsuccess/index',
104
       'pages/checkin/checkinsuccess/index',
105
-      // 'pages/checkin/unregistered/index',
105
+     
106
 
106
 
107
     ],
107
     ],
108
     window: {
108
     window: {
225
     return new Promise(resolve => {
225
     return new Promise(resolve => {
226
       const router = this.$router.params
226
       const router = this.$router.params
227
       let { query: { scene: paramsId } } = router
227
       let { query: { scene: paramsId } } = router
228
-
228
+console.log(paramsId,'paramsId---')
229
       if (paramsId) {
229
       if (paramsId) {
230
         // 扫码进入
230
         // 扫码进入
231
         getCodeScene(paramsId).then(res => {
231
         getCodeScene(paramsId).then(res => {
255
 
255
 
256
         resolve(router)
256
         resolve(router)
257
       }
257
       }
258
+      
258
     })
259
     })
259
   }
260
   }
260
   // 在 App 类中的 render() 函数没有实际作用
261
   // 在 App 类中的 render() 函数没有实际作用

+ 43
- 18
src/pages/checkin/index.js View File

4
 
4
 
5
 // import achievePhone from '@components/achievePhone'
5
 // import achievePhone from '@components/achievePhone'
6
 import { checkinDetails, checkinActive } from '@services/checkin'
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
 export default class checkin extends Component {
14
 export default class checkin extends Component {
11
 
15
 
12
   state = {
16
   state = {
16
   }
20
   }
17
 
21
 
18
   componentWillMount () {
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
   // dynamicId
65
   // dynamicId
41
   getcheckinDetails (id, type) {
66
   getcheckinDetails (id, type) {
66
         title: `失败: ${err.message}`,
91
         title: `失败: ${err.message}`,
67
         icon: 'none'
92
         icon: 'none'
68
       })
93
       })
69
-    
94
+
70
       console.error(err)
95
       console.error(err)
71
     })
96
     })
72
   }
97
   }
80
 
105
 
81
   render () {
106
   render () {
82
     const { dynamic = {}, enlist = {}, person = {} } = this.state.data || {}
107
     const { dynamic = {}, enlist = {}, person = {} } = this.state.data || {}
83
-    const {  activityStatus   } =  dynamic  || {}
108
+    const { activityStatus } = dynamic || {}
84
     console.log(enlist, 'enlist')
109
     console.log(enlist, 'enlist')
85
     return (
110
     return (
86
       <View className="checkin" style="width:100vw;height:100vh;" >
111
       <View className="checkin" style="width:100vw;height:100vh;" >
130
         </View>
155
         </View>
131
           }
156
           }
132
 
157
 
133
-          {!activityStatus &&
158
+          {activityStatus===0 &&
134
             <View>
159
             <View>
135
               <View>
160
               <View>
136
                 <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>
161
                 <Image className="img1" src={require('@assets/checkin/noentry.png')} ></Image>