农燊高科官方网站
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
пре 4 година
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. requirejs.config({
  2. urlArgs: "ver=1.0_" + (new Date).getTime(),
  3. baseUrl: '/static/js/',
  4. paths: {
  5. //第三方库的路径配置
  6. jquery: 'lib/jquery/jquery-1.9.1.min', //jquery
  7. bootstrap: 'lib/bootstrap/js/bootstrap.min', //bootstrap
  8. jqueryCookie: 'lib/jquery-cookie/jquery.cookie', //cookie插件
  9. template: 'lib/template/template', //模板引擎
  10. templaten: 'lib/template/template-native', //模板引擎-后端写法
  11. jqueryLazyload: 'lib/jQuery-plugins/jquery.lazyload.min', //图片延迟加载
  12. dialog: 'lib/dialog/dialog', //artDialog弹窗插件
  13. dialogConf: 'lib/dialog/dialog-config',
  14. drag: 'lib/dialog/drag',
  15. popup: 'lib/dialog/popup',
  16. swiper: 'lib/swiper/swiper.min', //焦点图插件
  17. nprogress: 'lib/nprogress/nprogress', //页面加载loading组件
  18. echarts: 'lib/echarts/echarts.min', //echarts组件
  19. //自己写的路径配置
  20. Tools: 'common/tools',
  21. addressApi: 'api/index' //所有Ajax接口存放地
  22. },
  23. shim: {
  24. bootstrap: {
  25. deps: ['jquery']
  26. },
  27. jqueryLazyload: {
  28. deps: ['jquery']
  29. },
  30. dialog: {
  31. deps: ['jquery', 'dialogConf', 'drag', 'popup'],
  32. exports: 'dialog'
  33. },
  34. swiper: {
  35. deps: ['jquery'],
  36. exports: 'swiper'
  37. },
  38. nprogress: {
  39. deps: ['jquery'],
  40. exports: 'nprogress'
  41. }
  42. }
  43. });
  44. //所有页面都需要的js,先行加载
  45. require(['jquery', 'addressApi']);
  46. require(["jquery", "nprogress"], function ($, nprogress) {
  47. //ajax加载页面跳转
  48. $(document).ajaxStart(function () {
  49. // $('.loading').show();
  50. nprogress.start();
  51. }).ajaxStop(function () {
  52. // $('.loading').hide();
  53. nprogress.done();
  54. });
  55. //根据条件加载不同js文件
  56. var currentPage = $("#require-page").attr("current-page");
  57. var targetModule = $("#require-page").attr("target-module");
  58. if (targetModule) {
  59. // 页面加载完毕后再执行相关业务代码比较稳妥
  60. $(function () {
  61. require([targetModule], function (targetModule) {
  62. // 不要在这里写业务代码
  63. //全部统一调用init方法
  64. //也就是每个模块都暴露一个init方法用于事件监听,页面内容加载等
  65. targetModule.init(currentPage);
  66. });
  67. });
  68. return;
  69. }
  70. })