农燊高科官方网站
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

main.js 3.1 KiB

hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
hace 4 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. laydata:'lib/laydata/laydata',
  20. paging:'lib/paging/page_common',
  21. //自己写的路径配置
  22. Tools: 'common/tools',
  23. addressApi: 'api/index', //所有Ajax接口存放地
  24. newApi: 'api/new', //新闻接口
  25. itemsApi: 'api/items', //挂牌项目接口
  26. biddingApi: 'api/bidding', //竞价大厅接口
  27. announApi: 'api/announcementList', //项目公告接口
  28. demandApi: 'api/demand', //个人供求接口
  29. policyApi: 'api/policy',//政策法规接口
  30. interactApi: 'api/interact',//互动交流接口
  31. },
  32. shim: {
  33. bootstrap: {
  34. deps: ['jquery']
  35. },
  36. jqueryLazyload: {
  37. deps: ['jquery']
  38. },
  39. dialog: {
  40. deps: ['jquery', 'dialogConf', 'drag', 'popup'],
  41. exports: 'dialog'
  42. },
  43. swiper: {
  44. deps: ['jquery'],
  45. exports: 'swiper'
  46. },
  47. nprogress: {
  48. deps: ['jquery'],
  49. exports: 'nprogress'
  50. },
  51. paging: {
  52. deps: ['jquery'],
  53. exports: 'paging'
  54. }
  55. }
  56. });
  57. //所有页面都需要的js,先行加载
  58. require(['jquery', 'addressApi']);
  59. require(["jquery", "nprogress"], function ($, nprogress) {
  60. //ajax加载页面跳转
  61. $(document).ajaxStart(function () {
  62. // $('.loading').show();
  63. nprogress.start();
  64. }).ajaxStop(function () {
  65. // $('.loading').hide();
  66. nprogress.done();
  67. });
  68. //根据条件加载不同js文件
  69. var currentPage = $("#require-page").attr("current-page");
  70. var targetModule = $("#require-page").attr("target-module");
  71. if (targetModule) {
  72. // 页面加载完毕后再执行相关业务代码比较稳妥
  73. $(function () {
  74. require([targetModule], function (targetModule) {
  75. // 不要在这里写业务代码
  76. //全部统一调用init方法
  77. //也就是每个模块都暴露一个init方法用于事件监听,页面内容加载等
  78. targetModule.init(currentPage);
  79. });
  80. });
  81. return;
  82. }
  83. })