Browse Source

add punishment

EthnaYeh 6 years ago
parent
commit
3754d795eb
2 changed files with 38 additions and 3 deletions
  1. 7 0
      src/api/gambleGameBucket.js
  2. 31 3
      src/views/gambleGameBucket/detail/index.vue

+ 7 - 0
src/api/gambleGameBucket.js

77
     method: 'get'
77
     method: 'get'
78
   })
78
   })
79
 }
79
 }
80
+
81
+export function fetchPunishmentRecord(data, query = { round: 1 }) {
82
+  return request({
83
+    url: `/gambleGameBuckets/${data.id}/round/${query.round}/punishmentRecord`,
84
+    method: 'get'
85
+  })
86
+}
80
 // export function fetchRoundRecord(data) {
87
 // export function fetchRoundRecord(data) {
81
 //   return request({
88
 //   return request({
82
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,
89
 //     url: `/gambleGameBuckets/${data.id}/initDoor`,

+ 31 - 3
src/views/gambleGameBucket/detail/index.vue

130
       </el-table-column>      
130
       </el-table-column>      
131
     </el-table>
131
     </el-table>
132
 
132
 
133
-
133
+    <el-table :data="punishmentRecord" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
134
+      style="width: 100%">
135
+      <el-table-column label="懲罰名單" align="center">
136
+        <el-table-column prop="GambleMember.name" label="玩家">
137
+        </el-table-column>
138
+        <el-table-column label="原因">
139
+          <template slot-scope="scope">
140
+            <div>{{reason(scope.row.rule)}}</div>
141
+          </template>
142
+        </el-table-column>
143
+        <el-table-column prop="chips" label="金額">
144
+        </el-table-column>
145
+      </el-table-column>      
146
+    </el-table>
134
     <el-table :data="members" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
147
     <el-table :data="members" v-loading.body="listLoading" element-loading-text="Loading" border fit highlight-current-row
135
       style="width: 100%">
148
       style="width: 100%">
136
       <el-table-column label="當前玩家餘額" align="center">
149
       <el-table-column label="當前玩家餘額" align="center">
158
 <script>
171
 <script>
159
 
172
 
160
 import { mapGetters, mapActions } from 'vuex'
173
 import { mapGetters, mapActions } from 'vuex'
161
-import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord, fetchGameBid, fetchWagerRecord, fetchMemberInfo } from '@/api/gambleGameBucket'
174
+import { fetchDetails, fetchRoundCount, fetchDealingRecords, fetchMemberRecords, fetchRoundRecord, fetchGameBid, fetchWagerRecord, fetchMemberInfo, fetchPunishmentRecord } from '@/api/gambleGameBucket'
162
 import { fetchGambleMemberList } from '@/api/gambleMember'
175
 import { fetchGambleMemberList } from '@/api/gambleMember'
163
 import { ponitTransform } from '@/utils/point'
176
 import { ponitTransform } from '@/utils/point'
164
 import _ from 'lodash'
177
 import _ from 'lodash'
187
       memberRecord: [],
200
       memberRecord: [],
188
       door: 0,
201
       door: 0,
189
       // bidChips: 0,
202
       // bidChips: 0,
203
+      punishmentRecord: [],
190
       memberRecordTemp: [],
204
       memberRecordTemp: [],
191
       wagerRecord: [],
205
       wagerRecord: [],
192
     }
206
     }
324
 
338
 
325
         this.func = eval(`(function() {${this.statement}})`)
339
         this.func = eval(`(function() {${this.statement}})`)
326
       })
340
       })
327
-
341
+      fetchPunishmentRecord(this.data.secondLayer, this.listQuery).then(response => {
342
+        this.punishmentRecord = response.data
343
+      })
328
       fetchMemberInfo(this.data.secondLayer, this.listQuery).then(response => {
344
       fetchMemberInfo(this.data.secondLayer, this.listQuery).then(response => {
329
         let { data } = response
345
         let { data } = response
330
         let members = {}
346
         let members = {}
408
     },
424
     },
409
     initDoor({row, column, rowIndex, columnIndex}) {
425
     initDoor({row, column, rowIndex, columnIndex}) {
410
       return  columnIndex === this.door ? { color: '#F56C6C' } : ``
426
       return  columnIndex === this.door ? { color: '#F56C6C' } : ``
427
+    },
428
+    reason(reason ){
429
+      switch(reason) {
430
+        case 'NO_DRAW_RIGHTS':
431
+          return '亂抽紅包'
432
+        break;
433
+        case 'NO_RESPONSE':
434
+          return '門主未抽紅包'
435
+        break;
436
+        default:
437
+          return '請找客服'
438
+      }
411
     }
439
     }
412
   },
440
   },
413
   destroyed() {
441
   destroyed() {