klsfGroupHeader.blade.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <div class="haomabox">
  2. <div class="waring" id="waringbox">
  3. <div class="flash"><i></i></div>
  4. 温馨提示:因网络问题,开奖结果会有延迟,所以您需要去喝杯咖啡等一会儿!
  5. </div>
  6. <div class="haomaqu" id="klsf">
  7. <div class="haomaqu_resetPar">
  8. <div class="haomaqul">
  9. <div class="haomaline">
  10. <div class="haomaimg">
  11. <img src="/Public/Home/stati/img/{$imgname}.png" alt="{$gamename}"/>
  12. </div>
  13. <div class="numberqu">
  14. <div class="nuberqutit">
  15. <span class="klsf">{$gamename}</span>第
  16. <span class="preDrawIssue" v-text="gameData.info_no||0"></span> 期开奖号码<input type="hidden" id="drawTime" />
  17. </div>
  18. <div class="kajianhao">
  19. <ul>
  20. <li class="numblueHead" v-for="x in codes" v-text="x.number||0"></li>
  21. </ul>
  22. </div>
  23. <div class="line drawCountDiv">已开<span class="drawCount"></span>期,还有<span class="sdrawCount"></span>期</div>
  24. </div>
  25. </div>
  26. </div>
  27. <div class="haomaqur">
  28. <div class="haomaqur_l">
  29. <div class="line linetit">距<span class="nextIssue" v-text="parseInt(gameData.info_no)+1||0"></span>期开奖仅有</div>
  30. <div class="line linetime" id="timebox">
  31. <div v-if="isOpen" class="opening opentyle">开奖中...</div>
  32. <div v-else class="cuttime">
  33. <span class="bgtime minute" v-text="dao_time>60?parseInt(dao_time / 60)>10?parseInt(dao_time / 60):'0'+parseInt(dao_time / 60):'00'">00</span>
  34. <span>分</span>
  35. <span class="bgtime second" v-text="dao_time>60?parseInt(dao_time % 60)>9?parseInt(dao_time % 60):'0'+parseInt(dao_time % 60):dao_time>9?dao_time:'0'+dao_time">00</span>
  36. <span>秒</span>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="line soundId haomaqur_r">
  41. <div class="soundline ifSoundSet" id="ifSoundOpen"></div>
  42. <!--关闭铃声-->
  43. <div class="soundline soundSet" id="soundSet"></div>
  44. <!--设置铃声-->
  45. </div>
  46. <div class="line margt20" id="startVideo">
  47. <img src="/Public/Home/stati/img/tjklsf.jpg?v=2018961524" />
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="haomaqu_resetSon">
  54. <div class="homaline2">
  55. <div class="margt30 li_td">
  56. <ul class="zoushimap">
  57. {foreach $menu as $m}
  58. <li {if $type == $m.code} class="checked" {/if}><a href="{$m.url}?game={$game}">{$m.title}</a></li>
  59. {/foreach}
  60. </ul>
  61. </div>
  62. </div>
  63. </div>
  64. {literal}
  65. <script>
  66. new Vue({
  67. el: '.haomaqu',
  68. data() {
  69. return {
  70. msg: 'Welcome to Your Vue.js App',
  71. gameType:'cqssc',
  72. gameData:[],
  73. nowGameData:'',//存储开奖号码
  74. dao_time:0,//倒计时
  75. kjTimer:'',
  76. isOpen:false, // 是否正在开奖
  77. }
  78. },
  79. watch: {
  80. dao_time(e){
  81. e===0?()=>{clearInterval(this.kjTimer),this.dao_time=0,this.preGame()}:null
  82. console.log('this.dao_timethis.dao_time',this.dao_time)
  83. }
  84. },
  85. computed: {
  86. codes(){
  87. let codes=this.nowGameData.split(','),newCodes=[];
  88. for (let x=0;x<codes.length;x++){
  89. newCodes.push({number:parseInt(codes[x])})
  90. }
  91. return newCodes
  92. },
  93. },
  94. created() {
  95. console.log(this.boxSelection());
  96. this.preGame();
  97. },
  98. mounted() {
  99. },
  100. methods: {
  101. boxSelection() {
  102. console.log(11)
  103. },
  104. preGame() {
  105. const gameType=this.request('game');
  106. $.ajax({
  107. url: '/api-gameCenter/preGame?game_name='+gameType,
  108. type: "GET",
  109. data: '',
  110. success: (r)=> {
  111. this.gameData=r.data,this.nowGameData=!!r.data.codes?r.data.codes:'1,2,3,4,5',this.nowGame();
  112. if(!!r.data.codes) this.cleaAnimate();
  113. },
  114. error: (r)=> {
  115. this.preGame()
  116. },
  117. });
  118. },
  119. nowGame() {
  120. const gameType=this.request('game');
  121. $.ajax({
  122. url: '/api-gameCenter/nowGame?game_name='+gameType,
  123. type: "GET",
  124. data: '',
  125. success:(r)=> {
  126. this.dao_time=r.data.dao_time;
  127. r.data.info_no==this.gameData.info_no?this.isOpen=true:this.isOpen=false;
  128. clearInterval(this.kjTimer)
  129. this.kjTimer=setInterval(()=>{
  130. this.dao_time>0?this.dao_time --:(clearInterval(this.kjTimer),this.dao_time=0,setTimeout(()=>{this.preGame()},1000))
  131. },1000)
  132. this.isOpen?(this.cleaAnimate(),this.animate()):this.cleaAnimate()
  133. },
  134. error: (data)=> {
  135. this.nowGame()
  136. },
  137. });
  138. },
  139. request(name) {
  140. const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`, 'i'),
  141. r = window.location.search.substr(1).match(reg);
  142. return r !== null ? unescape(r[2]) : null;
  143. },
  144. animate(){
  145. animateMethod.sscAnimate('#klsf');
  146. },
  147. cleaAnimate(){
  148. clearInterval(animateID['#klsf']); //清除动画
  149. delete animateID['#klsf'];
  150. },
  151. },
  152. destroyed() {
  153. }
  154. })
  155. </script>
  156. {/literal}