html_end.blade.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. </body>
  2. <script src="{{theme_asset('mobile/js/fastclick.js')}}"></script>
  3. <script src="{{theme_asset('mobile/js/qsToast.js')}}"></script>
  4. <script src="{{theme_asset('mobile/js/QSpopout.js')}}"></script>
  5. <script src="{{theme_asset('mobile/js/QSfilter.js')}}"></script>
  6. <script src="{{theme_asset('mobile/js/scrollTo.js')}}"></script>
  7. <script>
  8. window.addEventListener( "load", function() {
  9. FastClick.attach(document.body);
  10. }, false );
  11. </script>
  12. <script>
  13. $('a[href]').click(function(){
  14. var f = $(this).attr('href');
  15. var reg = /\#(\w+)/;
  16. if(reg.test(f)) {
  17. if (!$(this).data('nm')) {
  18. return !1;
  19. }
  20. }
  21. });
  22. $('.js-back').on('click', function () {
  23. var href = $(this).data('href');
  24. if (!href) {
  25. history.back();
  26. } else {
  27. location.href = href;
  28. }
  29. });
  30. $('.rbtn').on('click', function() {
  31. forCloseNav();
  32. })
  33. $('.t-mask').on('click', function () {
  34. forCloseNav();
  35. })
  36. $('.h-navclose').on('click', function () {
  37. forCloseNav();
  38. })
  39. function forCloseNav() {
  40. if ($('.topnavshow').hasClass('qs-actionsheet-toggle')) {
  41. $('.t-mask').hide();
  42. $('.topnavshow').removeClass('qs-actionsheet-toggle');
  43. } else {
  44. $('.t-mask').show();
  45. $('.topnavshow').addClass('qs-actionsheet-toggle');
  46. }
  47. }
  48. /**
  49. * 监听鼠标
  50. */
  51. if ('ontouchstart' in window) {
  52. $.EVENT_START = 'touchstart';
  53. $.EVENT_END = 'touchend';
  54. } else {
  55. $.EVENT_START = 'mousedown';
  56. $.EVENT_END = 'mouseup';
  57. }
  58. $('.plist-txt, .qs-btn, .for-event').on($.EVENT_START, function() {
  59. $(this).addClass('eventactive');
  60. })
  61. $('.plist-txt, .qs-btn, .for-event').on($.EVENT_END, function() {
  62. $(this).removeClass('eventactive');
  63. })
  64. $('.logout').on('click', function () {
  65. var dialog = new QSpopout();
  66. dialog.setContent('确定退出吗?');
  67. forCloseNav();
  68. dialog.show();
  69. dialog.getPrimaryBtn().on('click', function () {
  70. @if(strpos(\Illuminate\Support\Facades\Request::getRequestUri(),'/jkq') === 0)
  71. window.location.href = "{{route('jkq.mobile.logout')}}";
  72. @else
  73. window.location.href = "{{route('mobile.logout')}}";
  74. @endif
  75. });
  76. });
  77. // 处理select
  78. $('select').on('change', function () {
  79. $(this).prev().text($(this).find('option').not(function(){ return !this.selected }).text());
  80. })
  81. $('select').each(function () {
  82. $(this).prev().text($(this).find('option').not(function(){ return !this.selected }).text());
  83. })
  84. @php
  85. $wechat = App\Wechat\WechatParam::instance();
  86. @endphp
  87. @if(!empty($wechat->get('signature')))
  88. wx.config({
  89. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  90. appId: "{{$wechat->get('appid')}}", // 必填,公众号的唯一标识
  91. timestamp: "{{$wechat->get('timestamp')}}", // 必填,生成签名的时间戳
  92. nonceStr: "{{$wechat->get('nonceStr')}}", // 必填,生成签名的随机串
  93. signature: "{{$wechat->get('signature')}}",// 必填,签名,见附录1
  94. jsApiList: ['updateAppMessageShareData','updateTimelineShareData','openLocation'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  95. });
  96. wx.checkJsApi({
  97. jsApiList: ['updateAppMessageShareData','updateTimelineShareData','openLocation'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
  98. success: function(res) {
  99. console.log(res);
  100. // 以键值对的形式返回,可用的api值true,不可用为false
  101. // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
  102. }
  103. });
  104. wx.ready(function () {
  105. wx.updateAppMessageShareData({
  106. title: '{{empty($share_title) ? '聚才网' : $share_title}}', // 分享标题
  107. desc: '{{empty($share_desc) ? '' : $share_desc}}', // 分享描述
  108. link: '{{empty($share_link) ? Illuminate\Support\Facades\Request::url() : $share_link}}', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  109. imgUrl: '{{empty($share_image_url) ? theme_asset('mobile/images/rcg.png') : $share_image_url}}', // 分享图标
  110. success: function () {
  111. // 用户确认分享后执行的回调函数
  112. if (typeof wx_share_callback === 'function') {
  113. wx_share_callback('message');
  114. }
  115. }
  116. });
  117. wx.updateTimelineShareData({
  118. title: '{{empty($share_title) ? '聚才网' : $share_title}}', // 分享标题
  119. link: '{{empty($share_link) ? Illuminate\Support\Facades\Request::url() : $share_link}}', // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
  120. imgUrl: '{{empty($share_image_url) ? theme_asset('mobile/images/rcg.png') : $share_image_url}}', // 分享图标
  121. success: function () {
  122. // 用户确认分享后执行的回调函数
  123. if (typeof wx_share_callback === 'function') {
  124. wx_share_callback('message');
  125. }
  126. }
  127. })
  128. });
  129. @endif
  130. </script>
  131. @yield('script')
  132. </html>