|
@@ -17,30 +17,35 @@
|
17
|
17
|
</div>
|
18
|
18
|
<el-table :data="list" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row>
|
19
|
19
|
<el-table-column :label="member.name" align="center">
|
20
|
|
- <el-table-column label="場次" align="center">
|
|
20
|
+ <el-table-column label="時間" align="center">
|
21
|
21
|
<template slot-scope="scope">
|
22
|
|
- {{scope.row.game}}
|
|
22
|
+ <span>{{moment(scope.row.createdAt)}}</span>
|
23
|
23
|
</template>
|
24
|
24
|
</el-table-column>
|
25
|
|
- <el-table-column label="總押注" align="center">
|
|
25
|
+ <el-table-column label="事件" align="center">
|
26
|
26
|
<template slot-scope="scope">
|
27
|
|
- <span>{{scope.row.wager}}</span>
|
|
27
|
+ {{scope.row.type}}
|
28
|
28
|
</template>
|
29
|
29
|
</el-table-column>
|
30
|
|
- <el-table-column label="總輸贏" align="center">
|
|
30
|
+ <el-table-column label="金額" align="center">
|
31
|
31
|
<template slot-scope="scope">
|
32
|
|
- <span :style="moneyColor(scope.row.earned)">{{scope.row.earned}}</span>
|
|
32
|
+ <span :style="moneyColor(scope.row.amount)">{{scope.row.amount}}</span>
|
33
|
33
|
</template>
|
34
|
34
|
</el-table-column>
|
35
|
|
- <el-table-column label="時間" align="center">
|
|
35
|
+ <el-table-column label="錢包" align="center">
|
|
36
|
+ <template slot-scope="scope">
|
|
37
|
+ <span :style="moneyColor(scope.row.wallet)">{{scope.row.wallet}}</span>
|
|
38
|
+ </template>
|
|
39
|
+ </el-table-column>
|
|
40
|
+ <el-table-column label="ID" align="center">
|
36
|
41
|
<template slot-scope="scope">
|
37
|
|
- <span>{{moment(scope.row['GambleGame-Bucket'].createdAt)}}</span>
|
|
42
|
+ <span>{{scope.row.id}}</span>
|
38
|
43
|
</template>
|
39
|
44
|
</el-table-column>
|
40
|
45
|
<el-table-column align="center" label="操作" width="250">
|
41
|
46
|
<template slot-scope="scope">
|
42
|
|
- <el-button type="primary" size="mini" icon="el-icon-tickets" @click="handlePersonDetail(scope.row)">個人明細</el-button>
|
43
|
|
- <el-button type="primary" size="mini" icon="el-icon-tickets" @click="handleGameDetail(scope.row)">此場明細</el-button>
|
|
47
|
+ <el-button v-show="scope.row.type==='遊戲'" type="primary" size="mini" icon="el-icon-tickets" @click="handlePersonDetail(scope.row)">個人明細</el-button>
|
|
48
|
+ <el-button v-show="scope.row.type==='遊戲'" type="primary" size="mini" icon="el-icon-tickets" @click="handleGameDetail(scope.row)">此場明細</el-button>
|
44
|
49
|
</template>
|
45
|
50
|
</el-table-column>
|
46
|
51
|
</el-table-column>
|
|
@@ -92,9 +97,11 @@
|
92
|
97
|
<script>
|
93
|
98
|
|
94
|
99
|
import { mapActions, mapGetters } from 'vuex'
|
95
|
|
-import { fetchGameHistory, fetchPersonGameDetail } from '@/api/gambleMember'
|
|
100
|
+import { fetchGameHistory, fetchChipsHistory, fetchPersonGameDetail } from '@/api/gambleMember'
|
96
|
101
|
import waves from '@/directive/waves' // 水波纹指令
|
97
|
102
|
import moment from 'moment-timezone'
|
|
103
|
+import config from '../../../../config'
|
|
104
|
+import _ from 'lodash'
|
98
|
105
|
|
99
|
106
|
export default {
|
100
|
107
|
directives: {
|
|
@@ -102,7 +109,9 @@ export default {
|
102
|
109
|
},
|
103
|
110
|
data() {
|
104
|
111
|
return {
|
105
|
|
- list: null,
|
|
112
|
+ chipLogList: [],
|
|
113
|
+ gameRecordList: [],
|
|
114
|
+ list: [],
|
106
|
115
|
dialogList: null,
|
107
|
116
|
total: null,
|
108
|
117
|
listLoading: true,
|
|
@@ -177,15 +186,43 @@ export default {
|
177
|
186
|
getList() {
|
178
|
187
|
this.listLoading = true
|
179
|
188
|
fetchGameHistory(this.member, this.listQuery).then(response => {
|
180
|
|
- this.list = response.data
|
181
|
|
- this.total = response.data.length
|
|
189
|
+ this.chipLogList = response.data
|
|
190
|
+ this.chipLogList.map((item) => {
|
|
191
|
+ this.list.push({
|
|
192
|
+ id: item.game,
|
|
193
|
+ createdAt: item['GambleGame-Bucket'].createdAt,
|
|
194
|
+ type: '遊戲',
|
|
195
|
+ amount: item.earned,
|
|
196
|
+ wallet: 'N/A'
|
|
197
|
+ })
|
|
198
|
+ })
|
|
199
|
+ this.listLoading = false
|
|
200
|
+ })
|
|
201
|
+ fetchChipsHistory(this.member, this.listQuery).then(response => {
|
|
202
|
+ this.gameRecordList = response.data
|
|
203
|
+ this.gameRecordList.map((item) => {
|
|
204
|
+ this.list.push({
|
|
205
|
+ id: item.id,
|
|
206
|
+ createdAt: item.createdAt,
|
|
207
|
+ type: item.type === config.const.GambleMemberChipsLog.type.deposit ? '上 / 下 分':'獎勵 / 懲罰',
|
|
208
|
+ amount: item.chips,
|
|
209
|
+ wallet: item.totalChips
|
|
210
|
+ })
|
|
211
|
+ })
|
|
212
|
+ this.list.sort(function compare(a, b) {
|
|
213
|
+ const dateA = new Date(a.createdAt);
|
|
214
|
+ const dateB = new Date(b.createdAt);
|
|
215
|
+ return dateB - dateA;
|
|
216
|
+ });
|
|
217
|
+
|
182
|
218
|
this.listLoading = false
|
183
|
219
|
})
|
|
220
|
+
|
184
|
221
|
},
|
185
|
222
|
handlePersonDetail(row) {
|
186
|
223
|
this.listLoading = true
|
187
|
224
|
this.dialogFormVisible = true
|
188
|
|
- fetchPersonGameDetail(this.member.id, row['GambleGame-Bucket'].id).then(response => {
|
|
225
|
+ fetchPersonGameDetail(this.member.id, row.id).then(response => {
|
189
|
226
|
this.dialogList = response.data.rows
|
190
|
227
|
this.listLoading = false
|
191
|
228
|
})
|