hugePrize.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div>
  3. <table class="huge-table" :class="{'en-lang': $i18n.locale == 'en'}">
  4. <thead>
  5. <th>{{$t('validate.text3')}}</th>
  6. <th>{{$t('table.col2')}}</th>
  7. <th>{{$t('table.col3')}}</th>
  8. <th>{{$t('table.col4')}}</th>
  9. <th>{{$t('table.col5')}}</th>
  10. </thead>
  11. <tbody>
  12. <tr v-for="(item, index) in list" :key="index">
  13. <td>
  14. <a class="link" target="_blank" :href="`https://eospark.com/block/${item.result_block_num}`" v-if="item.result_block_num">{{item.result_block_num}}</a>
  15. </td>
  16. <td>
  17. <i class="vip-level" :class="`icon-level${item.vip_level}`"></i>
  18. <span class="player-name"><a :href="`https://eospark.com/MainNet/account/${item.player}`" target="_blank" class="link">{{item.player}}</a></span>
  19. </td>
  20. <td class="left enable result" @click="$showValidate(item)">
  21. <span class="dice" :class="`dice-${item.num1}`"></span>
  22. <span class="dice" :class="`dice-${item.num2}`"></span>
  23. <span class="dice" :class="`dice-${item.num3}`"></span>
  24. <span class="type">{{resultMap(item.result.split('|')[0])}}</span>
  25. <span class="type">{{resultMap(item.result.split('|')[1])}}</span>
  26. <span class="type">{{item.result.split('|')[2]/1 - 1}}</span>
  27. </td>
  28. <td>
  29. <i class="money-icon"></i>
  30. <a class="link" target="_blank" :href="`https://eospark.com/tx/${item.transfer_trx_id}`">
  31. {{item.offerall.split(" ")[0]}} ({{getOffer(item.offertype)}})
  32. </a>
  33. </td>
  34. <td>
  35. <template v-if="item.win_int">
  36. <a target="_blank" class="link win-amount" :href="`https://eospark.com/tx/${item.result_trx_id}`">
  37. <i class="money-icon"></i>{{item.win_int / 10000}}
  38. </a>
  39. </template>
  40. </td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. <div class="moblie-list">
  45. <div class="list-item" v-for="(item, index) in list" :key="index" @click="$showValidate(item)">
  46. <div class="top">
  47. <i class="vip-level" :class="`icon-level${item.vip_level}`"></i>{{item.player}}
  48. <span class="amount">
  49. {{$t('table.col4')}}:<i class="game-eos-icon"></i>
  50. {{item.offerall.split(" ")[0]}} ({{getOffer(item.offertype)}})
  51. </span>
  52. </div>
  53. <div class="content">
  54. <div class="m-dice-item" :class="`dice-${item.num1}`"></div>
  55. <div class="m-dice-item" :class="`dice-${item.num2}`"></div>
  56. <div class="m-dice-item" :class="`dice-${item.num3}`"></div>
  57. <span class="type">{{resultMap(item.result.split('|')[0])}}</span>
  58. <span class="type">{{resultMap(item.result.split('|')[1])}}</span>
  59. <span class="type">{{resultMap(item.result.split('|')[2])}}</span>
  60. <div class="right" v-if="item.win_int > 0">
  61. {{$t('table.col5')}}<i class="game-eos-icon"></i><em>{{item.win_int / 10000}}</em>
  62. </div>
  63. </div>
  64. <div class="bottom">
  65. <div class="time" v-if="item.result_block_num">{{item.result_block_num}}</div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. import API from '@/api'
  73. export default {
  74. data () {
  75. return {
  76. list: []
  77. }
  78. },
  79. props: ['bot'],
  80. watch: {
  81. bot () {
  82. this.getHugePeize()
  83. }
  84. },
  85. mounted () {
  86. this.getHugePeize()
  87. },
  88. methods: {
  89. getHugePeize (limit = 50, page = this.bot) {
  90. API.table.getHugePeize({ limit, page }).then(({ data }) => {
  91. this.list = this.list.concat(data.data.list)
  92. this.$emit('endloading')
  93. })
  94. },
  95. getOffer (offertype) {
  96. var belMap = (value) => {
  97. let map = {
  98. '0': this.$t('game.small.title'),
  99. '1': this.$t('game.big.title'),
  100. '3': this.$t('game.single.title'),
  101. '2': this.$t('game.double.title')
  102. }
  103. return value > 3 ? value / 1 - 1 : map[value]
  104. }
  105. let arr = offertype.split('|')
  106. arr.map((e, i) => {
  107. arr[i] = belMap(arr[i])
  108. })
  109. return arr.join(',')
  110. }
  111. },
  112. computed: {
  113. /**
  114. * 对应关系 0 小 1 大 2 双 3 单
  115. */
  116. resultMap (value) {
  117. return (value) => {
  118. let map = {
  119. '0': this.$t('game.small.title'),
  120. '1': this.$t('game.big.title'),
  121. '3': this.$t('game.single.title'),
  122. '2': this.$t('game.double.title')
  123. }
  124. return map[value]
  125. }
  126. }
  127. }
  128. }
  129. </script>