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.

58 lines
3.5 KiB

1 week ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const uni_modules_uviewPlus_libs_mixin_mixin = require("./libs/mixin/mixin.js");
  4. const uni_modules_uviewPlus_libs_mixin_mpMixin = require("./libs/mixin/mpMixin.js");
  5. const uni_modules_uviewPlus_libs_luchRequest_core_Request = require("./libs/luch-request/core/Request.js");
  6. const uni_modules_uviewPlus_libs_util_route = require("./libs/util/route.js");
  7. const uni_modules_uviewPlus_libs_function_colorGradient = require("./libs/function/colorGradient.js");
  8. const uni_modules_uviewPlus_libs_function_test = require("./libs/function/test.js");
  9. const uni_modules_uviewPlus_libs_function_debounce = require("./libs/function/debounce.js");
  10. const uni_modules_uviewPlus_libs_function_throttle = require("./libs/function/throttle.js");
  11. const uni_modules_uviewPlus_libs_function_index = require("./libs/function/index.js");
  12. const uni_modules_uviewPlus_libs_config_config = require("./libs/config/config.js");
  13. const uni_modules_uviewPlus_libs_config_props = require("./libs/config/props.js");
  14. const uni_modules_uviewPlus_libs_config_zIndex = require("./libs/config/zIndex.js");
  15. const uni_modules_uviewPlus_libs_config_color = require("./libs/config/color.js");
  16. const uni_modules_uviewPlus_libs_function_platform = require("./libs/function/platform.js");
  17. const http = new uni_modules_uviewPlus_libs_luchRequest_core_Request.Request();
  18. let themeType = ["primary", "success", "error", "warning", "info"];
  19. function setConfig(configs) {
  20. uni_modules_uviewPlus_libs_function_index.index.shallowMerge(uni_modules_uviewPlus_libs_config_config.config, configs.config || {});
  21. uni_modules_uviewPlus_libs_function_index.index.shallowMerge(uni_modules_uviewPlus_libs_config_props.defProps, configs.props || {});
  22. uni_modules_uviewPlus_libs_function_index.index.shallowMerge(uni_modules_uviewPlus_libs_config_color.color, configs.color || {});
  23. uni_modules_uviewPlus_libs_function_index.index.shallowMerge(uni_modules_uviewPlus_libs_config_zIndex.zIndex, configs.zIndex || {});
  24. }
  25. uni_modules_uviewPlus_libs_function_index.index.setConfig = setConfig;
  26. const $u = {
  27. route: uni_modules_uviewPlus_libs_util_route.route,
  28. date: uni_modules_uviewPlus_libs_function_index.index.timeFormat,
  29. // 另名date
  30. colorGradient: uni_modules_uviewPlus_libs_function_colorGradient.colorGradient.colorGradient,
  31. hexToRgb: uni_modules_uviewPlus_libs_function_colorGradient.colorGradient.hexToRgb,
  32. rgbToHex: uni_modules_uviewPlus_libs_function_colorGradient.colorGradient.rgbToHex,
  33. colorToRgba: uni_modules_uviewPlus_libs_function_colorGradient.colorGradient.colorToRgba,
  34. test: uni_modules_uviewPlus_libs_function_test.test,
  35. type: themeType,
  36. http,
  37. config: uni_modules_uviewPlus_libs_config_config.config,
  38. // uview-plus配置信息相关,比如版本号
  39. zIndex: uni_modules_uviewPlus_libs_config_zIndex.zIndex,
  40. debounce: uni_modules_uviewPlus_libs_function_debounce.debounce,
  41. throttle: uni_modules_uviewPlus_libs_function_throttle.throttle,
  42. mixin: uni_modules_uviewPlus_libs_mixin_mixin.mixin,
  43. mpMixin: uni_modules_uviewPlus_libs_mixin_mpMixin.mpMixin,
  44. props: uni_modules_uviewPlus_libs_config_props.defProps,
  45. ...uni_modules_uviewPlus_libs_function_index.index,
  46. color: uni_modules_uviewPlus_libs_config_color.color,
  47. platform: uni_modules_uviewPlus_libs_function_platform.platform
  48. };
  49. common_vendor.index.$u = $u;
  50. const install = (Vue) => {
  51. Vue.config.globalProperties.$u = $u;
  52. Vue.mixin(uni_modules_uviewPlus_libs_mixin_mixin.mixin);
  53. };
  54. const uviewPlus = {
  55. install
  56. };
  57. exports.http = http;
  58. exports.uviewPlus = uviewPlus;