@conecli/cone-render 0.8.19 → 0.8.20-beta.2
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/README.md +7 -1
- 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/isvStorage/index.h5.ts +1 -0
- package/dist/common/isvStorage/index.ts +1 -0
- 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/const.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -0
- package/dist/common/token/index.ts +1 -0
- package/dist/common/token/token.jd.ts +1 -0
- package/dist/common/token/token.ts +1 -0
- package/dist/common/token/token.wxapp.ts +1 -0
- package/dist/common/wxappApi.jd.ts +1 -0
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.module.scss +49 -44
- 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/const.ts +1 -0
- package/dist/components/base/CustomVideo/index.module.scss +40 -64
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +22 -2
- package/dist/components/base/Dialog/index.tsx +1 -1
- package/dist/components/base/Exposure/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/const.ts +1 -0
- package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.module.scss +20 -9
- 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/InViewRender/index.weapp.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -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 +128 -69
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
- package/dist/components/base/Price/Base/index.module.scss +148 -0
- package/dist/components/base/Price/Base/index.tsx +1 -0
- package/dist/components/base/Price/Double/index.module.scss +190 -0
- package/dist/components/base/Price/Double/index.tsx +1 -0
- package/dist/components/base/Price/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/base/Skeleton/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 -0
- 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 -0
- 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.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 -0
- package/dist/jumpEventReport/web.jdjch.ts +1 -0
- package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
- package/dist/jumpEventReport/web.pc.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/language/en_US.json +231 -0
- package/dist/language/zh_CN.json +231 -0
- package/dist/language/zh_HK.json +231 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -27
- 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/business.ts +1 -0
- package/dist/open/api/jump/index.ts +1 -0
- package/dist/open/api/jump/minPath.ts +1 -0
- package/dist/open/api/jump/side.ts +1 -0
- package/dist/open/api/jump/webUrl.ts +1 -0
- package/dist/open/api/jump copy.ts +1 -0
- package/dist/open/api/moduleUtil.ts +1 -1
- package/dist/open/api/request.ts +1 -0
- package/dist/open/api/shopMember.ts +1 -0
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/userToken.ts +1 -0
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/sass/app.h5.scss +294 -212
- package/dist/sass/base.scss +195 -137
- package/dist/service/bMallConst.ts +1 -0
- package/dist/service/bMallConst.weapp.ts +1 -0
- package/dist/service/fetchGateway.ts +1 -0
- package/dist/service/fetchGateway.weapp.ts +1 -0
- package/dist/service/fetchJsonp.ts +1 -0
- package/dist/service/http/colorSign.ts +1 -0
- package/dist/service/http/colorSign.weapp.ts +1 -0
- package/dist/service/http/const.ts +1 -0
- package/dist/service/http/h5Http.ts +1 -0
- package/dist/service/http/http.ts +1 -0
- package/dist/service/http/httpInterceptors.jd.ts +1 -0
- package/dist/service/http/httpInterceptors.ts +1 -0
- package/dist/service/http/index.h5.ts +1 -0
- package/dist/service/http/index.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -0
- package/dist/service/requestServer.ts +1 -0
- package/dist/service/requestServer.weapp.ts +1 -0
- 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/intersectionObserver.ts +1 -1
- package/dist/utils/jm-common.js +1 -1
- package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
- package/dist/utils/jumpExtMapUtil.ts +1 -0
- package/dist/utils/priceUtils.js +1 -0
- package/dist/utils/ready.ts +1 -0
- package/dist/utils/sColor.js +1 -0
- package/dist/utils/sgmCodeUtils.ts +1 -0
- package/dist/utils/taroRenderUtil.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/api/helper.js +1 -0
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/dist/wxapp/components/launch-app/index.js +1 -0
- package/dist/wxapp/components/launch-app/index.json +5 -0
- package/dist/wxapp/components/launch-app/index.wxml +0 -0
- package/dist/wxapp/components/launch-app/index.wxss +0 -0
- package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
- package/dist/wxapp/components/subscribe-guider/index.js +1 -0
- package/dist/wxapp/components/subscribe-guider/index.json +5 -0
- package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
- package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
- package/package.json +145 -114
- package/dist/components/base/Price/index.module.scss +0 -136
- package/dist/components/base/Skeleton/old.tsx +0 -1
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
- package/dist/open/api/jump.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import { JdJumpJdApp } from './jdJumpJdApp'
|
|
1
|
+
import { JdJumpJdApp } from './jdJumpJdApp';
|
|
2
2
|
routerInfo: {
|
|
3
3
|
params: {},
|
|
4
4
|
},
|
|
5
5
|
nativeEvent: null,
|
|
6
6
|
jumpConfig: {
|
|
7
7
|
venderId: null,
|
|
8
8
|
shopId: null,
|
|
9
9
|
sourceValue: '',
|
|
10
10
|
sourceType: 'App-H5',
|
|
11
11
|
activityType: 'shopx',
|
|
12
12
|
moduleId: 'none',
|
|
13
13
|
entrance: 'none',
|
|
14
14
|
},
|
|
15
15
|
logPageParamStr: '',
|
|
16
16
|
public logPageId: string;
|
|
17
17
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
|
|
18
18
|
constructor(opt = {}) {
|
|
19
19
|
super(opt);
|
|
20
20
|
this.getConfig(opt);
|
|
21
21
|
}
|
|
22
22
|
getConfig(opt = {}) {
|
|
23
23
|
return Object.assign(this, {}, defaultConfig, opt);
|
|
24
24
|
}
|
|
25
25
|
updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
|
|
26
26
|
this.logPageId = pageId;
|
|
27
27
|
this.routerInfo = routerInfo;
|
|
28
28
|
this.jumpConfig = Object.assign({}, this.jumpConfig, routerInfo.params);
|
|
29
29
|
this.logPname = logPname;
|
|
30
30
|
}
|
|
31
31
|
reportInfoPv(
|
|
32
32
|
pageId = LogPageIdInfo.APP,
|
|
33
33
|
opt: {
|
|
34
34
|
pageParam?: any;
|
|
35
35
|
} = {},
|
|
36
36
|
) {
|
|
37
37
|
const { pageParam } = opt;
|
|
38
38
|
this.logPageParamStr = pageParam
|
|
39
39
|
? pageParam
|
|
40
40
|
: this.creatParamToLogStr(this.jumpConfig)
|
|
41
41
|
.replace(/moduleId/, 'JumpmoduleID')
|
|
42
42
|
.replace(/entrance/, 'Jumpentrance');
|
|
43
43
|
reportPV({
|
|
44
44
|
pageId,
|
|
45
45
|
pageParam: this.logPageParamStr,
|
|
46
46
|
...opt,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
jdJumpToDongDongChatGroup(groupId, source = '4') {
|
|
51
51
|
this.jdNavigateToNative({
|
|
52
52
|
category: 'jump',
|
|
53
53
|
des: 'dongdong_group_chat',
|
|
54
54
|
source: source,
|
|
55
55
|
groupId: `${groupId}`,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
jdJumpToWeb(
|
|
60
60
|
url,
|
|
61
61
|
logEventInfo,
|
|
62
62
|
successBack?: functionType | undefined,
|
|
63
63
|
failBack?: functionType | undefined,
|
|
64
64
|
) {
|
|
65
65
|
console.log('jd web', this.isOpenJdAppUrl(url), url);
|
|
66
66
|
if (this.isOpenJdAppUrl(url)) {
|
|
67
67
|
const getOpenAppParams = this.jdOpenAppParams(url);
|
|
68
68
|
console.log('jd web 获取自定义openApp链接解析后的参数结果', getOpenAppParams);
|
|
69
69
|
if (getOpenAppParams) {
|
|
70
70
|
|
|
71
71
|
const { useEncodeParams, ...otherLogInfo } = logEventInfo || {};
|
|
72
72
|
this.jdNavigateToNative(
|
|
73
73
|
Object.assign({}, getOpenAppParams, {
|
|
74
74
|
logEventInfo: otherLogInfo,
|
|
75
75
|
useEncodeParams: Boolean(useEncodeParams),
|
|
76
76
|
}),
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
} else {
|
|
80
80
|
let _getLastUrl = url;
|
|
81
81
|
if (/shop\.m\.jd\.com|pages\.jd\.com/.test(_getLastUrl)) {
|
|
82
82
|
const getUrlSearchParamState = _getLastUrl.indexOf('?') !== -1;
|
|
83
83
|
if (!/jwebprog=0/.test(_getLastUrl)) {
|
|
84
84
|
_getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}jwebprog=0`;
|
|
85
85
|
}
|
|
86
86
|
if (global.info.sysInfo?.isJdTabletDevice && !/device=tablet/.test(_getLastUrl)) {
|
|
87
87
|
_getLastUrl = `${_getLastUrl}${getUrlSearchParamState ? '&' : '?'}device=tablet`;
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
super.jdJumpToWeb(
|
|
91
91
|
_getLastUrl,
|
|
92
92
|
{
|
|
93
93
|
...logEventInfo,
|
|
94
94
|
},
|
|
95
95
|
successBack,
|
|
96
96
|
failBack,
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
jdJumpToWebInner(url, logEventInfo) {
|
|
102
102
|
this.jdJumpToWeb(url, logEventInfo);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
jdJumpConfigUrl(detail, logEventInfo = {}) {
|
|
106
106
|
const { configDataType, configDataValue } = detail;
|
|
107
107
|
switch (configDataType) {
|
|
108
108
|
case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
|
|
109
109
|
this.jdJumpToShopCategory({
|
|
110
110
|
...configDataValue,
|
|
111
111
|
logEventInfo,
|
|
112
112
|
});
|
|
113
113
|
break;
|
|
114
114
|
case LinkConfigType.CONFIG_TYPE_SKU_LIST:
|
|
115
115
|
if (logEventInfo?.jsonParam?.logBaseInfo?.mInfo) {
|
|
116
116
|
logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds;
|
|
117
117
|
}
|
|
118
118
|
this.jdJumpToProduct(configDataValue.skuIds, logEventInfo);
|
|
119
119
|
break;
|
|
120
120
|
case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
|
|
121
121
|
this.jdJumpToWeb(
|
|
122
122
|
`${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
|
|
123
123
|
{},
|
|
124
124
|
);
|
|
125
125
|
break;
|
|
126
126
|
case LinkConfigType.CONFIG_TYPE_CATEGORY:
|
|
127
127
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
128
128
|
const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
129
129
|
console.log('jd web 获取店铺分类链接解析后的参数结果', getShopSearchParams);
|
|
130
130
|
getShopSearchParams &&
|
|
131
131
|
this.jdJumpToShopSearch(
|
|
132
132
|
Object.assign({}, getShopSearchParams, {
|
|
133
133
|
logEventInfo,
|
|
134
134
|
}),
|
|
135
135
|
);
|
|
136
136
|
} else {
|
|
137
137
|
const extraParam = configDataValue?.pageId ? { pageId: configDataValue.pageId } : {};
|
|
138
138
|
this.jdJumpToShopSearch(
|
|
139
139
|
configDataValue['cid']
|
|
140
140
|
? Object.assign(
|
|
141
141
|
{},
|
|
142
142
|
{
|
|
143
143
|
shopId: global.info.queryInfo.shopId,
|
|
144
144
|
categoryId: configDataValue.cid,
|
|
145
145
|
searchType: '5',
|
|
146
146
|
...extraParam,
|
|
147
147
|
logEventInfo,
|
|
148
148
|
},
|
|
149
149
|
)
|
|
150
150
|
: {
|
|
151
151
|
shopId: global.info.queryInfo.shopId,
|
|
152
152
|
...extraParam,
|
|
153
153
|
logEventInfo,
|
|
154
154
|
},
|
|
155
155
|
);
|
|
156
156
|
}
|
|
157
157
|
break;
|
|
158
158
|
case LinkConfigType.CONFIG_TYPE_MEMBER:
|
|
159
159
|
if (isAppHomeForMarketPage) {
|
|
160
160
|
this.jdJumpToBottomTabBrandMember({
|
|
161
161
|
logEventInfo,
|
|
162
162
|
});
|
|
163
163
|
} else {
|
|
164
164
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
165
165
|
const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
166
166
|
getShopMemberParams &&
|
|
167
167
|
this.jdJumpToShopMember(
|
|
168
168
|
Object.assign({}, getShopMemberParams, {
|
|
169
169
|
logEventInfo,
|
|
170
170
|
}),
|
|
171
171
|
);
|
|
172
172
|
} else {
|
|
173
173
|
this.jdJumpToShopMember({
|
|
174
174
|
shopId: global.info.queryInfo.shopId,
|
|
175
175
|
venderId: configDataValue.shopDetail,
|
|
176
176
|
logEventInfo,
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
break;
|
|
181
181
|
case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
|
|
182
182
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
183
183
|
const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
184
184
|
getShopActivityParams &&
|
|
185
185
|
this.jdJumpToShopActivity(
|
|
186
186
|
Object.assign({}, getShopActivityParams, {
|
|
187
187
|
logEventInfo,
|
|
188
188
|
}),
|
|
189
189
|
);
|
|
190
190
|
} else if (configDataValue['projectId']) {
|
|
191
191
|
this.jdJumpToShopActivity({
|
|
192
192
|
projectId: configDataValue['projectId'],
|
|
193
193
|
configDataValue,
|
|
194
194
|
logEventInfo,
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
break;
|
|
198
198
|
case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
|
|
199
199
|
case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
|
|
200
200
|
const _url = configDataValue.linkUrl;
|
|
201
201
|
if (
|
|
202
202
|
_url.indexOf('to=') === -1 &&
|
|
203
203
|
_url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
|
|
204
204
|
) {
|
|
205
205
|
const _shopId = _url.match(/\d+/g)[0];
|
|
206
206
|
this.jdJumpToShopHome({
|
|
207
207
|
shopId: `${_shopId}`,
|
|
208
208
|
logEventInfo,
|
|
209
209
|
});
|
|
210
210
|
} else if (this.isOpenJdAppUrl(_url)) {
|
|
211
211
|
const getOpenAppParams = this.jdOpenAppParams(_url);
|
|
212
212
|
console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams);
|
|
213
213
|
if (getOpenAppParams) {
|
|
214
214
|
let _changeOpenAppParams = getOpenAppParams;
|
|
215
215
|
if (isAppHomeForMarketPage) {
|
|
216
216
|
const { operation, ...otherOpenAppParams } = getOpenAppParams;
|
|
217
217
|
if (operation && operation === 'jumpTabInner') {
|
|
218
218
|
_changeOpenAppParams = otherOpenAppParams;
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
this.jdNavigateToNative(
|
|
222
222
|
Object.assign({}, _changeOpenAppParams, {
|
|
223
223
|
logEventInfo,
|
|
224
224
|
}),
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
} else {
|
|
228
228
|
this.jdJumpToWeb(_url, logEventInfo);
|
|
229
229
|
}
|
|
230
230
|
break;
|
|
231
231
|
}
|
|
232
232
|
case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
|
|
233
233
|
this.jdJumpToShopDetail({
|
|
234
234
|
venderId: global.info.queryInfo.venderId,
|
|
235
235
|
shopId: global.info.queryInfo.shopId,
|
|
236
236
|
logEventInfo,
|
|
237
237
|
});
|
|
238
238
|
break;
|
|
239
239
|
case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
|
|
240
240
|
this.jdJumpToShopHome({
|
|
241
241
|
...configDataValue,
|
|
242
242
|
logEventInfo,
|
|
243
243
|
});
|
|
244
244
|
break;
|
|
245
245
|
case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
|
|
246
246
|
break;
|
|
247
247
|
case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
|
|
248
248
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
249
249
|
const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
250
250
|
getShoppingGuideParams &&
|
|
251
251
|
this.jdJumpToShopActivity(
|
|
252
252
|
Object.assign({}, getShoppingGuideParams, {
|
|
253
253
|
logEventInfo,
|
|
254
254
|
}),
|
|
255
255
|
);
|
|
256
256
|
}
|
|
257
257
|
break;
|
|
258
258
|
case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
|
|
259
259
|
const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
|
|
260
260
|
const search = linkUrl.match(/\?.+/);
|
|
261
261
|
if (search) {
|
|
262
262
|
const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
|
|
263
263
|
parseQueryUrlString(linkUrl);
|
|
264
264
|
try {
|
|
265
265
|
miniQueryData.param = JSON.parse(<string>miniQueryData?.param);
|
|
266
266
|
} catch (e) {
|
|
267
267
|
console.warn('解析小程序 param 错误:', miniQueryData.param);
|
|
268
268
|
}
|
|
269
269
|
this.jdJumpToMiniProgram(miniQueryData);
|
|
270
270
|
} else {
|
|
271
271
|
console.warn('小程序地址错误:', linkUrl);
|
|
272
272
|
}
|
|
273
273
|
break;
|
|
274
274
|
}
|
|
275
275
|
case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
|
|
276
276
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
277
277
|
const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
278
278
|
console.log('jd web 获取店铺结果落地页链接解析后的参数结果', getShopSearchParams);
|
|
279
279
|
getShopSearchParams &&
|
|
280
280
|
this.jdJumpToShopSearch(
|
|
281
281
|
Object.assign({}, getShopSearchParams, {
|
|
282
282
|
logEventInfo,
|
|
283
283
|
}),
|
|
284
284
|
);
|
|
285
285
|
} else {
|
|
286
286
|
this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo);
|
|
287
287
|
}
|
|
288
288
|
break;
|
|
289
289
|
}
|
|
290
290
|
default:
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
jdNavigateToNative(
|
|
295
295
|
params: object,
|
|
296
296
|
url = 'openapp.jdmobile://virtual',
|
|
297
297
|
successBack?: functionType | null,
|
|
298
298
|
failBack?: functionType | null,
|
|
299
299
|
) {
|
|
300
300
|
console.log('[降级H5] jdNavigateToNative web.jd:', params);
|
|
301
301
|
const getResParams: JumpEventReportInterFace.JdMiniJumpParams = Object.assign(
|
|
302
302
|
{},
|
|
303
303
|
{
|
|
304
304
|
sourceValue: 'sourceValue_jshopModuleWeb',
|
|
305
305
|
sourceType: 'sourceType_jshopModuleWeb',
|
|
306
306
|
param: {},
|
|
307
307
|
},
|
|
308
308
|
params,
|
|
309
309
|
);
|
|
310
310
|
const { logEventInfo, useEncodeParams, ...otherParams } = getResParams;
|
|
311
311
|
console.log('jd web 获取open协议参数 jdNavigateToNative params: ', getResParams);
|
|
312
312
|
console.log('logEventInfo params: ', logEventInfo);
|
|
313
313
|
global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
|
|
314
314
|
this.clickEventLog(logEventInfo || getResParams)
|
|
315
315
|
.then(() => {
|
|
316
316
|
if (typeof successBack === 'function') {
|
|
317
317
|
successBack(getResParams);
|
|
318
318
|
} else {
|
|
319
319
|
try {
|
|
320
320
|
const paramsStr = JSON.stringify(otherParams);
|
|
321
321
|
console.log('跳转web jd open协议', `${url}?params=${paramsStr}`);
|
|
322
322
|
window.location.href = useEncodeParams
|
|
323
323
|
? `${url}?params=${encodeURIComponent(paramsStr)}`
|
|
324
324
|
: `${url}?params=${paramsStr}`;
|
|
325
325
|
} catch (e) {
|
|
326
326
|
console.log('跳转异常', e);
|
|
327
327
|
draBusinessCustomReport({
|
|
328
328
|
type: 'jdapp_jdNavigateToNative_catch_err',
|
|
329
329
|
errMsg: '跳转web jd open协议发生错误',
|
|
330
330
|
originReqDataStr: JSON.stringify({
|
|
331
331
|
url,
|
|
332
332
|
isJdApp,
|
|
333
333
|
jdAppVersion: jdAppVersionStr,
|
|
334
334
|
...otherParams,
|
|
335
335
|
}),
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
339
|
})
|
|
340
340
|
.catch(() => {
|
|
341
341
|
typeof failBack === 'function' && failBack(getResParams);
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, reportKey = 'click') {
|
|
346
346
|
const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts;
|
|
347
347
|
if (eventId && jsonParam) {
|
|
348
348
|
const { etModelInfo, logBaseInfo } = jsonParam;
|
|
349
349
|
let getJsonParam = {};
|
|
350
350
|
if (etModelInfo && logBaseInfo) {
|
|
351
351
|
getJsonParam = logBaseInfo;
|
|
352
352
|
} else {
|
|
353
353
|
if (Array.isArray(jsonParam)) {
|
|
354
354
|
getJsonParam = jsonParam;
|
|
355
355
|
} else {
|
|
356
356
|
getJsonParam = Object.assign(
|
|
357
357
|
{},
|
|
358
358
|
{
|
|
359
359
|
shopid: global.info.queryInfo?.shopId,
|
|
360
360
|
},
|
|
361
361
|
jsonParam,
|
|
362
362
|
);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
if (
|
|
366
366
|
reportKey === 'exposure' &&
|
|
367
367
|
/^TerminatorNew/.test(eventId) &&
|
|
368
368
|
!Array.isArray(getJsonParam)
|
|
369
369
|
) {
|
|
370
370
|
getJsonParam = [getJsonParam];
|
|
371
371
|
}
|
|
372
372
|
const webLogParams = {
|
|
373
373
|
isExpo: reportKey === 'exposure',
|
|
374
374
|
eid: eventId,
|
|
375
375
|
elevel: eventLevel,
|
|
376
376
|
jsonParam: JSON.stringify(getJsonParam),
|
|
377
377
|
etModel: JSON.stringify(etModelInfo || {}),
|
|
378
378
|
pageId: this.logPageId,
|
|
379
379
|
pageParam: this.logPageParamStr,
|
|
380
380
|
...otherParams,
|
|
381
381
|
};
|
|
382
382
|
return /click|exposure/.test(reportKey)
|
|
383
383
|
? reportClick(webLogParams)
|
|
384
384
|
: reportToCart(opts, webLogParams);
|
|
385
385
|
} else {
|
|
386
386
|
console.log('暂无埋点参数eventId和eventParam');
|
|
387
387
|
return Promise.resolve(false);
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
exposureEventLog(opts) {
|
|
392
392
|
return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
|
|
393
393
|
? this.clickEventLog(
|
|
394
394
|
{
|
|
395
395
|
...opts,
|
|
396
396
|
exposureState: true,
|
|
397
397
|
},
|
|
398
398
|
'exposure',
|
|
399
399
|
)
|
|
400
400
|
: Promise.resolve(false);
|
|
401
401
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { JdJumpJdApp } from './jdJumpJdApp'
|
|
2
|
routerInfo: {
|
|
1
3
|
params: {},
|
|
2
4
|
},
|
|
3
5
|
nativeEvent: null,
|
|
4
6
|
jumpConfig: {
|
|
5
7
|
venderId: null,
|
|
6
8
|
shopId: null,
|
|
7
9
|
sourceValue: '',
|
|
8
10
|
sourceType: 'App-H5',
|
|
9
11
|
activityType: 'shopx',
|
|
10
12
|
moduleId: 'none',
|
|
11
13
|
entrance: 'none',
|
|
12
14
|
},
|
|
13
15
|
logPageParamStr: '',
|
|
14
16
|
public logPageId: string
|
|
15
17
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
|
|
16
18
|
constructor(opt = {}) {
|
|
17
19
|
console.log('jdb加载==========')
|
|
18
20
|
super(opt)
|
|
19
21
|
this.getConfig(opt)
|
|
20
22
|
}
|
|
21
23
|
jdbOpenAppParams(openAppUrl): Object | boolean {
|
|
22
24
|
let getParams: boolean | Object = false
|
|
23
25
|
if (this.isOpenJdbAppUrl(openAppUrl)) {
|
|
24
26
|
try {
|
|
25
27
|
getParams = openAppUrl.replace(
|
|
26
28
|
/openApp\.jdbmall:\/\/virtual\?params=/i,
|
|
27
29
|
'',
|
|
28
30
|
)
|
|
29
31
|
getParams = JSON.parse(String(getParams))
|
|
30
32
|
} catch (e) {
|
|
31
33
|
console.log(e)
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
return getParams
|
|
35
37
|
}
|
|
36
38
|
isOpenJdbAppUrl(openAppUrl) {
|
|
37
39
|
return /openApp\.jdbmall:\/\/virtual\?params=/i.test(openAppUrl)
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
async jdJumpConfigUrl(detail, logEventInfo = {}) {
|
|
41
43
|
const { configDataType, configDataValue } = detail
|
|
42
44
|
switch (configDataType) {
|
|
43
45
|
case LinkConfigType.CONFIG_TYPE_SKU_LIST:
|
|
44
46
|
this.jdJumpToProduct(
|
|
45
47
|
{
|
|
46
48
|
...configDataValue,
|
|
47
49
|
skuId: configDataValue.skuIds,
|
|
48
50
|
skuUniformBizInfo: { buId: configDataValue.buId },
|
|
49
51
|
},
|
|
50
52
|
logEventInfo,
|
|
51
53
|
)
|
|
52
54
|
break
|
|
53
55
|
case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK: {
|
|
54
56
|
const _url = configDataValue.linkUrl
|
|
55
57
|
if (this.isOpenJdbAppUrl(_url)) {
|
|
56
58
|
const getOpenAppParams = this.jdbOpenAppParams(_url)
|
|
57
59
|
console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
|
|
58
60
|
if (getOpenAppParams) {
|
|
59
61
|
this.jdNavigateToNative(
|
|
60
62
|
Object.assign({}, getOpenAppParams, {
|
|
61
63
|
logEventInfo,
|
|
62
64
|
}),
|
|
63
65
|
)
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
break
|
|
67
69
|
}
|
|
68
70
|
default:
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
jdJumpToProduct(skuParams, logEventInfo) {
|
|
73
75
|
if (typeof skuParams !== 'object') {
|
|
74
76
|
console.error('万商app跳转商品详情参数需要对象,详情请查看文档')
|
|
75
77
|
return
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
let { skuId, bMallTag = '1', skuUniformBizInfo } = skuParams
|
|
79
81
|
skuId = skuId.toString().trim()
|
|
80
82
|
this.jdNavigateToNative({
|
|
81
83
|
category: 'jump',
|
|
82
84
|
des: 'skudetail',
|
|
83
85
|
param: {
|
|
84
86
|
skuId: skuId,
|
|
85
87
|
bMallTag: bMallTag,
|
|
86
88
|
skuUniformBizInfo,
|
|
87
89
|
},
|
|
88
90
|
logEventInfo,
|
|
89
91
|
})
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
|
|
93
95
|
this.jdJumpToProduct(skuInfo, logEventInfo)
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
jdNavigateToNative(
|
|
97
99
|
params: {},
|
|
98
100
|
url = OpenAppHost,
|
|
99
101
|
successBack?: Function | null,
|
|
100
102
|
failBack?: Function | null,
|
|
101
103
|
) {
|
|
102
104
|
console.log('jdb web', params)
|
|
103
105
|
const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
|
|
104
106
|
Object.assign(
|
|
105
107
|
{},
|
|
106
108
|
{
|
|
107
109
|
param: {},
|
|
108
110
|
},
|
|
109
111
|
params,
|
|
110
112
|
)
|
|
111
113
|
const { logEventInfo, ...otherParams } = getResParams
|
|
112
114
|
console.log(
|
|
113
115
|
'jdb web 获取open协议参数 jdNavigateToNative params: ',
|
|
114
116
|
otherParams,
|
|
115
117
|
)
|
|
116
118
|
console.log('logEventInfo params: ', logEventInfo)
|
|
117
119
|
console.log('otherParams', otherParams)
|
|
118
120
|
const paramsStr = JSON.stringify(otherParams)
|
|
119
121
|
console.log('跳转web jdb open协议', `${url}?params=${paramsStr}`)
|
|
120
122
|
global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
|
|
121
123
|
this.clickEventLog(logEventInfo || getResParams)
|
|
122
124
|
.then(() => {
|
|
123
125
|
if (typeof successBack == 'function') {
|
|
124
126
|
successBack(getResParams)
|
|
125
127
|
} else {
|
|
126
128
|
try {
|
|
127
129
|
const paramsStr = JSON.stringify(otherParams)
|
|
128
130
|
console.log(
|
|
129
131
|
'success: 跳转web jdb open协议',
|
|
130
132
|
`${url}?params=${paramsStr}`,
|
|
131
133
|
)
|
|
132
134
|
window.location.href = `${url}?params=${paramsStr}`
|
|
133
135
|
} catch (e) {
|
|
134
136
|
console.log('跳转异常', e)
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
})
|
|
138
140
|
.catch((e) => {
|
|
139
141
|
console.log('catch', e)
|
|
140
142
|
typeof failBack == 'function' && failBack(getResParams)
|
|
141
143
|
})
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
clickEventLog(
|
|
145
147
|
opts: JumpEventReportInterFace.OptEventLogParams = {},
|
|
146
148
|
reportKey = 'click',
|
|
147
149
|
) {
|
|
148
150
|
const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
|
|
149
151
|
if (eventId && jsonParam) {
|
|
150
152
|
const { etModelInfo, logBaseInfo } = jsonParam
|
|
151
153
|
let getJsonParam = {}
|
|
152
154
|
if (etModelInfo && logBaseInfo) {
|
|
153
155
|
getJsonParam = logBaseInfo
|
|
154
156
|
} else {
|
|
155
157
|
if (Array.isArray(jsonParam)){
|
|
156
158
|
getJsonParam = jsonParam
|
|
157
159
|
} else {
|
|
158
160
|
getJsonParam = Object.assign(
|
|
159
161
|
{},
|
|
160
162
|
{
|
|
161
163
|
shopid: global.info.queryInfo?.shopId,
|
|
162
164
|
},
|
|
163
165
|
jsonParam,
|
|
164
166
|
)
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
const webLogParams = {
|
|
168
170
|
eid: eventId,
|
|
169
171
|
elevel: eventLevel,
|
|
170
172
|
eparam:JSON.stringify(getJsonParam),
|
|
171
173
|
jsonParam: JSON.stringify(getJsonParam),
|
|
172
174
|
etModel: JSON.stringify(etModelInfo || {}),
|
|
173
175
|
pageId: this.logPageId,
|
|
174
176
|
pageParam: this.logPageParamStr,
|
|
175
177
|
...otherParams,
|
|
176
178
|
}
|
|
177
179
|
return /click|exposure/.test(reportKey)
|
|
178
180
|
? reportClick(webLogParams)
|
|
179
181
|
: reportToCart(opts,webLogParams)
|
|
180
182
|
} else {
|
|
181
183
|
console.log('暂无埋点参数eventId和eventParam')
|
|
182
184
|
return Promise.resolve(false)
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
getConfig(opt = {}) {
|
|
186
188
|
return Object.assign(this, {}, defaultConfig, opt)
|
|
187
189
|
}
|