Browse Source

fix reload prblom

ethan 6 years ago
parent
commit
baf36c5bae
1 changed files with 8 additions and 9 deletions
  1. 8 9
      src/views/gambleGameBucket/detail/index.vue

+ 8 - 9
src/views/gambleGameBucket/detail/index.vue

214
       roundTime: 0,
214
       roundTime: 0,
215
     }
215
     }
216
   },
216
   },
217
-  created() {
218
-    console.log('eeee', this.data.secondLayer)
217
+  async created() {
218
+    await fetchRoundCount(this.data.secondLayer).then((response) => {
219
+      this.listQuery.round = response.data
220
+      for (let i = 1; i <= response.data; i++) {
221
+        this.roundOptions.push({ label: `第 ${i} 關`, key: i })
222
+      }
223
+    })
219
     fetchRoundRecord(this.data.secondLayer, this.listQuery).then(response => {
224
     fetchRoundRecord(this.data.secondLayer, this.listQuery).then(response => {
220
       this.roundTime = response.data.createdAt
225
       this.roundTime = response.data.createdAt
221
       this.door = response.data.initialDoor
226
       this.door = response.data.initialDoor
223
     // fetchGameBid(this.data.secondLayer).then(response => {
228
     // fetchGameBid(this.data.secondLayer).then(response => {
224
     //   this.bidChips = response.data
229
     //   this.bidChips = response.data
225
     // })
230
     // })
226
-    fetchRoundCount(this.data.secondLayer).then((response) => {
227
-      this.listQuery.round = response.data
228
-      for (let i = 1; i <= response.data; i++) {
229
-        this.roundOptions.push({ label: `第 ${i} 關`, key: i })
230
-      }
231
-    })
232
     this.SetVisible(2)
231
     this.SetVisible(2)
233
     this.getList()
232
     this.getList()
234
   },
233
   },
406
       fetchRoundRecord(this.data.secondLayer, this.listQuery).then(response => {
405
       fetchRoundRecord(this.data.secondLayer, this.listQuery).then(response => {
407
         this.roundTime = response.data.createdAt        
406
         this.roundTime = response.data.createdAt        
408
         this.door = response.data.initialDoor
407
         this.door = response.data.initialDoor
409
-        this.listQuery.round = response.data.initialDoor
410
       })
408
       })
409
+      console.log('door', this.door)
411
       // this.SetQuery({layer:2, query: {round: this.query.secondLayer.round}})      
410
       // this.SetQuery({layer:2, query: {round: this.query.secondLayer.round}})      
412
       this.dealing = []
411
       this.dealing = []
413
       this.getList()
412
       this.getList()