Explorar el Código

add bookie total wagger

EthnaYeh %!s(int64=6) %!d(string=hace) años
padre
commit
64e9ac0431
Se han modificado 2 ficheros con 14 adiciones y 8 borrados
  1. 6 0
      src/api/gambleGameBucket.js
  2. 8 8
      src/views/gambleGameBucket/detail/index.vue

+ 6 - 0
src/api/gambleGameBucket.js

@@ -65,6 +65,12 @@ export function fetchRoundRecord(data, query = { round: 1 }) {
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 74
 // export function fetchRoundRecord(data) {
69 75
 //   return request({
70 76
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,

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

@@ -151,7 +151,7 @@
151 151
 <script>
152 152
 
153 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 155
 import { fetchGambleMemberList } from '@/api/gambleMember'
156 156
 import { ponitTransform } from '@/utils/point'
157 157
 import _ from 'lodash'
@@ -177,9 +177,13 @@ export default {
177 177
       memberRecord: [],
178 178
       door: 0,
179 179
       bidChips: 0,
180
+      wagerRecord: [],
180 181
     }
181 182
   },
182 183
   created() {
184
+    fetchWagerRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
185
+      this.wagerRecord = response.data
186
+    })
183 187
     fetchRoundRecord(this.data.secondLayer, this.query.secondLayer).then(response => {
184 188
       this.door = response.data.initialDoor
185 189
     })
@@ -340,14 +344,10 @@ export default {
340 344
     },
341 345
     getSummaries() {
342 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 351
       return sums
352 352
     },
353 353
     handleFilter() {