@conecli/cone-render 0.10.1-shop3.50 → 0.10.1-shop3.51
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 +1 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
console.warn('🚗 ~~ file: index.tsx:22 ~~ reportException() ~~ {type, detail, text}:', {
|
|
3
2
|
type,
|
|
4
3
|
data,
|
|
5
4
|
text,
|
|
6
5
|
});
|
|
7
6
|
sgmCustomReport({
|
|
8
7
|
code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_${type}`),
|
|
9
8
|
msg: {
|
|
10
9
|
type,
|
|
11
10
|
data,
|
|
12
11
|
text: '[双价格组件]' + text,
|
|
13
12
|
},
|
|
14
13
|
});
|
|
15
14
|
return rest.some((item) => item === undefined || item === '');
|
|
16
15
|
const numPrice = Number(strPrice);
|
|
17
16
|
if (isNaN(numPrice)) {
|
|
18
17
|
reportException({
|
|
19
18
|
type: 'isNotNumericType',
|
|
20
19
|
data: props,
|
|
21
20
|
text: `传入价格字段值“${strPrice}”转换数字报错`,
|
|
22
21
|
});
|
|
23
22
|
return false;
|
|
24
23
|
}
|
|
25
24
|
else if (numPrice <= 0) {
|
|
26
25
|
reportException({
|
|
27
26
|
type: 'isNotPositiveNumber',
|
|
28
27
|
data: props,
|
|
29
28
|
text: `传入价格字段值“${strPrice}”不是一个正数`,
|
|
30
29
|
});
|
|
31
30
|
return false;
|
|
32
31
|
}
|
|
33
32
|
const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
|
|
34
33
|
if (result && result[3]?.length > 2) {
|
|
35
34
|
reportException({
|
|
36
35
|
type: 'decimalPlaceTooLong',
|
|
37
36
|
data: props,
|
|
38
37
|
text: `传入价格字段值“${strPrice}”小数位不能超过2位`,
|
|
39
38
|
});
|
|
40
39
|
return false;
|
|
41
40
|
}
|
|
42
41
|
if (/^\d+(\.\d+)?[eE][+-]?\d+$/.test(strPrice)) {
|
|
43
42
|
reportException({
|
|
44
43
|
type: 'findScientificNotation',
|
|
45
44
|
data: props,
|
|
46
45
|
text: `传入价格字段值“${strPrice}”是一个科学计数法格式`,
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
48
|
return true;
|
|
50
49
|
const { jdPrice, finalPrice, forceShowFinalPrice } = props;
|
|
51
50
|
if (jdPrice && finalPrice) {
|
|
52
51
|
const getLastPassValidateState = forceShowFinalPrice || Number(finalPrice) < Number(jdPrice);
|
|
53
52
|
!getLastPassValidateState &&
|
|
54
53
|
reportException({
|
|
55
54
|
type: 'pricesCompareException',
|
|
56
55
|
data: props,
|
|
57
56
|
text: `身份/到手价必须小于松果价`,
|
|
58
57
|
});
|
|
59
58
|
return getLastPassValidateState;
|
|
60
59
|
} else {
|
|
61
60
|
return true;
|
|
62
61
|
}
|
|
63
62
|
const numPrice = Number(strPrice);
|
|
64
63
|
const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
|
|
65
64
|
if (result) {
|
|
66
65
|
return {
|
|
67
66
|
integerPrice: result[1],
|
|
68
67
|
decimalPrice: (result[3] || '').replace(/0+$/, ''),
|
|
69
68
|
};
|
|
70
69
|
} else {
|
|
71
70
|
reportException({
|
|
72
71
|
type: 'deconstructException',
|
|
73
72
|
data: props,
|
|
74
73
|
text: `解构传入价格字段值“${strPrice}”解构发生异常`,
|
|
75
74
|
});
|
|
76
75
|
return null;
|
|
77
76
|
}
|
|
78
77
|
const {
|
|
79
78
|
jdPrice,
|
|
80
79
|
finalPrice,
|
|
81
80
|
priceText = '',
|
|
82
81
|
priceTextColor = '',
|
|
83
82
|
priceUnit = '',
|
|
84
83
|
priceType,
|
|
85
84
|
hitUserIdentity = false,
|
|
86
85
|
forceShowFinalPrice = false,
|
|
87
86
|
hideSmallPrice = false,
|
|
88
87
|
fallbackRender = null,
|
|
89
88
|
className = null,
|
|
90
89
|
style = {},
|
|
91
90
|
childrenClassName = null,
|
|
92
91
|
bigNoPriceClassName = null,
|
|
93
92
|
bigSymbolClassName = null,
|
|
94
93
|
bigIntegerClassName = null,
|
|
95
94
|
bigDecimalClassName = null,
|
|
96
95
|
priceDescClassName = null,
|
|
97
96
|
smallPriceClassName = null,
|
|
98
97
|
lineNumber = 1,
|
|
99
98
|
size = 'M',
|
|
100
99
|
isDefaultRemoveSmallPrice = false,
|
|
101
100
|
useFontV2 = false,
|
|
102
101
|
useFontV2Bold = false,
|
|
103
102
|
} = props;
|
|
104
103
|
let useBackstop = false;
|
|
105
104
|
const isShowPriceUnit = priceUnit && priceUnit !== '';
|
|
106
105
|
if (isNull(props.jdPrice, props.priceType)) {
|
|
107
106
|
useBackstop = true;
|
|
108
107
|
reportException({
|
|
109
108
|
type: 'paramMiss',
|
|
110
109
|
data: props,
|
|
111
110
|
text: '缺少必要入参:jdPrice、priceType',
|
|
112
111
|
});
|
|
113
112
|
} else if (
|
|
114
113
|
!allowedNoHitUserIdentityTypes.includes(props.priceType) &&
|
|
115
114
|
props.hitUserIdentity === undefined
|
|
116
115
|
) {
|
|
117
116
|
useBackstop = true;
|
|
118
117
|
reportException({
|
|
119
118
|
type: 'paramMiss',
|
|
120
119
|
data: props,
|
|
121
120
|
text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`,
|
|
122
121
|
});
|
|
123
122
|
}
|
|
124
123
|
const especialHitStyleType = {
|
|
125
124
|
7: 'plusStyle',
|
|
126
125
|
9: 'samStyle',
|
|
127
126
|
};
|
|
128
127
|
const especialMissStyleType = {
|
|
129
128
|
7: 'plusStyle',
|
|
130
129
|
8: 'fansStyle',
|
|
131
130
|
9: 'samStyle',
|
|
132
131
|
10: 'studentStyle',
|
|
133
132
|
12: 'yhdStyle',
|
|
134
133
|
13: 'memberStyle',
|
|
135
134
|
};
|
|
136
135
|
const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType);
|
|
137
136
|
const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity;
|
|
138
137
|
const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice);
|
|
139
138
|
const smallPrice = isEquivalentHit ? jdPrice : finalPrice;
|
|
140
139
|
const isHideSmallPrice =
|
|
141
140
|
hideSmallPrice || priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice));
|
|
142
141
|
const isTextPrice = priceType === 4;
|
|
143
142
|
if (!isTextPrice && !useBackstop) {
|
|
144
143
|
if (finalPrice && !numericPriceValidate(finalPrice, props)) {
|
|
145
144
|
useBackstop = true;
|
|
146
145
|
} else if (!numericPriceValidate(jdPrice, props)) {
|
|
147
146
|
useBackstop = true;
|
|
148
147
|
}
|
|
149
148
|
if (!useBackstop && !isOnlyShowBigPrice && !isHideSmallPrice && !pricesCompareValidate(props)) {
|
|
150
149
|
useBackstop = true;
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
const bigPriceObj =
|
|
154
153
|
isTextPrice || useBackstop
|
|
155
154
|
? {}
|
|
156
155
|
: getDeconstructPrice(isEquivalentHit && !isNull(finalPrice) ? finalPrice : jdPrice, props);
|
|
157
156
|
const { integerPrice = '', decimalPrice = '' } = bigPriceObj || {};
|
|
158
157
|
const isPriceDescInFront = isEquivalentHit;
|
|
159
158
|
const hitColorStyle = isEquivalentHit ? styles[especialHitStyleType[priceType]] : null;
|
|
160
159
|
const missColorStyle = isEquivalentHit ? null : styles[especialMissStyleType[priceType]];
|
|
161
160
|
const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice);
|
|
162
161
|
const sizeLineHeight = {
|
|
163
162
|
XS: 28,
|
|
164
163
|
S: 34,
|
|
165
164
|
M: 40,
|
|
166
165
|
L: 46,
|
|
167
166
|
XL: 52,
|
|
168
167
|
};
|
|
169
168
|
const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25);
|
|
170
169
|
const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber);
|
|
171
170
|
const computedHeightStyle = {
|
|
172
171
|
height: wrapHeight,
|
|
173
172
|
};
|
|
174
173
|
const itemCommonStyle = {
|
|
175
174
|
height: lineHeight,
|
|
176
175
|
};
|
|
177
176
|
const priceTextStyle = priceTextColor ? { color: priceTextColor } : {};
|
|
178
177
|
const needSizeStyles = [
|
|
179
178
|
'bigNoPrice',
|
|
180
179
|
'bigSymbol',
|
|
181
180
|
'bigInteger',
|
|
182
181
|
'bigDecimal',
|
|
183
182
|
'priceDesc',
|
|
184
183
|
'smallPrice',
|
|
185
184
|
'priceUnit',
|
|
186
185
|
];
|
|
187
186
|
const sizeStyles = needSizeStyles.reduce((acc, cur) => {
|
|
188
187
|
acc[cur] = styles[cur + size];
|
|
189
188
|
return acc;
|
|
190
189
|
}, {});
|
|
191
190
|
const finalFallbackText = global?.languageJsonData?.noPriceTip || '暂无报价';
|
|
192
191
|
const noPriceShowText =
|
|
193
192
|
priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice) ? jdPrice : finalFallbackText);
|
|
194
193
|
if (useBackstop && fallbackRender) {
|
|
195
194
|
return fallbackRender;
|
|
196
195
|
}
|
|
197
196
|
return (
|
|
198
197
|
<View
|
|
199
198
|
className={classNames(styles.wrap, className)}
|
|
200
199
|
style={{ ...computedHeightStyle, ...style }}
|
|
201
200
|
>
|
|
202
201
|
{isTextPrice || useBackstop ? (
|
|
203
202
|
<Text
|
|
204
203
|
className={classNames(
|
|
205
204
|
styles.childStyle,
|
|
206
205
|
styles.bigStyle,
|
|
207
206
|
styles.bigNoPrice,
|
|
208
207
|
sizeStyles['bigNoPrice'],
|
|
209
208
|
childrenClassName,
|
|
210
209
|
bigNoPriceClassName,
|
|
211
210
|
)}
|
|
212
211
|
style={{ ...itemCommonStyle }}
|
|
213
212
|
>
|
|
214
213
|
{useBackstop ? finalFallbackText : noPriceShowText}
|
|
215
214
|
</Text>
|
|
216
215
|
) : (
|
|
217
216
|
[
|
|
218
217
|
<Text
|
|
219
218
|
className={classNames(
|
|
220
219
|
styles.childStyle,
|
|
221
220
|
styles.bigStyle,
|
|
222
221
|
styles.bigSymbol,
|
|
223
222
|
sizeStyles['bigSymbol'],
|
|
224
223
|
hitColorStyle,
|
|
225
224
|
childrenClassName,
|
|
226
225
|
bigSymbolClassName,
|
|
227
226
|
{
|
|
228
227
|
[styles.fontV2]: useFontV2,
|
|
229
228
|
[styles.fontV2Bold]: useFontV2Bold,
|
|
230
229
|
},
|
|
231
230
|
)}
|
|
232
231
|
key="bigSymbol"
|
|
233
232
|
style={{ ...itemCommonStyle }}
|
|
234
233
|
>
|
|
235
234
|
¥
|
|
236
235
|
</Text>,
|
|
237
236
|
<Text
|
|
238
237
|
className={classNames(
|
|
239
238
|
styles.childStyle,
|
|
240
239
|
styles.bigStyle,
|
|
241
240
|
styles.bigInteger,
|
|
242
241
|
sizeStyles['bigInteger'],
|
|
243
242
|
hitColorStyle,
|
|
244
243
|
!isOnlyShowBigPrice &&
|
|
245
244
|
!isBigPriceHasDecimal &&
|
|
246
245
|
!isPriceDescInFront &&
|
|
247
246
|
!isShowPriceUnit
|
|
248
247
|
? styles.rightMargin
|
|
249
248
|
: null,
|
|
250
249
|
childrenClassName,
|
|
251
250
|
bigIntegerClassName,
|
|
252
251
|
{
|
|
253
252
|
[styles.fontV2]: useFontV2,
|
|
254
253
|
[styles.fontV2Bold]: useFontV2Bold,
|
|
255
254
|
},
|
|
256
255
|
)}
|
|
257
256
|
key="bigInteger"
|
|
258
257
|
style={{ ...itemCommonStyle }}
|
|
259
258
|
>
|
|
260
259
|
{integerPrice}
|
|
261
260
|
</Text>,
|
|
262
261
|
isBigPriceHasDecimal ? (
|
|
263
262
|
<Text
|
|
264
263
|
className={classNames(
|
|
265
264
|
styles.childStyle,
|
|
266
265
|
styles.bigStyle,
|
|
267
266
|
styles.bigDecimal,
|
|
268
267
|
sizeStyles['bigDecimal'],
|
|
269
268
|
hitColorStyle,
|
|
270
269
|
isPriceDescInFront || isShowPriceUnit ? null : styles.rightMargin,
|
|
271
270
|
childrenClassName,
|
|
272
271
|
bigDecimalClassName,
|
|
273
272
|
{
|
|
274
273
|
[styles.fontV2]: useFontV2,
|
|
275
274
|
[styles.fontV2Bold]: useFontV2Bold,
|
|
276
275
|
},
|
|
277
276
|
)}
|
|
278
277
|
key="bigDecimal"
|
|
279
278
|
style={{ ...itemCommonStyle }}
|
|
280
279
|
>
|
|
281
280
|
.{decimalPrice}
|
|
282
281
|
</Text>
|
|
283
282
|
) : null,
|
|
284
283
|
isShowPriceUnit ? (
|
|
285
284
|
<Text
|
|
286
285
|
className={classNames(
|
|
287
286
|
styles.childStyle,
|
|
288
287
|
styles.priceUnit,
|
|
289
288
|
styles.rightMargin,
|
|
290
289
|
sizeStyles['priceUnit'],
|
|
291
290
|
styles.bigStyle,
|
|
292
291
|
hitColorStyle,
|
|
293
292
|
childrenClassName,
|
|
294
293
|
priceDescClassName,
|
|
295
294
|
)}
|
|
296
295
|
key="descFrontUnit"
|
|
297
296
|
style={{ ...itemCommonStyle }}
|
|
298
297
|
>
|
|
299
298
|
{priceUnit}
|
|
300
299
|
</Text>
|
|
301
300
|
) : null,
|
|
302
301
|
!isOnlyShowBigPrice && [
|
|
303
302
|
isPriceDescInFront && (
|
|
304
303
|
<Text
|
|
305
304
|
className={classNames(
|
|
306
305
|
styles.childStyle,
|
|
307
306
|
styles.priceDesc,
|
|
308
307
|
{
|
|
309
308
|
[styles['priceEnDesc']]: isLanguageForEn,
|
|
310
309
|
},
|
|
311
310
|
{
|
|
312
311
|
[styles['priceHiddenDesc']]: priceText === '',
|
|
313
312
|
},
|
|
314
313
|
sizeStyles['priceDesc'],
|
|
315
314
|
styles.bigStyle,
|
|
316
315
|
hitColorStyle,
|
|
317
316
|
isPriceDescInFront && !isShowPriceUnit ? styles.rightMargin : null,
|
|
318
317
|
childrenClassName,
|
|
319
318
|
priceDescClassName,
|
|
320
319
|
)}
|
|
321
320
|
key="descFront"
|
|
322
321
|
style={{ ...itemCommonStyle, ...priceTextStyle }}
|
|
323
322
|
>
|
|
324
323
|
{priceText === '' ? '_' : priceText}
|
|
325
324
|
</Text>
|
|
326
325
|
),
|
|
327
326
|
<View
|
|
328
327
|
style={{
|
|
329
328
|
display: 'inline-flex',
|
|
330
329
|
}}
|
|
331
330
|
>
|
|
332
331
|
{smallPrice && !isHideSmallPrice ? (
|
|
333
332
|
<Text
|
|
334
333
|
className={classNames(
|
|
335
334
|
styles.childStyle,
|
|
336
335
|
styles.smallPrice,
|
|
337
336
|
sizeStyles['smallPrice'],
|
|
338
337
|
styles.smallStyle,
|
|
339
338
|
missColorStyle,
|
|
340
339
|
childrenClassName,
|
|
341
340
|
smallPriceClassName,
|
|
342
341
|
{
|
|
343
342
|
[styles.fontV2]: useFontV2,
|
|
344
343
|
[styles.fontV2Bold]: useFontV2Bold,
|
|
345
344
|
},
|
|
346
345
|
)}
|
|
347
346
|
key="smallPrice"
|
|
348
347
|
style={{ ...itemCommonStyle }}
|
|
349
348
|
>
|
|
350
349
|
¥{Number(smallPrice)}
|
|
351
350
|
</Text>
|
|
352
351
|
) : null}
|
|
353
352
|
{isShowPriceUnit && !isHideSmallPrice ? (
|
|
354
353
|
<Text
|
|
355
354
|
className={classNames(
|
|
356
355
|
styles.childStyle,
|
|
357
356
|
styles.priceUnit,
|
|
358
357
|
sizeStyles['priceUnit'],
|
|
359
358
|
styles.smallStyle,
|
|
360
359
|
styles.missPriceDesc,
|
|
361
360
|
missColorStyle,
|
|
362
361
|
childrenClassName,
|
|
363
362
|
priceDescClassName,
|
|
364
363
|
)}
|
|
365
364
|
key="descFrontUnit"
|
|
366
365
|
style={{ ...itemCommonStyle }}
|
|
367
366
|
>
|
|
368
367
|
{priceUnit}
|
|
369
368
|
</Text>
|
|
370
369
|
) : null}
|
|
371
370
|
{!isPriceDescInFront && !isHideSmallPrice && (
|
|
372
371
|
<Text
|
|
373
372
|
className={classNames(
|
|
374
373
|
styles.childStyle,
|
|
375
374
|
styles.priceDesc,
|
|
376
375
|
{
|
|
377
376
|
[styles['priceEnDesc']]: isLanguageForEn,
|
|
378
377
|
},
|
|
379
378
|
{
|
|
380
379
|
[styles['priceHiddenDesc']]: priceText === '',
|
|
381
380
|
},
|
|
382
381
|
sizeStyles['priceDesc'],
|
|
383
382
|
styles.smallStyle,
|
|
384
383
|
styles.missPriceDesc,
|
|
385
384
|
missColorStyle,
|
|
386
385
|
childrenClassName,
|
|
387
386
|
priceDescClassName,
|
|
388
387
|
)}
|
|
389
388
|
key="descBack"
|
|
390
389
|
style={{ ...itemCommonStyle }}
|
|
391
390
|
>
|
|
392
391
|
{priceText === '' ? '_' : priceText}
|
|
393
392
|
</Text>
|
|
394
393
|
)}
|
|
395
394
|
</View>,
|
|
396
395
|
],
|
|
397
396
|
]
|
|
398
397
|
)}
|
|
399
398
|
</View>
|
|
400
399
|
);
|
|
400
|
+
import React from 'react';
|
|
401
401
|
console.warn('🚗 ~~ file: index.tsx:22 ~~ reportException() ~~ {type, detail, text}:', {
|
|
402
402
|
type,
|
|
403
403
|
data,
|
|
404
404
|
text,
|
|
405
405
|
});
|
|
406
406
|
sgmCustomReport({
|
|
407
407
|
code: getSgmCustomCode(`${SgmCustomCode.PRICE_RENDER}_${type}`),
|
|
408
408
|
msg: {
|
|
409
409
|
type,
|
|
410
410
|
data,
|
|
411
411
|
text: '[双价格组件]' + text,
|
|
412
412
|
},
|
|
413
413
|
});
|
|
414
414
|
return rest.some((item) => item === undefined || item === '');
|
|
415
415
|
const numPrice = Number(strPrice);
|
|
416
416
|
if (isNaN(numPrice)) {
|
|
417
417
|
reportException({
|
|
418
418
|
type: 'isNotNumericType',
|
|
419
419
|
data: props,
|
|
420
420
|
text: `传入价格字段值“${strPrice}”转换数字报错`,
|
|
421
421
|
});
|
|
422
422
|
return false;
|
|
423
423
|
}
|
|
424
424
|
else if (numPrice <= 0) {
|
|
425
425
|
reportException({
|
|
426
426
|
type: 'isNotPositiveNumber',
|
|
427
427
|
data: props,
|
|
428
428
|
text: `传入价格字段值“${strPrice}”不是一个正数`,
|
|
429
429
|
});
|
|
430
430
|
return false;
|
|
431
431
|
}
|
|
432
432
|
const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
|
|
433
433
|
if (result && result[3]?.length > 2) {
|
|
434
434
|
reportException({
|
|
435
435
|
type: 'decimalPlaceTooLong',
|
|
436
436
|
data: props,
|
|
437
437
|
text: `传入价格字段值“${strPrice}”小数位不能超过2位`,
|
|
438
438
|
});
|
|
439
439
|
return false;
|
|
440
440
|
}
|
|
441
441
|
if (/^\d+(\.\d+)?[eE][+-]?\d+$/.test(strPrice)) {
|
|
442
442
|
reportException({
|
|
443
443
|
type: 'findScientificNotation',
|
|
444
444
|
data: props,
|
|
445
445
|
text: `传入价格字段值“${strPrice}”是一个科学计数法格式`,
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
448
|
return true;
|
|
449
449
|
const { jdPrice, finalPrice, forceShowFinalPrice } = props;
|
|
450
450
|
if (jdPrice && finalPrice) {
|
|
451
451
|
const getLastPassValidateState = forceShowFinalPrice || Number(finalPrice) < Number(jdPrice);
|
|
452
452
|
!getLastPassValidateState &&
|
|
453
453
|
reportException({
|
|
454
454
|
type: 'pricesCompareException',
|
|
455
455
|
data: props,
|
|
456
456
|
text: `身份/到手价必须小于松果价`,
|
|
457
457
|
});
|
|
458
458
|
return getLastPassValidateState;
|
|
459
459
|
} else {
|
|
460
460
|
return true;
|
|
461
461
|
}
|
|
462
462
|
const numPrice = Number(strPrice);
|
|
463
463
|
const result = numPrice.toString().match(/(\d+)(\.(\d+))?/);
|
|
464
464
|
if (result) {
|
|
465
465
|
return {
|
|
466
466
|
integerPrice: result[1],
|
|
467
467
|
decimalPrice: (result[3] || '').replace(/0+$/, ''),
|
|
468
468
|
};
|
|
469
469
|
} else {
|
|
470
470
|
reportException({
|
|
471
471
|
type: 'deconstructException',
|
|
472
472
|
data: props,
|
|
473
473
|
text: `解构传入价格字段值“${strPrice}”解构发生异常`,
|
|
474
474
|
});
|
|
475
475
|
return null;
|
|
476
476
|
}
|
|
477
477
|
const {
|
|
478
478
|
jdPrice,
|
|
479
479
|
finalPrice,
|
|
480
480
|
priceText = '',
|
|
481
481
|
priceTextColor = '',
|
|
482
482
|
priceUnit = '',
|
|
483
483
|
priceType,
|
|
484
484
|
hitUserIdentity = false,
|
|
485
485
|
forceShowFinalPrice = false,
|
|
486
486
|
hideSmallPrice = false,
|
|
487
487
|
fallbackRender = null,
|
|
488
488
|
className = null,
|
|
489
489
|
style = {},
|
|
490
490
|
childrenClassName = null,
|
|
491
491
|
bigNoPriceClassName = null,
|
|
492
492
|
bigSymbolClassName = null,
|
|
493
493
|
bigIntegerClassName = null,
|
|
494
494
|
bigDecimalClassName = null,
|
|
495
495
|
priceDescClassName = null,
|
|
496
496
|
smallPriceClassName = null,
|
|
497
497
|
smallPriceDescClassName = null,
|
|
498
498
|
lineNumber = 1,
|
|
499
499
|
size = 'M',
|
|
500
500
|
isDefaultRemoveSmallPrice = false,
|
|
501
501
|
useFontV2 = false,
|
|
502
502
|
useFontV2Bold = false,
|
|
503
503
|
useSmallFontV2 = false,
|
|
504
504
|
useSmallFontV2Bold = false,
|
|
505
505
|
} = props;
|
|
506
506
|
let useBackstop = false;
|
|
507
507
|
const isShowPriceUnit = priceUnit && priceUnit !== '';
|
|
508
508
|
if (isNull(props.jdPrice, props.priceType)) {
|
|
509
509
|
useBackstop = true;
|
|
510
510
|
reportException({
|
|
511
511
|
type: 'paramMiss',
|
|
512
512
|
data: props,
|
|
513
513
|
text: '缺少必要入参:jdPrice、priceType',
|
|
514
514
|
});
|
|
515
515
|
} else if (
|
|
516
516
|
!allowedNoHitUserIdentityTypes.includes(props.priceType) &&
|
|
517
517
|
props.hitUserIdentity === undefined
|
|
518
518
|
) {
|
|
519
519
|
useBackstop = true;
|
|
520
520
|
reportException({
|
|
521
521
|
type: 'paramMiss',
|
|
522
522
|
data: props,
|
|
523
523
|
text: `价格类型${props.priceType}缺少必要入参:hitUserIdentity`,
|
|
524
524
|
});
|
|
525
525
|
}
|
|
526
526
|
const especialHitStyleType = {
|
|
527
527
|
7: 'plusStyle',
|
|
528
528
|
9: 'samStyle',
|
|
529
529
|
};
|
|
530
530
|
const especialMissStyleType = {
|
|
531
531
|
7: 'plusStyle',
|
|
532
532
|
8: 'fansStyle',
|
|
533
533
|
9: 'samStyle',
|
|
534
534
|
10: 'studentStyle',
|
|
535
535
|
12: 'yhdStyle',
|
|
536
536
|
13: 'memberStyle',
|
|
537
537
|
};
|
|
538
538
|
const isUseFinalPriceAsBigPrice = allowedNoHitUserIdentityTypes.includes(priceType);
|
|
539
539
|
const isEquivalentHit = isUseFinalPriceAsBigPrice || hitUserIdentity;
|
|
540
540
|
const isOnlyShowBigPrice = priceType === 3 || isNull(finalPrice);
|
|
541
541
|
const smallPrice = isEquivalentHit ? jdPrice : finalPrice;
|
|
542
542
|
const isHideSmallPrice =
|
|
543
543
|
hideSmallPrice || priceType === 14 || isDefaultRemoveSmallPrice || isNaN(Number(smallPrice));
|
|
544
544
|
const isTextPrice = priceType === 4;
|
|
545
545
|
if (!isTextPrice && !useBackstop) {
|
|
546
546
|
if (finalPrice && !numericPriceValidate(finalPrice, props)) {
|
|
547
547
|
useBackstop = true;
|
|
548
548
|
} else if (!numericPriceValidate(jdPrice, props)) {
|
|
549
549
|
useBackstop = true;
|
|
550
550
|
}
|
|
551
551
|
if (!useBackstop && !isOnlyShowBigPrice && !isHideSmallPrice && !pricesCompareValidate(props)) {
|
|
552
552
|
useBackstop = true;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
const bigPriceObj =
|
|
556
556
|
isTextPrice || useBackstop
|
|
557
557
|
? {}
|
|
558
558
|
: getDeconstructPrice(isEquivalentHit && !isNull(finalPrice) ? finalPrice : jdPrice, props);
|
|
559
559
|
const { integerPrice = '', decimalPrice = '' } = bigPriceObj || {};
|
|
560
560
|
const isPriceDescInFront = isEquivalentHit;
|
|
561
561
|
const hitColorStyle = isEquivalentHit ? styles[especialHitStyleType[priceType]] : null;
|
|
562
562
|
const missColorStyle = isEquivalentHit ? null : styles[especialMissStyleType[priceType]];
|
|
563
563
|
const isBigPriceHasDecimal = decimalPrice !== '' && !/^0+$/.test(decimalPrice);
|
|
564
564
|
const sizeLineHeight = {
|
|
565
565
|
XS: 28,
|
|
566
566
|
S: 34,
|
|
567
567
|
M: 40,
|
|
568
568
|
L: 46,
|
|
569
569
|
XL: 52,
|
|
570
570
|
};
|
|
571
571
|
const lineHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25);
|
|
572
572
|
const wrapHeight = Taro.pxTransform(sizeLineHeight[size] * 1.25 * lineNumber);
|
|
573
573
|
const computedHeightStyle = {
|
|
574
574
|
height: wrapHeight,
|
|
575
575
|
};
|
|
576
576
|
const itemCommonStyle = {
|
|
577
577
|
height: lineHeight,
|
|
578
578
|
};
|
|
579
579
|
const priceTextStyle = priceTextColor ? { color: priceTextColor } : {};
|
|
580
580
|
const needSizeStyles = [
|
|
581
581
|
'bigNoPrice',
|
|
582
582
|
'bigSymbol',
|
|
583
583
|
'bigInteger',
|
|
584
584
|
'bigDecimal',
|
|
585
585
|
'priceDesc',
|
|
586
586
|
'smallPrice',
|
|
587
587
|
'priceUnit',
|
|
588
588
|
];
|
|
589
589
|
const sizeStyles = needSizeStyles.reduce((acc, cur) => {
|
|
590
590
|
acc[cur] = styles[cur + size];
|
|
591
591
|
return acc;
|
|
592
592
|
}, {});
|
|
593
593
|
const finalFallbackText = global?.languageJsonData?.noPriceTip || '暂无报价';
|
|
594
594
|
const noPriceShowText =
|
|
595
595
|
priceText || (/^[\u4e00-\u9fa5]+$/.test(jdPrice) ? jdPrice : finalFallbackText);
|
|
596
596
|
if (useBackstop && fallbackRender) {
|
|
597
597
|
return fallbackRender;
|
|
598
598
|
}
|
|
599
599
|
return (
|
|
600
600
|
<View
|
|
601
601
|
className={classNames(styles.wrap, className)}
|
|
602
602
|
style={{ ...computedHeightStyle, ...style }}
|
|
603
603
|
>
|
|
604
604
|
{isTextPrice || useBackstop ? (
|
|
605
605
|
<Text
|
|
606
606
|
className={classNames(
|
|
607
607
|
styles.childStyle,
|
|
608
608
|
styles.bigStyle,
|
|
609
609
|
styles.bigNoPrice,
|
|
610
610
|
sizeStyles['bigNoPrice'],
|
|
611
611
|
childrenClassName,
|
|
612
612
|
bigNoPriceClassName,
|
|
613
613
|
)}
|
|
614
614
|
style={{ ...itemCommonStyle }}
|
|
615
615
|
>
|
|
616
616
|
{useBackstop ? finalFallbackText : noPriceShowText}
|
|
617
617
|
</Text>
|
|
618
618
|
) : (
|
|
619
619
|
[
|
|
620
620
|
<Text
|
|
621
621
|
className={classNames(
|
|
622
622
|
styles.childStyle,
|
|
623
623
|
styles.bigStyle,
|
|
624
624
|
styles.bigSymbol,
|
|
625
625
|
sizeStyles['bigSymbol'],
|
|
626
626
|
hitColorStyle,
|
|
627
627
|
childrenClassName,
|
|
628
628
|
bigSymbolClassName,
|
|
629
629
|
{
|
|
630
630
|
[styles.fontV2]: useFontV2,
|
|
631
631
|
[styles.fontV2Bold]: useFontV2Bold,
|
|
632
632
|
},
|
|
633
633
|
)}
|
|
634
634
|
key="bigSymbol"
|
|
635
635
|
style={{ ...itemCommonStyle }}
|
|
636
636
|
>
|
|
637
637
|
¥
|
|
638
638
|
</Text>,
|
|
639
639
|
<Text
|
|
640
640
|
className={classNames(
|
|
641
641
|
styles.childStyle,
|
|
642
642
|
styles.bigStyle,
|
|
643
643
|
styles.bigInteger,
|
|
644
644
|
sizeStyles['bigInteger'],
|
|
645
645
|
hitColorStyle,
|
|
646
646
|
!isOnlyShowBigPrice &&
|
|
647
647
|
!isBigPriceHasDecimal &&
|
|
648
648
|
!isPriceDescInFront &&
|
|
649
649
|
!isShowPriceUnit
|
|
650
650
|
? styles.rightMargin
|
|
651
651
|
: null,
|
|
652
652
|
childrenClassName,
|
|
653
653
|
bigIntegerClassName,
|
|
654
654
|
{
|
|
655
655
|
[styles.fontV2]: useFontV2,
|
|
656
656
|
[styles.fontV2Bold]: useFontV2Bold,
|
|
657
657
|
},
|
|
658
658
|
)}
|
|
659
659
|
key="bigInteger"
|
|
660
660
|
style={{ ...itemCommonStyle }}
|
|
661
661
|
>
|
|
662
662
|
{integerPrice}
|
|
663
663
|
</Text>,
|
|
664
664
|
isBigPriceHasDecimal ? (
|
|
665
665
|
<Text
|
|
666
666
|
className={classNames(
|
|
667
667
|
styles.childStyle,
|
|
668
668
|
styles.bigStyle,
|
|
669
669
|
styles.bigDecimal,
|
|
670
670
|
sizeStyles['bigDecimal'],
|
|
671
671
|
hitColorStyle,
|
|
672
672
|
isPriceDescInFront || isShowPriceUnit ? null : styles.rightMargin,
|
|
673
673
|
childrenClassName,
|
|
674
674
|
bigDecimalClassName,
|
|
675
675
|
{
|
|
676
676
|
[styles.fontV2]: useFontV2,
|
|
677
677
|
[styles.fontV2Bold]: useFontV2Bold,
|
|
678
678
|
},
|
|
679
679
|
)}
|
|
680
680
|
key="bigDecimal"
|
|
681
681
|
style={{ ...itemCommonStyle }}
|
|
682
682
|
>
|
|
683
683
|
.{decimalPrice}
|
|
684
684
|
</Text>
|
|
685
685
|
) : null,
|
|
686
686
|
isShowPriceUnit ? (
|
|
687
687
|
<Text
|
|
688
688
|
className={classNames(
|
|
689
689
|
styles.childStyle,
|
|
690
690
|
styles.priceUnit,
|
|
691
691
|
styles.rightMargin,
|
|
692
692
|
sizeStyles['priceUnit'],
|
|
693
693
|
styles.bigStyle,
|
|
694
694
|
hitColorStyle,
|
|
695
695
|
childrenClassName,
|
|
696
696
|
priceDescClassName,
|
|
697
697
|
)}
|
|
698
698
|
key="descFrontUnit"
|
|
699
699
|
style={{ ...itemCommonStyle }}
|
|
700
700
|
>
|
|
701
701
|
{priceUnit}
|
|
702
702
|
</Text>
|
|
703
703
|
) : null,
|
|
704
704
|
!isOnlyShowBigPrice && [
|
|
705
705
|
isPriceDescInFront && (
|
|
706
706
|
<Text
|
|
707
707
|
className={classNames(
|
|
708
708
|
styles.childStyle,
|
|
709
709
|
styles.priceDesc,
|
|
710
710
|
{
|
|
711
711
|
[styles['priceEnDesc']]: isLanguageForEn,
|
|
712
712
|
},
|
|
713
713
|
{
|
|
714
714
|
[styles['priceHiddenDesc']]: priceText === '',
|
|
715
715
|
},
|
|
716
716
|
sizeStyles['priceDesc'],
|
|
717
717
|
styles.bigStyle,
|
|
718
718
|
hitColorStyle,
|
|
719
719
|
isPriceDescInFront && !isShowPriceUnit ? styles.rightMargin : null,
|
|
720
720
|
childrenClassName,
|
|
721
721
|
priceDescClassName,
|
|
722
722
|
)}
|
|
723
723
|
key="descFront"
|
|
724
724
|
style={{ ...itemCommonStyle, ...priceTextStyle }}
|
|
725
725
|
>
|
|
726
726
|
{priceText === '' ? '_' : priceText}
|
|
727
727
|
</Text>
|
|
728
728
|
),
|
|
729
729
|
<View
|
|
730
730
|
style={{
|
|
731
731
|
display: 'inline-flex',
|
|
732
732
|
}}
|
|
733
733
|
>
|
|
734
734
|
{smallPrice && !isHideSmallPrice ? (
|
|
735
735
|
<Text
|
|
736
736
|
className={classNames(
|
|
737
737
|
styles.childStyle,
|
|
738
738
|
styles.smallPrice,
|
|
739
739
|
sizeStyles['smallPrice'],
|
|
740
740
|
styles.smallStyle,
|
|
741
741
|
missColorStyle,
|
|
742
742
|
childrenClassName,
|
|
743
743
|
smallPriceClassName,
|
|
744
744
|
{
|
|
745
745
|
[styles.fontV2]: useSmallFontV2Bold ? false : useSmallFontV2 || useFontV2,
|
|
746
746
|
[styles.fontV2Bold]: useSmallFontV2 ? false : useSmallFontV2Bold || useFontV2Bold,
|
|
747
747
|
},
|
|
748
748
|
)}
|
|
749
749
|
key="smallPrice"
|
|
750
750
|
style={{ ...itemCommonStyle }}
|
|
751
751
|
>
|
|
752
752
|
¥{Number(smallPrice)}
|
|
753
753
|
</Text>
|
|
754
754
|
) : null}
|
|
755
755
|
{isShowPriceUnit && !isHideSmallPrice ? (
|
|
756
756
|
<Text
|
|
757
757
|
className={classNames(
|
|
758
758
|
styles.childStyle,
|
|
759
759
|
styles.priceUnit,
|
|
760
760
|
sizeStyles['priceUnit'],
|
|
761
761
|
styles.smallStyle,
|
|
762
762
|
styles.missPriceDesc,
|
|
763
763
|
missColorStyle,
|
|
764
764
|
childrenClassName,
|
|
765
765
|
smallPriceDescClassName || priceDescClassName,
|
|
766
766
|
)}
|
|
767
767
|
key="descFrontUnit"
|
|
768
768
|
style={{ ...itemCommonStyle }}
|
|
769
769
|
>
|
|
770
770
|
{priceUnit}
|
|
771
771
|
</Text>
|
|
772
772
|
) : null}
|
|
773
773
|
{!isPriceDescInFront && !isHideSmallPrice && (
|
|
774
774
|
<Text
|
|
775
775
|
className={classNames(
|
|
776
776
|
styles.childStyle,
|
|
777
777
|
styles.priceDesc,
|
|
778
778
|
{
|
|
779
779
|
[styles['priceEnDesc']]: isLanguageForEn,
|
|
780
780
|
},
|
|
781
781
|
{
|
|
782
782
|
[styles['priceHiddenDesc']]: priceText === '',
|
|
783
783
|
},
|
|
784
784
|
sizeStyles['priceDesc'],
|
|
785
785
|
styles.smallStyle,
|
|
786
786
|
styles.missPriceDesc,
|
|
787
787
|
missColorStyle,
|
|
788
788
|
childrenClassName,
|
|
789
789
|
smallPriceDescClassName || priceDescClassName,
|
|
790
790
|
)}
|
|
791
791
|
key="descBack"
|
|
792
792
|
style={{ ...itemCommonStyle }}
|
|
793
793
|
>
|
|
794
794
|
{priceText === '' ? '_' : priceText}
|
|
795
795
|
</Text>
|
|
796
796
|
)}
|
|
797
797
|
</View>,
|
|
798
798
|
],
|
|
799
799
|
]
|
|
800
800
|
)}
|
|
801
801
|
</View>
|
|
802
802
|
);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 2025-
|
|
2
|
-
var Taro=require("@tarojs/taro");!function(n){var h={};if("weapp"===process.env.TARO_ENV)h=["t_1000578828_xcx_1000_wxtd","t_1000578828_xcx_1001_fxrk","t_1000578828_xcx_1003_xblb","t_1000578826_xcx_1005_fxss","t_1000578826_xcx_1006_fxss","t_1000578832_xcx_1007_drxxkp","t_1000578832_xcx_1008_qlxxkp","t_1000578828_xcx_1010_scj","t_1000578833_xcx_1011_smewm","t_1000578833_xcx_1012_tpsm","t_1000578833_xcx_1013_xcsm","t_1000578827_xcx_1014_xcxmbxx","t_1000578829_xcx_1017_tyb","t_1000578830_xcx_1019_qb","t_1000072662_xcx_1020_gzhjs","t_1000578828_xcx_1022_zdrk","t_1000578828_xcx_1023_zmtb","t_1000578828_xcx_1024_xcxjs","t_1000578833_xcx_1025_smywm","t_1000578829_xcx_1026_fjxcx","t_1000578826_xcx_1027_dbss","t_1000578836_xcx_1028_kqkb","t_1000578836_xcx_1029_kqxq","t_1000578829_xcx_1030_zdhcs","t_1000578833_xcx_1031_tpsm","t_1000578833_xcx_1032_xcsm","t_1000578827_xcx_1034_zfwcxx","t_1000072662_xcx_1035_cdl","t_335139774_xcx_1036_appfxxx","t_1000578834_xcx_1037_xcxtz","t_1000578834_xcx_1038_xcxtz","t_1000578829_xcx_1039_yds","t_1000578826_xcx_1042_tjss","t_1000072662_xcx_1043_gzhxx","t_1000578832_xcx_1044_fxxxkp","t_1000578833_xcx_1047_smxcxm","t_1000578833_xcx_1048_tpsm","t_1000578833_xcx_1049_xcsm","t_1000578836_xcx_1052_kqmdlb","t_1000578826_xcx_1053_sys","t_1000578828_xcx_1054_dbss","t_1000578829_xcx_1055_h5hq","t_1000578829_xcx_1056_ylbf","t_1000578830_xcx_1057_yxkxqy","t_1000072663_xcx_1058_gzhwz","t_1000578829_xcx_1059_yqy","t_1000578829_xcx_1064_wifilj","t_1000578829_xcx_1069_ydyy","t_1000578830_xcx_1071_yxklby","t_1000578833_xcx_1072_ewmsk","t_1000578829_xcx_1073_kfxx","t_1000072663_xcx_1074_gzhxx","t_1000578829_xcx_1077_yzb","t_1000578829_xcx_1078_wifilj","t_1000578829_xcx_1079_yxzx","t_1000578829_xcx_1081_kfwzl","t_1000072663_xcx_1082_hhwzl","t_1000578828_xcx_1088_hhxx","t_1000578828_xcx_1089_ltkxl","t_1000578828_xcx_1090_xcxcd","t_1000072663_xcx_1091_wzspkp","t_1000578829_xcx_1092_csfwrk","t_1000578828_xcx_1096_ltjl","t_1000578829_xcx_1097_zfqy","t_1000578829_xcx_1099_cj","t_1000578828_xcx_1100_hbfmxqy","t_1000072663_xcx_1102_fwyl","t_1000578829_xcx_1103_fxwd","t_1000578829_xcx_1104_xlwd","t_1000578828_xcx_1106_xlss","t_1000578828_xcx_1107_dyxx","t_1000578828_xcx_1113_azfyp","t_1000578828_xcx_1114_azcbl","t_1000578828_xcx_1119_qywxgzt","t_1000578828_xcx_1120_qywxgrzl","t_1000072660_xcx_1121_fxrk","t_1000578832_xcx_1123_qwqt","t_1000578833_xcx_1124_smywym","t_1000578829_xcx_1129_pc","t_1000578828_xcx_1133_yjsb","t_1000578829_xcx_1135_zcxtz","t_1000072663_xcx_1152_dyhspdkxcx","t_1000578832_xcx_1154_pyqdy","t_1000578832_xcx_1155_pyqdytz","t_1000578832_xcx_1157_fqhhhk","t_1000578832_xcx_1158_qgjdkxcx","t_1000578828_xcx_1167_bqtz","t_1000578828_xcx_1168_qqllq","t_1000578832_xcx_1202_qwhh","t_1000578832_xcx_1207_qwwzl","t_1000578828_xcx_1223_azwidget","t_1000578828_xcx_1242_fxrk","t_1000578828_xcx_1245_fxrk","t_1000578833_xcx_1253_swjgy","t_1000578828_xcx_1256_pcmb","t_1000578828_xcx_1257_pcmb","t_1000578832_xcx_1265_tpxqy","t_1000578832_xcx_1266_tpcabprk","t_1000578828_xcx_1273_fxrk","t_1000578828_xcx_1278_fxrk","t_1000578828_xcx_1279_fxrk","t_1000578826_xcx_1280_xlwd","t_1000578826_xcx_1281_xlwd","t_1000578828_xcx_1282_fxrk","t_1000578828_xcx_1285_fxrk","t_1000578828_xcx_1286_mwscheme","t_1000072663_xcx_1287_djtp","t_1000578829_xcx_1296_ffdjqp","t_1000578826_xcx_1298_xlwd","t_1000578826_xcx_1299_xlwd","t_1000578826_xcx_1300_fxrk","t_1000578826_xcx_1301_fxrk","t_1000578828_xcx_1302_pcmb","t_1000578828_xcx_1303_fxrk","t_1000578828_xcx_1304_sjfyp","t_1000072663_xcx_1305_bojsy","t_1000072663_xcx_1306_djguxj","t_1000578828_xcx_1307_fxrk","t_1000578828_xcx_1308_pcmb","t_1000072663_xcx_1309_wzxyxcps","t_1000072676_xcx_100000_sq","t_1000072676_xcx_100001_sq","t_1000072676_xcx_100002_sq","t_1000072676_xcx_100003_sq"].reduce(function(t,e){return t[e.split("_")[3]]=["direct",e,"xcx","-"],t},{});var N=function(t){var e="";try{e=n.getStorageSync(t)}catch(t){}return e},B=function(t,e){try{n.setStorageSync(t,e)}catch(t){}},r=n.request,t=n.getSystemInfo,e=n.getDeviceInfo,_=n.onAppHide,a=n.getNetworkType,i="";"weapp"===process.env.TARO_ENV?i="wx-app":"swan"===process.env.TARO_ENV?i="baidu-app":"tt"===process.env.TARO_ENV?i="toutiao-app":"alipay"===process.env.TARO_ENV?i="alipay-app":"rn"===process.env.TARO_ENV?i="rn-app":"h5"===process.env.TARO_ENV&&(i="h5-app");var V={jsVer:"TR2.1.6",jdaKey:"__jda",jddKey:"__jdd",jdvKey:"__jdv",jdvSceneKey:"__scene_jdv",rdJdvKey:"cookies",debugKey:"__debugId__",sysExtKey:"__sysExtKey__",customerInfoKey:"union_customerinfo",jdvTimeMS:864e5,customerInfoTime:86400,sessionTime:1800,referKey:"__refer",md5Salt:"5YT%aC89$22OI@pQ",batchKey:"zwx-stream-storage",reportStrategy:"zwx-report-strategy",sendByBatch:!1,own:{__jda:1,__jdd:1,__jdv:1,__refer:1,appid:1,jdwcx:1,jdzdm:1,union_customerinfo:1},addr:function(t){var e="https://neptune.jd.com/log/m";try{var n=getApp({allowDefault:!0});n&&n.globalRequestUrl&&(e=n.globalRequestUrl.replace(/\/*$/,"/neptune/log/m"))}catch(t){}return t?"https://luna.jd.com/debuglog/xapp":e}},s=0;function W(t){t=t||"tr-"+s++,this.name=t,this.logCache=[],this.env=[],this.ext={},this.isReady=W.isWxDataReady,W.loggerList&&W.loggerList instanceof Array&&W.loggerList.push(this),W.isInitJda||(W.initJda(),W.isInitJda=!0)}W.loggerList=[],W.dependList={sysinfo:0,netType:0},W.isWxDataReady=!1,W.instance=!1,W.getInstance=function(){return W.instance||(W.instance=new W)},W.getMulInstance=function(t){return new W(t)},W.dataReady=function(t){if(!W.isWxDataReady){for(var e in W.dependList[t]=1,W.dependList)if(!W.dependList[e])return;W.isWxDataReady=!0;e=0;for(var n=W.loggerList.length;e<n;e++)W.loggerList[e].ready();delete W.loggerList}},(W.pr=W.prototype).ready=function(){this.isReady=!0;for(var t=this.logCache.length,e=0;e<t;e++)this.sendData.apply(this,this.logCache[e])},W.pr.sendData=function(t,e,n){var a;(a="pv"==e?this.initPvData(n,e):"cl"==e?this.initClickData(n,e):"cd"==e?this.initShoppingData(n):"od"==e?this.initOrderData(n):"sr"==e?this.initPageUnloadData(n):"ep"==e?this.initExposureData(n):n).tpc=t,a.report_ts=H()/1e3,a.token=W.md5(a.report_ts+V.md5Salt),a.data[0].typ=e,a.data[0].debugId=this.env[gt]||"",this.logByPost(a,a.data[0])},W.pr.send=function(t,e,n){this.isReady?this.sendData.apply(this,arguments):this.logCache.push(arguments)},W.pr.request=function(t,e){var n=!!this.env[gt],a="https://neptune.jd.com/log/m/v3?std="+t.std;r({url:e?a:V.addr(n)+"?std="+t.std,data:t,method:"POST",header:{"content-type":"application/json"},success:function(t){}})},W.pr.exports=function(){var _=this;return{set:function(t){_.setData(t)},setCommon:function(t){_.setData(t,!0)},pv:function(t){_.lastPvTime&&H()-_.lastPvTime<100||(_.lastPvTime=H(),_.setData(t),_.setupPageview(!0),_.send("wx_app.000000","pv",t))},click:function(t){_.send("wx_app.000001","cl",t)},exposure:function(t){_.send("wx_app.000005","ep",t)},spmPV:function(t){if(_.validateSpm("pv",t)){var e=_.formatSpmParams("pv",t);this.pv(e)}},spmClick:function(t){if(_.validateSpm("cl",t)){var e=_.formatSpmParams("cl",t);this.click(e)}},spmExposure:function(t){if(_.validateSpm("expo",t)){var e=_.formatSpmParams("expo",t);this.exposure(e)}},autoClick:function(t){var e,n=t.target.dataset,a=t.currentTarget.dataset;if(n&&n.eid?e=n:a&&a.eid&&(e=a),e){var r={eid:e.eid,elevel:e.elevel,eparam:e.eparam,pname:e.pname,pparam:e.pparam,target:e.target,event:t};_.send("wx_app.000001","cl",r)}},addToCart:function(t){_.send("wx_app.000002","cd",t)},order:function(t){_.send("wx_app.000003","od",t)},pageUnload:function(t){_.send("wx_app.000004","sr",t)},getSeries:function(){return _.env[k]||(_.setupPageview(),_.env[k]=!0),JSON.stringify(_.getSeriesData())},urlAddSeries:function(t){var e=(t||"").indexOf("#"),n="wxappSeries="+encodeURIComponent(this.getSeries());return-1<e?e===t.length-1?t+n:t+"&"+n:t+"#"+n},setMParam:function(t){return _.setMParam(t)},getJda:function(){return N(V.jdaKey)},getJdv:function(){return N(V.jdvKey)},getStorage:function(t){return N(t)},setStorage:function(t,e){return B(t,e)},setJdv:function(t){return t&&5===t.split("|").length&&B(V.jdvKey,t+"|"+H())}}};var c=2e3,o=1e3,x=1e3,p=100,d=10,u=null,l={num:"numberOut",time:"timeOut",pageHide:"pageHide"};function f(t){t&&$(t)&&(V.sendByBatch=t.h5_size&&1!=t.h5_size||t.h5_time&&1!=t.h5_time,d=t.h5_size?+t.h5_size:d,x=t.h5_time?1e3*t.h5_time:x)}function v(t,e){var n;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(t[n],n)}function m(t,n){v(t,function(t,e){n[e]=t})}function g(n){var a,t,r,e={};for(m(n[0],e),a=0;a<n.length;++a)for(r=[],v(e,function(t,e){t!==n[a][e]&&r.push(e)}),t=0;t<r.length;++t)delete e[r[t]];return v(e,function(t,e){for(a=0;a<n.length;++a)delete n[a][e]}),e.data=n,e}function y(){var t=N(V.batchKey);if(t){var e,n=t.data;for(delete t.data,e=0;e<n.length;++e)m(t,n[e]);return n}return[]}W.pr.batchSend=function(t,e){try{if(t.length){B(V.batchKey,null);var n=g(t);n.batch_report_type=e,n.report_ts=H()/1e3,n.token=W.md5(n.report_ts+V.md5Salt),this.request(n,!0)}}catch(t){}},W.pr.logByPost=function(t,e){var n=this;if(!!!this.env[gt]&&V.sendByBatch)try{if(!u){!function t(e,n){var a=c+(o*Math.random()<<0),r=x+(p*Math.random()<<0);u=setTimeout(function(){try{n.batchSend(y(),l.time),t(!1,n)}catch(t){}},e?a:r)}(!0,n),_(function(){!function(t){try{clearTimeout(u),u=null,n.batchSend(y(),t)}catch(t){}}(l.pageHide)})}var a={};delete t.report_ts,delete t.token,delete t.data,m(t,a),m(e,a);var r=y().concat(a);r.length>=d?this.batchSend(r,l.num):B(V.batchKey,g(r))}catch(t){}else this.request(t)},function(t){var _=0;function e(t){return a(n(r(t)))}function n(t){return s(c(i(t),8*t.length))}function a(t){for(var e,n=_?"0123456789ABCDEF":"0123456789abcdef",a="",r=0;r<t.length;r++)e=t.charCodeAt(r),a+=n.charAt(e>>>4&15)+n.charAt(15&e);return a}function r(t){for(var e,n,a="",r=-1;++r<t.length;)e=t.charCodeAt(r),n=r+1<t.length?t.charCodeAt(r+1):0,55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e=65536+((1023&e)<<10)+(1023&n),r++),e<=127?a+=String.fromCharCode(e):e<=2047?a+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?a+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(a+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return a}function i(t){var e,n=Array(t.length>>2);for(e=0;e<n.length;e++)n[e]=0;for(e=0;e<8*t.length;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function s(t){for(var e="",n=0;n<32*t.length;n+=8)e+=String.fromCharCode(t[n>>5]>>>n%32&255);return e}function c(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,a=-271733879,r=-1732584194,_=271733878,i=0;i<t.length;i+=16){var s=n,c=a,o=r,x=_;a=l(a=l(a=l(a=l(a=u(a=u(a=u(a=u(a=d(a=d(a=d(a=d(a=p(a=p(a=p(a=p(a,r=p(r,_=p(_,n=p(n,a,r,_,t[i+0],7,-680876936),a,r,t[i+1],12,-389564586),n,a,t[i+2],17,606105819),_,n,t[i+3],22,-1044525330),r=p(r,_=p(_,n=p(n,a,r,_,t[i+4],7,-176418897),a,r,t[i+5],12,1200080426),n,a,t[i+6],17,-1473231341),_,n,t[i+7],22,-45705983),r=p(r,_=p(_,n=p(n,a,r,_,t[i+8],7,1770035416),a,r,t[i+9],12,-1958414417),n,a,t[i+10],17,-42063),_,n,t[i+11],22,-1990404162),r=p(r,_=p(_,n=p(n,a,r,_,t[i+12],7,1804603682),a,r,t[i+13],12,-40341101),n,a,t[i+14],17,-1502002290),_,n,t[i+15],22,1236535329),r=d(r,_=d(_,n=d(n,a,r,_,t[i+1],5,-165796510),a,r,t[i+6],9,-1069501632),n,a,t[i+11],14,643717713),_,n,t[i+0],20,-373897302),r=d(r,_=d(_,n=d(n,a,r,_,t[i+5],5,-701558691),a,r,t[i+10],9,38016083),n,a,t[i+15],14,-660478335),_,n,t[i+4],20,-405537848),r=d(r,_=d(_,n=d(n,a,r,_,t[i+9],5,568446438),a,r,t[i+14],9,-1019803690),n,a,t[i+3],14,-187363961),_,n,t[i+8],20,1163531501),r=d(r,_=d(_,n=d(n,a,r,_,t[i+13],5,-1444681467),a,r,t[i+2],9,-51403784),n,a,t[i+7],14,1735328473),_,n,t[i+12],20,-1926607734),r=u(r,_=u(_,n=u(n,a,r,_,t[i+5],4,-378558),a,r,t[i+8],11,-2022574463),n,a,t[i+11],16,1839030562),_,n,t[i+14],23,-35309556),r=u(r,_=u(_,n=u(n,a,r,_,t[i+1],4,-1530992060),a,r,t[i+4],11,1272893353),n,a,t[i+7],16,-155497632),_,n,t[i+10],23,-1094730640),r=u(r,_=u(_,n=u(n,a,r,_,t[i+13],4,681279174),a,r,t[i+0],11,-358537222),n,a,t[i+3],16,-722521979),_,n,t[i+6],23,76029189),r=u(r,_=u(_,n=u(n,a,r,_,t[i+9],4,-640364487),a,r,t[i+12],11,-421815835),n,a,t[i+15],16,530742520),_,n,t[i+2],23,-995338651),r=l(r,_=l(_,n=l(n,a,r,_,t[i+0],6,-198630844),a,r,t[i+7],10,1126891415),n,a,t[i+14],15,-1416354905),_,n,t[i+5],21,-57434055),r=l(r,_=l(_,n=l(n,a,r,_,t[i+12],6,1700485571),a,r,t[i+3],10,-1894986606),n,a,t[i+10],15,-1051523),_,n,t[i+1],21,-2054922799),r=l(r,_=l(_,n=l(n,a,r,_,t[i+8],6,1873313359),a,r,t[i+15],10,-30611744),n,a,t[i+6],15,-1560198380),_,n,t[i+13],21,1309151649),r=l(r,_=l(_,n=l(n,a,r,_,t[i+4],6,-145523070),a,r,t[i+11],10,-1120210379),n,a,t[i+2],15,718787259),_,n,t[i+9],21,-343485551),n=h(n,s),a=h(a,c),r=h(r,o),_=h(_,x)}return Array(n,a,r,_)}function o(t,e,n,a,r,_){return h((i=h(h(e,t),h(a,_)))<<(s=r)|i>>>32-s,n);var i,s}function p(t,e,n,a,r,_,i){return o(e&n|~e&a,t,e,r,_,i)}function d(t,e,n,a,r,_,i){return o(e&a|n&~a,t,e,r,_,i)}function u(t,e,n,a,r,_,i){return o(e^n^a,t,e,r,_,i)}function l(t,e,n,a,r,_,i){return o(n^(e|~a),t,e,r,_,i)}function h(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}W.md5=e}();var H=function(){return(new Date).getTime()},X=function(){return H()+""+parseInt(2147483647*Math.random())},$=function(t){return"[object Object]"=={}.toString.call(t)},w=function(t,e){if($(t)&&$(e))for(var n in e)t[n]=e[n]},F=function(t){var e=[];if($(t))for(var n in t)"m_param"!==n&&e.push(n+"="+t[n]);return e.join("&")},Y=function(t){if($(t))for(var e in t)return!1;return!0},j=0,b=j++,G=j++,Q=j++,Z=j++,tt=j++,et=j++,nt=j++,at=j++,rt=j++,_t=j++,k=j++,it=j++,S=j++,D=j++,P=j++,st=j++,ct=j++,ot=j++,xt=j++,C=j++,K=j++,q=j++,pt=j++,dt=j++,ut=j++,I=j++,z=j++,R=j++,lt=j++,ht=j++,ft=j++,T=j++,A=j++,E=j++,vt=j++,mt=j++,gt=j++,O=j++,U=j++,J=j++,L=j++;W.pr.getData=function(t){for(var e={},n=0,a=t.length;n<a;n++){var r=t[n];e[r[0]]=this.env[r[1]]||""}return e};var M,yt,wt=null,jt=function(t,e,n,a){var r=(t||"").split("|"),_="",i="",s="",c="",o=!0;6<=r.length&&e-r[5]<=V.jdvTimeMS&&(_=r[1],i=r[2],s=r[3],c=r[4],o=!1);var x=Y(n[st])?n[xt]:n[st],p=[];if(a&&wt&&h[wt]){var d=h[wt];p[0]=d[0],p[1]=encodeURIComponent(d[1]),p[2]=encodeURIComponent(d[2])||"none",p[3]=encodeURIComponent(d[3])||"-",wt=null}x&&x.utm_source&&(p[0]=encodeURIComponent(x.utm_source),p[1]=encodeURIComponent(x.utm_campaign||"")||i,p[2]=encodeURIComponent(x.utm_medium||"")||s,p[3]=encodeURIComponent(x.utm_term||"")||c,c=p[3],o=!0);var u=a;a||(0<p.length&&"direct"!=p[0]?u=(p[0]!==_||p[1]!==i||p[2]!==s)&&"referral"!==p[2]:0<p.length&&"direct"==p[0]&&("direct"===_||!_)&&(u=p[1]!==i||p[2]!==s||p[3]!==c));var l="";return u&&(_=p[0]||_,i=p[1]||i,s=p[2]||s,c=p[3]||c),(o||u)&&(l=[1,_||"direct",i||"-",s||"none",c||"-",e].join("|")),a||(n[_t]=n[_t]||u),l};W.pr.getPname=function(t){return(t=t||{}).pname||this.env[K]||this.env[D]||this.env[ct]||""},W.pr.getPparam=function(t){return(t=t||{}).pparam||this.env[q]||this.env[P]||this.env[ot]||""},W.pr.getUrl=function(){return this.env[D]||this.env[ct]||""},W.pr.getUrlParam=function(){return this.env[P]||this.env[ot]||""},W.pr.validateSpm=function(t,e){if(!e||!e.spm||"[object String]"!==Object.prototype.toString.call(e.spm))return console.error("spm 是埋点必填字段"),!1;var n=e.spm.split(".");if("pv"===t){if(2!==n.length)return console.error("spm 格式不对"),!1}else if(n.length<3||4<n.length)return console.error("spm 格式不对"),!1;return!0},W.pr.formatSpmParams=function(t,e){var n=e.spm.split("."),a=n[0],r=n[1],_=n[2],i=e.page_id||r,s=e.biz_type,c=e.event_id,o=c||[[a,r,_].join("."),s||"null",t].join("_"),x={};return w(x,e),w(x,{pageId:i,eid:o}),x},W.pr.setupPageview=function(t){var e,n,a,r=this.env,_=H(),i=parseInt(_/1e3),s=N(V.jdaKey),c=N(V.jddKey),o=N(V.jdvKey),x=N(V.jdvSceneKey),p=N(V.debugKey);r[it]=!0;try{var d=(A=getCurrentPages())[A.length-1];r[ct]=d.route||d.__route__||"";var u=$(d.options)?d.options:{};r[ot]=F(u)||"",r[xt]=u,this.setMParam((this.env[st]||{}).m_param||u.m_param)}catch(t){}r[_t]=!1,e=i,n=r,1<(a=(c||"").split(".")).length?n[_t]=n[_t]||1*a[1]+V.sessionTime<e:n[_t]=!0;var l,h,f,v,m,g,y,w,j,b,k,S,D,P,C=jt(o,_,r),K=jt(x,_,r,!0),q=(b=i,k=r,S=t,D=(c||"").split("."),(P=1)<D.length?(k[_t]=k[_t]||1*D[1]+V.sessionTime<b,P=(k[_t]?1:S?1*D[0]+1:1*D[0])||1):k[_t]=!0,(k[et]=P)+"."+b),I=(l=i,h=r,y=(s||"").split("."),j=w=1,5<y.length?(w=y[0]||w,f=y[1]||X(),v=y[2]||l,h[_t]?(m=y[4]||l,g=l,j=1*y[5]+1||1):(m=y[3]||l,g=y[4]||l,j=1*y[5]||1)):(f=X(),v=m=g=l,j=1),[h[vt]=w,h[G]=f,h[Q]=v,h[Z]=m,h[tt]=g,h[nt]=j].join("."));B(V.jddKey,q),B(V.jdaKey,I),C&&B(V.jdvKey,C),K&&B(V.jdvSceneKey,K),r[at]=C||o,r[rt]=K||x,W.setAppData(),function(t){if(t[mt]&&t[mt].pv_sid&&t[mt].pv_seq){var e=1*t[mt].pv_sid,n=1*t[mt].pv_seq;99999999<e||(e>t[nt]||e==t[nt]&&n>=t[et])&&(t[nt]=e,t[et]=n+1)}}(r);var z,R,T=function(t,e,n){var a=Y(n[st])?n[xt]:n[st],r="",_="";if(a&&a.customerinfo)r=a.customerinfo,_=e;else{var i=t instanceof Array?t:[];2==i.length&&e-i[1]<V.customerInfoTime&&(r=i[0],_=i[1])}return(n[ft]=r)?[r,_]:[]}(N(V.customerInfoKey),i,r);B(V.customerInfoKey,T),z=this.env,(R=N("jdwcx")||N("jdzdm"))&&(R.unionid&&(z[lt]=R.unionid),R.wxversion&&(z[ht]=R.wxversion));try{d=(A=getCurrentPages())[A.length-1];var A,E=$(d.options)?d.options:{},O=decodeURIComponent(E.scene),U=new RegExp("(^|&)"+V.debugKey+"=([^&]*)(&|$)"),J=O.match(U),L=E[V.debugKey];null!=J&&(L=J[2]),L?(B(V.debugKey,L),p=L):r[_t]&&(B(V.debugKey,""),p=""),r[gt]=p}catch(t){}if(r[_t])r[pt]="",r[dt]="",r[ut]="";else{var M=N(V.referKey);r[pt]=M[0],r[dt]=M[1],r[ut]=M[2]}B(V.referKey,[this.getUrl(),this.getUrlParam(),""])},W.pr.initMulcommonData=function(){var t=W.instance&&W.instance.env||[],e={account:I,siteId:b,appid:z,openid:R,unionid:lt};for(var n in e)this.env[e[n]]=this.env[e[n]]||t[e[n]]},W.pr.initPvData=function(t,e){this.pageLoadTime=H(),this.maxClickDeep=0,t=t||{};var n=this.baseEnv(e),a=n.data[0];return this.env[L]=a.ma_log_id,a.page_id=this.env[C]||"",a.pname=this.getPname(t),a.pparam=this.getPparam(t),a.sku=this.env[T]||"",a.shp=this.env[A]||"",a.tit=this.env[S]||"",a.ldt=this.env[E]||"",a.ma_et_refer=this.env[ut]||"",t.spm&&(a.spm=t.spm),w(a.ext,t.ext),n},W.pr.initClickData=function(t,e){var n,a=this.baseEnv(),r=a.data[0];if(r.eid=t.eid||"",r.eparam=t.eparam||"",r.elevel=t.elevel||"",r.page_id=t.pageId||this.env[C]||"",r.pname=this.getPname(t),r.pparam=this.getPparam(t),r.tar=t.target||"",r.x=0,r.y=0,t.spm&&(r.spm=t.spm,r.biz_type=t.biz_type,r.material_name=t.material_name),n=t.event,$(n)&&n.type&&n.target){var _=t.event,i=_.touches;if((!i||i.length<1)&&(i=_.changedTouches),i&&0<i.length){r.x=parseInt(i[0].pageX);var s=parseInt(i[0].pageY);(r.y=s)>this.maxClickDeep&&(this.maxClickDeep=s)}}if(w(r.ext,t.ext),"cl"===e){var c=N(V.referKey)||[];B(V.referKey,[c[0],c[1],r.eid])}return a},W.pr.initExposureData=W.pr.initClickData,W.pr.initShoppingData=function(t){var e=this.baseEnv(),n=e.data[0];return n.eid=t.eid||"",n.eparam=t.eparam||"",n.elevel=t.elevel||"",n.page_id=t.pageId||this.env[C]||"",n.pname=this.getPname(t),n.pparam=this.getPparam(t),n.sku_list=t.shoppingList?JSON.stringify(t.shoppingList):"",w(n.ext,t.ext),e},W.pr.initOrderData=function(t){var e=this.baseEnv(),n=e.data[0];return n.eid=t.eid||"",n.eparam=t.eparam||"",n.elevel=t.elevel||"",n.page_id=t.pageId||this.env[C]||"",n.pname=this.getPname(t),n.pparam=this.getPparam(t),n.sku_list=t.orderList?JSON.stringify(t.orderList):"",n.order_total_fee=t.total||0,n.sale_ord_id=t.orderid||"",w(n.ext,t.ext),e},W.pr.initPageUnloadData=function(t){var e=((H()-this.pageLoadTime)/1e3).toFixed(3),n=this.baseEnv(),a=n.data[0];return t=t||{},a.page_id=t.pageId||this.env[C]||"",a.pname=this.getPname(t),a.pparam=this.getPparam(t),a.alive_seconds=e,a.click_deep=this.maxClickDeep,w(a.ext,t.ext),n},W.pr.initStrategy=function(t){var e=N(V.reportStrategy);r({url:"https://policy.jd.com/m/log/v2?key=x&item="+t+"&v="+(e&&e.v),method:"GET",header:{"content-type":"application/json"},success:function(t){t&&t.data&&("1"===t.data.code&&f(e),"0"===t.data.code&&(B(V.reportStrategy,t.data),f(t.data)))}})},M=W.wxDat={},(yt=e&&e())&&yt.system&&(M.system=yt.system),t({success:function(t){t&&(M.dvc=t.model,M.pixelRatio=(t.pixelRatio||"")+"",M.scr=parseInt(t.windowWidth)+"x"+parseInt(t.windowHeight),M.lang=t.language,M.wxver=t.version,M.sdkver=t.SDKVersion||"")},complete:function(){W.dataReady("sysinfo")}}),a({success:function(t){t&&(M.net=t.networkType)},complete:function(){W.dataReady("netType")}}),W.pr.setData=function(t,e){t=$(t)?t:{};var n=$(t.urlParam)?t.urlParam:{},a={skuid:[T],shopid:[A],title:[S],loadtime:[E],url:[D],urlParam:[P,F],pname:[K],pparam:[q],pageId:[C],pvLogId:[L]},r={account:[I],siteId:[b],appid:[z],openid:[R],unionid:[lt],sendByBatch:[O],latitude:[U],longitude:[J]};for(var _ in r){var i=r[_];this.env[i[0]]=t[_]?i[1]?i[1](t[_]):t[_]:this.env[i[0]]||"",delete t[_]}if(!e){for(var _ in this.ext={},this.env[st]=n,this.setMParam(n.m_param),a){i=a[_];this.env[i[0]]=t[_]?i[1]?i[1](t[_]):t[_]:"",delete t[_]}for(var _ in t)"ext"!==_&&(this.ext[_]=t[_]);this.env[z]||(this.env[z]=N("appid")),this.env[O]&&this.env[b]&&!W.isStrategyReady&&(W.isStrategyReady=!0,this.initStrategy(this.env[b]))}},W.appDat={},W.setAppData=function(t){try{var e={},n=N(V.sysExtKey);for(var a in w(e,n),w(e,t),e)W.appDat[a]=e[a],"wxapp_scene"===a&&t&&t[a]&&(wt=t[a]);B(V.sysExtKey,e)}catch(t){}},W.clearAppData=function(){W.appDat={},function(t){try{n.removeStorageSync(t)}catch(t){}}(V.sysExtKey)},W.scene=null,W.setScene=function(t){W.scene=t},W.pr.setMParam=function(t){try{var e=JSON.parse(t);this.env[mt]=$(e)?e:{}}catch(t){this.env[mt]={}}},W.pr.baseEnv=function(t){this===W.instance?this.env[it]||this.setupPageview():this.initCommon||(this.initMulcommonData(),this.initCommon=!0);var e=this.env,n=W.wxDat,a={cli:i,std:e[b]||"WXAPP-JA2016-1",uuid:e[G]||"",scr:n.scr||"",dvc:n.dvc||"",lang:n.lang||"",appkey:e[ht]||"",appid:e[z]||"",openid:e[R]||"",unionid:e[lt]||"",gender:n.gender||"",city:n.city||"",province:n.province||"",country:n.country||"",wxver:n.wxver||"",data:[]};n.system&&(a.osp=n.system.split(" ")[0],a.osv=n.system.split(" ")[1]);var r=[["realUrl",ct],["realParam",ot],["ref",pt],["rpr",dt],["seq",et],["vts",nt],["pin",I],["fst",Q],["pst",Z],["vct",tt],["lat",U],["lon",J]],_=this.getData(r);return _.ma_log_id=e[G]+"-"+(new Date).getTime()+"-"+Math.floor(2147483647*Math.random()),"pv"!==t&&(_.ma_pv_log_id=e[L]),_.jsver=V.jsVer,_.net=n.net||"",_.speed=n.speed||"",_.accuracy=n.accuracy||"",_.pixelRatio=n.pixelRatio||"",_.jdv=e[at]||"",_.customerInfo=e[ft]||"",_.ctp=this.getUrl(),_.par=this.getUrlParam(),_.unpl=N("unpl")||"",_.scene=W.scene||"",_.sdkver=n.sdkver||"","JA2019_5112348"===e[b]&&(_.rdJdv=function(){var t="",e=N(V.rdJdvKey);if(e&&e._expire>Date.now()){var n=e._data&&e._data[V.jdvKey];n&&new Date(n.expires)>new Date&&(t=n?n.value:"")}return t}()),_.ext={sceneJdv:e[rt]||""},_.std_param=W.appDat,w(_.ext,this.ext),w(_.ext,W.appDat),a.data.push(_),a},W.pr.getSeriesData=function(){var t=this.env,e={uuid:t[G]||"",std:t[b]||"WXAPP-JA2016-1",seq:t[et],vts:t[nt]};return t[ht]&&(e.appkey=t[ht]),t[z]&&(e.appid=t[z]),t[gt]&&(e.debugId=t[gt]),e},W.initJda=function(){var t=N(V.jdaKey);if(!t){var e=H();t=[1,X(),e,e,e,0].join("."),B(V.jdaKey,t)}return t},module.exports={init:function(t){return W.getInstance().exports()},instance:function(t){return W.getMulInstance(t).exports()},usePlugin:function(t){if(t)try{pluginObj=requirePlugin(t)}catch(t){}},setAppData:function(t){W.setAppData(t)},clearAppData:function(){W.clearAppData()},setScene:function(t){W.setScene(t)}}}(Taro);
|
|
1
|
+
/* 2025-12-17 14:04:28 @issue to huangzhihua@jd.com Thanks */
|
|
2
|
+
var Taro=require("@tarojs/taro");!function(n){var h={};if("weapp"===process.env.TARO_ENV)h=["t_1000578828_xcx_1000_wxtd","t_1000578828_xcx_1001_fxrk","t_1000578828_xcx_1003_xblb","t_1000578826_xcx_1005_fxss","t_1000578826_xcx_1006_fxss","t_1000578832_xcx_1007_drxxkp","t_1000578832_xcx_1008_qlxxkp","t_1000578828_xcx_1010_scj","t_1000578833_xcx_1011_smewm","t_1000578833_xcx_1012_tpsm","t_1000578833_xcx_1013_xcsm","t_1000578827_xcx_1014_xcxmbxx","t_1000578829_xcx_1017_tyb","t_1000578830_xcx_1019_qb","t_1000072662_xcx_1020_gzhjs","t_1000578828_xcx_1022_zdrk","t_1000578828_xcx_1023_zmtb","t_1000578828_xcx_1024_xcxjs","t_1000578833_xcx_1025_smywm","t_1000578829_xcx_1026_fjxcx","t_1000578826_xcx_1027_dbss","t_1000578836_xcx_1028_kqkb","t_1000578836_xcx_1029_kqxq","t_1000578829_xcx_1030_zdhcs","t_1000578833_xcx_1031_tpsm","t_1000578833_xcx_1032_xcsm","t_1000578827_xcx_1034_zfwcxx","t_1000072662_xcx_1035_cdl","t_335139774_xcx_1036_appfxxx","t_1000578834_xcx_1037_xcxtz","t_1000578834_xcx_1038_xcxtz","t_1000578829_xcx_1039_yds","t_1000578826_xcx_1042_tjss","t_1000072662_xcx_1043_gzhxx","t_1000578832_xcx_1044_fxxxkp","t_1000578833_xcx_1047_smxcxm","t_1000578833_xcx_1048_tpsm","t_1000578833_xcx_1049_xcsm","t_1000578836_xcx_1052_kqmdlb","t_1000578826_xcx_1053_sys","t_1000578828_xcx_1054_dbss","t_1000578829_xcx_1055_h5hq","t_1000578829_xcx_1056_ylbf","t_1000578830_xcx_1057_yxkxqy","t_1000072663_xcx_1058_gzhwz","t_1000578829_xcx_1059_yqy","t_1000578829_xcx_1064_wifilj","t_1000578829_xcx_1069_ydyy","t_1000578830_xcx_1071_yxklby","t_1000578833_xcx_1072_ewmsk","t_1000578829_xcx_1073_kfxx","t_1000072663_xcx_1074_gzhxx","t_1000578829_xcx_1077_yzb","t_1000578829_xcx_1078_wifilj","t_1000578829_xcx_1079_yxzx","t_1000578829_xcx_1081_kfwzl","t_1000072663_xcx_1082_hhwzl","t_1000578828_xcx_1088_hhxx","t_1000578828_xcx_1089_ltkxl","t_1000578828_xcx_1090_xcxcd","t_1000072663_xcx_1091_wzspkp","t_1000578829_xcx_1092_csfwrk","t_1000578828_xcx_1096_ltjl","t_1000578829_xcx_1097_zfqy","t_1000578829_xcx_1099_cj","t_1000578828_xcx_1100_hbfmxqy","t_1000072663_xcx_1102_fwyl","t_1000578829_xcx_1103_fxwd","t_1000578829_xcx_1104_xlwd","t_1000578828_xcx_1106_xlss","t_1000578828_xcx_1107_dyxx","t_1000578828_xcx_1113_azfyp","t_1000578828_xcx_1114_azcbl","t_1000578828_xcx_1119_qywxgzt","t_1000578828_xcx_1120_qywxgrzl","t_1000072660_xcx_1121_fxrk","t_1000578832_xcx_1123_qwqt","t_1000578833_xcx_1124_smywym","t_1000578829_xcx_1129_pc","t_1000578828_xcx_1133_yjsb","t_1000578829_xcx_1135_zcxtz","t_1000072663_xcx_1152_dyhspdkxcx","t_1000578832_xcx_1154_pyqdy","t_1000578832_xcx_1155_pyqdytz","t_1000578832_xcx_1157_fqhhhk","t_1000578832_xcx_1158_qgjdkxcx","t_1000578828_xcx_1167_bqtz","t_1000578828_xcx_1168_qqllq","t_1000578832_xcx_1202_qwhh","t_1000578832_xcx_1207_qwwzl","t_1000578828_xcx_1223_azwidget","t_1000578828_xcx_1242_fxrk","t_1000578828_xcx_1245_fxrk","t_1000578833_xcx_1253_swjgy","t_1000578828_xcx_1256_pcmb","t_1000578828_xcx_1257_pcmb","t_1000578832_xcx_1265_tpxqy","t_1000578832_xcx_1266_tpcabprk","t_1000578828_xcx_1273_fxrk","t_1000578828_xcx_1278_fxrk","t_1000578828_xcx_1279_fxrk","t_1000578826_xcx_1280_xlwd","t_1000578826_xcx_1281_xlwd","t_1000578828_xcx_1282_fxrk","t_1000578828_xcx_1285_fxrk","t_1000578828_xcx_1286_mwscheme","t_1000072663_xcx_1287_djtp","t_1000578829_xcx_1296_ffdjqp","t_1000578826_xcx_1298_xlwd","t_1000578826_xcx_1299_xlwd","t_1000578826_xcx_1300_fxrk","t_1000578826_xcx_1301_fxrk","t_1000578828_xcx_1302_pcmb","t_1000578828_xcx_1303_fxrk","t_1000578828_xcx_1304_sjfyp","t_1000072663_xcx_1305_bojsy","t_1000072663_xcx_1306_djguxj","t_1000578828_xcx_1307_fxrk","t_1000578828_xcx_1308_pcmb","t_1000072663_xcx_1309_wzxyxcps","t_1000072676_xcx_100000_sq","t_1000072676_xcx_100001_sq","t_1000072676_xcx_100002_sq","t_1000072676_xcx_100003_sq"].reduce(function(t,e){return t[e.split("_")[3]]=["direct",e,"xcx","-"],t},{});var B=function(t){var e="";try{e=n.getStorageSync(t)}catch(t){}return e},N=function(t,e){try{n.setStorageSync(t,e)}catch(t){}},r=n.request,t=n.getSystemInfo,e=n.getDeviceInfo,_=n.onAppHide,a=(n.onAppShow,n.getNetworkType),i=n.onBeforeAppRoute,c="";"weapp"===process.env.TARO_ENV?c="wx-app":"swan"===process.env.TARO_ENV?c="baidu-app":"tt"===process.env.TARO_ENV?c="toutiao-app":"alipay"===process.env.TARO_ENV?c="alipay-app":"rn"===process.env.TARO_ENV?c="rn-app":"h5"===process.env.TARO_ENV&&(c="h5-app");var V={jsVer:"TR2.1.6",jdaKey:"__jda",jddKey:"__jdd",jdvKey:"__jdv",jdvSceneKey:"__scene_jdv",rdJdvKey:"cookies",debugKey:"__debugId__",sysExtKey:"__sysExtKey__",customerInfoKey:"union_customerinfo",jdvTimeMS:864e5,customerInfoTime:86400,sessionTime:1800,referKey:"__refer",md5Salt:"5YT%aC89$22OI@pQ",batchKey:"zwx-stream-storage",reportStrategy:"zwx-report-strategy",sendByBatch:!1,own:{__jda:1,__jdd:1,__jdv:1,__refer:1,appid:1,jdwcx:1,jdzdm:1,union_customerinfo:1},addr:function(t){var e="https://neptune.jd.com/log/m";try{var n=getApp({allowDefault:!0});n&&n.globalRequestUrl&&(e=n.globalRequestUrl.replace(/\/*$/,"/neptune/log/m"))}catch(t){}return t?"https://luna.jd.com/debuglog/xapp":e}},s=0;function W(t){t=t||"tr-"+s++,this.name=t,this.logCache=[],this.env=[],this.ext={},this.isReady=W.isWxDataReady,W.loggerList&&W.loggerList instanceof Array&&W.loggerList.push(this),W.isInitJda||(W.initJda(),W.isInitJda=!0)}W.loggerList=[],W.dependList={sysinfo:0,netType:0},W.isWxDataReady=!1,W.instance=!1,W.getInstance=function(){return W.instance||(W.instance=new W)},W.getMulInstance=function(t){return new W(t)},W.dataReady=function(t){if(!W.isWxDataReady){for(var e in W.dependList[t]=1,W.dependList)if(!W.dependList[e])return;W.isWxDataReady=!0;e=0;for(var n=W.loggerList.length;e<n;e++)W.loggerList[e].ready();delete W.loggerList}},(W.pr=W.prototype).ready=function(){this.isReady=!0;for(var t=this.logCache.length,e=0;e<t;e++)this.sendData.apply(this,this.logCache[e])},W.pr.sendData=function(t,e,n){var a;(a="pv"==e?this.initPvData(n,e):"cl"==e?this.initClickData(n,e):"cd"==e?this.initShoppingData(n):"od"==e?this.initOrderData(n):"sr"==e?this.initPageUnloadData(n):"ep"==e?this.initExposureData(n):n).tpc=t,a.report_ts=H()/1e3,a.token=W.md5(a.report_ts+V.md5Salt),a.data[0].typ=e,a.data[0].debugId=this.env[gt]||"",this.logByPost(a,a.data[0])},W.pr.send=function(t,e,n){this.isReady?this.sendData.apply(this,arguments):this.logCache.push(arguments)},W.pr.request=function(t,e){var n=!!this.env[gt],a="https://neptune.jd.com/log/m/v3?std="+t.std;r({url:e?a:V.addr(n)+"?std="+t.std,data:t,method:"POST",header:{"content-type":"application/json"},success:function(t){}})},W.pr.exports=function(){var _=this;return{set:function(t){_.setData(t)},setCommon:function(t){_.setData(t,!0)},pv:function(t){_.setData(t),_.setupPageview(!0),_.send("wx_app.000000","pv",t)},click:function(t){_.send("wx_app.000001","cl",t)},exposure:function(t){_.send("wx_app.000005","ep",t)},spmPV:function(t){if(_.validateSpm("pv",t)){var e=_.formatSpmParams("pv",t);e.eid=void 0,this.pv(e)}},spmClick:function(t){if(_.validateSpm("cl",t)){var e=_.formatSpmParams("cl",t);this.click(e)}},spmExposure:function(t){if(_.validateSpm("expo",t)){var e=_.formatSpmParams("expo",t);this.exposure(e)}},autoClick:function(t){var e,n=t.target.dataset,a=t.currentTarget.dataset;if(n&&n.eid?e=n:a&&a.eid&&(e=a),e){var r={eid:e.eid,elevel:e.elevel,eparam:e.eparam,pname:e.pname,pparam:e.pparam,target:e.target,event:t};_.send("wx_app.000001","cl",r)}},addToCart:function(t){_.send("wx_app.000002","cd",t)},order:function(t){_.send("wx_app.000003","od",t)},pageUnload:function(t){_.send("wx_app.000004","sr",t)},getSeries:function(){return _.env[S]||(_.setupPageview(),_.env[S]=!0),JSON.stringify(_.getSeriesData())},urlAddSeries:function(t){var e=(t||"").indexOf("#"),n="wxappSeries="+encodeURIComponent(this.getSeries());return-1<e?e===t.length-1?t+n:t+"&"+n:t+"#"+n},setMParam:function(t){return _.setMParam(t)},getJda:function(){return B(V.jdaKey)},getJdv:function(){return B(V.jdvKey)},getStorage:function(t){return B(t)},setStorage:function(t,e){return N(t,e)},setJdv:function(t){return t&&5===t.split("|").length&&N(V.jdvKey,t+"|"+H())}}};var o=2e3,x=1e3,p=1e3,d=100,u=10,l=null,f={num:"numberOut",time:"timeOut",pageHide:"pageHide"};function v(t){t&&$(t)&&(V.sendByBatch=t.h5_size&&1!=t.h5_size||t.h5_time&&1!=t.h5_time,u=t.h5_size?+t.h5_size:u,p=t.h5_time?1e3*t.h5_time:p)}function m(t,e){var n;for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(t[n],n)}function g(t,n){m(t,function(t,e){n[e]=t})}function y(n){var a,t,r,e={};for(g(n[0],e),a=0;a<n.length;++a)for(r=[],m(e,function(t,e){t!==n[a][e]&&r.push(e)}),t=0;t<r.length;++t)delete e[r[t]];return m(e,function(t,e){for(a=0;a<n.length;++a)delete n[a][e]}),e.data=n,e}function w(){var t=B(V.batchKey);if(t){var e,n=t.data;for(delete t.data,e=0;e<n.length;++e)g(t,n[e]);return n}return[]}W.pr.batchSend=function(t,e){try{if(t.length){N(V.batchKey,null);var n=y(t);n.batch_report_type=e,n.report_ts=H()/1e3,n.token=W.md5(n.report_ts+V.md5Salt),this.request(n,!0)}}catch(t){}},W.pr.logByPost=function(t,e){var n=this;if(!!!this.env[gt]&&V.sendByBatch)try{if(!l){!function t(e,n){var a=o+(x*Math.random()<<0),r=p+(d*Math.random()<<0);l=setTimeout(function(){try{n.batchSend(w(),f.time),t(!1,n)}catch(t){}},e?a:r)}(!0,n),_(function(){!function(t){try{clearTimeout(l),l=null,n.batchSend(w(),t)}catch(t){}}(f.pageHide)})}var a={};delete t.report_ts,delete t.token,delete t.data,g(t,a),g(e,a);var r=w().concat(a);r.length>=u?this.batchSend(r,f.num):N(V.batchKey,y(r))}catch(t){}else this.request(t)},function(t){var _=0;function e(t){return a(n(r(t)))}function n(t){return c(s(i(t),8*t.length))}function a(t){for(var e,n=_?"0123456789ABCDEF":"0123456789abcdef",a="",r=0;r<t.length;r++)e=t.charCodeAt(r),a+=n.charAt(e>>>4&15)+n.charAt(15&e);return a}function r(t){for(var e,n,a="",r=-1;++r<t.length;)e=t.charCodeAt(r),n=r+1<t.length?t.charCodeAt(r+1):0,55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e=65536+((1023&e)<<10)+(1023&n),r++),e<=127?a+=String.fromCharCode(e):e<=2047?a+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?a+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(a+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return a}function i(t){var e,n=Array(t.length>>2);for(e=0;e<n.length;e++)n[e]=0;for(e=0;e<8*t.length;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function c(t){for(var e="",n=0;n<32*t.length;n+=8)e+=String.fromCharCode(t[n>>5]>>>n%32&255);return e}function s(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,a=-271733879,r=-1732584194,_=271733878,i=0;i<t.length;i+=16){var c=n,s=a,o=r,x=_;a=l(a=l(a=l(a=l(a=u(a=u(a=u(a=u(a=d(a=d(a=d(a=d(a=p(a=p(a=p(a=p(a,r=p(r,_=p(_,n=p(n,a,r,_,t[i+0],7,-680876936),a,r,t[i+1],12,-389564586),n,a,t[i+2],17,606105819),_,n,t[i+3],22,-1044525330),r=p(r,_=p(_,n=p(n,a,r,_,t[i+4],7,-176418897),a,r,t[i+5],12,1200080426),n,a,t[i+6],17,-1473231341),_,n,t[i+7],22,-45705983),r=p(r,_=p(_,n=p(n,a,r,_,t[i+8],7,1770035416),a,r,t[i+9],12,-1958414417),n,a,t[i+10],17,-42063),_,n,t[i+11],22,-1990404162),r=p(r,_=p(_,n=p(n,a,r,_,t[i+12],7,1804603682),a,r,t[i+13],12,-40341101),n,a,t[i+14],17,-1502002290),_,n,t[i+15],22,1236535329),r=d(r,_=d(_,n=d(n,a,r,_,t[i+1],5,-165796510),a,r,t[i+6],9,-1069501632),n,a,t[i+11],14,643717713),_,n,t[i+0],20,-373897302),r=d(r,_=d(_,n=d(n,a,r,_,t[i+5],5,-701558691),a,r,t[i+10],9,38016083),n,a,t[i+15],14,-660478335),_,n,t[i+4],20,-405537848),r=d(r,_=d(_,n=d(n,a,r,_,t[i+9],5,568446438),a,r,t[i+14],9,-1019803690),n,a,t[i+3],14,-187363961),_,n,t[i+8],20,1163531501),r=d(r,_=d(_,n=d(n,a,r,_,t[i+13],5,-1444681467),a,r,t[i+2],9,-51403784),n,a,t[i+7],14,1735328473),_,n,t[i+12],20,-1926607734),r=u(r,_=u(_,n=u(n,a,r,_,t[i+5],4,-378558),a,r,t[i+8],11,-2022574463),n,a,t[i+11],16,1839030562),_,n,t[i+14],23,-35309556),r=u(r,_=u(_,n=u(n,a,r,_,t[i+1],4,-1530992060),a,r,t[i+4],11,1272893353),n,a,t[i+7],16,-155497632),_,n,t[i+10],23,-1094730640),r=u(r,_=u(_,n=u(n,a,r,_,t[i+13],4,681279174),a,r,t[i+0],11,-358537222),n,a,t[i+3],16,-722521979),_,n,t[i+6],23,76029189),r=u(r,_=u(_,n=u(n,a,r,_,t[i+9],4,-640364487),a,r,t[i+12],11,-421815835),n,a,t[i+15],16,530742520),_,n,t[i+2],23,-995338651),r=l(r,_=l(_,n=l(n,a,r,_,t[i+0],6,-198630844),a,r,t[i+7],10,1126891415),n,a,t[i+14],15,-1416354905),_,n,t[i+5],21,-57434055),r=l(r,_=l(_,n=l(n,a,r,_,t[i+12],6,1700485571),a,r,t[i+3],10,-1894986606),n,a,t[i+10],15,-1051523),_,n,t[i+1],21,-2054922799),r=l(r,_=l(_,n=l(n,a,r,_,t[i+8],6,1873313359),a,r,t[i+15],10,-30611744),n,a,t[i+6],15,-1560198380),_,n,t[i+13],21,1309151649),r=l(r,_=l(_,n=l(n,a,r,_,t[i+4],6,-145523070),a,r,t[i+11],10,-1120210379),n,a,t[i+2],15,718787259),_,n,t[i+9],21,-343485551),n=h(n,c),a=h(a,s),r=h(r,o),_=h(_,x)}return Array(n,a,r,_)}function o(t,e,n,a,r,_){return h((i=h(h(e,t),h(a,_)))<<(c=r)|i>>>32-c,n);var i,c}function p(t,e,n,a,r,_,i){return o(e&n|~e&a,t,e,r,_,i)}function d(t,e,n,a,r,_,i){return o(e&a|n&~a,t,e,r,_,i)}function u(t,e,n,a,r,_,i){return o(e^n^a,t,e,r,_,i)}function l(t,e,n,a,r,_,i){return o(n^(e|~a),t,e,r,_,i)}function h(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}W.md5=e}();var H=function(){return(new Date).getTime()},X=function(){return H()+""+parseInt(2147483647*Math.random())},$=function(t){return"[object Object]"=={}.toString.call(t)},j=function(t,e){if($(t)&&$(e))for(var n in e)t[n]=e[n]},F=function(t){var e=[];if($(t))for(var n in t)"m_param"!==n&&e.push(n+"="+t[n]);return e.join("&")},Y=function(t){if($(t))for(var e in t)return!1;return!0},k=0,b=k++,G=k++,Q=k++,Z=k++,tt=k++,et=k++,nt=k++,at=k++,rt=k++,_t=k++,S=k++,it=k++,D=k++,P=k++,C=k++,ct=k++,st=k++,ot=k++,xt=k++,K=k++,q=k++,I=k++,pt=k++,dt=k++,ut=k++,z=k++,R=k++,A=k++,lt=k++,ht=k++,ft=k++,T=k++,E=k++,O=k++,vt=k++,mt=k++,gt=k++,U=k++,J=k++,L=k++,M=k++;W.pr.getData=function(t){for(var e={},n=0,a=t.length;n<a;n++){var r=t[n];e[r[0]]=this.env[r[1]]||""}return e};var yt,wt,jt=null,kt=function(t,e,n,a){var r=(t||"").split("|"),_="",i="",c="",s="",o=!0;6<=r.length&&e-r[5]<=V.jdvTimeMS&&(_=r[1],i=r[2],c=r[3],s=r[4],o=!1);var x=Y(n[ct])?n[xt]:n[ct],p=[];if(a&&jt&&h[jt]){var d=h[jt];p[0]=d[0],p[1]=encodeURIComponent(d[1]),p[2]=encodeURIComponent(d[2])||"none",p[3]=encodeURIComponent(d[3])||"-",jt=null}x&&x.utm_source&&(p[0]=encodeURIComponent(x.utm_source),p[1]=encodeURIComponent(x.utm_campaign||"")||i,p[2]=encodeURIComponent(x.utm_medium||"")||c,p[3]=encodeURIComponent(x.utm_term||"")||s,s=p[3],o=!0);var u=a;a||(0<p.length&&"direct"!=p[0]?u=(p[0]!==_||p[1]!==i||p[2]!==c)&&"referral"!==p[2]:0<p.length&&"direct"==p[0]&&("direct"===_||!_)&&(u=p[1]!==i||p[2]!==c||p[3]!==s));var l="";return u&&(_=p[0]||_,i=p[1]||i,c=p[2]||c,s=p[3]||s),(o||u)&&(l=[1,_||"direct",i||"-",c||"none",s||"-",e].join("|")),a||(n[_t]=n[_t]||u),l};W.pr.getPname=function(t){return(t=t||{}).pname||this.env[q]||this.env[P]||this.env[st]||""},W.pr.getPparam=function(t){return(t=t||{}).pparam||this.env[I]||this.env[C]||this.env[ot]||""},W.pr.getUrl=function(){return this.env[P]||this.env[st]||""},W.pr.getUrlParam=function(){return this.env[C]||this.env[ot]||""},W.pr.validateSpm=function(t,e){if(!e||!e.spm||"[object String]"!==Object.prototype.toString.call(e.spm))return console.error("spm 是埋点必填字段"),!1;var n=e.spm.split(".");if("pv"===t){if(2!==n.length)return console.error("spm 格式不对"),!1}else if(n.length<3||4<n.length)return console.error("spm 格式不对"),!1;return!0},W.pr.formatSpmParams=function(t,e){var n=e.spm.split("."),a=n[0],r=n[1],_=n[2],i=e.page_id||e.pageId||this.env[K]||[a,r].join("."),c=e.biz_type,s=e.event_id,o=s||[[a,r,_].join("."),c||"null",t].join("###"),x={};return j(x,e),j(x,{pageId:i,page_id:void 0,eid:o}),x},W.pr.setupPageview=function(t){var e,n,a,r=this.env,_=H(),i=parseInt(_/1e3),c=B(V.jdaKey),s=B(V.jddKey),o=B(V.jdvKey),x=B(V.jdvSceneKey),p=B(V.debugKey);r[it]=!0;try{var d=(T=getCurrentPages())[T.length-1];r[st]=d.route||d.__route__||"";var u=$(d.options)?d.options:{};r[ot]=F(u)||"",r[xt]=u,this.setMParam((this.env[ct]||{}).m_param||u.m_param)}catch(t){}r[_t]=!1,e=i,n=r,1<(a=(s||"").split(".")).length?n[_t]=n[_t]||1*a[1]+V.sessionTime<e:n[_t]=!0;var l,h,f,v,m,g,y,w,j,k,b,S,D,P,C=kt(o,_,r),K=kt(x,_,r,!0),q=(k=i,b=r,S=t,D=(s||"").split("."),(P=1)<D.length?(b[_t]=b[_t]||1*D[1]+V.sessionTime<k,P=(b[_t]?1:S?1*D[0]+1:1*D[0])||1):b[_t]=!0,(b[et]=P)+"."+k),I=(l=i,h=r,y=(c||"").split("."),j=w=1,5<y.length?(w=y[0]||w,f=y[1]||X(),v=y[2]||l,h[_t]?(m=y[4]||l,g=l,j=1*y[5]+1||1):(m=y[3]||l,g=y[4]||l,j=1*y[5]||1)):(f=X(),v=m=g=l,j=1),[h[vt]=w,h[G]=f,h[Q]=v,h[Z]=m,h[tt]=g,h[nt]=j].join("."));N(V.jddKey,q),N(V.jdaKey,I),C&&N(V.jdvKey,C),K&&N(V.jdvSceneKey,K),r[at]=C||o,r[rt]=K||x,W.setAppData(),function(t){if(t[mt]&&t[mt].pv_sid&&t[mt].pv_seq){var e=1*t[mt].pv_sid,n=1*t[mt].pv_seq;99999999<e||(e>t[nt]||e==t[nt]&&n>=t[et])&&(t[nt]=e,t[et]=n+1)}}(r);var z,R,A=function(t,e,n){var a=Y(n[ct])?n[xt]:n[ct],r="",_="";if(a&&a.customerinfo)r=a.customerinfo,_=e;else{var i=t instanceof Array?t:[];2==i.length&&e-i[1]<V.customerInfoTime&&(r=i[0],_=i[1])}return(n[ft]=r)?[r,_]:[]}(B(V.customerInfoKey),i,r);N(V.customerInfoKey,A),z=this.env,(R=B("jdwcx")||B("jdzdm"))&&(R.unionid&&(z[lt]=R.unionid),R.wxversion&&(z[ht]=R.wxversion));try{d=(T=getCurrentPages())[T.length-1];var T,E=$(d.options)?d.options:{},O=decodeURIComponent(E.scene),U=new RegExp("(^|&)"+V.debugKey+"=([^&]*)(&|$)"),J=O.match(U),L=E[V.debugKey];null!=J&&(L=J[2]),L?(N(V.debugKey,L),p=L):r[_t]&&(N(V.debugKey,""),p=""),r[gt]=p}catch(t){}if(r[_t])r[pt]="",r[dt]="",r[ut]="";else{var M=B(V.referKey);r[pt]=M[0],r[dt]=M[1],r[ut]=M[2]}N(V.referKey,[this.getUrl(),this.getUrlParam(),""])},W.pr.initMulcommonData=function(){var t=W.instance&&W.instance.env||[],e={account:z,siteId:b,appid:R,openid:A,unionid:lt};for(var n in e)this.env[e[n]]=this.env[e[n]]||t[e[n]]},W.pr.initPvData=function(t,e){this.pageLoadTime=H(),this.maxClickDeep=0,t=t||{};var n=this.baseEnv(e),a=n.data[0];return this.env[M]=a.ma_log_id,a.page_id=this.env[K]||"",a.pname=this.getPname(t),a.pparam=this.getPparam(t),a.sku=this.env[T]||"",a.shp=this.env[E]||"",a.tit=this.env[D]||"",a.ldt=this.env[O]||"",a.ma_et_refer=this.env[ut]||"",t.spm&&(a.spm=t.spm),j(a.ext,t.ext),n},W.pr.initClickData=function(t,e){var n,a=this.baseEnv(),r=a.data[0];if(r.eid=t.eid||"",r.eparam=t.eparam||"",r.elevel=t.elevel||"",r.page_id=t.pageId||this.env[K]||"",r.pname=this.getPname(t),r.pparam=this.getPparam(t),r.tar=t.target||"",r.x=0,r.y=0,t.spm&&(r.spm=t.spm,r.biz_type=t.biz_type,r.material_name=t.material_name),n=t.event,$(n)&&n.type&&n.target){var _=t.event,i=_.touches;if((!i||i.length<1)&&(i=_.changedTouches),i&&0<i.length){r.x=parseInt(i[0].pageX);var c=parseInt(i[0].pageY);(r.y=c)>this.maxClickDeep&&(this.maxClickDeep=c)}}if(j(r.ext,t.ext),"cl"===e){var s=B(V.referKey)||[];N(V.referKey,[s[0],s[1],r.eid])}return"cl"===e&&(r.stream_eid=B("_we_tk")||B("tk")||""),a},W.pr.initExposureData=W.pr.initClickData,W.pr.initShoppingData=function(t){var e=this.baseEnv(),n=e.data[0];return n.eid=t.eid||"",n.eparam=t.eparam||"",n.elevel=t.elevel||"",n.page_id=t.pageId||this.env[K]||"",n.pname=this.getPname(t),n.pparam=this.getPparam(t),n.sku_list=t.shoppingList?JSON.stringify(t.shoppingList):"",j(n.ext,t.ext),e},W.pr.initOrderData=function(t){var e=this.baseEnv(),n=e.data[0];return n.eid=t.eid||"",n.eparam=t.eparam||"",n.elevel=t.elevel||"",n.page_id=t.pageId||this.env[K]||"",n.pname=this.getPname(t),n.pparam=this.getPparam(t),n.sku_list=t.orderList?JSON.stringify(t.orderList):"",n.order_total_fee=t.total||0,n.sale_ord_id=t.orderid||"",j(n.ext,t.ext),e},W.pr.initPageUnloadData=function(t){var e=((H()-this.pageLoadTime)/1e3).toFixed(3),n=this.baseEnv(),a=n.data[0];return t=t||{},a.page_id=t.pageId||this.env[K]||"",a.pname=this.getPname(t),a.pparam=this.getPparam(t),a.alive_seconds=e,a.click_deep=this.maxClickDeep,j(a.ext,t.ext),n},W.pr.initStrategy=function(t){var e=B(V.reportStrategy);r({url:"https://policy.jd.com/m/log/v2?key=x&item="+t+"&v="+(e&&e.v),method:"GET",header:{"content-type":"application/json"},success:function(t){t&&t.data&&("1"===t.data.code&&v(e),"0"===t.data.code&&(N(V.reportStrategy,t.data),v(t.data)))}})},yt=W.wxDat={},(wt=e&&e())&&wt.system&&(yt.system=wt.system),t({success:function(t){t&&(yt.dvc=t.model,yt.pixelRatio=(t.pixelRatio||"")+"",yt.scr=parseInt(t.windowWidth)+"x"+parseInt(t.windowHeight),yt.lang=t.language,yt.wxver=t.version,yt.sdkver=t.SDKVersion||"")},complete:function(){W.dataReady("sysinfo")}}),a({success:function(t){t&&(yt.net=t.networkType)},complete:function(){W.dataReady("netType")}}),i?i(function(t){yt.roll_back="navigateBack"===t.openType?1:0}):yt.roll_back=-100,W.pr.setData=function(t,e){t=$(t)?t:{};var n=$(t.urlParam)?t.urlParam:{},a={skuid:[T],shopid:[E],title:[D],loadtime:[O],url:[P],urlParam:[C,F],pname:[q],pparam:[I],pageId:[K],pvLogId:[M]},r={account:[z],siteId:[b],appid:[R],openid:[A],unionid:[lt],sendByBatch:[U],latitude:[J],longitude:[L]};for(var _ in r){var i=r[_];this.env[i[0]]=t[_]?i[1]?i[1](t[_]):t[_]:this.env[i[0]]||"",delete t[_]}if(!e){for(var _ in this.ext={},this.env[ct]=n,this.setMParam(n.m_param),a){i=a[_];this.env[i[0]]=t[_]?i[1]?i[1](t[_]):t[_]:"",delete t[_]}for(var _ in t)"ext"!==_&&(this.ext[_]=t[_]);this.env[R]||(this.env[R]=B("appid")),this.env[U]&&this.env[b]&&!W.isStrategyReady&&(W.isStrategyReady=!0,this.initStrategy(this.env[b]))}},W.appDat={},W.setAppData=function(t){try{var e={},n=B(V.sysExtKey);for(var a in j(e,n),j(e,t),e)W.appDat[a]=e[a],"wxapp_scene"===a&&t&&t[a]&&(jt=t[a]);N(V.sysExtKey,e)}catch(t){}},W.clearAppData=function(){W.appDat={},function(t){try{n.removeStorageSync(t)}catch(t){}}(V.sysExtKey)},W.scene=null,W.setScene=function(t){W.scene=t},W.pr.setMParam=function(t){try{var e=JSON.parse(t);this.env[mt]=$(e)?e:{}}catch(t){this.env[mt]={}}},W.pr.baseEnv=function(t){this===W.instance?this.env[it]||this.setupPageview():this.initCommon||(this.initMulcommonData(),this.initCommon=!0);var e=this.env,n=W.wxDat,a={cli:c,std:e[b]||"WXAPP-JA2016-1",uuid:e[G]||"",scr:n.scr||"",dvc:n.dvc||"",lang:n.lang||"",appkey:e[ht]||"",appid:e[R]||"",openid:e[A]||"",unionid:e[lt]||"",gender:n.gender||"",city:n.city||"",province:n.province||"",country:n.country||"",wxver:n.wxver||"",data:[]};n.system&&(a.osp=n.system.split(" ")[0],a.osv=n.system.split(" ")[1]);var r=[["realUrl",st],["realParam",ot],["ref",pt],["rpr",dt],["seq",et],["vts",nt],["pin",z],["fst",Q],["pst",Z],["vct",tt],["lat",J],["lon",L]],_=this.getData(r);return _.ma_log_id=e[G]+"-"+(new Date).getTime()+"-"+Math.floor(2147483647*Math.random()),"pv"!==t&&(_.ma_pv_log_id=e[M]),"pv"===t&&(_.roll_back=n.roll_back||0,-100!==_.roll_back&&(n.roll_back=0)),_.jsver=V.jsVer,_.net=n.net||"",_.speed=n.speed||"",_.accuracy=n.accuracy||"",_.pixelRatio=n.pixelRatio||"",_.jdv=e[at]||"",_.customerInfo=e[ft]||"",_.ctp=this.getUrl(),_.par=this.getUrlParam(),_.unpl=B("unpl")||"",_.scene=W.scene||"",_.sdkver=n.sdkver||"",_.device_ts=(new Date).getTime(),_.ma_app_id=e[R]||"","JA2019_5112348"===e[b]&&(_.rdJdv=function(){var t="",e=B(V.rdJdvKey);if(e&&e._expire>Date.now()){var n=e._data&&e._data[V.jdvKey];n&&new Date(n.expires)>new Date&&(t=n?n.value:"")}return t}()),_.ext={sceneJdv:e[rt]||""},_.std_param=W.appDat,j(_.ext,this.ext),j(_.ext,W.appDat),a.data.push(_),a},W.pr.getSeriesData=function(){var t=this.env,e={uuid:t[G]||"",std:t[b]||"WXAPP-JA2016-1",seq:t[et],vts:t[nt]};return t[ht]&&(e.appkey=t[ht]),t[R]&&(e.appid=t[R]),t[gt]&&(e.debugId=t[gt]),e},W.initJda=function(){var t=B(V.jdaKey);if(!t){var e=H();t=[1,X(),e,e,e,0].join("."),N(V.jdaKey,t)}return t},module.exports={init:function(t){return W.getInstance().exports()},instance:function(t){return W.getMulInstance(t).exports()},usePlugin:function(t){if(t)try{pluginObj=requirePlugin(t)}catch(t){}},setAppData:function(t){W.setAppData(t)},clearAppData:function(){W.clearAppData()},setScene:function(t){W.setScene(t)}}}(Taro);
|