Browse Source

add bookie total wagger

EthnaYeh 6 years ago
parent
commit
64e9ac0431
2 changed files with 14 additions and 8 deletions
  1. 6 0
      src/api/gambleGameBucket.js
  2. 8 8
      src/views/gambleGameBucket/detail/index.vue

+ 6 - 0
src/api/gambleGameBucket.js

65
   })
65
   })
66
 }
66
 }
67
 
67
 
68
+export function fetchWagerRecord(data, query = { round: 1 }) {
69
+  return request({
70
+    url: `/gambleGameBuckets/${data.id}/round/${query.round}/wagerRecord`,
71
+    method: 'get'
72
+  })
73
+}
68
 // export function fetchRoundRecord(data) {
74
 // export function fetchRoundRecord(data) {
69
 //   return request({
75
 //   return request({
70
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,
76
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,

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

151
 <script>
151
 <script>
152
 
152
 
153
 import { mapGetters, mapActions } from 'vuex'
153
 import { mapGetters, mapActions } from 'vuex'
154
-import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord, fetchGameBid } from '@/api/gambleGameBucket'
154
+import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord, fetchGameBid, fetchWagerRecord } from '@/api/gambleGameBucket'
155
 import { fetchGambleMemberList } from '@/api/gambleMember'
155
 import { fetchGambleMemberList } from '@/api/gambleMember'
156
 import { ponitTransform } from '@/utils/point'
156
 import { ponitTransform } from '@/utils/point'
157
 import _ from 'lodash'
157
 import _ from 'lodash'
177
       memberRecord: [],
177
       memberRecord: [],
178
       door: 0,
178
       door: 0,
179
       bidChips: 0,
179
       bidChips: 0,
180
+      wagerRecord: [],
180
     }
181
     }
181
   },
182
   },
182
   created() {
183
   created() {
184
+    fetchWagerRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
185
+      this.wagerRecord = response.data
186
+    })
183
     fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
187
     fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
184
       this.door = response.data.initialDoor
188
       this.door = response.data.initialDoor
185
     })
189
     })
340
     },
344
     },
341
     getSummaries() {
345
     getSummaries() {
342
       const sums = []
346
       const sums = []
343
-      this.memberRecord.map((group, index) => {
344
-        if (index === 0) sums[index] = '總押注'
345
-        let doorTotal = 0
346
-        group.map((door) => {
347
-          doorTotal += door.wager
347
+        this.wagerRecord.map((door, index) => {
348
+          if (index === 0) sums[index] = '總押注'
349
+          sums[index+1] = door.chips
348
         })
350
         })
349
-        sums[index + 1] = doorTotal
350
-      })
351
       return sums
351
       return sums
352
     },
352
     },
353
     handleFilter() {
353
     handleFilter() {