buy_house.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. {!! $grid->render() !!}
  2. <style>
  3. p#vtip { display: none; position: absolute; padding: 10px; left: 5px; font-size: 0.8em; background-color: white; border: 1px solid #a6c9e2; -moz-border-radius: 5px; -webkit-border-radius: 5px; z-index: 9999 }
  4. p#vtip #vtipArrow { position: absolute; top: -10px; left: 5px }
  5. </style>
  6. <div class="modal fade" id="notice" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
  7. <div class="modal-dialog" role="document">
  8. <div class="modal-content">
  9. <div class="modal-header">
  10. <button type="button" class="close close_modal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
  11. </button>
  12. <h4 class="modal-title" id="myModalLabel12">提示</h4>
  13. </div>
  14. <div class="modal-body">
  15. <div class="modal-body" id="error_content">
  16. </div>
  17. <div class="modal-footer">
  18. <button type="button" class="btn btn-default close_modal" data-dismiss="modal" aria-label="Close">确定</button>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. <script>
  25. this.vtip = function() {
  26. this.xOffset = -10; // x distance from mouse
  27. this.yOffset = 15; // y distance from mouse
  28. $(".vtip").unbind().hover(
  29. function(e) {
  30. this.t = $(this).attr("title");
  31. this.title = '';
  32. this.top = (e.pageY + yOffset);
  33. this.left = (e.pageX + xOffset);
  34. $('body').css("cursor","help");
  35. $('p#vtip').width()>450?$('p#vtip').width(450):'';
  36. $('body').append( '<p id="vtip">' + this.t + '</p>' );
  37. $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn(0);
  38. },
  39. function() {
  40. this.title = this.t;
  41. $('body').css("cursor","");
  42. $("p#vtip").fadeOut("slow").remove();
  43. }
  44. ).mousemove(
  45. function(e) {
  46. this.top = (e.pageY + yOffset);
  47. this.left = (e.pageX + xOffset);
  48. $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
  49. }
  50. );
  51. };
  52. $(document).ready(function() {
  53. vtip();
  54. });
  55. //释放名额
  56. $('.sock').on('click', function () {
  57. let id = $(this).data('id');
  58. $.ajax({
  59. url: "{{admin_base_path('/content/buy_house/sock')}}",
  60. data:{'id':id,'_token':'{{csrf_token()}}'},
  61. method: 'POST',
  62. dataType:'json',
  63. success:function (res) {
  64. if (res.code == 0) {
  65. $('#notice').addClass('in');
  66. $('#notice').css('display', 'block');
  67. $('#error_content').html(res.content);
  68. } else {
  69. location.reload();
  70. }
  71. },
  72. })
  73. });
  74. //同步到选房系统
  75. $('.sync').on('click', function () {
  76. let id = $(this).data('id');
  77. $.ajax({
  78. url: "{{admin_base_path('/content/buy_house/sync')}}",
  79. data:{'id':id,'_token':'{{csrf_token()}}'},
  80. method: 'POST',
  81. dataType:'json',
  82. success:function (res) {
  83. if (res.code == 0) {
  84. $('#notice').addClass('in');
  85. $('#notice').css('display', 'block');
  86. $('#error_content').html(res.content);
  87. } else {
  88. location.reload();
  89. }
  90. },
  91. })
  92. });
  93. $('.close_modal').on('click',function () {
  94. $('#notice').addClass('out');
  95. $('#notice').css('display', 'none');
  96. })
  97. $('.select_house').click(function(){
  98. let id = $(this).data('id');
  99. location.href = "{{admin_base_path('/content/buy_house_select/index')}}/"+id;
  100. });
  101. </script>