xujing 5 years ago
parent
commit
a0469cecdd

+ 5
- 1
src/pages/activity/detail/assemble.js View File

120
       const router = Taro.getStorageSync('router') || { query: {} }
120
       const router = Taro.getStorageSync('router') || { query: {} }
121
       let id = this.$router.params.id || router.query.id
121
       let id = this.$router.params.id || router.query.id
122
       let recordId = this.$router.params.recordId || router.query.recordId
122
       let recordId = this.$router.params.recordId || router.query.recordId
123
+      console.log(this.$router,"this.$router")
124
+      console.log(router,"----router-------->")
123
 
125
 
124
-      if (!id) {
126
+      if (this.$router.params.scene) {
127
+        console.log('没有id,请求扫码参数接口')
125
         getQrCodeParams(this.$router.params.scene).then(res => {
128
         getQrCodeParams(this.$router.params.scene).then(res => {
126
           console.log(res,"扫码参数")
129
           console.log(res,"扫码参数")
127
           this.setState({ id: res.id, recordId: res.recordId, qrcodeParams: res }, () => {
130
           this.setState({ id: res.id, recordId: res.recordId, qrcodeParams: res }, () => {
134
           })
137
           })
135
         })
138
         })
136
       } else {
139
       } else {
140
+        console.log('没有id,不请求扫码参数接口')
137
         this.setState({ id, recordId }, () => {
141
         this.setState({ id, recordId }, () => {
138
           this.loadDetail()
142
           this.loadDetail()
139
         })
143
         })

+ 5
- 1
src/pages/activity/detail/assistance.js View File

122
       const router = Taro.getStorageSync('router') || { query: {} }
122
       const router = Taro.getStorageSync('router') || { query: {} }
123
       let id = this.$router.params.id || router.query.id
123
       let id = this.$router.params.id || router.query.id
124
       let initiateId = this.$router.params.initiateId || router.query.initiateId
124
       let initiateId = this.$router.params.initiateId || router.query.initiateId
125
+      console.log(this.$router,"this.$router")
126
+      console.log(router,"----router-------->")
125
 
127
 
126
-      if (!id) {
128
+      if (this.$router.params.scene) {
129
+        console.log('没有id,请求扫码参数接口')
127
         getQrCodeParams(this.$router.params.scene).then(res => {
130
         getQrCodeParams(this.$router.params.scene).then(res => {
128
           console.log(res,"扫码参数")
131
           console.log(res,"扫码参数")
129
           this.setState({ id: res.id, initiateId: res.initiateId, qrcodeParams: res, }, () => {
132
           this.setState({ id: res.id, initiateId: res.initiateId, qrcodeParams: res, }, () => {
136
           })
139
           })
137
         })
140
         })
138
       } else {
141
       } else {
142
+        console.log('没有id,不请求扫码参数接口')
139
         this.setState({ id, initiateId }, () => {
143
         this.setState({ id, initiateId }, () => {
140
           this.loadDetail()
144
           this.loadDetail()
141
         })
145
         })

+ 5
- 1
src/pages/activity/detail/index.js View File

58
     ready.queue(() => {
58
     ready.queue(() => {
59
       const router = Taro.getStorageSync('router') || { query: {} }
59
       const router = Taro.getStorageSync('router') || { query: {} }
60
       const id = this.$router.params.id || router.query.id
60
       const id = this.$router.params.id || router.query.id
61
-      if (!id) {
61
+      console.log(this.$router,"this.$router")
62
+      console.log(router,"----router-------->")
63
+      if (this.$router.params.scene) {
64
+        console.log('没有id,请求扫码参数接口')
62
         getQrCodeParams(this.$router.params.scene).then(res => {
65
         getQrCodeParams(this.$router.params.scene).then(res => {
63
           console.log(res,"扫码参数")
66
           console.log(res,"扫码参数")
64
           this.setState({ id: res.id, qrcodeParams: res }, () => {
67
           this.setState({ id: res.id, qrcodeParams: res }, () => {
71
           })
74
           })
72
         })
75
         })
73
       } else {
76
       } else {
77
+        console.log('没有id,不请求扫码参数接口')
74
         this.setState({ id }, () => {
78
         this.setState({ id }, () => {
75
           this.loadDetail()
79
           this.loadDetail()
76
         })
80
         })

+ 5
- 1
src/pages/news/detail/index.js View File

61
       }
61
       }
62
 
62
 
63
       const newsId = this.$router.params.id || router.query.id
63
       const newsId = this.$router.params.id || router.query.id
64
+      console.log(this.$router,"this.$router")
65
+      console.log(router,"----router-------->")
64
 
66
 
65
-      if (!newsId) {
67
+      if (this.$router.params.scene) {
68
+        console.log('没有id,请求扫码参数接口')
66
         getQrCodeParams(this.$router.params.scene).then(res => {
69
         getQrCodeParams(this.$router.params.scene).then(res => {
67
           console.log(res,"扫码参数")
70
           console.log(res,"扫码参数")
68
           this.setState({ newsId: res.id, qrcodeParams: res }, () => {
71
           this.setState({ newsId: res.id, qrcodeParams: res }, () => {
76
           })
79
           })
77
         })
80
         })
78
       } else {
81
       } else {
82
+        console.log('有id,不请求扫码参数接口')
79
         this.setState({ newsId }, () => {
83
         this.setState({ newsId }, () => {
80
           this.loadDetail()
84
           this.loadDetail()
81
           addNewsUv(newsId)
85
           addNewsUv(newsId)

+ 3
- 2
src/pages/project/detail/index.js View File

85
       }
85
       }
86
 
86
 
87
       const id = this.$router.params.id || router.query.id
87
       const id = this.$router.params.id || router.query.id
88
-
88
+      console.log(this.$router,"this.$router")
89
+      console.log(router,"----router-------->")
89
       // 没有找到 id , 再重新找一次
90
       // 没有找到 id , 再重新找一次
90
-      if (!id) {
91
+      if (this.$router.params.scene) {
91
         console.log('没有项目id,请求扫码参数接口')
92
         console.log('没有项目id,请求扫码参数接口')
92
         getQrCodeParams(this.$router.params.scene).then(res => {
93
         getQrCodeParams(this.$router.params.scene).then(res => {
93
           console.log(res, "扫码参数")
94
           console.log(res, "扫码参数")