stellar-ui-plus 1.21.19 → 1.21.20
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/jssdk/alipay.d.ts +2 -0
- package/common/sensors/jssdk/baidu.d.ts +2 -0
- package/common/sensors/jssdk/heatmap.d.ts +2 -0
- package/common/sensors/jssdk/toutiao.d.ts +2 -0
- package/common/sensors/jssdk/vapph5define.d.ts +2 -0
- package/common/sensors/jssdk/vtrack.d.ts +2 -0
- package/common/sensors/jssdk/web.d.ts +2 -0
- package/common/sensors/jssdk/weixin.d.ts +0 -1
- package/common/sensors/middle/alipay.ts +336 -336
- package/common/sensors/middle/baidu.ts +336 -336
- package/common/sensors/middle/toutiao.ts +330 -330
- package/common/sensors/middle/weixin.ts +368 -368
- package/components/ste-barcode/encode.ts +16 -16
- package/components/ste-date-user/ste-date-user.vue +0 -1
- package/components/ste-main-info/ATTRIBUTES.md +17 -0
- package/components/ste-qrcode/uqrcode.js +33 -33
- package/components/ste-select/ATTRIBUTES.md +1 -0
- package/components/ste-select/props.ts +65 -58
- package/components/ste-select/ste-select.easycom.json +6 -0
- package/components/ste-select/ste-select.vue +3 -3
- package/components/ste-select/useData.ts +15 -12
- package/index.ts +2 -2
- package/package.json +3 -2
- package/types/components.d.ts +2 -2
- package/types/refComponents.d.ts +2 -2
- package/components/ste-donut-chart/ATTRIBUTES.md +0 -33
|
@@ -1,336 +1,336 @@
|
|
|
1
|
-
// middle/alipay.ts - 支付宝小程序桥接器TypeScript版本
|
|
2
|
-
import type { BridgeAPI, SensorsConfig, TrackProperties, ProfileProperties } from '../types';
|
|
3
|
-
|
|
4
|
-
// 动态导入支付宝小程序版本的神策SDK
|
|
5
|
-
let sensors: any;
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
// @ts-ignore - 条件编译导入
|
|
9
|
-
sensors = require('../jssdk/alipay.js').default || require('../jssdk/alipay.js');
|
|
10
|
-
} catch (error) {
|
|
11
|
-
console.error('支付宝小程序神策SDK加载失败:', error);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// 支付宝小程序平台适配器
|
|
15
|
-
let isParaSet: boolean = false;
|
|
16
|
-
|
|
17
|
-
const sa: BridgeAPI = {
|
|
18
|
-
// 提供扩展性
|
|
19
|
-
instance: sensors,
|
|
20
|
-
|
|
21
|
-
// 提供初始化和配置参数
|
|
22
|
-
init: function (para: SensorsConfig): void {
|
|
23
|
-
if (!sensors) {
|
|
24
|
-
console.error('支付宝小程序神策SDK未加载');
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
if (!isParaSet) {
|
|
30
|
-
this.setPara(para);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (typeof sensors.init === 'function') {
|
|
34
|
-
sensors.init(para);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// 设置全局属性
|
|
38
|
-
if (para && para.global_properties && typeof para.global_properties === 'object') {
|
|
39
|
-
this.register(para.global_properties);
|
|
40
|
-
}
|
|
41
|
-
} catch (error) {
|
|
42
|
-
console.error('支付宝小程序SDK初始化失败:', error);
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
setPara: function (para: SensorsConfig): void {
|
|
47
|
-
if (!sensors) {
|
|
48
|
-
console.error('支付宝小程序神策SDK未加载');
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
const defaultValue: Partial<SensorsConfig> = {
|
|
54
|
-
autoTrack: false,
|
|
55
|
-
...para,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
if (typeof sensors.setPara === 'function') {
|
|
59
|
-
sensors.setPara(defaultValue);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// 设置全局属性
|
|
63
|
-
if (para && para.global_properties && typeof para.global_properties === 'object') {
|
|
64
|
-
this.register(para.global_properties);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
isParaSet = true;
|
|
68
|
-
} catch (error) {
|
|
69
|
-
console.error('支付宝小程序SDK参数设置失败:', error);
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
// 用户标识
|
|
74
|
-
getDistinctID: function (): string {
|
|
75
|
-
if (!sensors || !sensors.store || typeof sensors.store.getDistinctId !== 'function') {
|
|
76
|
-
console.warn('支付宝小程序SDK getDistinctId方法不可用');
|
|
77
|
-
return '';
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
try {
|
|
81
|
-
return sensors.store.getDistinctId() || '';
|
|
82
|
-
} catch (error) {
|
|
83
|
-
console.error('获取distinctId失败:', error);
|
|
84
|
-
return '';
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
identify: function (distinctId: string, isLogin?: boolean): void {
|
|
89
|
-
if (!sensors || typeof sensors.identify !== 'function') {
|
|
90
|
-
console.warn('支付宝小程序SDK identify方法不可用');
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
try {
|
|
95
|
-
sensors.identify(distinctId, isLogin);
|
|
96
|
-
} catch (error) {
|
|
97
|
-
console.error('identify调用失败:', error);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
login: function (loginId: string): void {
|
|
102
|
-
if (!sensors || typeof sensors.login !== 'function') {
|
|
103
|
-
console.warn('支付宝小程序SDK login方法不可用');
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
try {
|
|
108
|
-
sensors.login(loginId);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.error('login调用失败:', error);
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
logout: function (): void {
|
|
115
|
-
if (!sensors || typeof sensors.logout !== 'function') {
|
|
116
|
-
console.warn('支付宝小程序SDK logout方法不可用');
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
try {
|
|
121
|
-
sensors.logout();
|
|
122
|
-
} catch (error) {
|
|
123
|
-
console.error('logout调用失败:', error);
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
// 事件追踪
|
|
128
|
-
track: function (eventName: string, properties?: TrackProperties): void {
|
|
129
|
-
if (!sensors || typeof sensors.track !== 'function') {
|
|
130
|
-
console.warn('支付宝小程序SDK track方法不可用');
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
try {
|
|
135
|
-
sensors.track(eventName, properties || {});
|
|
136
|
-
} catch (error) {
|
|
137
|
-
console.error('track调用失败:', error);
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
// 公共属性管理
|
|
142
|
-
register: function (properties: Record<string, any>): void {
|
|
143
|
-
if (!sensors || typeof sensors.registerApp !== 'function') {
|
|
144
|
-
console.warn('支付宝小程序SDK registerApp方法不可用');
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
try {
|
|
149
|
-
sensors.registerApp(properties);
|
|
150
|
-
} catch (error) {
|
|
151
|
-
console.error('register调用失败:', error);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
unRegister: function (propertyName: string): void {
|
|
156
|
-
console.warn('支付宝小程序SDK暂不支持unRegister方法');
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
clearRegister: function (): void {
|
|
160
|
-
if (!sensors || typeof sensors.clearRegister !== 'function') {
|
|
161
|
-
console.warn('支付宝小程序SDK clearRegister方法不可用');
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
try {
|
|
166
|
-
sensors.clearRegister();
|
|
167
|
-
} catch (error) {
|
|
168
|
-
console.error('clearRegister调用失败:', error);
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
// 用户属性设置
|
|
173
|
-
setProfile: function (properties: ProfileProperties): void {
|
|
174
|
-
if (!sensors || typeof sensors.setProfile !== 'function') {
|
|
175
|
-
console.warn('支付宝小程序SDK setProfile方法不可用');
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
sensors.setProfile(properties);
|
|
181
|
-
} catch (error) {
|
|
182
|
-
console.error('setProfile调用失败:', error);
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
setOnceProfile: function (properties: ProfileProperties): void {
|
|
187
|
-
if (!sensors || typeof sensors.setOnceProfile !== 'function') {
|
|
188
|
-
console.warn('支付宝小程序SDK setOnceProfile方法不可用');
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
try {
|
|
193
|
-
sensors.setOnceProfile(properties);
|
|
194
|
-
} catch (error) {
|
|
195
|
-
console.error('setOnceProfile调用失败:', error);
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
incrementProfile: function (properties: ProfileProperties): void {
|
|
200
|
-
if (!sensors || typeof sensors.incrementProfile !== 'function') {
|
|
201
|
-
console.warn('支付宝小程序SDK incrementProfile方法不可用');
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
try {
|
|
206
|
-
sensors.incrementProfile(properties);
|
|
207
|
-
} catch (error) {
|
|
208
|
-
console.error('incrementProfile调用失败:', error);
|
|
209
|
-
}
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
appendProfile: function (properties: ProfileProperties): void {
|
|
213
|
-
if (!sensors || typeof sensors.appendProfile !== 'function') {
|
|
214
|
-
console.warn('支付宝小程序SDK appendProfile方法不可用');
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
try {
|
|
219
|
-
sensors.appendProfile(properties);
|
|
220
|
-
} catch (error) {
|
|
221
|
-
console.error('appendProfile调用失败:', error);
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
unsetProfile: function (propertyName: string | string[]): void {
|
|
226
|
-
if (!sensors || typeof sensors.unsetProfile !== 'function') {
|
|
227
|
-
console.warn('支付宝小程序SDK unsetProfile方法不可用');
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
try {
|
|
232
|
-
sensors.unsetProfile(propertyName);
|
|
233
|
-
} catch (error) {
|
|
234
|
-
console.error('unsetProfile调用失败:', error);
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
deleteProfile: function (): void {
|
|
239
|
-
if (!sensors || typeof sensors.deleteProfile !== 'function') {
|
|
240
|
-
console.warn('支付宝小程序SDK deleteProfile方法不可用');
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
try {
|
|
245
|
-
sensors.deleteProfile();
|
|
246
|
-
} catch (error) {
|
|
247
|
-
console.error('deleteProfile调用失败:', error);
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
// ID-Mapping 3.0
|
|
252
|
-
bind: function (key: string, value: string): void {
|
|
253
|
-
if (!sensors || typeof sensors.bind !== 'function') {
|
|
254
|
-
console.warn('支付宝小程序SDK bind方法不可用');
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
try {
|
|
259
|
-
sensors.bind(key, value);
|
|
260
|
-
} catch (error) {
|
|
261
|
-
console.error('bind调用失败:', error);
|
|
262
|
-
}
|
|
263
|
-
},
|
|
264
|
-
|
|
265
|
-
unbind: function (key: string, value: string): void {
|
|
266
|
-
if (!sensors || typeof sensors.unbind !== 'function') {
|
|
267
|
-
console.warn('支付宝小程序SDK unbind方法不可用');
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
try {
|
|
272
|
-
sensors.unbind(key, value);
|
|
273
|
-
} catch (error) {
|
|
274
|
-
console.error('unbind调用失败:', error);
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
loginWithKey: function (key: string, value: string): void {
|
|
279
|
-
if (!sensors || typeof sensors.loginWithKey !== 'function') {
|
|
280
|
-
console.warn('支付宝小程序SDK loginWithKey方法不可用');
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
try {
|
|
285
|
-
sensors.loginWithKey(key, value);
|
|
286
|
-
} catch (error) {
|
|
287
|
-
console.error('loginWithKey调用失败:', error);
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
|
|
291
|
-
resetAnonymousIdentity: function (): void {
|
|
292
|
-
if (!sensors || typeof sensors.resetAnonymousIdentity !== 'function') {
|
|
293
|
-
console.warn('支付宝小程序SDK resetAnonymousIdentity方法不可用');
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
try {
|
|
298
|
-
sensors.resetAnonymousIdentity();
|
|
299
|
-
} catch (error) {
|
|
300
|
-
console.error('resetAnonymousIdentity调用失败:', error);
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
getIdentities: function (): Record<string, any> {
|
|
305
|
-
if (!sensors || typeof sensors.getIdentities !== 'function') {
|
|
306
|
-
console.warn('支付宝小程序SDK getIdentities方法不可用');
|
|
307
|
-
return {};
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
try {
|
|
311
|
-
return sensors.getIdentities() || {};
|
|
312
|
-
} catch (error) {
|
|
313
|
-
console.error('getIdentities调用失败:', error);
|
|
314
|
-
return {};
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
|
|
318
|
-
// 支付宝小程序不支持微信专用方法
|
|
319
|
-
bindOpenid: function (): void {
|
|
320
|
-
console.warn('支付宝小程序不支持bindOpenid方法');
|
|
321
|
-
},
|
|
322
|
-
|
|
323
|
-
unbindOpenid: function (): void {
|
|
324
|
-
console.warn('支付宝小程序不支持unbindOpenid方法');
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
bindUnionid: function (): void {
|
|
328
|
-
console.warn('支付宝小程序不支持bindUnionid方法');
|
|
329
|
-
},
|
|
330
|
-
|
|
331
|
-
unbindUnionid: function (): void {
|
|
332
|
-
console.warn('支付宝小程序不支持unbindUnionid方法');
|
|
333
|
-
},
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
export default sa;
|
|
1
|
+
// middle/alipay.ts - 支付宝小程序桥接器TypeScript版本
|
|
2
|
+
import type { BridgeAPI, SensorsConfig, TrackProperties, ProfileProperties } from '../types';
|
|
3
|
+
|
|
4
|
+
// 动态导入支付宝小程序版本的神策SDK
|
|
5
|
+
let sensors: any;
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
// @ts-ignore - 条件编译导入
|
|
9
|
+
sensors = require('../jssdk/alipay.js').default || require('../jssdk/alipay.js');
|
|
10
|
+
} catch (error) {
|
|
11
|
+
console.error('支付宝小程序神策SDK加载失败:', error);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// 支付宝小程序平台适配器
|
|
15
|
+
let isParaSet: boolean = false;
|
|
16
|
+
|
|
17
|
+
const sa: BridgeAPI = {
|
|
18
|
+
// 提供扩展性
|
|
19
|
+
instance: sensors,
|
|
20
|
+
|
|
21
|
+
// 提供初始化和配置参数
|
|
22
|
+
init: function (para: SensorsConfig): void {
|
|
23
|
+
if (!sensors) {
|
|
24
|
+
console.error('支付宝小程序神策SDK未加载');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
if (!isParaSet) {
|
|
30
|
+
this.setPara(para);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (typeof sensors.init === 'function') {
|
|
34
|
+
sensors.init(para);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 设置全局属性
|
|
38
|
+
if (para && para.global_properties && typeof para.global_properties === 'object') {
|
|
39
|
+
this.register(para.global_properties);
|
|
40
|
+
}
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error('支付宝小程序SDK初始化失败:', error);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
setPara: function (para: SensorsConfig): void {
|
|
47
|
+
if (!sensors) {
|
|
48
|
+
console.error('支付宝小程序神策SDK未加载');
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
const defaultValue: Partial<SensorsConfig> = {
|
|
54
|
+
autoTrack: false,
|
|
55
|
+
...para,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
if (typeof sensors.setPara === 'function') {
|
|
59
|
+
sensors.setPara(defaultValue);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 设置全局属性
|
|
63
|
+
if (para && para.global_properties && typeof para.global_properties === 'object') {
|
|
64
|
+
this.register(para.global_properties);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
isParaSet = true;
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error('支付宝小程序SDK参数设置失败:', error);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
// 用户标识
|
|
74
|
+
getDistinctID: function (): string {
|
|
75
|
+
if (!sensors || !sensors.store || typeof sensors.store.getDistinctId !== 'function') {
|
|
76
|
+
console.warn('支付宝小程序SDK getDistinctId方法不可用');
|
|
77
|
+
return '';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
return sensors.store.getDistinctId() || '';
|
|
82
|
+
} catch (error) {
|
|
83
|
+
console.error('获取distinctId失败:', error);
|
|
84
|
+
return '';
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
identify: function (distinctId: string, isLogin?: boolean): void {
|
|
89
|
+
if (!sensors || typeof sensors.identify !== 'function') {
|
|
90
|
+
console.warn('支付宝小程序SDK identify方法不可用');
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
sensors.identify(distinctId, isLogin);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
console.error('identify调用失败:', error);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
login: function (loginId: string): void {
|
|
102
|
+
if (!sensors || typeof sensors.login !== 'function') {
|
|
103
|
+
console.warn('支付宝小程序SDK login方法不可用');
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
sensors.login(loginId);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error('login调用失败:', error);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
logout: function (): void {
|
|
115
|
+
if (!sensors || typeof sensors.logout !== 'function') {
|
|
116
|
+
console.warn('支付宝小程序SDK logout方法不可用');
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
try {
|
|
121
|
+
sensors.logout();
|
|
122
|
+
} catch (error) {
|
|
123
|
+
console.error('logout调用失败:', error);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
// 事件追踪
|
|
128
|
+
track: function (eventName: string, properties?: TrackProperties): void {
|
|
129
|
+
if (!sensors || typeof sensors.track !== 'function') {
|
|
130
|
+
console.warn('支付宝小程序SDK track方法不可用');
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
sensors.track(eventName, properties || {});
|
|
136
|
+
} catch (error) {
|
|
137
|
+
console.error('track调用失败:', error);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
// 公共属性管理
|
|
142
|
+
register: function (properties: Record<string, any>): void {
|
|
143
|
+
if (!sensors || typeof sensors.registerApp !== 'function') {
|
|
144
|
+
console.warn('支付宝小程序SDK registerApp方法不可用');
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
try {
|
|
149
|
+
sensors.registerApp(properties);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
console.error('register调用失败:', error);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
unRegister: function (propertyName: string): void {
|
|
156
|
+
console.warn('支付宝小程序SDK暂不支持unRegister方法');
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
clearRegister: function (): void {
|
|
160
|
+
if (!sensors || typeof sensors.clearRegister !== 'function') {
|
|
161
|
+
console.warn('支付宝小程序SDK clearRegister方法不可用');
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
try {
|
|
166
|
+
sensors.clearRegister();
|
|
167
|
+
} catch (error) {
|
|
168
|
+
console.error('clearRegister调用失败:', error);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
// 用户属性设置
|
|
173
|
+
setProfile: function (properties: ProfileProperties): void {
|
|
174
|
+
if (!sensors || typeof sensors.setProfile !== 'function') {
|
|
175
|
+
console.warn('支付宝小程序SDK setProfile方法不可用');
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
try {
|
|
180
|
+
sensors.setProfile(properties);
|
|
181
|
+
} catch (error) {
|
|
182
|
+
console.error('setProfile调用失败:', error);
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
setOnceProfile: function (properties: ProfileProperties): void {
|
|
187
|
+
if (!sensors || typeof sensors.setOnceProfile !== 'function') {
|
|
188
|
+
console.warn('支付宝小程序SDK setOnceProfile方法不可用');
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
sensors.setOnceProfile(properties);
|
|
194
|
+
} catch (error) {
|
|
195
|
+
console.error('setOnceProfile调用失败:', error);
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
incrementProfile: function (properties: ProfileProperties): void {
|
|
200
|
+
if (!sensors || typeof sensors.incrementProfile !== 'function') {
|
|
201
|
+
console.warn('支付宝小程序SDK incrementProfile方法不可用');
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
sensors.incrementProfile(properties);
|
|
207
|
+
} catch (error) {
|
|
208
|
+
console.error('incrementProfile调用失败:', error);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
appendProfile: function (properties: ProfileProperties): void {
|
|
213
|
+
if (!sensors || typeof sensors.appendProfile !== 'function') {
|
|
214
|
+
console.warn('支付宝小程序SDK appendProfile方法不可用');
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
sensors.appendProfile(properties);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
console.error('appendProfile调用失败:', error);
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
unsetProfile: function (propertyName: string | string[]): void {
|
|
226
|
+
if (!sensors || typeof sensors.unsetProfile !== 'function') {
|
|
227
|
+
console.warn('支付宝小程序SDK unsetProfile方法不可用');
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
try {
|
|
232
|
+
sensors.unsetProfile(propertyName);
|
|
233
|
+
} catch (error) {
|
|
234
|
+
console.error('unsetProfile调用失败:', error);
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
deleteProfile: function (): void {
|
|
239
|
+
if (!sensors || typeof sensors.deleteProfile !== 'function') {
|
|
240
|
+
console.warn('支付宝小程序SDK deleteProfile方法不可用');
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
try {
|
|
245
|
+
sensors.deleteProfile();
|
|
246
|
+
} catch (error) {
|
|
247
|
+
console.error('deleteProfile调用失败:', error);
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
|
|
251
|
+
// ID-Mapping 3.0
|
|
252
|
+
bind: function (key: string, value: string): void {
|
|
253
|
+
if (!sensors || typeof sensors.bind !== 'function') {
|
|
254
|
+
console.warn('支付宝小程序SDK bind方法不可用');
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
try {
|
|
259
|
+
sensors.bind(key, value);
|
|
260
|
+
} catch (error) {
|
|
261
|
+
console.error('bind调用失败:', error);
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
|
|
265
|
+
unbind: function (key: string, value: string): void {
|
|
266
|
+
if (!sensors || typeof sensors.unbind !== 'function') {
|
|
267
|
+
console.warn('支付宝小程序SDK unbind方法不可用');
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
try {
|
|
272
|
+
sensors.unbind(key, value);
|
|
273
|
+
} catch (error) {
|
|
274
|
+
console.error('unbind调用失败:', error);
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
loginWithKey: function (key: string, value: string): void {
|
|
279
|
+
if (!sensors || typeof sensors.loginWithKey !== 'function') {
|
|
280
|
+
console.warn('支付宝小程序SDK loginWithKey方法不可用');
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
try {
|
|
285
|
+
sensors.loginWithKey(key, value);
|
|
286
|
+
} catch (error) {
|
|
287
|
+
console.error('loginWithKey调用失败:', error);
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
resetAnonymousIdentity: function (): void {
|
|
292
|
+
if (!sensors || typeof sensors.resetAnonymousIdentity !== 'function') {
|
|
293
|
+
console.warn('支付宝小程序SDK resetAnonymousIdentity方法不可用');
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
try {
|
|
298
|
+
sensors.resetAnonymousIdentity();
|
|
299
|
+
} catch (error) {
|
|
300
|
+
console.error('resetAnonymousIdentity调用失败:', error);
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
|
|
304
|
+
getIdentities: function (): Record<string, any> {
|
|
305
|
+
if (!sensors || typeof sensors.getIdentities !== 'function') {
|
|
306
|
+
console.warn('支付宝小程序SDK getIdentities方法不可用');
|
|
307
|
+
return {};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
try {
|
|
311
|
+
return sensors.getIdentities() || {};
|
|
312
|
+
} catch (error) {
|
|
313
|
+
console.error('getIdentities调用失败:', error);
|
|
314
|
+
return {};
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
|
|
318
|
+
// 支付宝小程序不支持微信专用方法
|
|
319
|
+
bindOpenid: function (): void {
|
|
320
|
+
console.warn('支付宝小程序不支持bindOpenid方法');
|
|
321
|
+
},
|
|
322
|
+
|
|
323
|
+
unbindOpenid: function (): void {
|
|
324
|
+
console.warn('支付宝小程序不支持unbindOpenid方法');
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
bindUnionid: function (): void {
|
|
328
|
+
console.warn('支付宝小程序不支持bindUnionid方法');
|
|
329
|
+
},
|
|
330
|
+
|
|
331
|
+
unbindUnionid: function (): void {
|
|
332
|
+
console.warn('支付宝小程序不支持unbindUnionid方法');
|
|
333
|
+
},
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export default sa;
|