张延森 5 years ago
parent
commit
a8352ba24f
2 changed files with 20 additions and 5 deletions
  1. 2
    2
      project.config.json
  2. 18
    3
      src/pages/checkin/index.js

+ 2
- 2
project.config.json View File

@@ -1,8 +1,8 @@
1 1
 {
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "mini-chengjiao",
4
-	"description": "融创",
5
-	"appid": "wxe9e01aa4a3568f52",
4
+	"description": "知与行互动",
5
+	"appid": "wxd6f47a9bb3052175",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,

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

@@ -24,9 +24,24 @@ export default class checkin extends Component {
24 24
       const router = Taro.getStorageSync('router')
25 25
 
26 26
       const { id = router.query.id, type = router.query.type || '' } = parseQueryString(router.query.params)
27
+     
28
+      if (!id) {
29
+        getQrCodeParams(this.$router.params.scene).then(res => {
30
+          this.setState({ id: res.id, type: res.type }, () => {
31
+            this.setState({ id, type })
32
+            this.getcheckinDetails(id, type)
33
+          })
34
+        }).catch(err => {
35
+          Taro.showToast({
36
+            title: '没有找到活动',
37
+            icon: 'none'
38
+          })
39
+        })
40
+      } else {
41
+        this.setState({ id, type })
42
+        this.getcheckinDetails(id, type)
43
+      }
27 44
       console.log(id, 'id-----')
28
-      this.setState({ id, type })
29
-      this.getcheckinDetails(id, type)
30 45
 
31 46
       // const routers = wx.getLaunchOptionsSync()
32 47
 
@@ -59,7 +74,7 @@ export default class checkin extends Component {
59 74
   // console.log(id, 'id-----')
60 75
   // this.setState({ id, type })
61 76
   componentDidShow () {
62
-    const { id, type } = this.state
77
+    // const { id, type } = this.state
63 78
     // this.getcheckinDetails(id, type)
64 79
   }
65 80
   // dynamicId