gameHeader.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="game-header">
  3. <img class="logo" src="./img/logo.png" alt="">
  4. <i class="game-question-icon" @click="showRules"></i>
  5. <div class="user-balance">
  6. <div class="m-limit-tips">
  7. {{$t('k3.limit')}} 100 EOS
  8. </div>
  9. <div class="balance-item">
  10. <i class="game-eos-icon"></i>
  11. {{balance}}
  12. </div>
  13. <div class="balance-item">
  14. <i class="game-gt-icon"></i>
  15. {{gt}}
  16. <i class="game-help-icon" @click="showGtRules"></i>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import Rules from '@/components/popup/rules'
  23. import NP from 'number-precision'
  24. export default {
  25. name: 'gameHeader',
  26. data () {
  27. return {
  28. }
  29. },
  30. computed: {
  31. balance () {
  32. return this.$store.state.balance ? NP.divide(this.$store.state.balance, 10000) : 0
  33. },
  34. gt () {
  35. return this.$store.state.gt
  36. }
  37. },
  38. methods: {
  39. showRules () {
  40. Rules.showRules()
  41. },
  42. showGtRules () {
  43. Rules.showGTRules()
  44. }
  45. },
  46. mounted () {
  47. }
  48. }
  49. </script>
  50. <style lang="scss">
  51. .game-header{
  52. width: px2rem(1300);
  53. margin: 0 auto;
  54. text-align: center;
  55. position: relative;
  56. img{
  57. width: px2rem(78);
  58. vertical-align: middle;
  59. }
  60. .game-question-icon{
  61. margin-left: px2rem(6);
  62. }
  63. }
  64. .user-balance{
  65. position: absolute;
  66. right: 0;
  67. bottom: px2rem(4);
  68. background-color: #514391;
  69. color: #ffffff;
  70. font-size: px2rem(16);
  71. padding: 0 px2rem(20);
  72. border-radius: px2rem(20);
  73. .balance-item{
  74. display: inline-block;
  75. height: px2rem(40);
  76. line-height: px2rem(40);
  77. min-width: px2rem(120);
  78. text-align: left;
  79. &:first-child{
  80. margin-right: px2rem(14);
  81. }
  82. }
  83. }
  84. .m-limit-tips{
  85. display: none;
  86. }
  87. @media #{$phone} {
  88. .game-header{
  89. width: 100%;
  90. position: absolute;
  91. left: px2rem(40);
  92. top: px2rem(30);
  93. width: px2rem(660);
  94. z-index: 1;
  95. .m-limit-tips{
  96. display: block;
  97. float: left;
  98. font-size: px2rem(20);
  99. margin-top: px2rem(6);
  100. margin-left: px2rem(10);
  101. }
  102. .user-balance{
  103. position: static;
  104. background-color: transparent;
  105. font-size: px2rem(24);
  106. text-align: right;
  107. padding: 0;
  108. .balance-item{
  109. margin-right: px2rem(10);
  110. }
  111. .game-help-icon{
  112. display: none;
  113. }
  114. .game-gt-icon{
  115. transform: scale(1.3);
  116. }
  117. .game-eos-icon{
  118. transform: scale(1.3);
  119. }
  120. }
  121. .logo{
  122. display: none;
  123. }
  124. .game-question-icon{
  125. display: none;
  126. }
  127. }
  128. }
  129. </style>