uni-oaview 1.0.14 → 1.0.16

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.
package/dist/index.d.ts CHANGED
@@ -1,14 +1,19 @@
1
+ /**
2
+ * 上报APP启动小程序的时候的入参
3
+ * @param params
4
+ */
5
+ declare function sendLaunchAppParamsLog(params: any): void;
6
+
1
7
  /**
2
8
  * 防抖函数
3
9
  * @param callback
4
10
  * @param time
5
11
  * @returns
6
12
  */
7
- declare function createDebounceFn(callback: (...params: any[]) => void, time: number): (...params: any[]) => void;
8
- declare function getAsk(): string;
13
+ declare function createDebounceFn(callback: (...params: any[]) => void, time: number): (...params: any[]) => void;
9
14
 
10
15
  declare const _default: {
11
16
  install: (Vue: any) => void;
12
17
  };
13
18
 
14
- export { createDebounceFn, _default as default, getAsk };
19
+ export { createDebounceFn, _default as default, sendLaunchAppParamsLog };
@@ -1,40 +1,44 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["UNI-OAVIEW"] = {}));
5
- })(this, (function (exports) { 'use strict';
1
+ import { reportLog } from 'uniapp-log-sdk';
6
2
 
7
- /**
8
- * 防抖函数
9
- * @param callback
10
- * @param time
11
- * @returns
12
- */
13
- function createDebounceFn(callback, time) {
14
- var timer = null;
15
- return function () {
16
- for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
17
- params[_key] = arguments[_key];
18
- }
19
- clearTimeout(timer);
20
- timer = setTimeout(function () {
21
- callback.apply(void 0, params);
22
- }, time);
23
- };
24
- }
25
- function getAsk() {
26
- return '我是航帆范德萨范德萨';
3
+ /**
4
+ * 上报APP启动小程序的时候的入参
5
+ * @param params
6
+ */
7
+ function sendLaunchAppParamsLog(params) {
8
+ var _a;
9
+ // #ifndef H5
10
+ try {
11
+ var outputData = JSON.parse(JSON.stringify((_a = params === null || params === void 0 ? void 0 : params.referrerInfo) === null || _a === void 0 ? void 0 : _a.extraData));
12
+ outputData === null || outputData === void 0 ? true : delete outputData.token;
13
+ reportLog(outputData, '小程序启动入参');
14
+ } catch (error) {
15
+ console.log(error);
27
16
  }
17
+ // #endif
18
+ }
28
19
 
29
- var install = function install(Vue) {};
30
- var index = {
31
- install: install
20
+ /**
21
+ * 防抖函数
22
+ * @param callback
23
+ * @param time
24
+ * @returns
25
+ */
26
+ function createDebounceFn(callback, time) {
27
+ var timer = null;
28
+ return function () {
29
+ for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
30
+ params[_key] = arguments[_key];
31
+ }
32
+ clearTimeout(timer);
33
+ timer = setTimeout(function () {
34
+ callback.apply(void 0, params);
35
+ }, time);
32
36
  };
37
+ }
33
38
 
34
- exports.createDebounceFn = createDebounceFn;
35
- exports["default"] = index;
36
- exports.getAsk = getAsk;
37
-
38
- Object.defineProperty(exports, '__esModule', { value: true });
39
+ var install = function install(Vue) {};
40
+ var index = {
41
+ install: install
42
+ };
39
43
 
40
- }));
44
+ export { createDebounceFn, index as default, sendLaunchAppParamsLog };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-oaview",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "uniapp小程序组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "typings": "dist/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "rollup-plugin-typescript2": "^0.27.2",
45
45
  "rollup-plugin-vue": "^6.0.0",
46
46
  "typescript": "^4.0.2",
47
- "uniapp-log-sdk": "^1.1.1",
47
+ "uniapp-log-sdk": "^1.2.17",
48
48
  "uview-plus": "^3.1.30"
49
49
  },
50
50
  "peerDependencies": {
@@ -1,3 +1,5 @@
1
+ export * from './send-log';
2
+
1
3
  /**
2
4
  * 防抖函数
3
5
  * @param callback
@@ -13,7 +15,3 @@ export function createDebounceFn(callback: (...params: any[]) => void, time: num
13
15
  }, time);
14
16
  };
15
17
  }
16
-
17
- export function getAsk() {
18
- return '我是航帆范德萨范德萨';
19
- }
@@ -0,0 +1,17 @@
1
+ import { reportLog } from 'uniapp-log-sdk';
2
+
3
+ /**
4
+ * 上报APP启动小程序的时候的入参
5
+ * @param params
6
+ */
7
+ export function sendLaunchAppParamsLog(params: any) {
8
+ // #ifndef H5
9
+ try {
10
+ const outputData = JSON.parse(JSON.stringify(params?.referrerInfo?.extraData));
11
+ delete outputData?.token;
12
+ reportLog(outputData, '小程序启动入参');
13
+ } catch (error) {
14
+ console.log(error);
15
+ }
16
+ // #endif
17
+ }
@@ -1,12 +0,0 @@
1
- <template>
2
- <div>我真的是服了 现在已经风湿了,防守打法打算我现在正在看电视{{ a }}</div>
3
- </template>
4
-
5
- <script lang="ts" setup>
6
- import { ref } from 'vue';
7
- import { getAsk } from '../../src';
8
-
9
- console.log('hello world');
10
- const a = ref(getAsk());
11
- </script>
12
- <style scoped lang="scss"></style>
@@ -1,52 +0,0 @@
1
- /**
2
- * 判断当前参数是否是undefined或者null
3
- * @param {Object} obj
4
- */
5
- export function isNullOrUndefined(value: any) {
6
- return typeof value === 'undefined' || value === null;
7
- }
8
- /**
9
- * 是否对象
10
- */
11
- export function isObject(value: any) {
12
- return Object.prototype.toString.call(value) === '[object Object]';
13
- }
14
-
15
- /**
16
- * 判断当前参数是否是空, 包括空字符和空对象,空数组,null,undefined
17
- * @param {Object} obj
18
- */
19
- export function isEmpty(obj: any) {
20
- if (isNullOrUndefined(obj)) {
21
- return true;
22
- }
23
- if (Array.isArray(obj) && obj.length === 0) {
24
- return true;
25
- }
26
- if (typeof obj === 'string' && obj === '') {
27
- return true;
28
- }
29
- return false;
30
- }
31
- /**
32
- * 验证十进制数字
33
- */
34
- export function isNumber(value: any) {
35
- return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
36
- }
37
-
38
- /**
39
- * 正则校验是否为颜色,支持#FFF,#FFFFFF,#FFFFFFFF格式
40
- */
41
- export function CheckIsColor(color: any) {
42
- const type = '^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$';
43
- const reg = new RegExp(type);
44
- return color.match(reg) !== null;
45
- }
46
-
47
- export default {
48
- isNullOrUndefined,
49
- isObject,
50
- isEmpty,
51
- isNumber,
52
- };