Browse Source

/gambleGameBuckets/:gambleGameBucketId/currentChips

ethan 6 years ago
parent
commit
4525071551
2 changed files with 25 additions and 12 deletions
  1. 10 0
      src/api/gambleGameBucket.js
  2. 15 12
      src/views/room/gameHistory/index.vue

+ 10 - 0
src/api/gambleGameBucket.js

84
     method: 'get'
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
 // export function fetchRoundRecord(data) {
97
 // export function fetchRoundRecord(data) {
88
 //   return request({
98
 //   return request({
89
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,
99
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,

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

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