@kmkf-fe-packages/kmkf-utils 0.3.1-alpha.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  export { default as ExpressData } from './expressData';
2
2
  export { default as AddressData } from './addressData';
3
+ export { default as PlatData } from './platData';
3
4
  export { default as request } from './request';
4
5
  export * from './utils';
package/dist/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as ExpressData } from "./expressData";
2
2
  export { default as AddressData } from "./addressData";
3
+ export { default as PlatData } from "./platData";
3
4
  export { default as request } from "./request";
4
5
  export * from "./utils";
@@ -0,0 +1,32 @@
1
+ interface PlatInterface {
2
+ /**
3
+ * @description 平台类型
4
+ */
5
+ platformType: number;
6
+ /**
7
+ * @description 平台名称
8
+ */
9
+ platformName: string;
10
+ /**
11
+ * @description 平台英文名称
12
+ */
13
+ platformTypeStr: string;
14
+ /**
15
+ * @description 平台Logo
16
+ */
17
+ img: string;
18
+ /**
19
+ * @description 是否对接
20
+ */
21
+ alreadyJoin: boolean;
22
+ }
23
+ export default class PlatData {
24
+ private static instance;
25
+ platTypeList: PlatInterface[];
26
+ constructor();
27
+ initData: () => void;
28
+ getPlatData: () => PlatInterface[];
29
+ static getInstance(): PlatData;
30
+ }
31
+ export declare type PlatDataClass = PlatData;
32
+ export {};
@@ -0,0 +1,55 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ import request from "../request";
15
+ var PlatData = /*#__PURE__*/function () {
16
+ function PlatData() {
17
+ var _this = this;
18
+ _classCallCheck(this, PlatData);
19
+ _defineProperty(this, "platTypeList", void 0);
20
+ _defineProperty(this, "initData", function () {
21
+ var _this$platTypeList;
22
+ if (((_this$platTypeList = _this.platTypeList) === null || _this$platTypeList === void 0 ? void 0 : _this$platTypeList.length) > 0) return;
23
+ request({
24
+ url: '/qy/platform/listPlatform',
25
+ method: 'get',
26
+ data: {}
27
+ }).then(function (res) {
28
+ if (res.success) {
29
+ var platType = res.data || {};
30
+ platType.alreadyJoinedList = platType.alreadyJoinedList || [];
31
+ platType.notJoinList = platType.notJoinList || [];
32
+ var list = [].concat(_toConsumableArray(platType.alreadyJoinedList), _toConsumableArray(platType.notJoinList));
33
+ _this.platTypeList = list;
34
+ }
35
+ });
36
+ });
37
+ _defineProperty(this, "getPlatData", function () {
38
+ return _this.platTypeList;
39
+ });
40
+ this.platTypeList = [];
41
+ this.initData();
42
+ }
43
+ _createClass(PlatData, null, [{
44
+ key: "getInstance",
45
+ value: function getInstance() {
46
+ if (!PlatData.instance) {
47
+ PlatData.instance = new PlatData();
48
+ }
49
+ return PlatData.instance;
50
+ }
51
+ }]);
52
+ return PlatData;
53
+ }();
54
+ _defineProperty(PlatData, "instance", void 0);
55
+ export { PlatData as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "0.3.1-alpha.2",
3
+ "version": "0.4.0",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -30,5 +30,5 @@
30
30
  "gitHooks": {
31
31
  "pre-commit": "lint-staged"
32
32
  },
33
- "gitHead": "47d57b41788f6c3283a068017db8980fdd122d6e"
33
+ "gitHead": "e3b9404a5ea8a0021630fcbee65b0ae13a4fef52"
34
34
  }