人人商城

myconfig.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. var version = +new Date();
  2. var myconfig = {
  3. path: '../addons/ewei_shopv2/static/js/',
  4. alias: {
  5. 'jquery': 'dist/jquery/jquery-1.11.1.min',
  6. 'jquery.form': 'dist/jquery/jquery.form',
  7. 'jquery.gcjs': 'dist/jquery/jquery.gcjs',
  8. 'jquery.validate': 'dist/jquery/jquery.validate.min',
  9. 'jquery.nestable': 'dist/jquery/nestable/jquery.nestable',
  10. 'jquery.qrcode':'../dist/jquery/jquery.qrcode.min',
  11. 'bootstrap': 'dist/bootstrap/bootstrap.min',
  12. 'bootstrap.suggest': 'dist/bootstrap/bootstrap-suggest.min',
  13. 'bootbox': 'dist/bootbox/bootbox.min',
  14. 'sweet': 'dist/sweetalert/sweetalert.min',
  15. 'select2': 'dist/select2/select2.min',
  16. 'jquery.confirm': 'dist/jquery/confirm/jquery-confirm',
  17. 'jquery.contextMenu': 'dist/jquery/contextMenu/jquery.contextMenu',
  18. 'switchery': 'dist/switchery/switchery',
  19. 'echarts': 'dist/echarts/echarts-all',
  20. 'echarts.min': 'dist/echarts/echarts.min',
  21. 'toast': 'dist/jquery/toastr.min',
  22. 'clipboard': 'dist/clipboard.min',
  23. 'tpl': 'dist/tmodjs',
  24. 'daterangepicker': 'dist/daterangepicker/daterangepicker',
  25. 'datetimepicker': 'dist/datetimepicker/jquery.datetimepicker',
  26. 'ueditor': 'dist/ueditor/ueditor.parse.min',
  27. 'tooltipbox': 'dist/tooltipbox',
  28. 'moment':'dist/moment/moment'
  29. },
  30. map: {
  31. 'js': '.js?v=' + version,
  32. 'css': '.css?v=' + version
  33. },
  34. css: {
  35. 'jquery.confirm': 'dist/jquery/confirm/jquery-confirm',
  36. 'sweet': 'dist/sweetalert/sweetalert',
  37. 'select2': 'dist/select2/select2,dist/select2/select2-bootstrap',
  38. 'jquery.nestable': 'dist/jquery/nestable/nestable',
  39. 'jquery.contextMenu': 'dist/jquery/contextMenu/jquery.contextMenu',
  40. 'daterangepicker': 'dist/daterangepicker/daterangepicker',
  41. 'datetimepicker': 'dist/datetimepicker/jquery.datetimepicker',
  42. 'ueditor': 'dist/ueditor/themes/default/css/ueditor.min',
  43. 'switchery': 'dist/switchery/switchery'
  44. }
  45. , preload: ['jquery']
  46. };
  47. var myrequire = function (arr, callback) {
  48. var newarr = [];
  49. $.each(arr, function () {
  50. var js = this;
  51. if (myconfig.css[js]) {
  52. var css = myconfig.css[js].split(',');
  53. $.each(css, function () {
  54. if(typeof myrequire.systemVersion !== 'undefined'){
  55. if (myrequire.systemVersion === '1.0.0' || myrequire.systemVersion <= '0.8')
  56. {
  57. newarr.push("css!" + myconfig.path + this + myconfig.map['css']);
  58. }
  59. else
  60. {
  61. newarr.push("loadcss!" + myconfig.path + this + myconfig.map['css']);
  62. }
  63. }else{
  64. newarr.push("css!" + myconfig.path + this + myconfig.map['css']);
  65. }
  66. });
  67. }
  68. var jsitem = this;
  69. if (myconfig.alias[js]) {
  70. jsitem = myconfig.alias[js];
  71. }
  72. newarr.push(myconfig.path + jsitem + myconfig.map['js']);
  73. });
  74. require(newarr, callback);
  75. }