@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import global from '../common';
|
|
2
|
objectToUrlEncode,
|
|
1
3
|
parseQueryUrlString,
|
|
2
4
|
isTjScence,
|
|
3
5
|
isTjM,
|
|
4
6
|
isTjJxM,
|
|
5
7
|
isH5AdnJxMini,
|
|
6
8
|
tjChannel,
|
|
7
9
|
public logPageId: string;
|
|
8
10
|
public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig;
|
|
9
11
|
constructor(opt) {
|
|
10
12
|
super(opt);
|
|
11
13
|
this.getConfig(opt);
|
|
12
14
|
console.log('加载特价/京喜m的跳转js文件....');
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
getTjShopParam() {
|
|
16
18
|
const { tjshop } = global.info.queryInfo;
|
|
17
19
|
const tjshopParam = tjshop ? `&tjshop=${tjshop}` : '';
|
|
18
20
|
const tjChannelStr = tjChannel ? `&tjChannel=${tjChannel}` : '';
|
|
19
21
|
return `${tjshopParam}${tjChannelStr}`;
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
jdJumpToProduct(skuIds, logEventInfo) {
|
|
23
25
|
skuIds = skuIds.toString().trim();
|
|
24
26
|
const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
|
|
25
27
|
const { jingxiSdx, ...otherLogInfo } = logEventInfo;
|
|
26
28
|
let url = `${this.jumpWebUrl.detail}${getSkuId}.html`;
|
|
27
29
|
if (isTjScence) {
|
|
28
30
|
if (isTjM) {
|
|
29
31
|
url = `${this.jumpWebUrl.tjDetail}?wareId=${getSkuId}`;
|
|
30
32
|
} else if (isTjJxM) {
|
|
31
33
|
const { _fd } = global.info.queryInfo;
|
|
32
34
|
const fd = _fd ? `&_fd=${_fd}` : '';
|
|
33
35
|
url = `${this.jumpWebUrl.jxDetail}?sku=${getSkuId}${fd}`;
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
if (jingxiSdx) {
|
|
37
39
|
this.jdNavigateToNative(`${url}?sdx=${jingxiSdx}`, otherLogInfo);
|
|
38
40
|
} else {
|
|
39
41
|
this.jdNavigateToNative(url, logEventInfo);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
|
|
44
46
|
const getSkuId = skuInfo?.skuId;
|
|
45
47
|
this.jdJumpToProduct(getSkuId, logEventInfo);
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
|
|
49
51
|
const currentShopInfo = {
|
|
50
52
|
shopId: global.info.queryInfo.shopId,
|
|
51
53
|
venderId: global.info.queryInfo.venderId,
|
|
52
54
|
};
|
|
53
55
|
const restParams =
|
|
54
56
|
(shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
|
|
55
57
|
(shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
|
|
56
58
|
? {}
|
|
57
59
|
: currentShopInfo;
|
|
58
60
|
const getInfo = Object.assign({}, restParams, shopInfo);
|
|
59
61
|
this.jdNavigateToNative(
|
|
60
62
|
`${this.jumpWebUrl.mshop}?${objectToUrlEncode(
|
|
61
63
|
this.getShopIdOrVenderIdParams(getInfo),
|
|
62
64
|
)}${this.getTjShopParam()}`,
|
|
63
65
|
{
|
|
64
66
|
...getInfo,
|
|
65
67
|
},
|
|
66
68
|
);
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
jdJumpToWeb(
|
|
70
72
|
url,
|
|
71
73
|
logEventInfo,
|
|
72
74
|
successBack?: Function | undefined,
|
|
73
75
|
failBack?: Function | undefined,
|
|
74
76
|
) {
|
|
75
77
|
console.log('web.tjm.ts - jdJumpToWeb');
|
|
76
78
|
if (url.indexOf('tjshop') == -1) {
|
|
77
79
|
url = url + this.getTjShopParam();
|
|
78
80
|
}
|
|
79
81
|
this.jdNavigateToNative(
|
|
80
82
|
url,
|
|
81
83
|
{
|
|
82
84
|
...logEventInfo,
|
|
83
85
|
},
|
|
84
86
|
successBack,
|
|
85
87
|
failBack,
|
|
86
88
|
);
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
jdJumpConfigUrl(detail, logEventInfo = {}) {
|
|
90
92
|
const { configDataType, configDataValue } = detail;
|
|
91
93
|
console.log('jdJumpConfigUrl web.tj.base configDataType:', configDataType, configDataValue);
|
|
92
94
|
switch (configDataType) {
|
|
93
95
|
case LinkConfigType.CONFIG_TYPE_SKU_LIST:
|
|
94
96
|
if (logEventInfo?.jsonParam?.logBaseInfo?.mInfo) {
|
|
95
97
|
logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds;
|
|
96
98
|
}
|
|
97
99
|
this.jdJumpToProduct(configDataValue.skuIds, logEventInfo);
|
|
98
100
|
break;
|
|
99
101
|
case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
|
|
100
102
|
this.jdJumpToWeb(
|
|
101
103
|
`${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
|
|
102
104
|
{},
|
|
103
105
|
);
|
|
104
106
|
break;
|
|
105
107
|
case LinkConfigType.CONFIG_TYPE_CATEGORY:
|
|
106
108
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
107
109
|
const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
108
110
|
getShopSearchParams &&
|
|
109
111
|
this.jdJumpToShopSearch(
|
|
110
112
|
Object.assign({}, getShopSearchParams, {
|
|
111
113
|
logEventInfo,
|
|
112
114
|
}),
|
|
113
115
|
);
|
|
114
116
|
} else {
|
|
115
117
|
this.jdJumpToShopSearch(
|
|
116
118
|
configDataValue['cid']
|
|
117
119
|
? Object.assign(
|
|
118
120
|
{},
|
|
119
121
|
{
|
|
120
122
|
shopId: global.info.queryInfo.shopId,
|
|
121
123
|
categoryId: configDataValue.cid,
|
|
122
124
|
...configDataValue,
|
|
123
125
|
logEventInfo,
|
|
124
126
|
},
|
|
125
127
|
)
|
|
126
128
|
: {
|
|
127
129
|
shopId: global.info.queryInfo.shopId,
|
|
128
130
|
logEventInfo,
|
|
129
131
|
},
|
|
130
132
|
);
|
|
131
133
|
}
|
|
132
134
|
break;
|
|
133
135
|
case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
|
|
134
136
|
this.jdJumpToShopCategory({
|
|
135
137
|
...configDataValue,
|
|
136
138
|
logEventInfo,
|
|
137
139
|
});
|
|
138
140
|
break;
|
|
139
141
|
case LinkConfigType.CONFIG_TYPE_MEMBER:
|
|
140
142
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
141
143
|
const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
142
144
|
getShopMemberParams &&
|
|
143
145
|
this.jdJumpToShopMember(
|
|
144
146
|
Object.assign({}, getShopMemberParams, {
|
|
145
147
|
logEventInfo,
|
|
146
148
|
}),
|
|
147
149
|
);
|
|
148
150
|
} else {
|
|
149
151
|
this.jdJumpToShopMember({
|
|
150
152
|
shopId: global.info.queryInfo.shopId,
|
|
151
153
|
venderId: configDataValue.shopDetail,
|
|
152
154
|
logEventInfo,
|
|
153
155
|
});
|
|
154
156
|
}
|
|
155
157
|
break;
|
|
156
158
|
case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
|
|
157
159
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
158
160
|
const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
159
161
|
if (getShopActivityParams && getShopActivityParams['des'] == 'jshopActivity') {
|
|
160
162
|
this.jdJumpToShopActivity({
|
|
161
163
|
projectId: configDataValue['projectId'],
|
|
162
164
|
configDataValue,
|
|
163
165
|
logEventInfo,
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
168
|
} else if (configDataValue['projectId']) {
|
|
167
169
|
this.jdJumpToShopActivity({
|
|
168
170
|
projectId: configDataValue['projectId'],
|
|
169
171
|
configDataValue,
|
|
170
172
|
logEventInfo,
|
|
171
173
|
});
|
|
172
174
|
}
|
|
173
175
|
break;
|
|
174
176
|
case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
|
|
175
177
|
case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON:
|
|
176
178
|
let _url = configDataValue.linkUrl;
|
|
177
179
|
const isProductM = /item\.m\.jd\.com/.test(_url);
|
|
178
180
|
const isProductPC = /item\.jd\.com/.test(_url);
|
|
179
181
|
if (isTjScence) {
|
|
180
182
|
const { appCode } = global.info.queryInfo;
|
|
181
183
|
|
|
182
184
|
if (/(pro|prodev)\.jd\.com(\/mall\/)/.test(_url)) {
|
|
183
185
|
if (isH5AdnJxMini) {
|
|
184
186
|
_url =
|
|
185
187
|
_url.replace(/([prodev]|[pro])(\.jd\.com)(\/mall)/, '$1.m$2/mini') +
|
|
186
188
|
`appCode=${appCode}&wxAppName=jx`;
|
|
187
189
|
} else {
|
|
188
190
|
_url = _url.replace(/([prodev]|[pro])(\.jd\.com)(\/mall)/, '$1.m$2/jdlite');
|
|
189
191
|
}
|
|
190
192
|
} else if (/(pro|prodev)\.(m\.jd|jd)\.com(\/mall\/)/.test(_url)) {
|
|
191
193
|
if (isH5AdnJxMini) {
|
|
192
194
|
_url =
|
|
193
195
|
_url.replace(/([prodev]|[pro])(\.m\.jd\.com)(\/mall)/, '$1$2/mini') +
|
|
194
196
|
`appCode=${appCode}&wxAppName=jx`;
|
|
195
197
|
} else {
|
|
196
198
|
_url = _url.replace(/([prodev]|[pro])(\.m\.jd\.com)(\/mall)/, '$1$2/jdlite');
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
201
|
}
|
|
200
202
|
if (
|
|
201
203
|
_url.indexOf('to=') === -1 &&
|
|
202
204
|
_url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
|
|
203
205
|
) {
|
|
204
206
|
const _shopId = _url.match(/\d+/g)[0];
|
|
205
207
|
this.jdJumpToShopHome({
|
|
206
208
|
shopId: `${_shopId}`,
|
|
207
209
|
logEventInfo,
|
|
208
210
|
});
|
|
209
211
|
} else if (this.isOpenJdAppUrl(_url)) {
|
|
210
212
|
const getOpenAppParams: any = this.jdOpenAppParams(_url);
|
|
211
213
|
if (getOpenAppParams) {
|
|
212
214
|
if (getOpenAppParams.jumpTab == 'allProduct') {
|
|
213
215
|
this.jdJumpToTabAllProduct(
|
|
214
216
|
global.info.queryInfo.shopId,
|
|
215
217
|
global.info.queryInfo.venderId,
|
|
216
218
|
);
|
|
217
219
|
} else if (
|
|
218
220
|
getOpenAppParams.des == 'productList' &&
|
|
219
221
|
getOpenAppParams.from == 'couponBatch'
|
|
220
222
|
) {
|
|
221
223
|
this.jdJumpToCouponSearchProductList(getOpenAppParams?.couponId);
|
|
222
224
|
} else if (getOpenAppParams.des == 'vapp') {
|
|
223
225
|
this.jdJumpToWeb(
|
|
224
226
|
`https://conecli.com/apps/mpshare/index.html?category=${
|
|
225
227
|
getOpenAppParams.category
|
|
226
228
|
}&des=${getOpenAppParams.des}&vapptype=${
|
|
227
229
|
getOpenAppParams.vapptype
|
|
228
230
|
}&appId=${getOpenAppParams.appId}&path=${
|
|
229
231
|
getOpenAppParams.path
|
|
230
232
|
}¶m=${encodeURI(JSON.stringify(getOpenAppParams.param))}`,
|
|
231
233
|
logEventInfo,
|
|
232
234
|
);
|
|
233
235
|
} else {
|
|
234
236
|
this.jdNavigateToNative(
|
|
235
237
|
'',
|
|
236
238
|
Object.assign({}, getOpenAppParams, {
|
|
237
239
|
logEventInfo,
|
|
238
240
|
}),
|
|
239
241
|
);
|
|
240
242
|
}
|
|
241
243
|
}
|
|
242
244
|
} else if (isProductM || isProductPC) {
|
|
243
245
|
const skuid = _url.match(/\d+/g)[0];
|
|
244
246
|
if (skuid) {
|
|
245
247
|
this.jdJumpToProduct(skuid, logEventInfo);
|
|
246
248
|
}
|
|
247
249
|
} else {
|
|
248
250
|
this.jdJumpToWeb(_url, logEventInfo);
|
|
249
251
|
}
|
|
250
252
|
break;
|
|
251
253
|
case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
|
|
252
254
|
this.jdJumpToShopDetail({
|
|
253
255
|
venderId: global.info.queryInfo.venderId,
|
|
254
256
|
shopId: global.info.queryInfo.shopId,
|
|
255
257
|
logEventInfo,
|
|
256
258
|
});
|
|
257
259
|
break;
|
|
258
260
|
case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
|
|
259
261
|
this.jdJumpToShopHome({
|
|
260
262
|
...configDataValue,
|
|
261
263
|
logEventInfo,
|
|
262
264
|
});
|
|
263
265
|
break;
|
|
264
266
|
case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
|
|
265
267
|
break;
|
|
266
268
|
case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
|
|
267
269
|
if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
|
|
268
270
|
const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
|
|
269
271
|
getShoppingGuideParams &&
|
|
270
272
|
this.jdJumpToShopActivity(
|
|
271
273
|
Object.assign({}, getShoppingGuideParams, {
|
|
272
274
|
logEventInfo,
|
|
273
275
|
}),
|
|
274
276
|
);
|
|
275
277
|
}
|
|
276
278
|
break;
|
|
277
279
|
case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
|
|
278
280
|
const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
|
|
279
281
|
const search = linkUrl.match(/\?.+/);
|
|
280
282
|
if (search) {
|
|
281
283
|
const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
|
|
282
284
|
parseQueryUrlString(linkUrl);
|
|
283
285
|
try {
|
|
284
286
|
miniQueryData.param = JSON.parse(<string>miniQueryData?.param);
|
|
285
287
|
} catch (e) {
|
|
286
288
|
console.warn('解析小程序 param 错误:', miniQueryData.param);
|
|
287
289
|
}
|
|
288
290
|
this.jdJumpToMiniProgram(miniQueryData);
|
|
289
291
|
} else {
|
|
290
292
|
console.warn('小程序地址错误:', linkUrl);
|
|
291
293
|
}
|
|
292
294
|
break;
|
|
293
295
|
}
|
|
294
296
|
default:
|
|
295
297
|
}
|
|
296
298
|
}
|
|
297
299
|
|
|
298
300
|
jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
|
|
299
301
|
if (isTjM) return;
|
|
300
302
|
let batchParam = isTjScence ? `coupon_batch=${couponId}` : `couponbatch=${couponId}`;
|
|
301
303
|
this.jdJumpToWeb(`${this.jumpWebUrl.jxCouponSearch}?${batchParam}`, logEventInfo);
|
|
302
304
|
}
|
|
303
305
|
|
|
304
306
|
jdNavigateToNative(
|
|
305
307
|
url: string,
|
|
306
308
|
params: {
|
|
307
309
|
logEventInfo?: object;
|
|
308
310
|
} = {},
|
|
309
311
|
successBack?: Function | undefined,
|
|
310
312
|
failBack?: Function | undefined,
|
|
311
313
|
) {
|
|
312
314
|
const { logEventInfo } = params;
|
|
313
315
|
const getEparam = logEventInfo || params;
|
|
314
316
|
if (url.indexOf('tjshop') == -1) {
|
|
315
317
|
url = url + this.getTjShopParam();
|
|
316
318
|
}
|
|
317
319
|
console.log(`url:::::::${url}`);
|
|
318
320
|
global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
|
|
319
321
|
this.clickEventLog(getEparam)
|
|
320
322
|
.then(() => {
|
|
321
323
|
typeof successBack === 'function' ? successBack(url) : (window.location.href = url);
|
|
322
324
|
})
|
|
323
325
|
.catch(() => {
|
|
324
326
|
typeof failBack === 'function' && failBack(url);
|
|
325
327
|
});
|
|
326
328
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import global from '../common'
|
|
2
1
|
console.log('window.shopGlobalSwitch:', JSON.stringify(window.shopGlobalSwitch))
|
|
3
2
|
console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的if')
|
|
4
3
|
this.jingGouMiniState = true
|
|
5
4
|
window.isJingGouMiniViewState = true
|
|
6
5
|
console.log('进入了 iwx?.miniProgram then 但是没有继续跳转的逻辑 ')
|
|
7
6
|
global.info.isJingGouMiniViewState = true
|
|
8
7
|
console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的esle')
|
|
9
8
|
}
|
|
9
|
+
import global from '../common';
|
|
10
10
|
objectToUrlEncode,
|
|
11
11
|
isH5AndJingGouMini,
|
|
12
12
|
public jingGouMiniState: boolean;
|
|
13
13
|
private isH5OpenToWxapp: boolean;
|
|
14
14
|
constructor(opt) {
|
|
15
15
|
super(opt);
|
|
16
16
|
this.jingGouMiniState = false;
|
|
17
17
|
this.getConfig(opt);
|
|
18
18
|
console.log('window.shopGlobalSwitch:', JSON.stringify(window.shopGlobalSwitch));
|
|
19
19
|
this.isH5OpenToWxapp = window.shopGlobalSwitch?.openMobileShopToWxApp == 'true';
|
|
20
20
|
this.init();
|
|
21
21
|
}
|
|
22
22
|
getConfig(opt) {
|
|
23
23
|
return Object.assign(this, {}, defaultConfig, super.getConfig(opt), opt);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
async init() {
|
|
28
28
|
if (window.isJingGouMiniViewState) {
|
|
29
29
|
this.jingGouMiniState = true;
|
|
30
30
|
} else {
|
|
31
31
|
console.log('初始化进行小程序环境检查, 当前是否是京购小程序里的H5', isH5AndJingGouMini);
|
|
32
32
|
if (isH5AndJingGouMini && this.isH5OpenToWxapp) {
|
|
33
33
|
console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的if');
|
|
34
34
|
this.jingGouMiniState = true;
|
|
35
35
|
window.isJingGouMiniViewState = true;
|
|
36
36
|
console.log('进入了 iwx?.miniProgram then 但是没有继续跳转的逻辑 ');
|
|
37
37
|
global.info.isJingGouMiniViewState = true;
|
|
38
38
|
} else {
|
|
39
39
|
console.log('进入了 isH5AndJingGouMini && this.isH5OpenToWxapp 的esle');
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
jdJumpToMiniPage(pageUrl, logEventInfo, type = 'navigateTo') {
|
|
45
45
|
this.jdNavigateToNative(
|
|
46
46
|
pageUrl,
|
|
47
47
|
logEventInfo,
|
|
48
48
|
() => {
|
|
49
49
|
console.log('JD.wxappext.goto');
|
|
50
50
|
wx?.miniProgram[type] &&
|
|
51
51
|
wx?.miniProgram[type]({
|
|
52
52
|
url: pageUrl,
|
|
53
53
|
});
|
|
54
54
|
},
|
|
55
55
|
() => {
|
|
56
56
|
console.log('JD.wxappext.goto2');
|
|
57
57
|
wx?.miniProgram[type] &&
|
|
58
58
|
wx?.miniProgram[type]({
|
|
59
59
|
url: pageUrl,
|
|
60
60
|
});
|
|
61
61
|
},
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
|
|
66
66
|
console.log('web.wxapp.ts - jdJumpToTabAllProduct');
|
|
67
67
|
if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
|
|
68
68
|
if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
|
|
69
69
|
if (this.jingGouMiniState) {
|
|
70
70
|
const param = {
|
|
71
71
|
shopId,
|
|
72
72
|
venderId,
|
|
73
73
|
tabActive: SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT],
|
|
74
74
|
};
|
|
75
75
|
const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`;
|
|
76
76
|
this.jdJumpToMiniPage(url, logEventInfo);
|
|
77
77
|
} else {
|
|
78
78
|
super.jdJumpToTabAllProduct(shopId, venderId, logEventInfo);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
jdJumpToTopTabBase(type, shopInfo = {}) {
|
|
83
83
|
const getInfo = Object.assign(
|
|
84
84
|
{},
|
|
85
85
|
{
|
|
86
86
|
shopId: global.info.queryInfo.shopId,
|
|
87
87
|
venderId: global.info.queryInfo.venderId,
|
|
88
88
|
},
|
|
89
89
|
shopInfo,
|
|
90
90
|
);
|
|
91
91
|
if (this.jingGouMiniState) {
|
|
92
92
|
const { shopId, venderId, ...otherInfo } = getInfo;
|
|
93
93
|
const param = {
|
|
94
94
|
shopId,
|
|
95
95
|
venderId,
|
|
96
96
|
tabActive: type,
|
|
97
97
|
};
|
|
98
98
|
const url = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(param)}`;
|
|
99
99
|
this.jdJumpToMiniPage(url, otherInfo);
|
|
100
100
|
} else {
|
|
101
101
|
super.jdJumpToTopTabBase(type, shopInfo);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
jdJumpToWeb(url, logEventInfo) {
|
|
106
106
|
console.log('web.wxapp.ts - jdJumpToWeb', url);
|
|
107
107
|
console.log('jingGouMiniState', this.jingGouMiniState);
|
|
108
108
|
if (this.jingGouMiniState) {
|
|
109
109
|
const encodeUrl = `${this.jumpMiniPath.h5}?encode_url=${encodeURIComponent(url)}`;
|
|
110
110
|
this.jdJumpToMiniPage(encodeUrl, logEventInfo);
|
|
111
111
|
} else {
|
|
112
112
|
super.jdJumpToWeb(url, logEventInfo);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
jdJumpToWebInner(url, logEventInfo) {
|
|
117
117
|
super.jdJumpToWeb(url, logEventInfo);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
jdJumpToProduct(skuIds, logEventInfo) {
|
|
121
121
|
if (this.jingGouMiniState) {
|
|
122
122
|
const detailUrl = `${this.jumpMiniPath.detail}?sku=${skuIds}`;
|
|
123
123
|
this.jdJumpToMiniPage(detailUrl, logEventInfo);
|
|
124
124
|
} else {
|
|
125
125
|
super.jdJumpToProduct(skuIds, logEventInfo);
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
|
|
130
130
|
const getSkuId = skuInfo?.skuId;
|
|
131
131
|
this.jdJumpToProduct(getSkuId, logEventInfo);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
jdJumpToShopHome(shopInfo) {
|
|
135
135
|
console.log('[降级H5] jdJumpToShopHome web.wxapp', shopInfo);
|
|
136
136
|
console.log(
|
|
137
137
|
'global.info.queryInfo.shopId',
|
|
138
138
|
global.info.queryInfo.shopId,
|
|
139
139
|
global.info.queryInfo.venderId,
|
|
140
140
|
);
|
|
141
141
|
const currentShopInfo = {
|
|
142
142
|
shopId: global.info.queryInfo.shopId,
|
|
143
143
|
venderId: global.info.queryInfo.venderId,
|
|
144
144
|
};
|
|
145
145
|
const restParams =
|
|
146
146
|
(shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
|
|
147
147
|
(shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
|
|
148
148
|
? {}
|
|
149
149
|
: currentShopInfo;
|
|
150
150
|
const getInfo = Object.assign({}, restParams, shopInfo);
|
|
151
151
|
const { type = 'navigateTo', ...otherShopInfo } = getInfo;
|
|
152
152
|
if (this.jingGouMiniState) {
|
|
153
153
|
let shopUrl = `${this.jumpMiniPath.shopx}${window.location.search}`;
|
|
154
154
|
if (
|
|
155
155
|
/(\/shop\/(samCenter|samCard))|(\/sale\/home)|(\/favorite)/.test(window.location.pathname)
|
|
156
156
|
) {
|
|
157
157
|
shopUrl = `${this.jumpMiniPath.shopx}?${objectToUrlEncode(
|
|
158
158
|
this.getShopIdsInfo(otherShopInfo),
|
|
159
159
|
)}`;
|
|
160
160
|
}
|
|
161
161
|
this.jdJumpToMiniPage(shopUrl, otherShopInfo, type);
|
|
162
162
|
} else {
|
|
163
163
|
super.jdJumpToShopHome(otherShopInfo);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
jdJumpToShopCategory(params) {
|
|
168
168
|
console.log('[降级H5] jdJumpToShopCategory web.wxapp');
|
|
169
169
|
const { type = 'navigateTo', ...otherShopInfo } = params;
|
|
170
170
|
console.log('获取分类跳转参数', params);
|
|
171
171
|
if (this.jingGouMiniState) {
|
|
172
172
|
this.jdJumpToTopTabBase('classify', otherShopInfo);
|
|
173
173
|
} else {
|
|
174
174
|
super.jdJumpToShopCategory(otherShopInfo);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
jdJumpToLive(liveInfo, logEventInfo = {}) {
|
|
179
179
|
if (liveInfo?.liveId) {
|
|
180
180
|
if (this.jingGouMiniState && liveInfo?.openWxappToLiveRoom) {
|
|
181
181
|
this.jdJumpToMiniPage(`${this.jumpMiniPath.jdLive}?liveId=${liveInfo.liveId}&origin=473`, {
|
|
182
182
|
logEventInfo,
|
|
183
183
|
});
|
|
184
184
|
} else {
|
|
185
185
|
this.jdJumpToWeb(
|
|
186
186
|
`${this.jumpWebUrl.mLive}/${liveInfo.liveId}?${
|
|
187
187
|
this.jingGouMiniState ? 'origin=0&appid=jdgw' : 'origin=30'
|
|
188
188
|
}`,
|
|
189
189
|
logEventInfo,
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
jdJumpToShopLight(shopInfo) {
|
|
196
196
|
if (this.jingGouMiniState) {
|
|
197
197
|
this.jdJumpToMiniPage(
|
|
198
198
|
`${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
|
|
199
199
|
this.getShopIdOrVenderIdParams(shopInfo),
|
|
200
200
|
)}`,
|
|
201
201
|
{
|
|
202
202
|
...shopInfo,
|
|
203
203
|
},
|
|
204
204
|
);
|
|
205
205
|
} else {
|
|
206
206
|
this.jdNavigateToNative(
|
|
207
207
|
`${this.jumpWebUrl.shopLight}?${objectToUrlEncode(
|
|
208
208
|
this.getShopIdOrVenderIdParams(shopInfo),
|
|
209
209
|
)}`,
|
|
210
210
|
{
|
|
211
211
|
...shopInfo,
|
|
212
212
|
},
|
|
213
213
|
);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
|
|
217
217
|
if (this.jingGouMiniState) {
|
|
218
218
|
const detailUrl = `${this.jumpMiniPath.searchCoupon}?batch=${couponId}`;
|
|
219
219
|
this.jdJumpToMiniPage(detailUrl, logEventInfo);
|
|
220
220
|
} else {
|
|
221
221
|
super.jdJumpToCouponSearchProductList(couponId, logEventInfo);
|
|
222
222
|
}
|
|
223
223
|
}
|