Преглед на файлове

/gambleGameBuckets/:gambleGameBucketId/currentChips

ethan преди 6 години
родител
ревизия
4525071551
променени са 2 файла, в които са добавени 25 реда и са изтрити 12 реда
  1. 10 0
      src/api/gambleGameBucket.js
  2. 15 12
      src/views/room/gameHistory/index.vue

+ 10 - 0
src/api/gambleGameBucket.js

@@ -84,6 +84,16 @@ export function fetchPunishmentRecord(data, query = { round: 1 }) {
84 84
     method: 'get'
85 85
   })
86 86
 }
87
+
88
+export function fetchCurrentChips(data, query) {
89
+  return request({
90
+    url: `/gambleGameBuckets/${data.id}/currentChips`,
91
+    method: 'get',
92
+    params: {
93
+      gambleMemberId: query.id
94
+    }
95
+  })
96
+}
87 97
 // export function fetchRoundRecord(data) {
88 98
 //   return request({
89 99
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,

+ 15 - 12
src/views/room/gameHistory/index.vue

@@ -38,11 +38,6 @@
38 38
               <span :style="moneyColor(scope.row.wallet)">{{scope.row.wallet}}</span>
39 39
             </template>
40 40
           </el-table-column>
41
-          <el-table-column label="ID" align="center">
42
-            <template slot-scope="scope">
43
-              <span>{{scope.row.id}}</span>
44
-            </template>
45
-          </el-table-column>
46 41
           <el-table-column align="center" label="操作" width="250">
47 42
             <template slot-scope="scope">
48 43
                 <el-button v-show="scope.row.type==='遊戲'" type="primary" size="mini" icon="el-icon-tickets" @click="handlePersonDetail(scope.row)">個人明細</el-button>  
@@ -99,6 +94,7 @@
99 94
 
100 95
 import { mapActions, mapGetters } from 'vuex'
101 96
 import { fetchGameHistory, fetchChipsHistory, fetchPersonGameDetail } from '@/api/gambleMember'
97
+import { fetchCurrentChips } from '@/api/gambleGameBucket'
102 98
 import waves from '@/directive/waves' // 水波纹指令
103 99
 import moment from 'moment-timezone'
104 100
 import config from '../../../../config' 
@@ -122,6 +118,7 @@ export default {
122 118
         startAt: null, 
123 119
         endAt: null 
124 120
       }, 
121
+      tempCurrentChips: [],
125 122
       pickerOptions: {
126 123
         shortcuts: [{
127 124
           text: '本週',
@@ -169,13 +166,17 @@ export default {
169 166
       this.list = []
170 167
       fetchGameHistory(this.data.thirdLayer, this.listQuery).then(response => {
171 168
         this.chipLogList = response.data
169
+        console.log('wallet', this.chipLogList,this.data.thirdLayer)
170
+        this.tempCurrentChips = []
172 171
         this.chipLogList.map((item) => {
173
-          this.list.push({
174
-            id: item.game,
175
-            createdAt: item['GambleGame-Bucket'].createdAt,
176
-            type: '遊戲',
177
-            amount: item.earned,
178
-            wallet: 'N/A'
172
+          fetchCurrentChips(item['GambleGame-Bucket'], this.data.thirdLayer).then(response => {
173
+            this.list.push({
174
+              id: item.game,
175
+              createdAt: item['GambleGame-Bucket'].createdAt,
176
+              type: '遊戲',
177
+              amount: item.earned,
178
+              wallet: response.data.currentChips
179
+            })
179 180
           })
180 181
         })
181 182
         this.listLoading = false
@@ -195,6 +196,9 @@ export default {
195 196
             wallet: item.totalChips
196 197
           })
197 198
         })
199
+
200
+      })
201
+      console.log('eeeesdsad',this.list)
198 202
         this.list.sort(function compare(a, b) {
199 203
           const dateA = new Date(a.createdAt);
200 204
           const dateB = new Date(b.createdAt);
@@ -202,7 +206,6 @@ export default {
202 206
         });
203 207
         this.total = this.list.length
204 208
         this.listLoading = false
205
-      })
206 209
       
207 210
     },
208 211
     handlePersonDetail(row) {