tenBet.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div class="pub-modal">
  3. <div class="mask"></div>
  4. <div class="modal">
  5. <i class="close-icon" @click="$emit('update:visible')"></i>
  6. <div class="title">
  7. <span>{{$t('k3.tenResult')}}</span>
  8. </div>
  9. <div class="content">
  10. <div class="ten-list-item">
  11. {{$t('k3.income')}}: <span>{{result.income / 10000}} <i class="game-eos-icon"></i></span>
  12. </div>
  13. <div class="ten-list-item">
  14. {{$t('game.resultTip.win')}}: <span>{{result.gt_amount_int / 10000}} <i class="game-gt-icon"></i></span>
  15. </div>
  16. <div class="ten-list-item">
  17. {{$t('k3.betContent')}}: <span>{{getType(result.offertype)}}</span>
  18. </div>
  19. <div class="ten-list-item">
  20. {{$t('k3.bet')}}: <span>{{result.offerall_int / 1000}} <i class="game-eos-icon"></i></span>
  21. </div>
  22. <div class="ten-tips-wrap">
  23. <i class="light-icon" :class="{'active': isChecked}" @click="nextBet"></i>
  24. <p class="tips"><em>{{countTime}}</em>{{$t('k3.countTime')}}</p>
  25. <i class="game-help-icon" @click="tipShow = !tipShow"></i>
  26. </div>
  27. <transition name="msgbox-fade">
  28. <div class="ten-bottom-msg" v-show="tipShow">
  29. <i class="arrow-up-icon" @click="tipShow = false"></i>
  30. {{$t('k3.tenTips')}}
  31. </div>
  32. </transition>
  33. </div>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. name: 'gameMain',
  40. data () {
  41. return {
  42. isChecked: false,
  43. tipShow: false,
  44. countTime: 5
  45. }
  46. },
  47. props: ['result'],
  48. methods: {
  49. getType (code) {
  50. let codeArr = code.split('|')
  51. let typeMap = {
  52. '0': this.$t('game.small.title'),
  53. '1': this.$t('game.big.title'),
  54. '2': this.$t('game.double.title'),
  55. '3': this.$t('game.single.title')
  56. }
  57. codeArr.map((v, i) => {
  58. if (v < 4) {
  59. codeArr[i] = typeMap[v]
  60. } else {
  61. codeArr[i]--
  62. }
  63. })
  64. return codeArr.join(',')
  65. },
  66. nextBet () {
  67. this.isChecked = !this.isChecked
  68. if (this.isChecked) {
  69. localStorage.setItem('ten_ben_checked', 1)
  70. this.countDown()
  71. } else {
  72. localStorage.removeItem('ten_ben_checked')
  73. if (this.timer) {
  74. clearInterval(this.timer)
  75. this.countTime = 5
  76. }
  77. }
  78. },
  79. countDown () {
  80. this.timer = setInterval(() => {
  81. this.countTime--
  82. if (this.countTime === 0) {
  83. this.$emit('nextbet')
  84. clearInterval(this.timer)
  85. }
  86. }, 1000)
  87. }
  88. },
  89. created () {
  90. let isChecked = localStorage.getItem('ten_ben_checked')
  91. if (isChecked) {
  92. this.isChecked = true
  93. this.countDown()
  94. }
  95. }
  96. }
  97. </script>
  98. <style lang="scss">
  99. .ten-list-item{
  100. height: px2rem(40);
  101. line-height: px2rem(40);
  102. font-size: px2rem(20);
  103. padding: 0 px2rem(14);
  104. box-sizing: border-box;
  105. color: #ffffff;
  106. background-color: #345981;
  107. border-radius: 6px;
  108. margin-bottom: px2rem(10);
  109. span{
  110. float: right;
  111. >i{
  112. margin-left: px2rem(6);
  113. }
  114. }
  115. .game-gt-icon{
  116. width: px2rem(18);
  117. height: px2rem(18);
  118. transform: scale(1.4);
  119. }
  120. }
  121. .ten-tips-wrap{
  122. font-size: px2rem(20);
  123. color: #789dba;
  124. .light-icon{
  125. display: inline-block;
  126. vertical-align: text-top;
  127. background: url('./img/icon_choice_b.png') top center no-repeat;
  128. background-size: 100%;
  129. width: px2rem(28);
  130. height: px2rem(30);
  131. cursor: pointer;
  132. &.active{
  133. position: relative;
  134. &::after{
  135. content: '';
  136. position: absolute;
  137. left: 50%;
  138. top: 50%;
  139. background-color: #26ff82;
  140. width: px2rem(12);
  141. height: px2rem(12);
  142. margin-left: -px2rem(6);
  143. margin-top: -px2rem(7);
  144. border-radius: 50%;
  145. }
  146. }
  147. }
  148. .tips{
  149. display: inline-block;
  150. margin-left: px2rem(14);
  151. user-select: none;
  152. em{
  153. color: #f0ff9a;
  154. display: inline-block;
  155. margin-right: px2rem(4);
  156. }
  157. }
  158. .game-help-icon{
  159. float: right;
  160. margin: px2rem(6) px2rem(6) 0;
  161. }
  162. }
  163. .ten-bottom-msg{
  164. background-color: #1e334b;
  165. font-size: px2rem(16);
  166. padding: px2rem(12) px2rem(48);
  167. color: #789dba;
  168. width: px2rem(370);
  169. box-sizing: border-box;
  170. margin: px2rem(14) auto 0;
  171. line-height: 1.6;
  172. border-radius: 6px;
  173. position: relative;
  174. .arrow-up-icon{
  175. cursor: pointer;
  176. position: absolute;
  177. background: url('./img/icon_closed_u.png') no-repeat;
  178. background-size: 100%;
  179. width: px2rem(17);
  180. height: px2rem(16);
  181. top: px2rem(8);
  182. right: px2rem(12);
  183. }
  184. }
  185. @media #{$phone} {
  186. .ten-list-item{
  187. height: px2rem(80);
  188. line-height: px2rem(80);
  189. font-size: px2rem(28);
  190. padding: 0 px2rem(20);
  191. .game-eos-icon{
  192. transform: scale(1.4);
  193. }
  194. .game-gt-icon{
  195. transform: scale(2);
  196. }
  197. }
  198. .ten-tips-wrap{
  199. .light-icon{
  200. width: px2rem(40);
  201. height: px2rem(40);
  202. vertical-align: middle;
  203. }
  204. .tips{
  205. font-size: px2rem(28);
  206. line-height: px2rem(40);
  207. height: px2rem(40);
  208. }
  209. .game-help-icon{
  210. width: px2rem(38);
  211. height: px2rem(38);
  212. }
  213. }
  214. .ten-bottom-msg{
  215. margin: px2rem(20) 0 0;
  216. width: 100%;
  217. font-size: px2rem(26);
  218. }
  219. }
  220. </style>