@conecli/cone-render 0.10.1-shop-beta.22 → 0.10.1-shop-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.ts +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +0 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/index.h5.ts +1 -1
- package/dist/common/index.jd.ts +1 -1
- package/dist/common/index.ts +1 -1
- package/dist/common/index.weapp.ts +1 -1
- package/dist/common/jdplayerSdk.weapp.tsx +1 -0
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/JdLoading/index.module.scss +0 -2
- package/dist/components/base/JdLoading/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +18 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
- package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
- package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
- package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -1
- package/dist/config/env.ts +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/interface/service.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.pc.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +179 -83
- package/dist/language/zh_CN.json +178 -82
- package/dist/language/zh_HK.json +178 -82
- package/dist/libs/openShopBridge.js +161 -0
- package/dist/libs/openShopBridge.min.js +1 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +16 -2
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +6 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -1
- package/dist/service/fetchJsonp.ts +1 -1
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/intersectionObserver.ts +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/package.json +13 -15
- package/dist/common/index.dynamic.ts +0 -1
- package/dist/components/base/Dialog/index.dynamic.module.scss +0 -126
- package/dist/components/base/Dialog/index.dynamic.tsx +0 -1
- package/dist/components/base/DynamicTest/index.dynamic.module.scss +0 -15
- package/dist/components/base/DynamicTest/index.module.scss +0 -16
- package/dist/components/base/DynamicTest/index.tsx +0 -1
- package/dist/components/base/LazyLoadImage/index.dynamic.module.scss +0 -40
- package/dist/components/base/LazyLoadImage/index.dynamic.tsx +0 -1
- package/dist/components/base/NetworkDataError/index.dynamic.module.scss +0 -95
- package/dist/components/base/NetworkDataError/index.dynamic.tsx +0 -1
- package/dist/components/base/Price/Base/index.dynamic.module.scss +0 -63
- package/dist/components/base/Price/Base/index.dynamic.tsx +0 -1
- package/dist/components/base/Price/Double/index.dynamic.module.scss +0 -172
- package/dist/components/base/Price/Double/index.dynamic.tsx +0 -1
- package/dist/jumpEventReport/index.dynamic.ts +0 -1
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/open/api/shopMember.dynamic.ts +0 -1
- package/dist/open/components/index.dynamic.ts +0 -1
- package/dist/sass/app.dynamic.scss +0 -306
- package/dist/service/fetchGateway.h5.ts +0 -1
- package/dist/service/fetchJsonp.h5.ts +0 -1
- package/dist/service/http/colorSign.dynamic.ts +0 -1
- package/dist/utils/connectNativeJsBridge.dynamic.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
- /package/dist/utils/{sColor.js → sColor.ts} +0 -0
package/dist/open/api/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import * as device from './device'
|
|
2
1
|
device,
|
|
3
2
|
environment,
|
|
4
3
|
jump,
|
|
5
4
|
storage,
|
|
6
5
|
util,
|
|
7
6
|
moduleUtil,
|
|
8
7
|
track,
|
|
9
8
|
trackPromise,
|
|
10
9
|
global,
|
|
11
10
|
http,
|
|
12
11
|
fetchGateway,
|
|
13
12
|
fetchJsonp,
|
|
14
13
|
shopMember,
|
|
15
14
|
userToken,
|
|
16
15
|
TokenPlatform,
|
|
17
16
|
requestServer,
|
|
18
17
|
isvStorage,
|
|
18
|
+
import * as device from './device'
|
|
19
19
|
device,
|
|
20
20
|
environment,
|
|
21
21
|
jump,
|
|
22
22
|
storage,
|
|
23
23
|
util,
|
|
24
24
|
moduleUtil,
|
|
25
25
|
track,
|
|
26
26
|
trackPromise,
|
|
27
27
|
global,
|
|
28
28
|
http,
|
|
29
29
|
fetchGateway,
|
|
30
30
|
fetchJsonp,
|
|
31
31
|
shopMember,
|
|
32
32
|
userToken,
|
|
33
33
|
TokenPlatform,
|
|
34
34
|
requestServer,
|
|
35
35
|
isvStorage,
|
package/dist/open/api/track.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import { JumpEventReport, JumpEventReportPromise } from '../../jumpEventReport'
|
|
2
1
|
getCustomClickEventInfo: (obj: object, obj2: object, obj3: object, groupState?: boolean) => object
|
|
3
2
|
getCustomExposureInfo: (obj: object, obj2: object, obj3: object, groupState?: boolean) => object
|
|
4
3
|
initOpenTriggerExposure: (type: string) => void
|
|
5
4
|
logPageIdInfo: Object
|
|
6
5
|
logPnameInfo: Object
|
|
7
6
|
getFloorPointIndexClassName: (obj: object, index?: number, tip?: string) => string
|
|
8
7
|
getIsvClickEventInfo: (obj) => obj,
|
|
9
8
|
getIsvExposureInfo: (obj) => obj,
|
|
10
9
|
getCustomClickEventInfo: (obj) => obj,
|
|
11
10
|
getCustomExposureInfo: (obj) => obj,
|
|
12
11
|
initOpenTriggerExposure: () => {},
|
|
13
12
|
logPageIdInfo: {},
|
|
14
13
|
logPnameInfo: {},
|
|
15
14
|
initOpenTriggerExposure,
|
|
16
15
|
logPageIdInfo,
|
|
17
16
|
logPnameInfo
|
|
18
17
|
getCustomClickEventInfo: ReportContainerData.getCustomClickEventInfo.bind(ReportContainerData),
|
|
19
18
|
getCustomExposureInfo: ReportContainerData.getCustomExposureInfo.bind(ReportContainerData),
|
|
20
19
|
initReportBaseData: ReportContainerData.initReportBaseData.bind(ReportContainerData),
|
|
21
20
|
updateSectionTabDataInfo: ReportContainerData.updateSectionTabDataInfo.bind(ReportContainerData),
|
|
22
21
|
initOpenTriggerExposure: initOpenTriggerExposure.bind(JumpEventReport),
|
|
23
22
|
logPnameInfo: logPnameInfo,
|
|
24
23
|
logPageIdInfo: logPageIdInfo,
|
|
25
24
|
getFloorPointIndexClassName: ReportContainerData.getFloorPointIndexClassName.bind(ReportContainerData)
|
|
25
|
+
import { JumpEventReport, JumpEventReportPromise } from '../../jumpEventReport'
|
|
26
26
|
getCustomClickEventInfo: (obj: object, obj2?: object, obj3?: object, groupState?: boolean) => object
|
|
27
27
|
getCustomExposureInfo: (obj: object, obj2?: object, obj3?: object, groupState?: boolean) => object
|
|
28
28
|
getCustomNewClickEventInfo: (obj: object, obj2?: object, obj3?: object, groupState?: boolean) => object
|
|
29
29
|
getCustomNewExposureInfo: (obj: object, obj2?: object, obj3?: object, groupState?: boolean) => object
|
|
30
30
|
initOpenTriggerExposure: (type: string) => void
|
|
31
31
|
logPageIdInfo: Object
|
|
32
32
|
logPnameInfo: Object
|
|
33
33
|
getFloorPointIndexClassName: (obj: object, index?: number, tip?: string) => string
|
|
34
34
|
getIsvClickEventInfo: (obj) => obj,
|
|
35
35
|
getIsvExposureInfo: (obj) => obj,
|
|
36
36
|
getCustomClickEventInfo: (obj) => obj,
|
|
37
37
|
getCustomExposureInfo: (obj) => obj,
|
|
38
38
|
getCustomNewClickEventInfo: (obj) => obj,
|
|
39
39
|
getCustomNewExposureInfo: (obj) => obj,
|
|
40
40
|
initOpenTriggerExposure: () => {},
|
|
41
41
|
logPageIdInfo: {},
|
|
42
42
|
logPnameInfo: {},
|
|
43
43
|
initOpenTriggerExposure,
|
|
44
44
|
logPageIdInfo,
|
|
45
45
|
logPnameInfo
|
|
46
46
|
getCustomClickEventInfo: ReportContainerData.getCustomClickEventInfo.bind(ReportContainerData),
|
|
47
47
|
getCustomExposureInfo: ReportContainerData.getCustomExposureInfo.bind(ReportContainerData),
|
|
48
48
|
getCustomNewClickEventInfo: ReportContainerData.getCustomNewClickEventInfo.bind(ReportContainerData),
|
|
49
49
|
getCustomNewExposureInfo: ReportContainerData.getCustomNewExposureInfo.bind(ReportContainerData),
|
|
50
50
|
initReportBaseData: ReportContainerData.initReportBaseData.bind(ReportContainerData),
|
|
51
51
|
updateSectionTabDataInfo: ReportContainerData.updateSectionTabDataInfo.bind(ReportContainerData),
|
|
52
52
|
initOpenTriggerExposure: initOpenTriggerExposure.bind(JumpEventReport),
|
|
53
53
|
logPnameInfo: logPnameInfo,
|
|
54
54
|
logPageIdInfo: logPageIdInfo,
|
|
55
55
|
getFloorPointIndexClassName: ReportContainerData.getFloorPointIndexClassName.bind(ReportContainerData)
|
package/dist/open/api/util.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
2
1
|
dateFormat,
|
|
3
2
|
showSuccessToast,
|
|
4
3
|
showFailToast,
|
|
5
4
|
showNormalToast,
|
|
6
5
|
isJdApp,
|
|
7
6
|
isH5AndJdShopView,
|
|
8
7
|
isH5,
|
|
9
8
|
isH5AndJdShopViewH5Scroll,
|
|
10
9
|
stopNativeScrollEvent,
|
|
11
10
|
pxTransformFromData,
|
|
12
11
|
remoteCustomReport,
|
|
13
12
|
isLanguageForEn,
|
|
14
13
|
lodashThrottle,
|
|
15
14
|
countStringify,
|
|
16
15
|
dateFormat,
|
|
17
16
|
countFormat: countStringify,
|
|
18
17
|
showSuccessToast,
|
|
19
18
|
showFailToast,
|
|
20
19
|
showNormalToast,
|
|
21
20
|
openDialog: openTaroEventDialog,
|
|
22
21
|
closeDialog: closeTaroEventDialog,
|
|
23
22
|
isJdApp,
|
|
24
23
|
isH5AndJdShopView,
|
|
25
24
|
isH5,
|
|
26
25
|
isH5AndJdShopViewH5Scroll,
|
|
27
26
|
stopNativeScrollEvent,
|
|
28
27
|
pxTransformFromData,
|
|
29
28
|
remoteCustomReport,
|
|
30
29
|
isLanguageForEn,
|
|
31
30
|
lodashThrottle,
|
|
31
|
+
import {
|
|
32
32
|
dateFormat,
|
|
33
33
|
showSuccessToast,
|
|
34
34
|
showFailToast,
|
|
35
35
|
showNormalToast,
|
|
36
36
|
isJdApp,
|
|
37
37
|
isH5AndJdShopView,
|
|
38
38
|
isH5,
|
|
39
39
|
isH5AndJdShopViewH5Scroll,
|
|
40
40
|
stopNativeScrollEvent,
|
|
41
41
|
pxTransformFromData,
|
|
42
42
|
remoteCustomReport,
|
|
43
43
|
isLanguageForEn,
|
|
44
44
|
isLanguageForHk,
|
|
45
45
|
languageNowType,
|
|
46
46
|
lodashThrottle,
|
|
47
47
|
countStringify,
|
|
48
48
|
dateFormat,
|
|
49
49
|
countFormat: countStringify,
|
|
50
50
|
showSuccessToast,
|
|
51
51
|
showFailToast,
|
|
52
52
|
showNormalToast,
|
|
53
53
|
openDialog: openTaroEventDialog,
|
|
54
54
|
closeDialog: closeTaroEventDialog,
|
|
55
55
|
isJdApp,
|
|
56
56
|
isH5AndJdShopView,
|
|
57
57
|
isH5,
|
|
58
58
|
isH5AndJdShopViewH5Scroll,
|
|
59
59
|
stopNativeScrollEvent,
|
|
60
60
|
pxTransformFromData,
|
|
61
61
|
remoteCustomReport,
|
|
62
62
|
isLanguageForEn,
|
|
63
63
|
isLanguageForHk,
|
|
64
64
|
languageNowType,
|
|
65
65
|
lodashThrottle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import CountDown from "../../components/base/CountDown";
|
|
2
1
|
CountDown,
|
|
3
2
|
CustomScrollView,
|
|
4
3
|
CustomImageLoadRealInfo,
|
|
5
4
|
LazyLayoutLoad,
|
|
6
5
|
LazyLoadImage,
|
|
7
6
|
Dialog,
|
|
8
7
|
Price,
|
|
9
8
|
Exposure,
|
|
10
9
|
ExposureSmart,
|
|
11
10
|
ItemViewExposureSmart,
|
|
12
11
|
InViewRender,
|
|
13
12
|
InOrOutViewObserver,
|
|
14
13
|
CustomVideo,
|
|
15
14
|
MobileCommonHeader,
|
|
16
15
|
NetworkDataError,
|
|
16
|
+
import CountDown from '../../components/base/CountDown';
|
|
17
17
|
CountDown,
|
|
18
18
|
CustomScrollView,
|
|
19
19
|
CustomImageLoadRealInfo,
|
|
20
20
|
LazyLayoutLoad,
|
|
21
21
|
LazyLoadImage,
|
|
22
22
|
Dialog,
|
|
23
23
|
Price,
|
|
24
24
|
Exposure,
|
|
25
25
|
ExposureSmart,
|
|
26
26
|
ItemViewExposureSmart,
|
|
27
27
|
InViewRender,
|
|
28
28
|
InOrOutViewObserver,
|
|
29
29
|
CustomVideo,
|
|
30
30
|
MobileCommonHeader,
|
|
31
31
|
NetworkDataError,
|
|
32
32
|
ShopLeGaoTag,
|
package/dist/open/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import taroJdBaseInfo from '../common'
|
|
2
1
|
const result = document.domain.match(/jd\.\w+$/)
|
|
3
2
|
if(result){
|
|
4
3
|
document.domain = result[0]
|
|
5
4
|
}
|
|
5
|
+
import taroJdBaseInfo from '../common'
|
|
6
6
|
const result = document.domain.match(/jd\.\w+$/)
|
|
7
7
|
if(result){
|
|
8
8
|
document.domain = result[0]
|
|
9
9
|
}
|
package/dist/sass/app.h5.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro';
|
|
2
1
|
clientVersion: '11.0.0',
|
|
3
2
|
client: 'wh5',
|
|
4
3
|
screen: `${Math.ceil(
|
|
5
4
|
getSystemInfo?.screenWidth * devicePixelRatio,
|
|
6
5
|
)}*${Math.ceil(getSystemInfo?.screenHeight * devicePixelRatio)}`,
|
|
7
6
|
area: '1_72_2799_0',
|
|
8
7
|
uuid: "-1",
|
|
9
8
|
const { area, realTimeArea } = areaInfo || {};
|
|
10
9
|
area && area !== '' && (clientParams.area = area);
|
|
11
10
|
realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
|
|
12
11
|
console.warn(
|
|
13
12
|
'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
|
|
14
13
|
areaInfo,
|
|
15
14
|
'更新后的接口底层信息',
|
|
16
15
|
clientParams,
|
|
17
16
|
);
|
|
18
17
|
functionId: string,
|
|
19
18
|
body = {},
|
|
20
19
|
options = {},
|
|
21
20
|
requestOptions = {},
|
|
22
21
|
const useBodyParams = { ...body };
|
|
23
22
|
const params = Object.assign(
|
|
24
23
|
{},
|
|
25
24
|
{
|
|
26
25
|
t: Date.now(),
|
|
27
26
|
functionId,
|
|
28
27
|
appid: 'shop_m_jd_com',
|
|
29
28
|
body: JSON.stringify(useBodyParams),
|
|
30
29
|
},
|
|
31
30
|
clientParams,
|
|
32
31
|
options,
|
|
33
32
|
{
|
|
34
33
|
area: clientParams.area,
|
|
35
34
|
client: !isJdApp && options?.client ? options?.client : clientParams.client,
|
|
36
35
|
clientVersion:
|
|
37
36
|
!isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
|
|
38
37
|
},
|
|
39
38
|
);
|
|
40
39
|
console.warn(
|
|
41
40
|
'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
|
|
42
41
|
'底层默认的clientParams',
|
|
43
42
|
clientParams,
|
|
44
43
|
'下发的options',
|
|
45
44
|
options,
|
|
46
45
|
'最后params',
|
|
47
46
|
params,
|
|
48
47
|
);
|
|
49
48
|
return http.post(api.apiFunc, params, requestOptions);
|
|
49
|
+
import Taro from '@tarojs/taro';
|
|
50
50
|
UUID,
|
|
51
51
|
isJdApp,
|
|
52
52
|
jdAppVersionStr,
|
|
53
53
|
isIosDevice,
|
|
54
54
|
isPc,
|
|
55
55
|
isJdAndIosDevice,
|
|
56
56
|
isJdAndAndroidDevice,
|
|
57
57
|
isJdAndHarmonyDevice,
|
|
58
58
|
isNewHarmonyShop,
|
|
59
59
|
passSmartCouponInfoFunctionIdList,
|
|
60
60
|
needFixClientValueToHarmonyFunctionIdList,
|
|
61
61
|
clientVersion: isJdApp && jdAppVersionStr !== '' ? jdAppVersionStr : '11.0.0',
|
|
62
62
|
client: isJdApp ? (isIosDevice ? 'apple' : 'android') : isPc ? 'pc' : 'wh5',
|
|
63
63
|
screen: `${Math.ceil(window.screen?.width * devicePixelRatio)}*${Math.ceil(
|
|
64
64
|
window.screen?.height * devicePixelRatio,
|
|
65
65
|
)}`,
|
|
66
66
|
area: '1_72_2799_0',
|
|
67
67
|
uuid: UUID,
|
|
68
68
|
const { area, realTimeArea } = areaInfo || {};
|
|
69
69
|
area && area !== '' && (clientParams.area = area);
|
|
70
70
|
realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
|
|
71
71
|
console.warn(
|
|
72
72
|
'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
|
|
73
73
|
areaInfo,
|
|
74
74
|
'更新后的接口底层信息',
|
|
75
75
|
clientParams,
|
|
76
76
|
);
|
|
77
77
|
if (isH5 && (isJdAndIosDevice || isJdAndAndroidDevice)) {
|
|
78
78
|
const smartCouponInfo = await getSmartCouponInfo();
|
|
79
79
|
if (smartCouponInfo) {
|
|
80
80
|
requestParams.smartCouponInfo = smartCouponInfo;
|
|
81
81
|
}
|
|
82
82
|
} else {
|
|
83
83
|
console.warn('🚗 ~~ handleSmartCouponInfo ~~ 不支持的环境!');
|
|
84
84
|
}
|
|
85
85
|
functionId: string,
|
|
86
86
|
body = {},
|
|
87
87
|
options = {},
|
|
88
88
|
requestOptions = {},
|
|
89
89
|
const useBodyParams = { ...body };
|
|
90
90
|
if (passSmartCouponInfoFunctionIdList.includes(functionId)) {
|
|
91
91
|
await handleSmartCouponInfo(useBodyParams);
|
|
92
92
|
}
|
|
93
93
|
const params = Object.assign(
|
|
94
94
|
{},
|
|
95
95
|
{
|
|
96
96
|
t: Date.now(),
|
|
97
97
|
functionId,
|
|
98
98
|
appid: 'shop_m_jd_com',
|
|
99
99
|
body: JSON.stringify(useBodyParams),
|
|
100
100
|
},
|
|
101
101
|
clientParams,
|
|
102
102
|
options,
|
|
103
103
|
{
|
|
104
104
|
area: clientParams.area,
|
|
105
105
|
client: !isJdApp && options?.client ? options?.client : clientParams.client,
|
|
106
106
|
clientVersion:
|
|
107
107
|
!isJdApp && options?.clientVersion ? options?.clientVersion : clientParams.clientVersion,
|
|
108
108
|
},
|
|
109
109
|
);
|
|
110
110
|
if (
|
|
111
111
|
isJdAndHarmonyDevice &&
|
|
112
112
|
(needFixClientValueToHarmonyFunctionIdList.includes(functionId) || isNewHarmonyShop)
|
|
113
113
|
) {
|
|
114
114
|
params.client = 'harmony';
|
|
115
115
|
} else {
|
|
116
116
|
}
|
|
117
117
|
console.warn(
|
|
118
118
|
'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
|
|
119
119
|
'底层默认的clientParams',
|
|
120
120
|
clientParams,
|
|
121
121
|
'下发的options',
|
|
122
122
|
options,
|
|
123
123
|
'最后params',
|
|
124
124
|
params,
|
|
125
125
|
);
|
|
126
126
|
return http.post(api.apiFunc, params, requestOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro';
|
|
2
1
|
clientVersion: '11.0.0',
|
|
3
2
|
client: 'wh5',
|
|
4
3
|
screen: `${Math.ceil(getSystemInfo?.screenWidth * devicePixelRatio)}*${Math.ceil(
|
|
5
4
|
getSystemInfo?.screenHeight * devicePixelRatio,
|
|
6
5
|
)}`,
|
|
7
6
|
area: '1_72_2799_0',
|
|
8
7
|
uuid: UUID,
|
|
9
8
|
const { area, realTimeArea } = areaInfo || {};
|
|
10
9
|
area && area !== '' && (clientParams.area = area);
|
|
11
10
|
realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
|
|
12
11
|
console.warn(
|
|
13
12
|
'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
|
|
14
13
|
areaInfo,
|
|
15
14
|
'更新后的接口底层信息',
|
|
16
15
|
clientParams,
|
|
17
16
|
);
|
|
18
17
|
functionId: string,
|
|
19
18
|
body = {},
|
|
20
19
|
options = {},
|
|
21
20
|
requestOptions = {},
|
|
22
21
|
const params = Object.assign(
|
|
23
22
|
{},
|
|
24
23
|
{
|
|
25
24
|
t: Date.now(),
|
|
26
25
|
functionId,
|
|
27
26
|
appid: 'shop_m_jd_com',
|
|
28
27
|
body: JSON.stringify(body),
|
|
29
28
|
},
|
|
30
29
|
clientParams,
|
|
31
30
|
options,
|
|
32
31
|
{
|
|
33
32
|
area: clientParams.area,
|
|
34
33
|
client: options?.client || clientParams.client,
|
|
35
34
|
clientVersion: options?.clientVersion || clientParams.clientVersion,
|
|
36
35
|
},
|
|
37
36
|
);
|
|
38
37
|
console.warn(
|
|
39
38
|
'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
|
|
40
39
|
'底层默认的clientParams',
|
|
41
40
|
clientParams,
|
|
42
41
|
'下发的options',
|
|
43
42
|
options,
|
|
44
43
|
'最后params',
|
|
45
44
|
params,
|
|
46
45
|
);
|
|
47
46
|
return http.post(api.apiFunc, params, requestOptions);
|
|
47
|
+
import Taro from '@tarojs/taro';
|
|
48
48
|
appid: 'wx_mini_app',
|
|
49
49
|
clientVersion: '11.0.0',
|
|
50
50
|
client: 'wh5',
|
|
51
51
|
area: '1_72_2799_0',
|
|
52
52
|
screen: `${Math.ceil(getSystemInfo?.screenWidth * devicePixelRatio)}*${Math.ceil(
|
|
53
53
|
getSystemInfo?.screenHeight * devicePixelRatio,
|
|
54
54
|
)}`,
|
|
55
55
|
uuid: '-1',
|
|
56
56
|
loginType: '11',
|
|
57
57
|
const { area, realTimeArea } = areaInfo || {};
|
|
58
58
|
area && area !== '' && (clientParams.area = area);
|
|
59
59
|
realTimeArea && realTimeArea !== '' && (clientParams['realTimeArea'] = realTimeArea);
|
|
60
60
|
console.warn(
|
|
61
61
|
'cone-render中对外暴露fetchGateway收到原生端获取传来的四级地址信息',
|
|
62
62
|
areaInfo,
|
|
63
63
|
'更新后的接口底层信息',
|
|
64
64
|
clientParams,
|
|
65
65
|
);
|
|
66
66
|
functionId: string,
|
|
67
67
|
body = {},
|
|
68
68
|
options = {},
|
|
69
69
|
requestOptions = {},
|
|
70
70
|
const params = Object.assign(
|
|
71
71
|
{},
|
|
72
72
|
{
|
|
73
73
|
t: Date.now(),
|
|
74
74
|
functionId,
|
|
75
75
|
appid: 'shop_m_jd_com',
|
|
76
76
|
body: JSON.stringify(body),
|
|
77
77
|
},
|
|
78
78
|
clientParams,
|
|
79
79
|
options,
|
|
80
80
|
{
|
|
81
81
|
area: clientParams.area,
|
|
82
82
|
client: options?.client || clientParams.client,
|
|
83
83
|
clientVersion: options?.clientVersion || clientParams.clientVersion,
|
|
84
84
|
},
|
|
85
85
|
);
|
|
86
86
|
console.warn(
|
|
87
87
|
'fetchGateway url:' + api.apiFunc + ',functionId:' + params.functionId,
|
|
88
88
|
'底层默认的clientParams',
|
|
89
89
|
clientParams,
|
|
90
90
|
'下发的options',
|
|
91
91
|
options,
|
|
92
92
|
'最后params',
|
|
93
93
|
params,
|
|
94
94
|
);
|
|
95
95
|
return http.post(api.apiFunc, params, requestOptions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const fetchJsonp = function (url: string | string[], options = {}) {
|
|
2
1
|
return Promise.reject(() => {
|
|
3
2
|
console.log("暂未实现jsonp的请求方式",url)
|
|
4
3
|
})
|
|
4
|
+
const defaultOptions = {
|
|
5
5
|
timeout: 5000,
|
|
6
6
|
jsonpCallback: 'callback',
|
|
7
7
|
return `jsonp_${Date.now()}_${Math.ceil(Math.random() * 100000)}`
|
|
8
8
|
try {
|
|
9
9
|
delete window[functionName]
|
|
10
10
|
} catch (e) {
|
|
11
11
|
window[functionName] = undefined
|
|
12
12
|
}
|
|
13
13
|
const script = document.getElementById(scriptId)
|
|
14
14
|
document.getElementsByTagName('head')[0].removeChild(script)
|
|
15
15
|
const timeout =
|
|
16
16
|
|
|
17
17
|
options.timeout != null ? options.timeout : defaultOptions.timeout
|
|
18
18
|
const jsonpCallback =
|
|
19
19
|
|
|
20
20
|
options.jsonpCallback != null
|
|
21
21
|
? options.jsonpCallback
|
|
22
22
|
: defaultOptions.jsonpCallback
|
|
23
23
|
let timeoutId: string | number | NodeJS.Timeout | undefined
|
|
24
24
|
return new Promise((resolve, reject) => {
|
|
25
25
|
const callbackFunction = generateCallbackFunction()
|
|
26
26
|
window[callbackFunction] = function (response: any) {
|
|
27
27
|
resolve({
|
|
28
28
|
ok: true,
|
|
29
29
|
json: function () {
|
|
30
30
|
return Promise.resolve(response)
|
|
31
31
|
},
|
|
32
32
|
})
|
|
33
33
|
if (timeoutId) clearTimeout(timeoutId)
|
|
34
34
|
removeScript(jsonpCallback + '_' + callbackFunction)
|
|
35
35
|
clearFunction(callbackFunction)
|
|
36
36
|
}
|
|
37
37
|
url += url.indexOf('?') === -1 ? '?' : '&'
|
|
38
38
|
const jsonpScript = document.createElement('script')
|
|
39
39
|
jsonpScript.setAttribute(
|
|
40
40
|
'src',
|
|
41
41
|
url + jsonpCallback + '=' + callbackFunction,
|
|
42
42
|
)
|
|
43
43
|
jsonpScript.id = jsonpCallback + '_' + callbackFunction
|
|
44
44
|
document.getElementsByTagName('head')[0].appendChild(jsonpScript)
|
|
45
45
|
timeoutId = setTimeout(() => {
|
|
46
46
|
reject(new Error(`JSONP request to ${url} timed out`))
|
|
47
47
|
clearFunction(callbackFunction)
|
|
48
48
|
removeScript(jsonpCallback + '_' + callbackFunction)
|
|
49
49
|
}, timeout)
|
|
50
50
|
})
|