detail.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <transition name="msgbox-fade">
  3. <div class="popup-wrap" v-show="visible">
  4. <div class="popup-modal"></div>
  5. <div class="popup-box">
  6. <div class="popup-hd">
  7. <div class="popup-hd-title"><em>{{$t('popupDetail.title1')}}</em></div>
  8. <span class="popup-close" @click="visible = false"></span>
  9. </div>
  10. <div class="popup-bd">
  11. <div class="detail-wrap">
  12. <div class="detail-top">
  13. <p class="d-tips">{{$t('popupDetail.content1')}}</p>
  14. <div class="d-filter">
  15. <p>{{filterName}}</p>
  16. <ul>
  17. <li v-for="(item, index) in filterList"
  18. :key="index"
  19. @click="handleCommand(item.appid)">
  20. {{item.text}}
  21. </li>
  22. </ul>
  23. <!-- <el-dropdown trigger="click" @command="handleCommand">
  24. <span class="el-dropdown-link">
  25. {{filterName}}<i class="el-icon-arrow-down el-icon--right"></i>
  26. </span>
  27. <el-dropdown-menu>
  28. <el-dropdown-item
  29. v-for="(item, index) in filterList"
  30. :key="index"
  31. :command="item.appid">
  32. {{item.text}}
  33. </el-dropdown-item>
  34. </el-dropdown-menu>
  35. </el-dropdown> -->
  36. </div>
  37. </div>
  38. <div class="detail-list">
  39. <div class="list-hd">
  40. <div class="col-1">{{$t('popupDetail.item1')}}</div>
  41. <div class="col-2">{{$t('popupDetail.item2')}}</div>
  42. <div class="col-3">{{$t('popupDetail.item3')}}</div>
  43. </div>
  44. <div class="list-bd">
  45. <ul>
  46. <li v-for="(item, index) in logList" :key="index">
  47. <div class="col-1">
  48. <h5>{{`${item.typeName} (${item.appid})`}}</h5>
  49. <p>{{item.create_time}}</p>
  50. </div>
  51. <div class="col-2">
  52. <em>{{item.memo}}</em>
  53. </div>
  54. <div class="col-3">
  55. <span class="tpAdd tpEOS" v-if="item.change_amount_format > 0">+{{item.change_amount_format}}</span>
  56. <span class="tpMinus tpEOS" v-else>{{item.change_amount_format}}</span>
  57. </div>
  58. </li>
  59. </ul>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </transition>
  67. </template>
  68. <script>
  69. import API from '@/api/'
  70. import Vue from 'vue'
  71. import { Dropdown, DropdownMenu, DropdownItem } from 'element-ui'
  72. Vue.component(Dropdown.name, Dropdown)
  73. Vue.component(DropdownMenu.name, DropdownMenu)
  74. Vue.component(DropdownItem.name, DropdownItem)
  75. export default {
  76. name: 'detailPopup',
  77. data () {
  78. return {
  79. logList: [],
  80. filterList: [{
  81. appid: '',
  82. text: this.$t('popupDetail.filter.all')
  83. }, {
  84. appid: 'box',
  85. text: this.$t('popupDetail.filter.box')
  86. }, {
  87. appid: 'sicbo',
  88. text: this.$t('popupDetail.filter.sicbo')
  89. }],
  90. filterName: this.$t('popupDetail.filter.all'),
  91. appid: '',
  92. listGlobalMap: {
  93. 'deposit': this.$t('popupDetail.global.deposit'),
  94. 'withdraw': this.$t('popupDetail.global.withdraw'),
  95. 'vip_return': this.$t('popupDetail.global.vip_return'),
  96. 'luckdraw': this.$t('popupDetail.global.luckdraw')
  97. },
  98. listBoxMap: {
  99. 'win': this.$t('popupDetail.box.win'),
  100. 'return': this.$t('popupDetail.box.return'),
  101. 'pledge': this.$t('popupDetail.box.pledge')
  102. },
  103. listSicboMap: {
  104. 'win': this.$t('popupDetail.sicbo.win'),
  105. 'bet': this.$t('popupDetail.sicbo.bet'),
  106. 'autobet': this.$t('popupDetail.sicbo.autobet')
  107. }
  108. }
  109. },
  110. methods: {
  111. handleCommand (command) {
  112. this.appid = command
  113. this.filterList.find(n => {
  114. if (n.appid === command) {
  115. this.filterName = n.text
  116. }
  117. })
  118. this.refreshList()
  119. },
  120. refreshList () {
  121. API.eos.getBalanceLog({
  122. appid: this.appid
  123. }).then(({ data }) => {
  124. if (data.code === 0) {
  125. let list = data.data.list
  126. list.forEach(n => {
  127. let listMap
  128. if (n.appid === 'box') {
  129. listMap = Object.assign(this.listGlobalMap, this.listBoxMap)
  130. } else if (n.appid === 'sicbo') {
  131. listMap = Object.assign(this.listGlobalMap, this.listSicboMap)
  132. }
  133. n.typeName = listMap[n.type]
  134. })
  135. this.logList = list
  136. }
  137. })
  138. }
  139. },
  140. created () {
  141. this.refreshList()
  142. }
  143. }
  144. </script>
  145. <style lang="scss">
  146. @import "./style.scss";
  147. </style>