网站
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. cupload:'lib/cupload/cupload',//上传图片插件
  22. dateTime:'lib/dateTime/dateTime.min',//时间选择器
  23. signature:'lib/jq-signature/jq-signature',
  24. WritingPad:'lib/jq-signature/WritingPad',
  25. //自己写的路径配置
  26. Tools: 'common/tools',
  27. addressApi: 'api/index', //所有Ajax接口存放地
  28. newApi: 'api/new', //新闻接口
  29. itemsApi: 'api/items', //交易项目接口
  30. biddingApi: 'api/bidding', //竞价大厅接口
  31. announApi: 'api/announcementList', //项目公告接口
  32. demandApi: 'api/demand', //个人供求接口
  33. policyApi: 'api/policy',//政策法规接口
  34. interactApi: 'api/interact',//互动交流接口
  35. user: 'api/user',//用户信息接口
  36. register:'api/register',//用户注册接口
  37. ajaxUploadImage:'lib/ajaxUpload/ajaxupload',//上传图片
  38. kindeditor:'lib/kindeditor/kindeditor-all',
  39. zhCN:'lib/kindeditor/lang/zh-CN',
  40. jsencrypt:'lib/jsencrypt/jsencrypt.min',//加密解密
  41. },
  42. shim: {
  43. bootstrap: {
  44. deps: ['jquery']
  45. },
  46. jqueryLazyload: {
  47. deps: ['jquery']
  48. },
  49. dialog: {
  50. deps: ['jquery', 'dialogConf', 'drag', 'popup'],
  51. exports: 'dialog'
  52. },
  53. swiper: {
  54. deps: ['jquery'],
  55. exports: 'swiper'
  56. },
  57. nprogress: {
  58. deps: ['jquery'],
  59. exports: 'nprogress'
  60. },
  61. paging: {
  62. deps: ['jquery'],
  63. exports: 'paging'
  64. },
  65. dateTime: {
  66. deps: ['jquery'],
  67. exports: 'dateTime'
  68. },
  69. ajaxUploadImage: {
  70. deps: ['jquery'],
  71. exports: 'ajaxUploadImage'
  72. },
  73. kindeditor: {
  74. deps: ['zhCN'],
  75. exports: 'kindeditor'
  76. },
  77. jsencrypt: {
  78. deps: ['jquery'],
  79. exports: 'jsencrypt'
  80. },
  81. // WritingPad: {
  82. // deps: ['jquery','signature'],
  83. // exports: 'WritingPad'
  84. // },
  85. }
  86. });
  87. //所有页面都需要的js,先行加载
  88. require(['jquery', 'addressApi']);
  89. // require(["jquery", "nprogress"], function ($, nprogress) {
  90. require(["jquery"], function ($) {
  91. //ajax加载页面跳转
  92. // $(document).ajaxStart(function () {
  93. // // $('.loading').show();
  94. // // nprogress.start();
  95. // }).ajaxStop(function () {
  96. // // $('.loading').hide();
  97. // // nprogress.done();
  98. // });
  99. //根据条件加载不同js文件
  100. var currentPage = $("#require-page").attr("current-page");
  101. var targetModule = $("#require-page").attr("target-module");
  102. if (targetModule) {
  103. // 页面加载完毕后再执行相关业务代码比较稳妥
  104. $(function () {
  105. require([targetModule], function (targetModule) {
  106. //不要在这里写业务代码
  107. //全部统一调用init方法
  108. //也就是每个模块都暴露一个init方法用于事件监听,页面内容加载等
  109. targetModule.init(currentPage);
  110. });
  111. });
  112. return;
  113. }
  114. })
  115. require(["jquery", "Tools","addressApi"], function ($, Tools) {
  116. var tools = new Tools();
  117. // document.getElementById('dress').onmouseover = function(){
  118. // document.getElementById('dressList').style.display = 'block';
  119. // };
  120. // document.getElementById('dressList').onmouseover = function(){
  121. // document.getElementById('dressList').style.display = 'block';
  122. // };
  123. // document.getElementById('dress').onmouseout = function(){
  124. // document.getElementById('dressList').style.display = 'none';
  125. // };
  126. // document.getElementById('dressList').onmouseout = function(){
  127. // document.getElementById('dressList').style.display = 'none';
  128. // };
  129. if(tools.getCookie('Admin-Token') != ''){
  130. document.getElementById('userInfo').style.display = 'block';
  131. document.getElementById('userLogin').style.display = 'none';
  132. document.getElementById('userRealName').innerHTML = tools.getCookie('userName');
  133. document.getElementById('userRealName2').innerHTML = tools.getCookie('userName');
  134. document.getElementById('userInfo').onmouseover = function(){
  135. document.getElementById('headHover').style.display = 'block';
  136. };
  137. document.getElementById('headHover').onmouseover = function(){
  138. document.getElementById('headHover').style.display = 'block';
  139. };
  140. document.getElementById('userInfo').onmouseout = function(){
  141. document.getElementById('headHover').style.display = 'none';
  142. };
  143. document.getElementById('headHover').onmouseout = function(){
  144. document.getElementById('headHover').style.display = 'none';
  145. };
  146. }else{
  147. document.getElementById('userLogin').style.display = 'block';
  148. }
  149. outLogin = function(){
  150. tools.doPost('/logout', {}, ()=>{
  151. tools.removeAllCookie();
  152. },true);
  153. }
  154. goIndex = function(){
  155. tools.skip('/');
  156. }
  157. searchAllNew = function () {
  158. var searchAllTitle = $('#searchAllTitle').val();
  159. tools.skip('/view/new/newList.html?title='+searchAllTitle);
  160. }
  161. })