stellar-ui-plus 1.21.16 → 1.21.18
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/common/sensors/common-api.ts +175 -0
- package/common/sensors/index.ts +113 -0
- package/common/sensors/jssdk/alipay.js +2072 -0
- package/common/sensors/jssdk/baidu.js +1 -0
- package/common/sensors/jssdk/heatmap.min.js +5 -0
- package/common/sensors/jssdk/toutiao.js +1 -0
- package/common/sensors/jssdk/vapph5define.min.js +1 -0
- package/common/sensors/jssdk/vtrack.min.js +4 -0
- package/common/sensors/jssdk/web.js +1 -0
- package/common/sensors/jssdk/weixin.js +2827 -0
- package/common/sensors/middle/alipay.ts +336 -0
- package/common/sensors/middle/app.ts +173 -0
- package/common/sensors/middle/baidu.ts +336 -0
- package/common/sensors/middle/toutiao.ts +330 -0
- package/common/sensors/middle/web.ts +362 -0
- package/common/sensors/middle/weixin.ts +372 -0
- package/common/sensors/plugin/get-location/index.esm.js +61 -0
- package/common/sensors/plugin/report-network/index.cmd.js +252 -0
- package/common/sensors/plugin/report-network/index.esm.js +278 -0
- package/common/sensors/plugin/report-network/readme.md +13 -0
- package/common/sensors/types/index.ts +159 -0
- package/common/sensors/vue3-mpclick.ts +183 -0
- package/components/ste-app-update/ATTRIBUTES.md +8 -0
- package/components/ste-barcode/encode.ts +16 -16
- package/components/ste-category/ATTRIBUTES.md +11 -0
- package/components/ste-date-user/ATTRIBUTES.md +8 -0
- package/components/ste-donut-chart/ATTRIBUTES.md +33 -0
- package/components/ste-dropdown-menu/ATTRIBUTES.md +1 -0
- package/components/ste-filter-tool/ATTRIBUTES.md +15 -0
- package/components/ste-function-list/ATTRIBUTES.md +24 -0
- package/components/ste-goods-info/ATTRIBUTES.md +44 -0
- package/components/ste-goods-list/ATTRIBUTES.md +10 -0
- package/components/ste-icon/ATTRIBUTES.md +1 -1
- package/components/ste-login/ATTRIBUTES.md +26 -0
- package/components/ste-login-info/ATTRIBUTES.md +21 -0
- package/components/ste-navbar/ATTRIBUTES.md +25 -0
- package/components/ste-navbar/ste-navbar.vue +2 -2
- package/components/ste-number-keyboard/ATTRIBUTES.md +3 -0
- package/components/ste-order-card/ATTRIBUTES.md +27 -0
- package/components/ste-qrcode/uqrcode.js +33 -33
- package/components/ste-search/ATTRIBUTES.md +1 -0
- package/components/ste-search-box/ATTRIBUTES.md +18 -0
- package/components/ste-stepper/ATTRIBUTES.md +1 -0
- package/components/ste-text/ATTRIBUTES.md +1 -0
- package/components/ste-user-info/ATTRIBUTES.md +26 -0
- package/index.ts +28 -0
- package/package.json +1 -1
- package/types/components.d.ts +38 -6
- package/types/refComponents.d.ts +28 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* uni-app sdk 公共方法
|
|
3
|
+
* 需要做类型检查,每个方法必须返回 true false,用来作为参数检查的结果
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
let sa = {
|
|
7
|
+
// 提供扩展性
|
|
8
|
+
instance: null,
|
|
9
|
+
// 提供初始化和配置参数
|
|
10
|
+
init: () => {
|
|
11
|
+
console.log('common-api,当前平台不支持此方法 init');
|
|
12
|
+
},
|
|
13
|
+
setPara: () => {
|
|
14
|
+
/*
|
|
15
|
+
server_url:'setServerUrl' 字符串
|
|
16
|
+
show_log:'enableLog' 布尔
|
|
17
|
+
|
|
18
|
+
app_flush_network_policy:'setFlushNetworkPolicy'数字
|
|
19
|
+
app_flush_interval:'setFlushInterval'数字
|
|
20
|
+
app_flush_bulkSize:'setFlushBulkSize'数字
|
|
21
|
+
app_session_interval_time:'setSessionIntervalTime'数字
|
|
22
|
+
app_data_collect:'enableDataCollect'布尔
|
|
23
|
+
|
|
24
|
+
mp_auto_track: object
|
|
25
|
+
*/
|
|
26
|
+
console.log('common-api,当前平台不支持此方法 setPara');
|
|
27
|
+
},
|
|
28
|
+
// app专用的方法
|
|
29
|
+
getAppFlushInterval: () => {
|
|
30
|
+
console.log('common-api,当前平台不支持此方法 getAppFlushInterval');
|
|
31
|
+
},
|
|
32
|
+
getAppFlushBulkSize: () => {
|
|
33
|
+
console.log('common-api,当前平台不支持此方法 getAppFlushBulkSize');
|
|
34
|
+
},
|
|
35
|
+
getAppSessionIntervalTime: () => {
|
|
36
|
+
console.log('common-api,当前平台不支持此方法 getAppSessionIntervalTime');
|
|
37
|
+
},
|
|
38
|
+
trackAppInstall: () => {
|
|
39
|
+
console.log('common-api,当前平台不支持此方法 trackAppInstall');
|
|
40
|
+
},
|
|
41
|
+
appFlush: () => {
|
|
42
|
+
console.log('common-api,当前平台不支持此方法 appFlush');
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
removeTimer: () => {
|
|
46
|
+
console.log('common-api,当前平台不支持此方法 removeTimer');
|
|
47
|
+
},
|
|
48
|
+
trackTimerStart: () => {
|
|
49
|
+
console.log('common-api,当前平台不支持此方法 trackTimerStart');
|
|
50
|
+
},
|
|
51
|
+
trackTimerPause: () => {
|
|
52
|
+
console.log('common-api,当前平台不支持此方法 trackTimerPause');
|
|
53
|
+
},
|
|
54
|
+
trackTimerResume: () => {
|
|
55
|
+
console.log('common-api,当前平台不支持此方法 trackTimerResume');
|
|
56
|
+
},
|
|
57
|
+
trackTimerEnd: () => {
|
|
58
|
+
console.log('common-api,当前平台不支持此方法 trackTimerEnd');
|
|
59
|
+
},
|
|
60
|
+
clearTrackTimer: () => {
|
|
61
|
+
console.log('common-api,当前平台不支持此方法 clearTrackTimer');
|
|
62
|
+
},
|
|
63
|
+
trackViewScreen: () => {
|
|
64
|
+
console.log('common-api,当前平台不支持此方法 trackViewScreen');
|
|
65
|
+
},
|
|
66
|
+
getSuperProperties: () => {
|
|
67
|
+
console.log('common-api,当前平台不支持此方法 getSuperProperties');
|
|
68
|
+
},
|
|
69
|
+
enableTrackScreenOrientation: () => {
|
|
70
|
+
console.log('common-api,当前平台不支持此方法 enableTrackScreenOrientation');
|
|
71
|
+
},
|
|
72
|
+
resumeTrackScreenOrientation: () => {
|
|
73
|
+
console.log('common-api,当前平台不支持此方法 resumeTrackScreenOrientation');
|
|
74
|
+
},
|
|
75
|
+
stopTrackScreenOrientation: () => {
|
|
76
|
+
console.log('common-api,当前平台不支持此方法 stopTrackScreenOrientation');
|
|
77
|
+
},
|
|
78
|
+
getScreenOrientation: () => {
|
|
79
|
+
console.log('common-api,当前平台不支持此方法 getScreenOrientation');
|
|
80
|
+
},
|
|
81
|
+
profileUnsetPushId: () => {
|
|
82
|
+
console.log('common-api,当前平台不支持此方法 profileUnsetPushId');
|
|
83
|
+
},
|
|
84
|
+
profilePushId: () => {
|
|
85
|
+
console.log('common-api,当前平台不支持此方法 profilePushId');
|
|
86
|
+
},
|
|
87
|
+
enableDeepLinkInstallSource: () => {
|
|
88
|
+
console.log('common-api,当前平台不支持此方法 enableDeepLinkInstallSource');
|
|
89
|
+
},
|
|
90
|
+
trackDeepLinkLaunch: () => {
|
|
91
|
+
console.log('common-api,当前平台不支持此方法 trackDeepLinkLaunch');
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
// 各端通用的常用API
|
|
95
|
+
getDistinctID: () => {
|
|
96
|
+
console.log('common-api,当前平台不支持此方法 getDistinctID');
|
|
97
|
+
},
|
|
98
|
+
getAnonymousID: () => {
|
|
99
|
+
console.log('common-api,当前平台不支持此方法 getAnonymousID');
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
register: para => {
|
|
103
|
+
console.log('common-api,当前平台不支持此方法 register');
|
|
104
|
+
},
|
|
105
|
+
unRegister: () => {
|
|
106
|
+
console.log('common-api,当前平台不支持此方法 unRegister');
|
|
107
|
+
},
|
|
108
|
+
clearRegister: () => {
|
|
109
|
+
console.log('common-api,当前平台不支持此方法 clearRegister');
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
//各端通用的标准API
|
|
113
|
+
identify: () => {
|
|
114
|
+
console.log('common-api,当前平台不支持此方法 identify');
|
|
115
|
+
},
|
|
116
|
+
login: () => {
|
|
117
|
+
console.log('common-api,当前平台不支持此方法 login');
|
|
118
|
+
},
|
|
119
|
+
logout: () => {
|
|
120
|
+
console.log('common-api,当前平台不支持此方法 logout');
|
|
121
|
+
},
|
|
122
|
+
track: () => {
|
|
123
|
+
console.log('common-api,当前平台不支持此方法 track');
|
|
124
|
+
},
|
|
125
|
+
setProfile: () => {
|
|
126
|
+
console.log('common-api,当前平台不支持此方法 setProfile');
|
|
127
|
+
},
|
|
128
|
+
setOnceProfile: () => {
|
|
129
|
+
console.log('common-api,当前平台不支持此方法 setOnceProfile');
|
|
130
|
+
},
|
|
131
|
+
incrementProfile: () => {
|
|
132
|
+
console.log('common-api,当前平台不支持此方法 incrementProfile');
|
|
133
|
+
},
|
|
134
|
+
appendProfile: () => {
|
|
135
|
+
console.log('common-api,当前平台不支持此方法 appendProfile');
|
|
136
|
+
},
|
|
137
|
+
unsetProfile: () => {
|
|
138
|
+
console.log('common-api,当前平台不支持此方法 unsetProfile');
|
|
139
|
+
},
|
|
140
|
+
deleteProfile: () => {
|
|
141
|
+
console.log('common-api,当前平台不支持此方法 deleteProfile');
|
|
142
|
+
},
|
|
143
|
+
// ID-Mapping 3.0
|
|
144
|
+
bind: () => {
|
|
145
|
+
console.log('common-api,当前平台不支持此方法 bind');
|
|
146
|
+
},
|
|
147
|
+
unbind: () => {
|
|
148
|
+
console.log('common-api,当前平台不支持此方法 unbind');
|
|
149
|
+
},
|
|
150
|
+
loginWithKey: () => {
|
|
151
|
+
console.log('common-api,当前平台不支持此方法 loginWithKey');
|
|
152
|
+
},
|
|
153
|
+
resetAnonymousIdentity: () => {
|
|
154
|
+
console.log('common-api,当前平台不支持此方法 resetAnonymousIdentity');
|
|
155
|
+
},
|
|
156
|
+
getIdentities: () => {
|
|
157
|
+
console.log('common-api,当前平台不支持此方法 getIdentities');
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
// id3 微信专用
|
|
161
|
+
bindOpenid: () => {
|
|
162
|
+
console.log('common-api,当前平台不支持此方法 bindOpenid');
|
|
163
|
+
},
|
|
164
|
+
unbindOpenid: () => {
|
|
165
|
+
console.log('common-api,当前平台不支持此方法 unbindOpenid');
|
|
166
|
+
},
|
|
167
|
+
bindUnionid: () => {
|
|
168
|
+
console.log('common-api,当前平台不支持此方法 bindUnionid');
|
|
169
|
+
},
|
|
170
|
+
unbindUnionid: () => {
|
|
171
|
+
console.log('common-api,当前平台不支持此方法 unbindUnionid');
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export default sa;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// index.ts - Sensors主入口文件TypeScript版本
|
|
2
|
+
/*
|
|
3
|
+
* @Date: 2022-10-28 10:30:10
|
|
4
|
+
* @File: Sensors主入口文件
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SensorsData uni-app SDK
|
|
9
|
+
* APP原生SDK所有API -> JS可用的所有API -> 各端通用的有限的桥API
|
|
10
|
+
* APP SDK(所有) -> JS 写的 SDK(所有) -> uni-app Bridge SDK(有限)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type { SensorsInstance, BridgeAPI, CommonAPI, TrackProperties } from './types';
|
|
14
|
+
import commonAPI from './common-api';
|
|
15
|
+
|
|
16
|
+
// 动态导入平台特定的bridgeAPI
|
|
17
|
+
let bridgeAPI: BridgeAPI | undefined;
|
|
18
|
+
|
|
19
|
+
// #ifdef APP-PLUS
|
|
20
|
+
// @ts-ignore - 条件编译导入
|
|
21
|
+
import appBridge from './middle/app';
|
|
22
|
+
bridgeAPI = appBridge;
|
|
23
|
+
// #endif
|
|
24
|
+
|
|
25
|
+
// #ifdef H5
|
|
26
|
+
// @ts-ignore - 条件编译导入
|
|
27
|
+
import webBridge from './middle/web';
|
|
28
|
+
bridgeAPI = webBridge;
|
|
29
|
+
// #endif
|
|
30
|
+
|
|
31
|
+
// #ifdef MP-WEIXIN
|
|
32
|
+
// @ts-ignore - 条件编译导入
|
|
33
|
+
import weixinBridge from './middle/weixin';
|
|
34
|
+
bridgeAPI = weixinBridge;
|
|
35
|
+
// #endif
|
|
36
|
+
|
|
37
|
+
// #ifdef MP-ALIPAY
|
|
38
|
+
// @ts-ignore - 条件编译导入
|
|
39
|
+
import alipayBridge from './middle/alipay';
|
|
40
|
+
bridgeAPI = alipayBridge;
|
|
41
|
+
// #endif
|
|
42
|
+
|
|
43
|
+
// #ifdef MP-BAIDU
|
|
44
|
+
// @ts-ignore - 条件编译导入
|
|
45
|
+
import baiduBridge from './middle/baidu';
|
|
46
|
+
bridgeAPI = baiduBridge;
|
|
47
|
+
// #endif
|
|
48
|
+
|
|
49
|
+
// #ifdef MP-TOUTIAO
|
|
50
|
+
// @ts-ignore - 条件编译导入
|
|
51
|
+
import toutiaoBridge from './middle/toutiao';
|
|
52
|
+
bridgeAPI = toutiaoBridge;
|
|
53
|
+
// #endif
|
|
54
|
+
|
|
55
|
+
import get_enableVue3MpClick from './vue3-mpclick';
|
|
56
|
+
|
|
57
|
+
let sa: SensorsInstance = {} as SensorsInstance;
|
|
58
|
+
|
|
59
|
+
let lib_plugin_track_timer: number = 0;
|
|
60
|
+
const js_uniapp_version: string = 'js_uniapp:0.0.1';
|
|
61
|
+
|
|
62
|
+
// 检查是否是支持的平台,如果不支持就使用commonAPI
|
|
63
|
+
if (typeof bridgeAPI === 'undefined') {
|
|
64
|
+
console.error('uni-app SDK 不支持当前平台,数据不会发送');
|
|
65
|
+
sa = commonAPI;
|
|
66
|
+
} else {
|
|
67
|
+
sa = bridgeAPI;
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
做一次common-api的遍历
|
|
71
|
+
如果bridgeAPI都实现了,就结束
|
|
72
|
+
如果bridgeAPI没有实现,从instance中获取,如果还没有就=common-api
|
|
73
|
+
*/
|
|
74
|
+
(Object.keys(commonAPI) as Array<keyof CommonAPI>).forEach(key => {
|
|
75
|
+
if (!(key in bridgeAPI!)) {
|
|
76
|
+
if (typeof bridgeAPI!.instance === 'object' && bridgeAPI!.instance !== null && typeof bridgeAPI!.instance[key] === 'function') {
|
|
77
|
+
(sa as any)[key] = bridgeAPI!.instance[key].bind(bridgeAPI!.instance);
|
|
78
|
+
} else {
|
|
79
|
+
(sa as any)[key] = (commonAPI as any)[key].bind(commonAPI);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 如果是track,先加属性
|
|
84
|
+
if (key === 'track') {
|
|
85
|
+
const oldTrack = sa.track;
|
|
86
|
+
sa.track = function (eventName: string, properties?: TrackProperties): void {
|
|
87
|
+
const arr: [string, TrackProperties?] = [eventName, properties];
|
|
88
|
+
|
|
89
|
+
if (++lib_plugin_track_timer === 1) {
|
|
90
|
+
if (typeof arr[1] === 'object' && arr[1] !== null) {
|
|
91
|
+
arr[1]['$lib_plugin_version'] = [js_uniapp_version];
|
|
92
|
+
} else {
|
|
93
|
+
arr[1] = {
|
|
94
|
+
$lib_plugin_version: [js_uniapp_version],
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return oldTrack.call(sa, arr[0], arr[1]);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Vue3小程序点击支持
|
|
106
|
+
const enableVue3MpClick = get_enableVue3MpClick(sa);
|
|
107
|
+
|
|
108
|
+
// #ifdef VUE3
|
|
109
|
+
enableVue3MpClick();
|
|
110
|
+
// #endif
|
|
111
|
+
|
|
112
|
+
export default sa;
|
|
113
|
+
export { enableVue3MpClick };
|