update-wechat.blade.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. @extends('layouts.base')
  2. @section('title', '微信开放平台数据更新')
  3. @section('content')
  4. <style>
  5. .loadEffect{
  6. display:none;
  7. width: 100px;
  8. height: 100px;
  9. position: absolute;
  10. left: 50%;
  11. margin: 0 auto;
  12. margin-top:100px;
  13. }
  14. .loadEffect span{
  15. display: inline-block;
  16. width: 16px;
  17. height: 16px;
  18. border-radius: 50%;
  19. background: lightgreen;
  20. position: absolute;
  21. -webkit-animation: load 1.04s ease infinite;
  22. }
  23. @-webkit-keyframes load{
  24. 0%{
  25. opacity: 1;
  26. }
  27. 100%{
  28. opacity: 0.2;
  29. }
  30. }
  31. .loadEffect span:nth-child(1){
  32. left: 0;
  33. top: 50%;
  34. margin-top:-8px;
  35. -webkit-animation-delay:0.13s;
  36. }
  37. .loadEffect span:nth-child(2){
  38. left: 14px;
  39. top: 14px;
  40. -webkit-animation-delay:0.26s;
  41. }
  42. .loadEffect span:nth-child(3){
  43. left: 50%;
  44. top: 0;
  45. margin-left: -8px;
  46. -webkit-animation-delay:0.39s;
  47. }
  48. .loadEffect span:nth-child(4){
  49. top: 14px;
  50. right:14px;
  51. -webkit-animation-delay:0.52s;
  52. }
  53. .loadEffect span:nth-child(5){
  54. right: 0;
  55. top: 50%;
  56. margin-top:-8px;
  57. -webkit-animation-delay:0.65s;
  58. }
  59. .loadEffect span:nth-child(6){
  60. right: 14px;
  61. bottom:14px;
  62. -webkit-animation-delay:0.78s;
  63. }
  64. .loadEffect span:nth-child(7){
  65. bottom: 0;
  66. left: 50%;
  67. margin-left: -8px;
  68. -webkit-animation-delay:0.91s;
  69. }
  70. .loadEffect span:nth-child(8){
  71. bottom: 14px;
  72. left: 14px;
  73. -webkit-animation-delay:1.04s;
  74. }
  75. </style>
  76. <div class='panel panel-default'>
  77. <div class="loadEffect"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></div>
  78. </div>
  79. <script>
  80. var loop = true;
  81. var _that = this;
  82. var query = setInterval(function () {
  83. console.log('---------loop--------' + _that.loop);
  84. if (_that.loop) {
  85. $.ajax({
  86. url: '{!! yzWebUrl('member.member.updateWechatData') !!}',
  87. type: 'POST',
  88. dataType: 'json',
  89. beforeSend: function () {
  90. $('.loadEffect').show();
  91. }
  92. }).done(function (json) {
  93. console.log(json.status);
  94. if (json.status == 1) {
  95. _that.loop = false;
  96. }
  97. }).fail(function (message) {
  98. console.log('fail:', message)
  99. location.href = '{!! yzWebUrl('member.member.updateWechatOpenData', ['status' => 0]) !!}';
  100. }).always(function () {
  101. // $('.loadEffect').hide();
  102. });
  103. } else {
  104. clearInterval(query);
  105. location.href = '{!! yzWebUrl('member.member.updateWechatOpenData', ['status' => 1]) !!}';
  106. }
  107. }, 1000);
  108. </script>
  109. @endsection