@conecli/cone-render 0.10.1-shop-beta.22 → 0.10.1-shop-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.ts +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +0 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/index.h5.ts +1 -1
- package/dist/common/index.jd.ts +1 -1
- package/dist/common/index.ts +1 -1
- package/dist/common/index.weapp.ts +1 -1
- package/dist/common/jdplayerSdk.weapp.tsx +1 -0
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/JdLoading/index.module.scss +0 -2
- package/dist/components/base/JdLoading/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +18 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
- package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
- package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
- package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -1
- package/dist/config/env.ts +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/interface/service.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.pc.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +179 -83
- package/dist/language/zh_CN.json +178 -82
- package/dist/language/zh_HK.json +178 -82
- package/dist/libs/openShopBridge.js +161 -0
- package/dist/libs/openShopBridge.min.js +1 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +6 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -1
- package/dist/service/fetchJsonp.ts +1 -1
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/intersectionObserver.ts +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/package.json +13 -15
- package/dist/common/index.dynamic.ts +0 -1
- package/dist/components/base/Dialog/index.dynamic.module.scss +0 -126
- package/dist/components/base/Dialog/index.dynamic.tsx +0 -1
- package/dist/components/base/DynamicTest/index.dynamic.module.scss +0 -15
- package/dist/components/base/DynamicTest/index.module.scss +0 -16
- package/dist/components/base/DynamicTest/index.tsx +0 -1
- package/dist/components/base/LazyLoadImage/index.dynamic.module.scss +0 -40
- package/dist/components/base/LazyLoadImage/index.dynamic.tsx +0 -1
- package/dist/components/base/NetworkDataError/index.dynamic.module.scss +0 -95
- package/dist/components/base/NetworkDataError/index.dynamic.tsx +0 -1
- package/dist/components/base/Price/Base/index.dynamic.module.scss +0 -63
- package/dist/components/base/Price/Base/index.dynamic.tsx +0 -1
- package/dist/components/base/Price/Double/index.dynamic.module.scss +0 -172
- package/dist/components/base/Price/Double/index.dynamic.tsx +0 -1
- package/dist/jumpEventReport/index.dynamic.ts +0 -1
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/open/api/shopMember.dynamic.ts +0 -1
- package/dist/open/components/index.dynamic.ts +0 -1
- package/dist/sass/app.dynamic.scss +0 -306
- package/dist/service/fetchGateway.h5.ts +0 -1
- package/dist/service/fetchJsonp.h5.ts +0 -1
- package/dist/service/http/colorSign.dynamic.ts +0 -1
- package/dist/utils/connectNativeJsBridge.dynamic.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
- /package/dist/utils/{sColor.js → sColor.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro';
|
|
2
|
parseQueryUrlString,
|
|
3
1
|
routerInfo: {
|
|
4
2
|
params: {},
|
|
5
3
|
},
|
|
6
4
|
nativeEvent: null,
|
|
7
5
|
jumpConfig: {
|
|
8
6
|
venderId: null,
|
|
9
7
|
shopId: null,
|
|
10
8
|
sourceValue: '',
|
|
11
9
|
sourceType: 'App-H5',
|
|
12
10
|
activityType: 'shopx',
|
|
13
11
|
moduleId: 'none',
|
|
14
12
|
entrance: 'none',
|
|
15
13
|
},
|
|
16
14
|
logPageParamStr: '',
|
|
17
15
|
public logPageId: string;
|
|
18
16
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
|
|
19
17
|
constructor(opt = {}) {
|
|
20
18
|
super(opt);
|
|
21
19
|
this.getConfig(opt);
|
|
22
20
|
}
|
|
23
21
|
getConfig(opt = {}) {
|
|
24
22
|
return Object.assign(this, {}, defaultConfig, opt);
|
|
25
23
|
}
|
|
26
24
|
updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
|
|
27
25
|
this.logPageId = pageId;
|
|
28
26
|
this.routerInfo = routerInfo;
|
|
29
27
|
this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params);
|
|
30
28
|
this.logPname = logPname;
|
|
31
29
|
}
|
|
32
30
|
reportInfoPv(
|
|
33
31
|
pageId = LogPageIdInfo.APP,
|
|
34
32
|
opt: {
|
|
35
33
|
pageParam?: any;
|
|
36
34
|
} = {},
|
|
37
35
|
) {
|
|
38
36
|
const { pageParam } = opt;
|
|
39
37
|
this.logPageParamStr = pageParam
|
|
40
38
|
? pageParam
|
|
41
39
|
: this.creatParamToLogStr(this.jumpConfig)
|
|
42
40
|
.replace(/moduleId/, 'JumpmoduleID')
|
|
43
41
|
.replace(/entrance/, 'Jumpentrance');
|
|
44
42
|
this.reportPV({
|
|
45
43
|
pageId,
|
|
46
44
|
pageParam: this.logPageParamStr,
|
|
47
45
|
...opt,
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
jdJumpToDongDongChatGroup(groupId, source = '4') {
|
|
52
50
|
this.jdNavigateToNative({
|
|
53
51
|
category: 'jump',
|
|
54
52
|
des: 'dongdong_group_chat',
|
|
55
53
|
source: source,
|
|
56
54
|
groupId: `${groupId}`,
|
|
57
55
|
});
|
|
58
56
|
}
|
|
59
57
|
|
|
60
58
|
jdJumpToWeb(
|
|
61
59
|
url,
|
|
62
60
|
logEventInfo,
|
|
63
61
|
successBack?: functionType | undefined,
|
|
64
62
|
failBack?: functionType | undefined,
|
|
65
63
|
) {
|
|
66
64
|
console.log('jd web', this.isOpenJdAppUrl(url), url);
|
|
67
65
|
if (this.isOpenJdAppUrl(url)) {
|
|
68
66
|
const getOpenAppParams = this.jdOpenAppParams(url);
|
|
69
67
|
console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
|
|
70
68
|
if (getOpenAppParams) {
|
|
71
69
|
this.jdNavigateToNative(
|
|
72
70
|
Object.assign({}, getOpenAppParams, {
|
|
73
71
|
logEventInfo,
|
|
74
72
|
}),
|
|
75
73
|
);
|
|
76
74
|
}
|
|
77
75
|
} else {
|
|
78
76
|
let _getLastUrl = url;
|
|
79
77
|
if (/shop\.m\.jd\.com|pages\.jd\.com/.test(_getLastUrl)) {
|
|
80
78
|
const getUrlSearchParamState = _getLastUrl.indexOf('?') !== -1;
|
|
81
79
|
if (!/jwebprog=0/.test(_getLastUrl)) {
|
|
82
80
|
_getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}jwebprog=0`;
|
|
83
81
|
}
|
|
84
82
|
if (global.info.sysInfo?.isJdTabletDevice && !/device=tablet/.test(_getLastUrl)) {
|
|
85
83
|
_getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}device=tablet`;
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
super.jdJumpToWeb(
|
|
89
87
|
_getLastUrl,
|
|
90
88
|
{
|
|
91
89
|
...logEventInfo,
|
|
92
90
|
},
|
|
93
91
|
successBack,
|
|
94
92
|
failBack,
|
|
95
93
|
);
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
jdJumpToWebInner(url, logEventInfo) {
|
|
100
98
|
this.jdJumpToWeb(url, logEventInfo);
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
jdJumpConfigUrl(detail, logEventInfo = {}) {
|
|
104
102
|
const { configDataType, configDataValue } = detail;
|
|
105
103
|
switch (configDataType) {
|
|
106
104
|
case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
|
|
107
105
|
this.jdJumpToShopCategory({
|
|
108
106
|
...configDataValue,
|
|
109
107
|
logEventInfo,
|
|
110
108
|
});
|
|
111
109
|
break;
|
|
112
110
|
case LinkConfigType.CONFIG_TYPE_SKU_LIST:
|
|
113
111
|
if (logEventInfo?.jsonParam?.logBaseInfo?.mInfo) {
|
|
114
112
|
logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds;
|
|
115
113
|
}
|
|
116
114
|
this.jdJumpToProduct(configDataValue.skuIds, logEventInfo);
|
|
117
115
|
break;
|
|
118
116
|
case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
|
|
119
117
|
this.jdJumpToWeb(
|
|
120
118
|
`${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
|
|
121
119
|
{},
|
|
122
120
|
);
|
|
123
121
|
break;
|
|
124
122
|
case LinkConfigType.CONFIG_TYPE_CATEGORY:
|
|
125
123
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
126
124
|
const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
127
125
|
console.log('jd web 获取店铺分类链接解析后的参数结果', getShopSearchParams);
|
|
128
126
|
getShopSearchParams &&
|
|
129
127
|
this.jdJumpToShopSearch(
|
|
130
128
|
Object.assign({}, getShopSearchParams, {
|
|
131
129
|
logEventInfo,
|
|
132
130
|
}),
|
|
133
131
|
);
|
|
134
132
|
} else {
|
|
135
133
|
this.jdJumpToShopSearch(
|
|
136
134
|
configDataValue['cid']
|
|
137
135
|
? Object.assign(
|
|
138
136
|
{},
|
|
139
137
|
{
|
|
140
138
|
shopId: global.info.queryInfo.shopId,
|
|
141
139
|
categoryId: configDataValue.cid,
|
|
142
140
|
searchType: '5',
|
|
143
141
|
logEventInfo,
|
|
144
142
|
},
|
|
145
143
|
)
|
|
146
144
|
: {
|
|
147
145
|
shopId: global.info.queryInfo.shopId,
|
|
148
146
|
logEventInfo,
|
|
149
147
|
},
|
|
150
148
|
);
|
|
151
149
|
}
|
|
152
150
|
break;
|
|
153
151
|
case LinkConfigType.CONFIG_TYPE_MEMBER:
|
|
154
152
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
155
153
|
const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
156
154
|
getShopMemberParams &&
|
|
157
155
|
this.jdJumpToShopMember(
|
|
158
156
|
Object.assign({}, getShopMemberParams, {
|
|
159
157
|
logEventInfo,
|
|
160
158
|
}),
|
|
161
159
|
);
|
|
162
160
|
} else {
|
|
163
161
|
this.jdJumpToShopMember({
|
|
164
162
|
shopId: global.info.queryInfo.shopId,
|
|
165
163
|
venderId: configDataValue.shopDetail,
|
|
166
164
|
logEventInfo,
|
|
167
165
|
});
|
|
168
166
|
}
|
|
169
167
|
break;
|
|
170
168
|
case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
|
|
171
169
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
172
170
|
const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
173
171
|
getShopActivityParams &&
|
|
174
172
|
this.jdJumpToShopActivity(
|
|
175
173
|
Object.assign({}, getShopActivityParams, {
|
|
176
174
|
logEventInfo,
|
|
177
175
|
}),
|
|
178
176
|
);
|
|
179
177
|
} else if (configDataValue['projectId']) {
|
|
180
178
|
this.jdJumpToShopActivity({
|
|
181
179
|
projectId: configDataValue['projectId'],
|
|
182
180
|
configDataValue,
|
|
183
181
|
logEventInfo,
|
|
184
182
|
});
|
|
185
183
|
}
|
|
186
184
|
break;
|
|
187
185
|
case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
|
|
188
186
|
case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
|
|
189
187
|
const _url = configDataValue.linkUrl;
|
|
190
188
|
if (
|
|
191
189
|
_url.indexOf('to=') === -1 &&
|
|
192
190
|
_url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
|
|
193
191
|
) {
|
|
194
192
|
const _shopId = _url.match(/\d+/g)[0];
|
|
195
193
|
this.jdJumpToShopHome({
|
|
196
194
|
shopId: `${_shopId}`,
|
|
197
195
|
logEventInfo,
|
|
198
196
|
});
|
|
199
197
|
} else if (this.isOpenJdAppUrl(_url)) {
|
|
200
198
|
const getOpenAppParams = this.jdOpenAppParams(_url);
|
|
201
199
|
console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams);
|
|
202
200
|
if (getOpenAppParams) {
|
|
203
201
|
let _changeOpenAppParams = getOpenAppParams;
|
|
204
202
|
const { operation, ...otherOpenAppParams } = getOpenAppParams;
|
|
205
203
|
if (operation && operation === 'jumpTabInner') {
|
|
206
204
|
_changeOpenAppParams = otherOpenAppParams;
|
|
207
205
|
}
|
|
208
206
|
this.jdNavigateToNative(
|
|
209
207
|
Object.assign({}, _changeOpenAppParams, {
|
|
210
208
|
logEventInfo,
|
|
211
209
|
}),
|
|
212
210
|
);
|
|
213
211
|
}
|
|
214
212
|
} else {
|
|
215
213
|
this.jdJumpToWeb(_url, logEventInfo);
|
|
216
214
|
}
|
|
217
215
|
break;
|
|
218
216
|
}
|
|
219
217
|
case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
|
|
220
218
|
this.jdJumpToShopDetail({
|
|
221
219
|
venderId: global.info.queryInfo.venderId,
|
|
222
220
|
shopId: global.info.queryInfo.shopId,
|
|
223
221
|
logEventInfo,
|
|
224
222
|
});
|
|
225
223
|
break;
|
|
226
224
|
case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
|
|
227
225
|
this.jdJumpToShopHome({
|
|
228
226
|
...configDataValue,
|
|
229
227
|
logEventInfo,
|
|
230
228
|
});
|
|
231
229
|
break;
|
|
232
230
|
case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
|
|
233
231
|
break;
|
|
234
232
|
case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
|
|
235
233
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
236
234
|
const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
237
235
|
getShoppingGuideParams &&
|
|
238
236
|
this.jdJumpToShopActivity(
|
|
239
237
|
Object.assign({}, getShoppingGuideParams, {
|
|
240
238
|
logEventInfo,
|
|
241
239
|
}),
|
|
242
240
|
);
|
|
243
241
|
}
|
|
244
242
|
break;
|
|
245
243
|
case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
|
|
246
244
|
const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
|
|
247
245
|
const search = linkUrl.match(/\?.+/);
|
|
248
246
|
if (search) {
|
|
249
247
|
const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
|
|
250
248
|
parseQueryUrlString(linkUrl);
|
|
251
249
|
try {
|
|
252
250
|
miniQueryData.param = JSON.parse(miniQueryData?.param);
|
|
253
251
|
} catch (e) {
|
|
254
252
|
console.warn('解析小程序 param 错误:', miniQueryData);
|
|
255
253
|
}
|
|
256
254
|
this.jdJumpToMiniProgram(miniQueryData);
|
|
257
255
|
} else {
|
|
258
256
|
console.warn('小程序地址错误:', linkUrl);
|
|
259
257
|
}
|
|
260
258
|
break;
|
|
261
259
|
}
|
|
262
260
|
case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
|
|
263
261
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
264
262
|
const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
265
263
|
console.log('jd web 获取店铺结果落地页链接解析后的参数结果', getShopSearchParams);
|
|
266
264
|
getShopSearchParams &&
|
|
267
265
|
this.jdJumpToShopSearch(
|
|
268
266
|
Object.assign({}, getShopSearchParams, {
|
|
269
267
|
logEventInfo,
|
|
270
268
|
}),
|
|
271
269
|
);
|
|
272
270
|
} else {
|
|
273
271
|
this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo);
|
|
274
272
|
}
|
|
275
273
|
break;
|
|
276
274
|
}
|
|
277
275
|
default:
|
|
278
276
|
}
|
|
279
277
|
}
|
|
280
278
|
|
|
281
279
|
jdNavigateToNative(
|
|
282
280
|
params: object,
|
|
283
281
|
url = 'openapp.jdmobile://virtual',
|
|
284
282
|
successBack?: functionType | null,
|
|
285
283
|
failBack?: functionType | null,
|
|
286
284
|
) {
|
|
287
285
|
const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
|
|
288
286
|
{},
|
|
289
287
|
{
|
|
290
288
|
sourceValue: 'sourceValue_jshopModuleWeb',
|
|
291
289
|
sourceType: 'sourceType_jshopModuleWeb',
|
|
292
290
|
param: {},
|
|
293
291
|
},
|
|
294
292
|
params,
|
|
295
293
|
);
|
|
296
294
|
const { logEventInfo, ...otherParams } = getResParams;
|
|
297
295
|
console.log('[taro dynamic] jdNavigateToNative jd:', params,"融合后的参数getResParams",getResParams,'logEventInfo params: ', logEventInfo);
|
|
298
296
|
global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
|
|
299
297
|
this.clickEventLog(logEventInfo || getResParams).then((res) => {
|
|
300
298
|
console.log('收到埋点回调,跳转taro dynamic jd 回调结果',res);
|
|
301
299
|
if (typeof successBack === 'function') {
|
|
302
300
|
successBack(getResParams);
|
|
303
301
|
} else {
|
|
304
302
|
try {
|
|
305
303
|
const paramsStr = JSON.stringify(otherParams);
|
|
306
304
|
console.log('跳转taro dynamic jd open协议', `${url}?params=${paramsStr}`);
|
|
307
305
|
Taro.JDNavigate.navigateTo({
|
|
308
306
|
url: `${url}?params=${paramsStr}`,
|
|
309
307
|
}).then(res => {
|
|
310
308
|
console.log('跳转taro dynamic jd open协议 成功',res);
|
|
311
309
|
})
|
|
312
310
|
} catch (e) {
|
|
313
311
|
console.log('跳转异常', e);
|
|
314
312
|
}
|
|
315
313
|
}
|
|
316
314
|
})
|
|
317
315
|
.catch(() => {
|
|
318
316
|
typeof failBack === 'function' && failBack(getResParams);
|
|
319
317
|
});
|
|
320
318
|
}
|
|
321
319
|
|
|
322
320
|
clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, reportKey = 'click') {
|
|
323
321
|
const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts;
|
|
324
322
|
if (eventId && jsonParam) {
|
|
325
323
|
const { etModelInfo, logBaseInfo } = jsonParam;
|
|
326
324
|
let getJsonParam = {};
|
|
327
325
|
if (etModelInfo && logBaseInfo) {
|
|
328
326
|
getJsonParam = logBaseInfo;
|
|
329
327
|
} else {
|
|
330
328
|
if (Array.isArray(jsonParam)) {
|
|
331
329
|
getJsonParam = jsonParam;
|
|
332
330
|
} else {
|
|
333
331
|
getJsonParam = Object.assign(
|
|
334
332
|
{},
|
|
335
333
|
{
|
|
336
334
|
shopid: global.info.queryInfo?.shopId,
|
|
337
335
|
},
|
|
338
336
|
jsonParam,
|
|
339
337
|
);
|
|
340
338
|
}
|
|
341
339
|
}
|
|
342
340
|
if (
|
|
343
341
|
reportKey === 'exposure' &&
|
|
344
342
|
/^TerminatorNew/.test(eventId) &&
|
|
345
343
|
!Array.isArray(getJsonParam)
|
|
346
344
|
) {
|
|
347
345
|
getJsonParam = [getJsonParam];
|
|
348
346
|
}
|
|
349
347
|
console.log("eventId",eventId, "jsonParam", jsonParam, "getJsonParam",getJsonParam)
|
|
350
348
|
const webLogParams = {
|
|
351
349
|
isExpo: reportKey === 'exposure',
|
|
352
350
|
eid: eventId,
|
|
353
351
|
elevel: eventLevel,
|
|
354
352
|
jsonParam: JSON.stringify(getJsonParam),
|
|
355
353
|
etModel: JSON.stringify(etModelInfo || {}),
|
|
356
354
|
pageId: this.logPageId,
|
|
357
355
|
pageParam: this.logPageParamStr,
|
|
358
356
|
...otherParams,
|
|
359
357
|
};
|
|
360
358
|
console.log(
|
|
361
359
|
`jdapp内,taro动态化---埋点参数对象-${reportKey}`,
|
|
362
360
|
webLogParams,
|
|
363
361
|
)
|
|
364
362
|
return new Promise((resolve) => {
|
|
365
363
|
const {
|
|
366
364
|
eid,
|
|
367
365
|
jsonParam,
|
|
368
366
|
pageParam,
|
|
369
367
|
pageId = 'TerminatorNew_All',
|
|
370
368
|
} = webLogParams;
|
|
371
369
|
const getReportData = {
|
|
372
370
|
event_id: eid,
|
|
373
371
|
page_id: pageId,
|
|
374
372
|
page_name: "",
|
|
375
373
|
page_param: pageParam,
|
|
376
374
|
json_param: jsonParam,
|
|
377
375
|
event_param:"",
|
|
378
376
|
next_page_name:"",
|
|
379
377
|
params:{},
|
|
380
378
|
}
|
|
381
379
|
console.log('Taro.JDMTA上报前的最终参数getReportData',getReportData)
|
|
382
380
|
Taro.JDMTA.click(getReportData).then(res => {
|
|
383
381
|
console.log(`event_id为${eid}的埋点上报成功`,res)
|
|
384
382
|
resolve(true);
|
|
385
383
|
}).catch((err) => {
|
|
386
384
|
resolve(false);
|
|
387
385
|
console.log(`event_id为${eid}的埋点上报异常`,err)
|
|
388
386
|
})
|
|
389
387
|
});
|
|
390
388
|
} else {
|
|
391
389
|
console.log('暂无埋点参数eventId和eventParam');
|
|
392
390
|
return Promise.resolve(false);
|
|
393
391
|
}
|
|
394
392
|
}
|
|
395
393
|
reportPV(opts){
|
|
396
394
|
const { pageId, pageParam, isSend = true } = opts;
|
|
397
395
|
isSend && Taro.JDMTA.pv({
|
|
398
396
|
page_id: pageId,
|
|
399
397
|
page_name: "",
|
|
400
398
|
page_param: pageParam
|
|
401
399
|
})
|
|
402
400
|
}
|
|
403
401
|
|
|
404
402
|
exposureEventLog(opts) {
|
|
405
403
|
return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
|
|
406
404
|
? this.clickEventLog(
|
|
407
405
|
{
|
|
408
406
|
...opts,
|
|
409
407
|
exposureState: true,
|
|
410
408
|
},
|
|
411
409
|
'exposure',
|
|
412
410
|
)
|
|
413
411
|
: Promise.resolve(false);
|
|
414
412
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { SECTION_HOME_TAB_TYPE, SHOP_MENU_ID_TYPE } from '../../common/const'
|