@conecli/cone-render 0.8.20-shop.21 → 0.8.20-shop.211
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/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/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/index.module.scss +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +16 -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/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 +125 -69
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.module.scss +12 -0
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +32 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/Price/index.tsx +1 -1
- 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 -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 -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 -1
- 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 +178 -0
- package/dist/language/zh_CN.json +178 -0
- package/dist/language/zh_HK.json +178 -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/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 +289 -212
- package/dist/sass/base.scss +195 -137
- package/dist/service/bMallConst.ts +1 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -0
- 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/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/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 +148 -115
- package/dist/components/base/Skeleton/old.tsx +0 -1
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
- package/dist/open/api/jump.ts +0 -1
- package/dist/utils/memberFormatUtils.js +0 -1
- /package/dist/service/{bMallConst.wxapp.ts → bMallConst.weapp.ts} +0 -0
- /package/dist/service/http/{colorSign.wxapp.ts → colorSign.weapp.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { dateFormat, getRandom, JSONParse } from '../utils/utils'
|
|
2
|
const dateStr = dateFormat(new Date(), 'yyyyMMddHHmmss')
|
|
1
3
|
const randomStr = getRandom(100000, 999999)
|
|
2
4
|
const callbackName = `${prefix}_CallBack_${dateStr}_${randomStr}`
|
|
3
5
|
return callbackName
|
|
4
6
|
return new Promise((resolve, reject) => {
|
|
5
7
|
if (window.XWebView && window.XWebView.callNative) {
|
|
6
8
|
const callbackName = getCallBackName('hasBgAudio')
|
|
7
9
|
window[callbackName] = function(result: any) {
|
|
8
10
|
const parsedData = JSONParse(result)
|
|
9
11
|
if (parsedData && parsedData.hasOwnProperty('data')) {
|
|
10
12
|
resolve(parsedData.data)
|
|
11
13
|
} else {
|
|
12
14
|
console.log('hasBgAudio error result:', result)
|
|
13
15
|
reject({
|
|
14
16
|
code: -2,
|
|
15
17
|
message: 'hasBgAudio error: result is not available',
|
|
16
18
|
})
|
|
17
19
|
}
|
|
18
20
|
window[callbackName] = null
|
|
19
21
|
delete window[callbackName]
|
|
20
22
|
}
|
|
21
23
|
let jsonStr = {}
|
|
22
24
|
window.XWebView.callNative(
|
|
23
25
|
'JDPlayerJSPlugin',
|
|
24
26
|
'hasBgAudio',
|
|
25
27
|
JSON.stringify(jsonStr),
|
|
26
28
|
callbackName,
|
|
27
29
|
'',
|
|
28
30
|
)
|
|
29
31
|
} else {
|
|
30
32
|
reject({
|
|
31
33
|
code: -1,
|
|
32
34
|
message: 'hasBgAudio error: XWebView.callNative is not defined',
|
|
33
35
|
})
|
|
34
36
|
}
|
|
35
37
|
})
|
|
36
38
|
return new Promise((resolve, reject) => {
|
|
37
39
|
if (window.XWebView && window.XWebView.callNative) {
|
|
38
40
|
const callbackName = getCallBackName('pauseBgAudio')
|
|
39
41
|
window[callbackName] = function(result: any) {
|
|
40
42
|
const parsedData = JSONParse(result)
|
|
41
43
|
if (parsedData && parsedData.hasOwnProperty('data')) {
|
|
42
44
|
resolve(parsedData.data)
|
|
43
45
|
} else {
|
|
44
46
|
console.log('pauseBgAudio error result:', result)
|
|
45
47
|
reject({
|
|
46
48
|
code: -2,
|
|
47
49
|
message: 'pauseBgAudio error: result is not available',
|
|
48
50
|
})
|
|
49
51
|
}
|
|
50
52
|
window[callbackName] = null
|
|
51
53
|
delete window[callbackName]
|
|
52
54
|
}
|
|
53
55
|
let jsonStr = {}
|
|
54
56
|
window.XWebView.callNative(
|
|
55
57
|
'JDPlayerJSPlugin',
|
|
56
58
|
'pauseBgAudio',
|
|
57
59
|
JSON.stringify(jsonStr),
|
|
58
60
|
callbackName,
|
|
59
61
|
'',
|
|
60
62
|
)
|
|
61
63
|
} else {
|
|
62
64
|
reject({
|
|
63
65
|
code: -1,
|
|
64
66
|
message: 'pauseBgAudio error: XWebView.callNative is not defined',
|
|
65
67
|
})
|
|
66
68
|
}
|
|
67
69
|
})
|
|
68
70
|
return new Promise((resolve, reject) => {
|
|
69
71
|
if (window.XWebView && window.XWebView.callNative) {
|
|
70
72
|
const callbackName = getCallBackName('resumeBgAudio')
|
|
71
73
|
window[callbackName] = function(result: any) {
|
|
72
74
|
const parsedData = JSONParse(result)
|
|
73
75
|
if (parsedData && parsedData.hasOwnProperty('data')) {
|
|
74
76
|
resolve(parsedData.data)
|
|
75
77
|
} else {
|
|
76
78
|
console.log('resumeBgAudio error result:', result)
|
|
77
79
|
reject({
|
|
78
80
|
code: -2,
|
|
79
81
|
message: 'resumeBgAudio error: result is not available',
|
|
80
82
|
})
|
|
81
83
|
}
|
|
82
84
|
window[callbackName] = null
|
|
83
85
|
delete window[callbackName]
|
|
84
86
|
}
|
|
85
87
|
let jsonStr = {}
|
|
86
88
|
window.XWebView.callNative(
|
|
87
89
|
'JDPlayerJSPlugin',
|
|
88
90
|
'resumeBgAudio',
|
|
89
91
|
JSON.stringify(jsonStr),
|
|
90
92
|
callbackName,
|
|
91
93
|
'',
|
|
92
94
|
)
|
|
93
95
|
} else {
|
|
94
96
|
reject({
|
|
95
97
|
code: -1,
|
|
96
98
|
message: 'resumeBgAudio error: XWebView.callNative is not defined',
|
|
97
99
|
})
|
|
98
100
|
}
|
|
99
101
|
})
|
|
100
102
|
return new Promise((resolve, reject) => {
|
|
101
103
|
if (window.XWebView && window.XWebView.callNative) {
|
|
102
104
|
const callbackName = getCallBackName('getWifiVideoAutoPlay')
|
|
103
105
|
window[callbackName] = function(result: any) {
|
|
104
106
|
const parsedData = JSONParse(result)
|
|
105
107
|
if (parsedData && parsedData.hasOwnProperty('data')) {
|
|
106
108
|
resolve(parsedData.data)
|
|
107
109
|
} else {
|
|
108
110
|
console.log('getWifiVideoAutoPlay error result:', result)
|
|
109
111
|
reject({
|
|
110
112
|
code: -2,
|
|
111
113
|
message: 'getWifiVideoAutoPlay error: result is not available',
|
|
112
114
|
})
|
|
113
115
|
}
|
|
114
116
|
window[callbackName] = null
|
|
115
117
|
delete window[callbackName]
|
|
116
118
|
}
|
|
117
119
|
let jsonStr = {}
|
|
118
120
|
window.XWebView.callNative(
|
|
119
121
|
'JDPlayerJSPlugin',
|
|
120
122
|
'actionIsWifiVideoAutoPlay',
|
|
121
123
|
JSON.stringify(jsonStr),
|
|
122
124
|
callbackName,
|
|
123
125
|
'',
|
|
124
126
|
)
|
|
125
127
|
} else {
|
|
126
128
|
reject({
|
|
127
129
|
code: -1,
|
|
128
130
|
message:
|
|
129
131
|
'getWifiVideoAutoPlay error: XWebView.callNative is not defined',
|
|
130
132
|
})
|
|
131
133
|
}
|
|
132
134
|
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import ready from '../utils/ready'
|
|
2
|
return new Promise((resolve, reject) => {
|
|
1
3
|
ready('jmfe', timeout)
|
|
2
4
|
.then(() => {
|
|
3
5
|
registerCode(JSSDK_APP_WEBVIEW_CODE)
|
|
4
6
|
resolve(window['jmfe'])
|
|
5
7
|
})
|
|
6
8
|
.catch(() => {
|
|
7
9
|
console.log('window.jmfe不存在')
|
|
8
10
|
reject(null)
|
|
9
11
|
})
|
|
10
12
|
})
|
|
11
13
|
if (window['jmfe']) {
|
|
12
14
|
console.log('registerCode:', code)
|
|
13
15
|
window['jmfe'].registerCode(code)
|
|
14
16
|
} else {
|
|
15
17
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
16
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const getPageType = () => {
|
|
2
|
return process.env.BUILD_TYPE || ''
|
|
1
3
|
|
|
2
4
|
M_DECORATE = 'm-decorate',
|
|
3
5
|
M_RENDER_MODULE = 'm-render-module',
|
|
4
6
|
M_PREVIEW = 'm-preview',
|
|
5
7
|
M_ISV_PREVIEW = 'm-isv-preview',
|
|
6
8
|
MARKETING_PREVIEW = 'marketing-preview',
|
|
7
9
|
|
|
8
10
|
APP_VIEW = 'app-view',
|
|
9
11
|
APP_MEMBER = 'app-member',
|
|
10
12
|
APP_INTRODUCE = 'app-introduce',
|
|
11
13
|
APP_PROMOTION = 'app-promotion',
|
|
12
14
|
APP_CLASSIFY = 'app-classify',
|
|
13
15
|
APP_PRODUCT = 'app-product',
|
|
14
16
|
MEMBER_HOME = 'member-home',
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
PC_VIEW = 'pc-view',
|
|
18
20
|
PC_VIEW1 = 'pc-view1',
|
|
19
21
|
PC_VIEW2 = 'pc-view2',
|
|
20
22
|
M_VIEW = 'm-view',
|
|
21
23
|
M_BSC_VIEW = 'm-bsc-view',
|
|
22
24
|
SALE_VIEW = 'sale-view',
|
|
23
25
|
VIP_VIEW = 'vip-view',
|
|
24
26
|
M_SEARCH = 'm-search',
|
|
25
27
|
M_INTRODUCE = 'm-introduce',
|
|
26
28
|
|
|
27
29
|
MEMBER_SHOPCARD = 'member-shopcard',
|
|
28
30
|
M_MEMBER = 'm-member',
|
|
29
31
|
M_MEMBER_SAM_BIND_CARD = 'm-member-sam-bind-card',
|
|
30
32
|
M_MEMBER_WATSONS_BIND_CARD = 'm-member-watsons-bind-card',
|
|
31
33
|
M_SAM_CARD = 'm-sam-card',
|
|
32
34
|
M_SAM_CENTER = 'm-sam-center',
|
|
33
35
|
M_WATSONS_CARD = 'm-watsons-card',
|
|
34
36
|
|
|
35
37
|
M_LOTTERY = 'm-lottery',
|
|
36
38
|
M_COUPON = 'm-coupon',
|
|
37
39
|
M_WARES = 'm-wares',
|
|
38
40
|
M_FAST_SHOPPING = 'm-fast-shopping',
|
|
39
41
|
M_SPECIAL_SECKILL = 'm-special-seckill',
|
|
40
42
|
WEAPP_SHOP = 'weapp-shop',
|
|
41
43
|
WEAPP_PROMOTION = 'weapp-promotion',
|
|
42
44
|
M_VIDEOS = 'm-videos',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG = 'noType_'
|
|
2
|
IMAGE_LOAD = 'imageLazyLoadError',
|
|
1
3
|
PRICE_RENDER = 'priceRenderError',
|
|
2
4
|
GRAYSCALE = 'grayscale',
|
|
3
5
|
REMOTEMODULE_DATA = 'remoteModule_interface_dataError',
|
|
4
6
|
REMOTEMODULE_JS = 'remoteModule_render_jsError',
|
|
5
7
|
SYSTEMMODULE_JS = 'systemModule_render_jsError',
|
|
6
8
|
SYSTEMPDCMODULE_DATA = 'systemPdcModule_interface_dataError',
|
|
7
9
|
SYSTEMPDCMODULE_JS = 'systemPdcModule_render_jsError',
|
|
8
10
|
FLOORLAZYLOAD_DATA = 'floorLazyLoad_render_dataError',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import { isApp } from '../../utils/jm-common'
|
|
2
1
|
return new Promise((resolve, reject) => {
|
|
3
2
|
let platform: string = getPlatform()
|
|
4
3
|
if (platform === TokenPlatform.TYPE_JDAPP) {
|
|
5
4
|
ready('jmfe', 3000)
|
|
6
5
|
.then(() => {
|
|
7
6
|
console.log('window.jmfe已经存在:', jmfe)
|
|
8
7
|
import('./token.jd')
|
|
9
8
|
.then((data) => {
|
|
10
9
|
console.log('data:', data)
|
|
11
10
|
resolve(data)
|
|
12
11
|
})
|
|
13
12
|
.catch((err) => {
|
|
14
13
|
reject(err)
|
|
15
14
|
})
|
|
16
15
|
})
|
|
17
16
|
.catch((e) => {
|
|
18
17
|
console.log('window.jmfe不存在')
|
|
19
18
|
reject(e)
|
|
20
19
|
})
|
|
21
20
|
}
|
|
22
21
|
else if (platform === TokenPlatform.TYPE_WQ) {
|
|
23
22
|
import('./token.wxapp')
|
|
24
23
|
.then((data) => {
|
|
25
24
|
console.log('data:', data)
|
|
26
25
|
resolve(data)
|
|
27
26
|
})
|
|
28
27
|
.catch((err) => {
|
|
29
28
|
reject(err)
|
|
30
29
|
})
|
|
31
30
|
} else {
|
|
32
31
|
import('./token')
|
|
33
32
|
.then((data) => {
|
|
34
33
|
console.log('data:', data)
|
|
35
34
|
resolve(data)
|
|
36
35
|
})
|
|
37
36
|
.catch((err) => {
|
|
38
37
|
reject(err)
|
|
39
38
|
})
|
|
40
39
|
}
|
|
41
40
|
})
|
|
42
41
|
console.log(e);
|
|
43
42
|
return {}
|
|
44
43
|
return new Promise((resolve) => {
|
|
45
44
|
loadTokenPromise
|
|
46
45
|
.then((proxy: any) => {
|
|
47
46
|
if (proxy?.isLogin) {
|
|
48
47
|
proxy?.isLogin().then((data: boolean) => {
|
|
49
48
|
resolve(data)
|
|
50
49
|
})
|
|
51
50
|
} else {
|
|
52
51
|
resolve(false)
|
|
53
52
|
}
|
|
54
53
|
})
|
|
55
54
|
.catch((err) => {
|
|
56
55
|
resolve(false)
|
|
57
56
|
})
|
|
58
57
|
})
|
|
59
58
|
return new Promise((resolve) => {
|
|
60
59
|
loadTokenPromise
|
|
61
60
|
.then((proxy: any) => {
|
|
62
61
|
if (proxy?.getIsvToken) {
|
|
63
62
|
proxy?.getIsvToken().then((data: string) => {
|
|
64
63
|
resolve(data)
|
|
65
64
|
})
|
|
66
65
|
} else {
|
|
67
66
|
resolve('')
|
|
68
67
|
}
|
|
69
68
|
})
|
|
70
69
|
.catch((err) => {
|
|
71
70
|
resolve('')
|
|
72
71
|
})
|
|
73
72
|
})
|
|
74
73
|
return new Promise((resolve) => {
|
|
75
74
|
loadTokenPromise
|
|
76
75
|
.then((proxy: any) => {
|
|
77
76
|
if (proxy?.toLogin) {
|
|
78
77
|
proxy?.toLogin(options)
|
|
79
78
|
resolve(true)
|
|
80
79
|
} else {
|
|
81
80
|
resolve(false)
|
|
82
81
|
}
|
|
83
82
|
})
|
|
84
83
|
.catch((err) => {
|
|
85
84
|
resolve(false)
|
|
86
85
|
})
|
|
87
86
|
})
|
|
88
87
|
let platform = TokenPlatform.TYPE_M
|
|
89
88
|
if (isApp('jd')) {
|
|
90
89
|
platform = TokenPlatform.TYPE_JDAPP
|
|
91
90
|
}
|
|
92
91
|
else if (isApp('wx') && isApp('mp')) {
|
|
93
92
|
platform = TokenPlatform.TYPE_WQ
|
|
94
93
|
}
|
|
95
94
|
return platform
|
|
96
95
|
let platform = getPlatform()
|
|
97
96
|
let source = platform
|
|
98
97
|
if (platform === TokenPlatform.TYPE_M || platform === TokenPlatform.TYPE_WQ) {
|
|
99
98
|
source = TokenPlatform.TYPE_JDAPP
|
|
100
99
|
}
|
|
101
100
|
return source
|
|
102
101
|
return window?.page_data?.pageChannel || ''
|
|
102
|
+
import global from '../../common';
|
|
103
103
|
return new Promise((resolve, reject) => {
|
|
104
104
|
let platform: string = getPlatform();
|
|
105
105
|
if (platform === TokenPlatform.TYPE_JDAPP) {
|
|
106
106
|
global
|
|
107
107
|
.jmfeReayPromise()
|
|
108
108
|
.then(() => {
|
|
109
109
|
console.log(
|
|
110
110
|
'loadTokenAsync window.jmfe已经存在:',
|
|
111
111
|
window?.jmfe,
|
|
112
112
|
'当前版本',
|
|
113
113
|
window?.jmfe?.VERSION,
|
|
114
114
|
);
|
|
115
115
|
import('./token.jd')
|
|
116
116
|
.then((data) => {
|
|
117
117
|
console.log('data:', data);
|
|
118
118
|
resolve(data);
|
|
119
119
|
})
|
|
120
120
|
.catch((err) => {
|
|
121
121
|
reject(err);
|
|
122
122
|
});
|
|
123
123
|
})
|
|
124
124
|
.catch((e) => {
|
|
125
125
|
console.log('window.jmfe不存在');
|
|
126
126
|
reject(e);
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
else if (platform === TokenPlatform.TYPE_WQ) {
|
|
130
130
|
import('./token.wxapp')
|
|
131
131
|
.then((data) => {
|
|
132
132
|
console.log('data:', data);
|
|
133
133
|
resolve(data);
|
|
134
134
|
})
|
|
135
135
|
.catch((err) => {
|
|
136
136
|
reject(err);
|
|
137
137
|
});
|
|
138
138
|
} else {
|
|
139
139
|
import('./token')
|
|
140
140
|
.then((data) => {
|
|
141
141
|
console.log('data:', data);
|
|
142
142
|
resolve(data);
|
|
143
143
|
})
|
|
144
144
|
.catch((err) => {
|
|
145
145
|
reject(err);
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
console.log(e);
|
|
150
150
|
return {};
|
|
151
151
|
return new Promise((resolve) => {
|
|
152
152
|
loadTokenPromise
|
|
153
153
|
.then((proxy: any) => {
|
|
154
154
|
if (proxy?.isLogin) {
|
|
155
155
|
proxy?.isLogin().then((data: boolean) => {
|
|
156
156
|
resolve(data);
|
|
157
157
|
});
|
|
158
158
|
} else {
|
|
159
159
|
resolve(false);
|
|
160
160
|
}
|
|
161
161
|
})
|
|
162
162
|
.catch((err) => {
|
|
163
163
|
console.log(err);
|
|
164
164
|
resolve(false);
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
167
|
return new Promise((resolve) => {
|
|
168
168
|
loadTokenPromise
|
|
169
169
|
.then((proxy: any) => {
|
|
170
170
|
if (proxy?.getIsvToken) {
|
|
171
171
|
proxy?.getIsvToken().then((data: string) => {
|
|
172
172
|
resolve(data);
|
|
173
173
|
});
|
|
174
174
|
} else {
|
|
175
175
|
resolve('');
|
|
176
176
|
}
|
|
177
177
|
})
|
|
178
178
|
.catch((err) => {
|
|
179
179
|
console.log(err);
|
|
180
180
|
resolve('');
|
|
181
181
|
});
|
|
182
182
|
});
|
|
183
183
|
return new Promise((resolve) => {
|
|
184
184
|
loadTokenPromise
|
|
185
185
|
.then((proxy: any) => {
|
|
186
186
|
if (proxy?.toLogin) {
|
|
187
187
|
proxy?.toLogin(options);
|
|
188
188
|
resolve(true);
|
|
189
189
|
} else {
|
|
190
190
|
resolve(false);
|
|
191
191
|
}
|
|
192
192
|
})
|
|
193
193
|
.catch((err) => {
|
|
194
194
|
console.log(err);
|
|
195
195
|
resolve(false);
|
|
196
196
|
});
|
|
197
197
|
});
|
|
198
198
|
let platform = TokenPlatform.TYPE_M;
|
|
199
199
|
if (isApp('jd')) {
|
|
200
200
|
platform = TokenPlatform.TYPE_JDAPP;
|
|
201
201
|
}
|
|
202
202
|
else if (isApp('wx') && isApp('mp')) {
|
|
203
203
|
platform = TokenPlatform.TYPE_WQ;
|
|
204
204
|
}
|
|
205
205
|
return platform;
|
|
206
206
|
let platform = getPlatform();
|
|
207
207
|
let source = platform;
|
|
208
208
|
if (platform === TokenPlatform.TYPE_M || platform === TokenPlatform.TYPE_WQ) {
|
|
209
209
|
source = TokenPlatform.TYPE_JDAPP;
|
|
210
210
|
}
|
|
211
211
|
return source;
|
|
212
212
|
return window?.page_data?.pageChannel || '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
console.log('load token.jd')
|
|
2
1
|
return new Promise((resolve) => {
|
|
3
2
|
if (jmfe) {
|
|
4
3
|
jmfe.isJDAppLogin().then(({ data }) => {
|
|
5
4
|
if (data === '1') {
|
|
6
5
|
resolve(true)
|
|
7
6
|
} else if (data === '0') {
|
|
8
7
|
resolve(false)
|
|
9
8
|
}
|
|
10
9
|
})
|
|
11
10
|
} else {
|
|
12
11
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
13
12
|
resolve(false)
|
|
14
13
|
}
|
|
15
14
|
})
|
|
16
15
|
return requestIsvToken(window.location.href)
|
|
17
16
|
if (jmfe) {
|
|
18
17
|
jmfe.toLogin(options)
|
|
19
18
|
} else {
|
|
20
19
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
21
20
|
}
|
|
22
21
|
if (jmfe) {
|
|
23
22
|
console.log('registerCode:', code)
|
|
24
23
|
jmfe.registerCode(code)
|
|
25
24
|
} else {
|
|
26
25
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
27
26
|
}
|
|
28
27
|
return new Promise((resolve) => {
|
|
29
28
|
console.log('requestIsvToken:', url)
|
|
30
29
|
if (jmfe) {
|
|
31
30
|
jmfe
|
|
32
31
|
.requestIsvToken(url)
|
|
33
32
|
.then((result: any) => {
|
|
34
33
|
console.log('requestIsvToken result:' + JSON.stringify(result))
|
|
35
34
|
const { status, data, msg } = result
|
|
36
35
|
if (status === '0') {
|
|
37
36
|
resolve(data || '')
|
|
38
37
|
} else {
|
|
39
38
|
resolve('')
|
|
40
39
|
}
|
|
41
40
|
})
|
|
42
41
|
.catch((e: any) => {
|
|
43
42
|
console.log('requestIsvToken error:' + JSON.stringify(e))
|
|
44
43
|
resolve('')
|
|
45
44
|
})
|
|
46
45
|
} else {
|
|
47
46
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
48
47
|
resolve('')
|
|
49
48
|
}
|
|
50
49
|
})
|
|
50
|
+
import {isJdAndHarmonyDevice, draBusinessCustomReport} from '../../utils/h5Utils'
|
|
51
51
|
draBusinessCustomReport({
|
|
52
52
|
type,
|
|
53
53
|
errMsg,
|
|
54
54
|
data,
|
|
55
55
|
});
|
|
56
56
|
return new Promise(resolve => {
|
|
57
57
|
if (window['jmfe']) {
|
|
58
58
|
window['jmfe'].isJDAppLogin().then(({ data }) => {
|
|
59
59
|
if (data === '1') {
|
|
60
60
|
resolve(true)
|
|
61
61
|
} else if (data === '0') {
|
|
62
62
|
resolve(false)
|
|
63
63
|
}
|
|
64
64
|
})
|
|
65
65
|
} else {
|
|
66
66
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
67
67
|
resolve(false)
|
|
68
68
|
}
|
|
69
69
|
})
|
|
70
70
|
return requestIsvToken(window.location.href)
|
|
71
71
|
if (window['jmfe']) {
|
|
72
72
|
window['jmfe'].toLogin(options)
|
|
73
73
|
} else {
|
|
74
74
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
75
75
|
}
|
|
76
76
|
if (window['jmfe']) {
|
|
77
77
|
console.log('registerCode:', code)
|
|
78
78
|
window['jmfe'].registerCode(code)
|
|
79
79
|
} else {
|
|
80
80
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
81
81
|
}
|
|
82
82
|
const plugin = 'JDHybridLoginPlugin';
|
|
83
83
|
const action = 'requestIsvToken';
|
|
84
84
|
const params = {url};
|
|
85
85
|
return jmfe.callNative(plugin, action, params)
|
|
86
86
|
return new Promise(resolve => {
|
|
87
87
|
console.log('requestIsvToken:', url)
|
|
88
88
|
if (window['jmfe']) {
|
|
89
89
|
const jmfeVersion = window['jmfe'].VERSION || 'unknow';
|
|
90
90
|
try{
|
|
91
91
|
(isJdAndHarmonyDevice? requestIsvTokenHarmony(url): window['jmfe'].requestIsvToken(url))
|
|
92
92
|
.then((result: any) => {
|
|
93
93
|
console.log('requestIsvToken result:' + JSON.stringify(result))
|
|
94
94
|
const { status, data } = result
|
|
95
95
|
if (status === '0') {
|
|
96
96
|
resolve(data || '')
|
|
97
97
|
} else {
|
|
98
98
|
resolve('')
|
|
99
99
|
}
|
|
100
100
|
if(!data){
|
|
101
101
|
exceptionReport({
|
|
102
102
|
data: {
|
|
103
103
|
desc: '调用API有返回,但token值为空',
|
|
104
104
|
jmfeVersion,
|
|
105
105
|
originResult: result,
|
|
106
106
|
url,
|
|
107
107
|
}
|
|
108
108
|
})
|
|
109
109
|
}
|
|
110
110
|
})
|
|
111
111
|
}catch(error){
|
|
112
112
|
resolve('')
|
|
113
113
|
const errorInfo = {
|
|
114
114
|
name: error?.name,
|
|
115
115
|
message: error?.message,
|
|
116
116
|
stack: error?.stack,
|
|
117
117
|
};
|
|
118
118
|
exceptionReport({
|
|
119
119
|
data: {
|
|
120
120
|
desc: '调用API发生异常',
|
|
121
121
|
jmfeVersion,
|
|
122
122
|
error: errorInfo,
|
|
123
123
|
url
|
|
124
124
|
}
|
|
125
125
|
})
|
|
126
126
|
}
|
|
127
127
|
} else {
|
|
128
128
|
resolve('')
|
|
129
129
|
exceptionReport({
|
|
130
130
|
data: {
|
|
131
131
|
desc: '前置依赖window.jmfe不存在',
|
|
132
132
|
}
|
|
133
133
|
})
|
|
134
134
|
}
|
|
135
135
|
})
|