xujing il y a 5 ans
Parent
révision
a0469cecdd

+ 5
- 1
src/pages/activity/detail/assemble.js Voir le fichier

@@ -120,8 +120,11 @@ export default class Detail extends Component {
120 120
       const router = Taro.getStorageSync('router') || { query: {} }
121 121
       let id = this.$router.params.id || router.query.id
122 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 128
         getQrCodeParams(this.$router.params.scene).then(res => {
126 129
           console.log(res,"扫码参数")
127 130
           this.setState({ id: res.id, recordId: res.recordId, qrcodeParams: res }, () => {
@@ -134,6 +137,7 @@ export default class Detail extends Component {
134 137
           })
135 138
         })
136 139
       } else {
140
+        console.log('没有id,不请求扫码参数接口')
137 141
         this.setState({ id, recordId }, () => {
138 142
           this.loadDetail()
139 143
         })

+ 5
- 1
src/pages/activity/detail/assistance.js Voir le fichier

@@ -122,8 +122,11 @@ export default class Detail extends Component {
122 122
       const router = Taro.getStorageSync('router') || { query: {} }
123 123
       let id = this.$router.params.id || router.query.id
124 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 130
         getQrCodeParams(this.$router.params.scene).then(res => {
128 131
           console.log(res,"扫码参数")
129 132
           this.setState({ id: res.id, initiateId: res.initiateId, qrcodeParams: res, }, () => {
@@ -136,6 +139,7 @@ export default class Detail extends Component {
136 139
           })
137 140
         })
138 141
       } else {
142
+        console.log('没有id,不请求扫码参数接口')
139 143
         this.setState({ id, initiateId }, () => {
140 144
           this.loadDetail()
141 145
         })

+ 5
- 1
src/pages/activity/detail/index.js Voir le fichier

@@ -58,7 +58,10 @@ export default class Detail extends Component {
58 58
     ready.queue(() => {
59 59
       const router = Taro.getStorageSync('router') || { query: {} }
60 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 65
         getQrCodeParams(this.$router.params.scene).then(res => {
63 66
           console.log(res,"扫码参数")
64 67
           this.setState({ id: res.id, qrcodeParams: res }, () => {
@@ -71,6 +74,7 @@ export default class Detail extends Component {
71 74
           })
72 75
         })
73 76
       } else {
77
+        console.log('没有id,不请求扫码参数接口')
74 78
         this.setState({ id }, () => {
75 79
           this.loadDetail()
76 80
         })

+ 5
- 1
src/pages/news/detail/index.js Voir le fichier

@@ -61,8 +61,11 @@ export default class NewsDetail extends Component {
61 61
       }
62 62
 
63 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 69
         getQrCodeParams(this.$router.params.scene).then(res => {
67 70
           console.log(res,"扫码参数")
68 71
           this.setState({ newsId: res.id, qrcodeParams: res }, () => {
@@ -76,6 +79,7 @@ export default class NewsDetail extends Component {
76 79
           })
77 80
         })
78 81
       } else {
82
+        console.log('有id,不请求扫码参数接口')
79 83
         this.setState({ newsId }, () => {
80 84
           this.loadDetail()
81 85
           addNewsUv(newsId)

+ 3
- 2
src/pages/project/detail/index.js Voir le fichier

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