auction.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <div>
  3. <div class="game-auction" @click="handleClick">
  4. <div class="game-auc-title">
  5. {{$t('auction.title')}}<i class="explain-icon" @click.stop="modalShow = true"></i>
  6. </div>
  7. <div class="game-auc-bd">
  8. <span class="time">{{timeStr}}</span>
  9. <img class="eos-icon" src="../../assets/icon_b_eos_mii.png" alt="">
  10. <p class="price-amount" v-if="auctionInfo">{{auctionInfo.prize / 10000}} EOS</p>
  11. </div>
  12. <div class="game-auc-bot">
  13. <span class="title">{{$t('auction.lastPrice')}}</span>
  14. <span class="name" v-if="auctionInfo">{{auctionInfo.lastBid.player}}</span>
  15. </div>
  16. </div>
  17. <!-- 解析弹窗 -->
  18. <div class="modal-mask" v-show="modalShow">
  19. <div class="overflow-modal">
  20. <div class="title">{{$t('auction.title')}}</div>
  21. <i class="close-icon" @click="modalShow = false"></i>
  22. <div class="game-modal">
  23. <div class="list-item">
  24. <span class="order">*.</span>
  25. <div class="text-wrap">
  26. <p class="text">{{$t('auction.explain0')}}</p>
  27. </div>
  28. </div>
  29. <div class="list-item">
  30. <span class="order">1.</span>
  31. <div class="text-wrap">
  32. <p class="text">{{$t('auction.explain1')}}</p>
  33. </div>
  34. </div>
  35. <div class="list-item">
  36. <span class="order">2.</span>
  37. <div class="text-wrap">
  38. <p class="text">{{$t('auction.explain2')}}</p>
  39. </div>
  40. </div>
  41. <div class="list-item">
  42. <span class="order">3.</span>
  43. <p class="item-text">{{$t('auction.explain3')}}</p>
  44. </div>
  45. <div class="list-item">
  46. <span class="order">4.</span>
  47. <p class="item-text">{{$t('auction.explain4')}}</p>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import Bus from '../../js/bus'
  56. export default {
  57. name: 'auction',
  58. data () {
  59. return {
  60. modalShow: false,
  61. timeStr: ''
  62. }
  63. },
  64. components: {
  65. // auctionModal: () => import('./auctionModal')
  66. },
  67. computed: {
  68. auctionInfo () {
  69. return this.$store.state.auctionInfo
  70. },
  71. account () {
  72. return this.$store.state.account
  73. }
  74. },
  75. methods: {
  76. handleClick () {
  77. if (this.account.name) {
  78. Bus.$emit('update:auctionShow')
  79. } else {
  80. this.$store.dispatch('doScatterLogin')
  81. }
  82. }
  83. },
  84. created () {
  85. Bus.$on('update:timeAuction', (data) => {
  86. this.timeStr = data
  87. })
  88. },
  89. beforeDestroy () {
  90. Bus.$off('update:timeAuction')
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. .game-auction{
  96. position: fixed;
  97. width: px2rem(148);
  98. right: 0;
  99. top: px2rem(345);
  100. cursor: pointer;
  101. .game-auc-title{
  102. height: px2rem(40);
  103. line-height: px2rem(40);
  104. background-color: #516fb9;
  105. text-align: center;
  106. color: #ffffff;
  107. font-size: px2rem(20);
  108. border-top-left-radius: 10px;
  109. position: relative;
  110. }
  111. .explain-icon{
  112. position: absolute;
  113. top: px2rem(8);
  114. right: px2rem(10);
  115. background: url('img/icon_question.png');
  116. vertical-align: middle;
  117. width: px2rem(24);
  118. height: px2rem(24);
  119. background-size: 100%;
  120. cursor: pointer;
  121. }
  122. }
  123. .game-auc-bd{
  124. background-color: #395497;
  125. text-align: center;
  126. overflow: hidden;
  127. position: relative;
  128. padding-bottom: px2rem(16);
  129. .time{
  130. position: absolute;
  131. width: px2rem(98);
  132. height: px2rem(26);
  133. top: px2rem(10);
  134. margin-left: -px2rem(49);
  135. left: 50%;
  136. background-color: #223871;
  137. line-height: px2rem(26);
  138. text-align: center;
  139. color: #869dd6;
  140. font-size: px2rem(18);
  141. border-radius: px2rem(13);
  142. }
  143. .eos-icon{
  144. display: block;
  145. margin-top: px2rem(20);
  146. width: 100%;
  147. }
  148. .price-amount{
  149. position: absolute;
  150. bottom: px2rem(20);
  151. text-align: center;
  152. left: 0;
  153. right: 0;
  154. font-size: px2rem(18);
  155. color: #ffffff;
  156. }
  157. }
  158. .game-auc-bot{
  159. background-color: #543b68;
  160. border-bottom-left-radius: 10px;
  161. padding: px2rem(6) 0;
  162. span{
  163. display: block;
  164. color: #bfb6c6;
  165. font-size: px2rem(14);
  166. text-align: center;
  167. line-height: px2rem(22);
  168. height: px2rem(22);
  169. }
  170. }
  171. </style>