@conecli/cone-render 0.9.1-shop2.3 → 0.9.1-shop2.31
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/assets/icon_blue_info.svg +1 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/environmentType.ts +1 -0
- 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.ts +1 -0
- package/dist/common/jssdk.ts +1 -0
- package/dist/common/pageType.ts +1 -0
- package/dist/common/sgmCustomCode.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/token/token.ts +1 -1
- package/dist/common/wxappApi.jd.ts +1 -0
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.module.scss +7 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/common.ts +1 -0
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +5 -0
- package/dist/components/base/Dialog/index.tsx +1 -1
- package/dist/components/base/Exposure/index.h5.tsx +1 -1
- 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.tsx +1 -1
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.module.scss +23 -20
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +7 -0
- 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.tsx +1 -1
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/debug/DebugLayout/index.module.scss +67 -0
- package/dist/components/debug/DebugLayout/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/utils.ts +1 -0
- package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
- package/dist/components/floorItem.jd.tsx +1 -1
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/floorItem.weapp.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +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/interface/utils.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.h5.ts +1 -1
- package/dist/jumpEventReport/index.jd.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.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.jdb.ts +1 -1
- package/dist/jumpEventReport/web.jdjch.ts +1 -1
- package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
- package/dist/jumpEventReport/web.tjapp.ts +1 -0
- package/dist/jumpEventReport/web.tjm.ts +1 -0
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/modules/ContainerFloorList/index.h5.module.scss +18 -1
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/open/api/device.ts +1 -1
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/jump copy.ts +1 -1
- package/dist/open/api/request.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- 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/sass/app.h5.scss +49 -3
- package/dist/sass/base.scss +57 -0
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/http/colorSign.ts +1 -1
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -0
- package/dist/service/http/index.h5.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -0
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
- package/dist/utils/draExceptionAndProfile.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- 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/jm-common.js +1 -1
- package/dist/utils/sgmCodeUtils.ts +1 -0
- package/dist/utils/taroRenderUtil.ts +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +26 -3
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
- package/dist/utils/memberFormatUtils.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import { JdJumpJdApp } from './jdJumpJdApp'
|
|
2
1
|
reportClick,
|
|
3
2
|
reportPV,
|
|
4
3
|
reportToCart,
|
|
5
4
|
routerInfo: {
|
|
6
5
|
params: {},
|
|
7
6
|
},
|
|
8
7
|
nativeEvent: null,
|
|
9
8
|
jumpConfig: {
|
|
10
9
|
venderId: null,
|
|
11
10
|
shopId: null,
|
|
12
11
|
sourceValue: '',
|
|
13
12
|
sourceType: 'App-H5',
|
|
14
13
|
activityType: 'shopx',
|
|
15
14
|
moduleId: 'none',
|
|
16
15
|
entrance: 'none',
|
|
17
16
|
},
|
|
18
17
|
logPageParamStr: '',
|
|
19
18
|
public logPageId: string
|
|
20
19
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
|
|
21
20
|
constructor(opt = {}) {
|
|
22
21
|
super(opt)
|
|
23
22
|
this.getConfig(opt)
|
|
24
23
|
}
|
|
25
24
|
getConfig(opt = {}) {
|
|
26
25
|
return Object.assign(this, {}, defaultConfig, opt)
|
|
27
26
|
}
|
|
28
27
|
updateInfo(
|
|
29
28
|
routerInfo,
|
|
30
29
|
logPname = LogPnameInfo.HOME,
|
|
31
30
|
pageId = LogPageIdInfo.APP,
|
|
32
31
|
) {
|
|
33
32
|
this.logPageId = pageId
|
|
34
33
|
this.routerInfo = routerInfo
|
|
35
34
|
this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params)
|
|
36
35
|
this.logPname = logPname
|
|
37
36
|
}
|
|
38
37
|
reportInfoPv(
|
|
39
38
|
pageId = LogPageIdInfo.APP,
|
|
40
39
|
opt: {
|
|
41
40
|
pageParam?: any
|
|
42
41
|
} = {},
|
|
43
42
|
) {
|
|
44
43
|
const { pageParam } = opt
|
|
45
44
|
this.logPageParamStr = pageParam
|
|
46
45
|
? pageParam
|
|
47
46
|
: this.creatParamToLogStr(this.jumpConfig)
|
|
48
47
|
.replace(/moduleId/, 'JumpmoduleID')
|
|
49
48
|
.replace(/entrance/, 'Jumpentrance')
|
|
50
49
|
reportPV({
|
|
51
50
|
pageId,
|
|
52
51
|
pageParam: this.logPageParamStr,
|
|
53
52
|
...opt,
|
|
54
53
|
})
|
|
55
54
|
}
|
|
56
55
|
|
|
57
56
|
jdJumpToDongDongChatGroup(groupId, source = '4') {
|
|
58
57
|
this.jdNavigateToNative({
|
|
59
58
|
category: 'jump',
|
|
60
59
|
des: 'dongdong_group_chat',
|
|
61
60
|
source: source,
|
|
62
61
|
groupId: `${groupId}`,
|
|
63
62
|
})
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
jdJumpToWeb(
|
|
67
66
|
url,
|
|
68
67
|
logEventInfo,
|
|
69
68
|
successBack?: Function | undefined,
|
|
70
69
|
failBack?: Function | undefined,
|
|
71
70
|
) {
|
|
72
71
|
if (this.isOpenJdAppUrl(url)) {
|
|
73
72
|
const getOpenAppParams = this.jdOpenAppParams(url)
|
|
74
73
|
console.log(
|
|
75
74
|
'jd web 获取自定义openApp链接解析后的参数结果',
|
|
76
75
|
getOpenAppParams,
|
|
77
76
|
)
|
|
78
77
|
if (getOpenAppParams) {
|
|
79
78
|
this.jdNavigateToNative(
|
|
80
79
|
Object.assign({}, getOpenAppParams, {
|
|
81
80
|
logEventInfo,
|
|
82
81
|
}),
|
|
83
82
|
)
|
|
84
83
|
}
|
|
85
84
|
} else {
|
|
86
85
|
super.jdJumpToWeb(
|
|
87
86
|
url,
|
|
88
87
|
{
|
|
89
88
|
...logEventInfo,
|
|
90
89
|
},
|
|
91
90
|
successBack,
|
|
92
91
|
failBack,
|
|
93
92
|
)
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
jdJumpToWebInner(url, logEventInfo) {
|
|
98
97
|
this.jdJumpToWeb(url, logEventInfo)
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
jdJumpConfigUrl(detail, logEventInfo = {}) {
|
|
102
101
|
const { configDataType, configDataValue } = detail
|
|
103
102
|
switch (configDataType) {
|
|
104
103
|
case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
|
|
105
104
|
this.jdJumpToShopCategory({
|
|
106
105
|
...configDataValue,
|
|
107
106
|
logEventInfo,
|
|
108
107
|
})
|
|
109
108
|
break
|
|
110
109
|
case LinkConfigType.CONFIG_TYPE_SKU_LIST:
|
|
111
110
|
if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
|
|
112
111
|
logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
|
|
113
112
|
}
|
|
114
113
|
this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
|
|
115
114
|
break
|
|
116
115
|
case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
|
|
117
116
|
this.jdJumpToWeb(
|
|
118
117
|
`${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
|
|
119
118
|
{},
|
|
120
119
|
)
|
|
121
120
|
break
|
|
122
121
|
case LinkConfigType.CONFIG_TYPE_CATEGORY:
|
|
123
122
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
124
123
|
const getShopSearchParams = this.jdOpenAppParams(
|
|
125
124
|
configDataValue.clickUrl,
|
|
126
125
|
)
|
|
127
126
|
console.log(
|
|
128
127
|
'jd web 获取店铺分类链接解析后的参数结果',
|
|
129
128
|
getShopSearchParams,
|
|
130
129
|
)
|
|
131
130
|
getShopSearchParams &&
|
|
132
131
|
this.jdJumpToShopSearch(
|
|
133
132
|
Object.assign({}, getShopSearchParams, {
|
|
134
133
|
logEventInfo,
|
|
135
134
|
}),
|
|
136
135
|
)
|
|
137
136
|
} else {
|
|
138
137
|
this.jdJumpToShopSearch(
|
|
139
138
|
configDataValue['cid']
|
|
140
139
|
? Object.assign(
|
|
141
140
|
{},
|
|
142
141
|
{
|
|
143
142
|
shopId: global.info.queryInfo.shopId,
|
|
144
143
|
categoryId: configDataValue.cid,
|
|
145
144
|
searchType: '5',
|
|
146
145
|
logEventInfo,
|
|
147
146
|
},
|
|
148
147
|
)
|
|
149
148
|
: {
|
|
150
149
|
shopId: global.info.queryInfo.shopId,
|
|
151
150
|
logEventInfo,
|
|
152
151
|
},
|
|
153
152
|
)
|
|
154
153
|
}
|
|
155
154
|
break
|
|
156
155
|
case LinkConfigType.CONFIG_TYPE_MEMBER:
|
|
157
156
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
158
157
|
const getShopMemberParams = this.jdOpenAppParams(
|
|
159
158
|
configDataValue.clickUrl,
|
|
160
159
|
)
|
|
161
160
|
getShopMemberParams &&
|
|
162
161
|
this.jdJumpToShopMember(
|
|
163
162
|
Object.assign({}, getShopMemberParams, {
|
|
164
163
|
logEventInfo,
|
|
165
164
|
}),
|
|
166
165
|
)
|
|
167
166
|
} else {
|
|
168
167
|
this.jdJumpToShopMember({
|
|
169
168
|
shopId: global.info.queryInfo.shopId,
|
|
170
169
|
venderId: configDataValue.shopDetail,
|
|
171
170
|
logEventInfo,
|
|
172
171
|
})
|
|
173
172
|
}
|
|
174
173
|
break
|
|
175
174
|
case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
|
|
176
175
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
177
176
|
const getShopActivityParams = this.jdOpenAppParams(
|
|
178
177
|
configDataValue.clickUrl,
|
|
179
178
|
)
|
|
180
179
|
getShopActivityParams &&
|
|
181
180
|
this.jdJumpToShopActivity(
|
|
182
181
|
Object.assign({}, getShopActivityParams, {
|
|
183
182
|
logEventInfo,
|
|
184
183
|
}),
|
|
185
184
|
)
|
|
186
185
|
} else if (configDataValue['projectId']) {
|
|
187
186
|
this.jdJumpToShopActivity({
|
|
188
187
|
projectId: configDataValue['projectId'],
|
|
189
188
|
configDataValue,
|
|
190
189
|
logEventInfo,
|
|
191
190
|
})
|
|
192
191
|
}
|
|
193
192
|
break
|
|
194
193
|
case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
|
|
195
194
|
case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
|
|
196
195
|
const _url = configDataValue.linkUrl
|
|
197
196
|
if (
|
|
198
197
|
_url.indexOf('to=') === -1 &&
|
|
199
198
|
_url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
|
|
200
199
|
) {
|
|
201
200
|
const _shopId = _url.match(/\d+/g)[0]
|
|
202
201
|
this.jdJumpToShopHome({
|
|
203
202
|
shopId: `${_shopId}`,
|
|
204
203
|
logEventInfo,
|
|
205
204
|
})
|
|
206
205
|
} else if (this.isOpenJdAppUrl(_url)) {
|
|
207
206
|
const getOpenAppParams = this.jdOpenAppParams(_url)
|
|
208
207
|
console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
|
|
209
208
|
if (getOpenAppParams) {
|
|
210
209
|
this.jdNavigateToNative(
|
|
211
210
|
Object.assign({}, getOpenAppParams, {
|
|
212
211
|
logEventInfo,
|
|
213
212
|
}),
|
|
214
213
|
)
|
|
215
214
|
}
|
|
216
215
|
} else {
|
|
217
216
|
this.jdJumpToWeb(_url, logEventInfo)
|
|
218
217
|
}
|
|
219
218
|
break
|
|
220
219
|
}
|
|
221
220
|
case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
|
|
222
221
|
this.jdJumpToShopDetail({
|
|
223
222
|
venderId: global.info.queryInfo.venderId,
|
|
224
223
|
shopId: global.info.queryInfo.shopId,
|
|
225
224
|
logEventInfo,
|
|
226
225
|
})
|
|
227
226
|
break
|
|
228
227
|
case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
|
|
229
228
|
this.jdJumpToShopHome({
|
|
230
229
|
...configDataValue,
|
|
231
230
|
logEventInfo,
|
|
232
231
|
})
|
|
233
232
|
break
|
|
234
233
|
case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
|
|
235
234
|
break
|
|
236
235
|
case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
|
|
237
236
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
238
237
|
const getShoppingGuideParams = this.jdOpenAppParams(
|
|
239
238
|
configDataValue.clickUrl,
|
|
240
239
|
)
|
|
241
240
|
getShoppingGuideParams &&
|
|
242
241
|
this.jdJumpToShopActivity(
|
|
243
242
|
Object.assign({}, getShoppingGuideParams, {
|
|
244
243
|
logEventInfo,
|
|
245
244
|
}),
|
|
246
245
|
)
|
|
247
246
|
}
|
|
248
247
|
break
|
|
249
248
|
case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
|
|
250
249
|
const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
|
|
251
250
|
const search = linkUrl.match(/\?.+/)
|
|
252
251
|
if (search) {
|
|
253
252
|
const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
|
|
254
253
|
parseQueryUrlString(linkUrl)
|
|
255
254
|
try {
|
|
256
255
|
miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
|
|
257
256
|
} catch (e) {
|
|
258
257
|
console.warn('解析小程序 param 错误:', miniQueryData.param)
|
|
259
258
|
}
|
|
260
259
|
this.jdJumpToMiniProgram(miniQueryData)
|
|
261
260
|
} else {
|
|
262
261
|
console.warn('小程序地址错误:', linkUrl)
|
|
263
262
|
}
|
|
264
263
|
break
|
|
265
264
|
}
|
|
266
265
|
default:
|
|
267
266
|
}
|
|
268
267
|
}
|
|
269
268
|
|
|
270
269
|
jdNavigateToNative(
|
|
271
270
|
params: {},
|
|
272
271
|
url = 'openapp.jdmobile://virtual',
|
|
273
272
|
successBack?: Function | null,
|
|
274
273
|
failBack?: Function | null,
|
|
275
274
|
) {
|
|
276
275
|
console.log('[降级H5] jdNavigateToNative web.jd:', params)
|
|
277
276
|
const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
|
|
278
277
|
Object.assign(
|
|
279
278
|
{},
|
|
280
279
|
{
|
|
281
280
|
sourceValue: 'sourceValue_jshopModuleWeb',
|
|
282
281
|
sourceType: 'sourceType_jshopModuleWeb',
|
|
283
282
|
param: {},
|
|
284
283
|
},
|
|
285
284
|
params,
|
|
286
285
|
)
|
|
287
286
|
const { logEventInfo, ...otherParams } = getResParams
|
|
288
287
|
console.log(
|
|
289
288
|
'jd web 获取open协议参数 jdNavigateToNative params: ',
|
|
290
289
|
getResParams,
|
|
291
290
|
)
|
|
292
291
|
console.log('logEventInfo params: ', logEventInfo)
|
|
293
292
|
global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
|
|
294
293
|
this.clickEventLog(logEventInfo || getResParams)
|
|
295
294
|
.then(() => {
|
|
296
295
|
if (typeof successBack == 'function') {
|
|
297
296
|
successBack(getResParams)
|
|
298
297
|
} else {
|
|
299
298
|
try {
|
|
300
299
|
const paramsStr = JSON.stringify(otherParams)
|
|
301
300
|
console.log('跳转web jd open协议', `${url}?params=${paramsStr}`)
|
|
302
301
|
window.location.href = `${url}?params=${paramsStr}`
|
|
303
302
|
} catch (e) {
|
|
304
303
|
console.log('跳转异常', e)
|
|
305
304
|
}
|
|
306
305
|
}
|
|
307
306
|
})
|
|
308
307
|
.catch(() => {
|
|
309
308
|
typeof failBack == 'function' && failBack(getResParams)
|
|
310
309
|
})
|
|
311
310
|
}
|
|
312
311
|
|
|
313
312
|
clickEventLog(
|
|
314
313
|
opts: JumpEventReportInterFace.OptEventLogParams = {},
|
|
315
314
|
reportKey = 'click',
|
|
316
315
|
) {
|
|
317
316
|
const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
|
|
318
317
|
if (eventId && jsonParam) {
|
|
319
318
|
const { etModelInfo, logBaseInfo } = jsonParam
|
|
320
319
|
const webLogParams = {
|
|
321
320
|
eid: eventId,
|
|
322
321
|
elevel: eventLevel,
|
|
323
322
|
jsonParam: JSON.stringify(logBaseInfo || jsonParam),
|
|
324
323
|
etModel: JSON.stringify(etModelInfo || {}),
|
|
325
324
|
pageId: this.logPageId,
|
|
326
325
|
pageParam: this.logPageParamStr,
|
|
327
326
|
...otherParams,
|
|
328
327
|
}
|
|
329
328
|
return /click|exposure/.test(reportKey)
|
|
330
329
|
? reportClick(webLogParams)
|
|
331
330
|
: reportToCart(opts,webLogParams)
|
|
332
331
|
} else {
|
|
333
332
|
console.log('暂无埋点参数eventId和eventParam')
|
|
334
333
|
return Promise.resolve(false)
|
|
335
334
|
}
|
|
336
335
|
}
|
|
337
336
|
|
|
338
337
|
exposureEventLog(opts) {
|
|
339
338
|
return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
|
|
340
339
|
? this.clickEventLog(
|
|
341
340
|
{
|
|
342
341
|
...opts,
|
|
343
342
|
exposureState: true,
|
|
344
343
|
},
|
|
345
344
|
'exposure',
|
|
346
345
|
)
|
|
347
346
|
: Promise.resolve(false)
|
|
348
347
|
}
|
|
348
|
+
import { JdJumpJdApp } from './jdJumpJdApp'
|
|
349
349
|
reportClick,
|
|
350
350
|
reportPV,
|
|
351
351
|
reportToCart,
|
|
352
352
|
routerInfo: {
|
|
353
353
|
params: {},
|
|
354
354
|
},
|
|
355
355
|
nativeEvent: null,
|
|
356
356
|
jumpConfig: {
|
|
357
357
|
venderId: null,
|
|
358
358
|
shopId: null,
|
|
359
359
|
sourceValue: '',
|
|
360
360
|
sourceType: 'App-H5',
|
|
361
361
|
activityType: 'shopx',
|
|
362
362
|
moduleId: 'none',
|
|
363
363
|
entrance: 'none',
|
|
364
364
|
},
|
|
365
365
|
logPageParamStr: '',
|
|
366
366
|
public logPageId: string
|
|
367
367
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
|
|
368
368
|
constructor(opt = {}) {
|
|
369
369
|
super(opt)
|
|
370
370
|
this.getConfig(opt)
|
|
371
371
|
}
|
|
372
372
|
getConfig(opt = {}) {
|
|
373
373
|
return Object.assign(this, {}, defaultConfig, opt)
|
|
374
374
|
}
|
|
375
375
|
updateInfo(
|
|
376
376
|
routerInfo,
|
|
377
377
|
logPname = LogPnameInfo.HOME,
|
|
378
378
|
pageId = LogPageIdInfo.APP,
|
|
379
379
|
) {
|
|
380
380
|
this.logPageId = pageId
|
|
381
381
|
this.routerInfo = routerInfo
|
|
382
382
|
this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params)
|
|
383
383
|
this.logPname = logPname
|
|
384
384
|
}
|
|
385
385
|
reportInfoPv(
|
|
386
386
|
pageId = LogPageIdInfo.APP,
|
|
387
387
|
opt: {
|
|
388
388
|
pageParam?: any
|
|
389
389
|
} = {},
|
|
390
390
|
) {
|
|
391
391
|
const { pageParam } = opt
|
|
392
392
|
this.logPageParamStr = pageParam
|
|
393
393
|
? pageParam
|
|
394
394
|
: this.creatParamToLogStr(this.jumpConfig)
|
|
395
395
|
.replace(/moduleId/, 'JumpmoduleID')
|
|
396
396
|
.replace(/entrance/, 'Jumpentrance')
|
|
397
397
|
reportPV({
|
|
398
398
|
pageId,
|
|
399
399
|
pageParam: this.logPageParamStr,
|
|
400
400
|
...opt,
|
|
401
401
|
})
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
jdJumpToDongDongChatGroup(groupId, source = '4') {
|
|
405
405
|
this.jdNavigateToNative({
|
|
406
406
|
category: 'jump',
|
|
407
407
|
des: 'dongdong_group_chat',
|
|
408
408
|
source: source,
|
|
409
409
|
groupId: `${groupId}`,
|
|
410
410
|
})
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
jdJumpToWeb(
|
|
414
414
|
url,
|
|
415
415
|
logEventInfo,
|
|
416
416
|
successBack?: Function | undefined,
|
|
417
417
|
failBack?: Function | undefined,
|
|
418
418
|
) {
|
|
419
419
|
console.log('jd web',this.isOpenJdAppUrl(url),url)
|
|
420
420
|
if (this.isOpenJdAppUrl(url)) {
|
|
421
421
|
const getOpenAppParams = this.jdOpenAppParams(url)
|
|
422
422
|
console.log(
|
|
423
423
|
'jd web 获取自定义openApp链接解析后的参数结果',
|
|
424
424
|
getOpenAppParams,
|
|
425
425
|
)
|
|
426
426
|
if (getOpenAppParams) {
|
|
427
427
|
this.jdNavigateToNative(
|
|
428
428
|
Object.assign({}, getOpenAppParams, {
|
|
429
429
|
logEventInfo,
|
|
430
430
|
}),
|
|
431
431
|
)
|
|
432
432
|
}
|
|
433
433
|
} else {
|
|
434
434
|
let _getLastUrl = url
|
|
435
435
|
if(/shop\.m\.jd\.com|pages\.jd\.com/.test(url)){
|
|
436
436
|
_getLastUrl = !/jwebprog=0/.test(url) ? `${url}${url.indexOf("?") !== -1 ? '&jwebprog=0' : '?jwebprog=0'}` : url
|
|
437
437
|
}
|
|
438
438
|
super.jdJumpToWeb(
|
|
439
439
|
_getLastUrl,
|
|
440
440
|
{
|
|
441
441
|
...logEventInfo,
|
|
442
442
|
},
|
|
443
443
|
successBack,
|
|
444
444
|
failBack,
|
|
445
445
|
)
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
jdJumpToWebInner(url, logEventInfo) {
|
|
450
450
|
this.jdJumpToWeb(url, logEventInfo)
|
|
451
451
|
}
|
|
452
452
|
|
|
453
453
|
jdJumpConfigUrl(detail, logEventInfo = {}) {
|
|
454
454
|
const { configDataType, configDataValue } = detail
|
|
455
455
|
switch (configDataType) {
|
|
456
456
|
case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
|
|
457
457
|
this.jdJumpToShopCategory({
|
|
458
458
|
...configDataValue,
|
|
459
459
|
logEventInfo,
|
|
460
460
|
})
|
|
461
461
|
break
|
|
462
462
|
case LinkConfigType.CONFIG_TYPE_SKU_LIST:
|
|
463
463
|
if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
|
|
464
464
|
logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
|
|
465
465
|
}
|
|
466
466
|
this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
|
|
467
467
|
break
|
|
468
468
|
case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
|
|
469
469
|
this.jdJumpToWeb(
|
|
470
470
|
`${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
|
|
471
471
|
{},
|
|
472
472
|
)
|
|
473
473
|
break
|
|
474
474
|
case LinkConfigType.CONFIG_TYPE_CATEGORY:
|
|
475
475
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
476
476
|
const getShopSearchParams = this.jdOpenAppParams(
|
|
477
477
|
configDataValue.clickUrl,
|
|
478
478
|
)
|
|
479
479
|
console.log(
|
|
480
480
|
'jd web 获取店铺分类链接解析后的参数结果',
|
|
481
481
|
getShopSearchParams,
|
|
482
482
|
)
|
|
483
483
|
getShopSearchParams &&
|
|
484
484
|
this.jdJumpToShopSearch(
|
|
485
485
|
Object.assign({}, getShopSearchParams, {
|
|
486
486
|
logEventInfo,
|
|
487
487
|
}),
|
|
488
488
|
)
|
|
489
489
|
} else {
|
|
490
490
|
this.jdJumpToShopSearch(
|
|
491
491
|
configDataValue['cid']
|
|
492
492
|
? Object.assign(
|
|
493
493
|
{},
|
|
494
494
|
{
|
|
495
495
|
shopId: global.info.queryInfo.shopId,
|
|
496
496
|
categoryId: configDataValue.cid,
|
|
497
497
|
searchType: '5',
|
|
498
498
|
logEventInfo,
|
|
499
499
|
},
|
|
500
500
|
)
|
|
501
501
|
: {
|
|
502
502
|
shopId: global.info.queryInfo.shopId,
|
|
503
503
|
logEventInfo,
|
|
504
504
|
},
|
|
505
505
|
)
|
|
506
506
|
}
|
|
507
507
|
break
|
|
508
508
|
case LinkConfigType.CONFIG_TYPE_MEMBER:
|
|
509
509
|
if(isAppHomeForMarketPage){
|
|
510
510
|
this.jdJumpToBottomTabBrandMember({
|
|
511
511
|
logEventInfo
|
|
512
512
|
})
|
|
513
513
|
}else {
|
|
514
514
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
515
515
|
const getShopMemberParams = this.jdOpenAppParams(
|
|
516
516
|
configDataValue.clickUrl,
|
|
517
517
|
)
|
|
518
518
|
getShopMemberParams &&
|
|
519
519
|
this.jdJumpToShopMember(
|
|
520
520
|
Object.assign({}, getShopMemberParams, {
|
|
521
521
|
logEventInfo,
|
|
522
522
|
}),
|
|
523
523
|
)
|
|
524
524
|
} else {
|
|
525
525
|
this.jdJumpToShopMember({
|
|
526
526
|
shopId: global.info.queryInfo.shopId,
|
|
527
527
|
venderId: configDataValue.shopDetail,
|
|
528
528
|
logEventInfo,
|
|
529
529
|
})
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
break
|
|
533
533
|
case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
|
|
534
534
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
535
535
|
const getShopActivityParams = this.jdOpenAppParams(
|
|
536
536
|
configDataValue.clickUrl,
|
|
537
537
|
)
|
|
538
538
|
getShopActivityParams &&
|
|
539
539
|
this.jdJumpToShopActivity(
|
|
540
540
|
Object.assign({}, getShopActivityParams, {
|
|
541
541
|
logEventInfo,
|
|
542
542
|
}),
|
|
543
543
|
)
|
|
544
544
|
} else if (configDataValue['projectId']) {
|
|
545
545
|
this.jdJumpToShopActivity({
|
|
546
546
|
projectId: configDataValue['projectId'],
|
|
547
547
|
configDataValue,
|
|
548
548
|
logEventInfo,
|
|
549
549
|
})
|
|
550
550
|
}
|
|
551
551
|
break
|
|
552
552
|
case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
|
|
553
553
|
case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
|
|
554
554
|
const _url = configDataValue.linkUrl
|
|
555
555
|
if (
|
|
556
556
|
_url.indexOf('to=') === -1 &&
|
|
557
557
|
_url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
|
|
558
558
|
) {
|
|
559
559
|
const _shopId = _url.match(/\d+/g)[0]
|
|
560
560
|
this.jdJumpToShopHome({
|
|
561
561
|
shopId: `${_shopId}`,
|
|
562
562
|
logEventInfo,
|
|
563
563
|
})
|
|
564
564
|
} else if (this.isOpenJdAppUrl(_url)) {
|
|
565
565
|
const getOpenAppParams = this.jdOpenAppParams(_url)
|
|
566
566
|
console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
|
|
567
567
|
if (getOpenAppParams) {
|
|
568
568
|
let _changeOpenAppParams = getOpenAppParams
|
|
569
569
|
if(isAppHomeForMarketPage){
|
|
570
570
|
const { operation, ...otherOpenAppParams } = getOpenAppParams
|
|
571
571
|
if(operation && operation === 'jumpTabInner'){
|
|
572
572
|
_changeOpenAppParams = otherOpenAppParams
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
this.jdNavigateToNative(
|
|
576
576
|
Object.assign({}, _changeOpenAppParams, {
|
|
577
577
|
logEventInfo,
|
|
578
578
|
}),
|
|
579
579
|
)
|
|
580
580
|
}
|
|
581
581
|
} else {
|
|
582
582
|
this.jdJumpToWeb(_url, logEventInfo)
|
|
583
583
|
}
|
|
584
584
|
break
|
|
585
585
|
}
|
|
586
586
|
case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
|
|
587
587
|
this.jdJumpToShopDetail({
|
|
588
588
|
venderId: global.info.queryInfo.venderId,
|
|
589
589
|
shopId: global.info.queryInfo.shopId,
|
|
590
590
|
logEventInfo,
|
|
591
591
|
})
|
|
592
592
|
break
|
|
593
593
|
case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
|
|
594
594
|
this.jdJumpToShopHome({
|
|
595
595
|
...configDataValue,
|
|
596
596
|
logEventInfo,
|
|
597
597
|
})
|
|
598
598
|
break
|
|
599
599
|
case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
|
|
600
600
|
break
|
|
601
601
|
case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
|
|
602
602
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
603
603
|
const getShoppingGuideParams = this.jdOpenAppParams(
|
|
604
604
|
configDataValue.clickUrl,
|
|
605
605
|
)
|
|
606
606
|
getShoppingGuideParams &&
|
|
607
607
|
this.jdJumpToShopActivity(
|
|
608
608
|
Object.assign({}, getShoppingGuideParams, {
|
|
609
609
|
logEventInfo,
|
|
610
610
|
}),
|
|
611
611
|
)
|
|
612
612
|
}
|
|
613
613
|
break
|
|
614
614
|
case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
|
|
615
615
|
const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
|
|
616
616
|
const search = linkUrl.match(/\?.+/)
|
|
617
617
|
if (search) {
|
|
618
618
|
const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
|
|
619
619
|
parseQueryUrlString(linkUrl)
|
|
620
620
|
try {
|
|
621
621
|
miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
|
|
622
622
|
} catch (e) {
|
|
623
623
|
console.warn('解析小程序 param 错误:', miniQueryData.param)
|
|
624
624
|
}
|
|
625
625
|
this.jdJumpToMiniProgram(miniQueryData)
|
|
626
626
|
} else {
|
|
627
627
|
console.warn('小程序地址错误:', linkUrl)
|
|
628
628
|
}
|
|
629
629
|
break
|
|
630
630
|
}
|
|
631
631
|
case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
|
|
632
632
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
633
633
|
const getShopSearchParams = this.jdOpenAppParams(
|
|
634
634
|
configDataValue.clickUrl,
|
|
635
635
|
)
|
|
636
636
|
console.log(
|
|
637
637
|
'jd web 获取店铺结果落地页链接解析后的参数结果',
|
|
638
638
|
getShopSearchParams,
|
|
639
639
|
)
|
|
640
640
|
getShopSearchParams &&
|
|
641
641
|
this.jdJumpToShopSearch(
|
|
642
642
|
Object.assign({}, getShopSearchParams, {
|
|
643
643
|
logEventInfo,
|
|
644
644
|
}),
|
|
645
645
|
)
|
|
646
646
|
} else {
|
|
647
647
|
this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo)
|
|
648
648
|
}
|
|
649
649
|
break
|
|
650
650
|
}
|
|
651
651
|
default:
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
jdNavigateToNative(
|
|
656
656
|
params: {},
|
|
657
657
|
url = 'openapp.jdmobile://virtual',
|
|
658
658
|
successBack?: Function | null,
|
|
659
659
|
failBack?: Function | null,
|
|
660
660
|
) {
|
|
661
661
|
console.log('[降级H5] jdNavigateToNative web.jd:', params)
|
|
662
662
|
const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
|
|
663
663
|
Object.assign(
|
|
664
664
|
{},
|
|
665
665
|
{
|
|
666
666
|
sourceValue: 'sourceValue_jshopModuleWeb',
|
|
667
667
|
sourceType: 'sourceType_jshopModuleWeb',
|
|
668
668
|
param: {},
|
|
669
669
|
},
|
|
670
670
|
params,
|
|
671
671
|
)
|
|
672
672
|
const { logEventInfo, ...otherParams } = getResParams
|
|
673
673
|
console.log(
|
|
674
674
|
'jd web 获取open协议参数 jdNavigateToNative params: ',
|
|
675
675
|
getResParams,
|
|
676
676
|
)
|
|
677
677
|
console.log('logEventInfo params: ', logEventInfo)
|
|
678
678
|
global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
|
|
679
679
|
this.clickEventLog(logEventInfo || getResParams)
|
|
680
680
|
.then(() => {
|
|
681
681
|
if (typeof successBack == 'function') {
|
|
682
682
|
successBack(getResParams)
|
|
683
683
|
} else {
|
|
684
684
|
try {
|
|
685
685
|
const paramsStr = JSON.stringify(otherParams)
|
|
686
686
|
console.log('跳转web jd open协议', `${url}?params=${paramsStr}`)
|
|
687
687
|
window.location.href = `${url}?params=${paramsStr}`
|
|
688
688
|
} catch (e) {
|
|
689
689
|
console.log('跳转异常', e)
|
|
690
690
|
}
|
|
691
691
|
}
|
|
692
692
|
})
|
|
693
693
|
.catch(() => {
|
|
694
694
|
typeof failBack == 'function' && failBack(getResParams)
|
|
695
695
|
})
|
|
696
696
|
}
|
|
697
697
|
|
|
698
698
|
clickEventLog(
|
|
699
699
|
opts: JumpEventReportInterFace.OptEventLogParams = {},
|
|
700
700
|
reportKey = 'click',
|
|
701
701
|
) {
|
|
702
702
|
const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
|
|
703
703
|
if (eventId && jsonParam) {
|
|
704
704
|
const { etModelInfo, logBaseInfo } = jsonParam
|
|
705
705
|
let getJsonParam = {}
|
|
706
706
|
if (etModelInfo && logBaseInfo) {
|
|
707
707
|
getJsonParam = logBaseInfo
|
|
708
708
|
} else {
|
|
709
709
|
if (Array.isArray(jsonParam)){
|
|
710
710
|
getJsonParam = jsonParam
|
|
711
711
|
} else {
|
|
712
712
|
getJsonParam = Object.assign(
|
|
713
713
|
{},
|
|
714
714
|
{
|
|
715
715
|
shopid: global.info.queryInfo?.shopId,
|
|
716
716
|
},
|
|
717
717
|
jsonParam,
|
|
718
718
|
)
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
if(reportKey === 'exposure' && /^TerminatorNew/.test(eventId) && !Array.isArray(getJsonParam)){
|
|
722
722
|
getJsonParam = [getJsonParam]
|
|
723
723
|
}
|
|
724
724
|
const webLogParams = {
|
|
725
725
|
eid: eventId,
|
|
726
726
|
elevel: eventLevel,
|
|
727
727
|
jsonParam: JSON.stringify(getJsonParam),
|
|
728
728
|
etModel: JSON.stringify(etModelInfo || {}),
|
|
729
729
|
pageId: this.logPageId,
|
|
730
730
|
pageParam: this.logPageParamStr,
|
|
731
731
|
...otherParams,
|
|
732
732
|
}
|
|
733
733
|
return /click|exposure/.test(reportKey)
|
|
734
734
|
? reportClick(webLogParams)
|
|
735
735
|
: reportToCart(opts,webLogParams)
|
|
736
736
|
} else {
|
|
737
737
|
console.log('暂无埋点参数eventId和eventParam')
|
|
738
738
|
return Promise.resolve(false)
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
|
|
742
742
|
exposureEventLog(opts) {
|
|
743
743
|
return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
|
|
744
744
|
? this.clickEventLog(
|
|
745
745
|
{
|
|
746
746
|
...opts,
|
|
747
747
|
exposureState: true,
|
|
748
748
|
},
|
|
749
749
|
'exposure',
|
|
750
750
|
)
|
|
751
751
|
: Promise.resolve(false)
|
|
752
752
|
}
|