Przeglądaj źródła

all current chips

EthnaYeh 6 lat temu
rodzic
commit
a30e13f26e

+ 6 - 0
src/api/gambleGameBucket.js

@@ -71,6 +71,12 @@ export function fetchWagerRecord(data, query = { round: 1 }) {
71 71
     method: 'get'
72 72
   })
73 73
 }
74
+export function fetchMemberInfo(data, query = { round: 1 }) {
75
+  return request({
76
+    url: `/gambleGameBuckets/${data.id}/round/${query.round}/memberInfo`,
77
+    method: 'get'
78
+  })
79
+}
74 80
 // export function fetchRoundRecord(data) {
75 81
 //   return request({
76 82
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,

+ 14 - 25
src/views/gambleGameBucket/detail/index.vue

@@ -122,7 +122,10 @@
122 122
             <div :style="moneyColor(scope.row.totalChips)">{{scope.row.totalChips}}</div>
123 123
           </template>
124 124
         </el-table-column>
125
-        <el-table-column prop="MemberRecord.currentChips" label="最終積分">
125
+        <el-table-column label="最終積分">
126
+          <template slot-scope="scope">
127
+            <div>{{scope.row.MemberRecord.currentChips+scope.row.MemberRecord.chips}}</div>
128
+          </template>
126 129
         </el-table-column>
127 130
       </el-table-column>      
128 131
     </el-table>
@@ -155,7 +158,7 @@
155 158
 <script>
156 159
 
157 160
 import { mapGetters, mapActions } from 'vuex'
158
-import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord, fetchGameBid, fetchWagerRecord } from '@/api/gambleGameBucket'
161
+import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord, fetchGameBid, fetchWagerRecord, fetchMemberInfo } from '@/api/gambleGameBucket'
159 162
 import { fetchGambleMemberList } from '@/api/gambleMember'
160 163
 import { ponitTransform } from '@/utils/point'
161 164
 import _ from 'lodash'
@@ -274,6 +277,7 @@ export default {
274 277
         this.bookie[0].effectiveWagger = _.sumBy(this.detail, item => {
275 278
           return Math.abs(item.MemberRecord.earned) ;
276 279
         })
280
+        console.log('ssss', this.detail)
277 281
         this.bookie[0].bookieResult = this.bookie[0].MemberRecord.earned - this.bookie[0].MemberRecord.serviceFees
278 282
         // console.log('bookie', this.bookie[0].effectiveWagger)
279 283
         this.group.map((item, itemIndex) => {
@@ -310,40 +314,25 @@ export default {
310 314
         this.func = eval(`(function() {${this.statement}})`)
311 315
       })
312 316
 
313
-      fetchGambleMemberList({ page: 1, limit: 9999999999, chipsSort: 'DESC' }).then(response => {
314
-        let { rows } = response.data
315
-        this.members = [];
317
+      fetchMemberInfo(this.data.secondLayer, this.listQuery).then(response => {
318
+        let { data } = response
319
+    
316 320
         let members = {}
317
-        // TODO refactor
318
-        let recordMembers = _.groupBy(this.memberRecordTemp, record => {
319
-          return record.GambleMember.id
320
-        })
321
-        recordMembers = Object.values(recordMembers)
322
-        let roundMembers = []
323
-        recordMembers.map(member => {
324
-          let roundMember = {}
325
-          roundMember.chips = member[0].currentChips
326
-          roundMember.name = member[0].GambleMember.name
327
-          roundMember.id = member[0].GambleMember.id
328
-          roundMembers.push(roundMember)
329
-        })
330
-        rows = _.unionBy(roundMembers, rows, "id");
331
-        rows = _.sortBy(rows, 'chips').reverse()
332
-        rows.map((person, index) => {
321
+        data.map((person, index) => {
333 322
           if (index % 4 === 0) {
334
-            members.name_0 = person.name
323
+            members.name_0 = person.GambleMember.name
335 324
             members.chips_0 = person.chips
336 325
             index === response.data.count - 1 ? this.members.push(members) : false
337 326
           } else if (index % 4 === 1) {
338
-            members.name_1 = person.name
327
+            members.name_1 = person.GambleMember.name
339 328
             members.chips_1 = person.chips
340 329
             index === response.data.count - 1 ? this.members.push(members) : false
341 330
           } else if (index % 4 === 2) {
342
-            members.name_2 = person.name
331
+            members.name_2 = person.GambleMember.name
343 332
             members.chips_2 = person.chips
344 333
             index === response.data.count - 1 ? this.members.push(members) : false
345 334
           } else if (index % 4 === 3) {
346
-            members.name_3 = person.name
335
+            members.name_3 = person.GambleMember.name
347 336
             members.chips_3 = person.chips
348 337
             this.members.push(members)
349 338
             members = {}