@conecli/cone-render 0.9.1-shop2.0 → 0.9.1-shop2.10
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/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/jssdk.ts +1 -0
- package/dist/common/pageType.ts +1 -0
- package/dist/common/sgmCustomCode.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/token/token.ts +1 -1
- package/dist/common/wxappApi.jd.ts +1 -0
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.module.scss +7 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +5 -0
- package/dist/components/base/Dialog/index.tsx +1 -1
- package/dist/components/base/Exposure/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.module.scss +20 -20
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +9 -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 +4 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/floorItem.jd.tsx +1 -1
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/floorItem.weapp.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/interface/service.ts +1 -1
- package/dist/interface/utils.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.jd.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.jdb.ts +1 -1
- package/dist/jumpEventReport/web.jdjch.ts +1 -1
- package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
- package/dist/jumpEventReport/web.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/modules/ContainerFloorList/index.h5.module.scss +17 -1
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/jump copy.ts +1 -1
- package/dist/open/api/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 +39 -3
- package/dist/sass/base.scss +12 -0
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/http/const.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
- package/dist/utils/draExceptionAndProfile.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/jm-common.js +1 -1
- package/dist/utils/sgmCodeUtils.ts +1 -0
- package/dist/utils/taroRenderUtil.ts +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
WXAPP_SUBS_GUIDER
|
|
3
2
|
floorVideInfo: {},
|
|
4
3
|
public config: {
|
|
5
4
|
[key: string]: any
|
|
6
5
|
}
|
|
7
6
|
this.config = {}
|
|
8
7
|
this.wxAppSubsGuider = WXAPP_SUBS_GUIDER
|
|
9
8
|
console.log('=================>', 'updateBusinessDomainAndApi')
|
|
10
9
|
|
|
11
10
|
setTimeout(() => {
|
|
12
11
|
console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
|
|
13
12
|
this.getLoginCookie(`${Date.now()}`)
|
|
14
13
|
},500)
|
|
15
14
|
this.getLoginCookie(`${Date.now()}`)
|
|
16
15
|
setTimeout(() => {
|
|
17
16
|
console.log("微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
|
|
18
17
|
this.getLoginCookie(`${Date.now()}`)
|
|
19
18
|
},500)
|
|
20
19
|
return new Promise((resolve) => {
|
|
21
20
|
console.log("开始获取更新wxapp中的cookie信息", updateKey)
|
|
22
21
|
if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
|
|
23
22
|
console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
|
|
24
23
|
resolve({
|
|
25
24
|
wqCookie: this.config.wqCookie,
|
|
26
25
|
wqCookieStr: this.config.wqCookieStr,
|
|
27
26
|
})
|
|
28
27
|
}else {
|
|
29
28
|
if (isPublishToWxapp) {
|
|
30
29
|
const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
|
|
31
30
|
if (getWxappCookieObj) {
|
|
32
31
|
const getCookieObj = getWxappCookieObj['_data']
|
|
33
32
|
const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
|
|
34
33
|
const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
|
|
35
34
|
this.info.loginState = true
|
|
36
35
|
this.info.userInfo.wqCookie = wqCookieStr
|
|
37
36
|
this.info.userInfo.wqVisitkey = visitkey
|
|
38
37
|
console.log('获取用户完整cookie信息', getCookieObj)
|
|
39
38
|
const getUserAddress = this.wxAppUserInfoInstance.getAddress()
|
|
40
39
|
console.log('获取微信用户地址信息', getUserAddress)
|
|
41
40
|
if (getUserAddress) {
|
|
42
41
|
this.info.pageInfo.address = getUserAddress?.areaId
|
|
43
42
|
this.info.pageInfo.addressCommaStr = this.info.pageInfo
|
|
44
43
|
.address
|
|
45
44
|
? this.info.pageInfo.address.replace(/_/g, ',')
|
|
46
45
|
: ''
|
|
47
46
|
this.info.pageInfo.un_area = this.info.pageInfo.address
|
|
48
47
|
Taro.eventCenter.trigger(
|
|
49
48
|
TaroEventType.USER_AREA_UPDATE,
|
|
50
49
|
this.info.pageInfo.address,
|
|
51
50
|
)
|
|
52
51
|
}
|
|
53
52
|
if(this.miniAppLogInstance){
|
|
54
53
|
this.miniAppLogInstance.set({
|
|
55
54
|
account: pin,
|
|
56
55
|
unionid: wq_unionid,
|
|
57
56
|
openid: wxapp_openid,
|
|
58
57
|
})
|
|
59
58
|
}
|
|
60
59
|
this.config.wqCookie = wqCookie
|
|
61
60
|
this.config.wqCookieStr = wqCookieStr
|
|
62
61
|
this.config.getWqCookieKey = updateKey
|
|
63
62
|
console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
|
|
64
63
|
resolve({
|
|
65
64
|
wqCookie,
|
|
66
65
|
wqCookieStr,
|
|
67
66
|
})
|
|
68
67
|
}else {
|
|
69
68
|
console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
|
|
70
69
|
resolve({
|
|
71
70
|
wqCookie: false,
|
|
72
71
|
wqCookieStr: false,
|
|
73
72
|
})
|
|
74
73
|
}
|
|
75
74
|
}else {
|
|
76
75
|
resolve({
|
|
77
76
|
wqCookie: false,
|
|
78
77
|
wqCookieStr: false,
|
|
79
78
|
})
|
|
80
79
|
}
|
|
81
80
|
}
|
|
82
81
|
})
|
|
82
|
+
import Taro from '@tarojs/taro'
|
|
83
83
|
WXAPP_SUBS_GUIDER
|
|
84
84
|
WXAPP_BIZ_SHOP_LIGHT_KEY
|
|
85
85
|
floorVideInfo: {},
|
|
86
86
|
productVideInfo: {},
|
|
87
87
|
isVipShop: false,
|
|
88
88
|
isJdShowNativeImmersivePlayer: false,
|
|
89
89
|
pageIdxHeightInfo: {
|
|
90
90
|
list: []
|
|
91
91
|
},
|
|
92
92
|
jdBottomBarHeight: 0,
|
|
93
93
|
jdNativeHeaderHeight: 0,
|
|
94
94
|
shopInfo: {},
|
|
95
95
|
openAppData: {}
|
|
96
96
|
public config: {
|
|
97
97
|
[key: string]: any
|
|
98
98
|
}
|
|
99
99
|
this.config = {}
|
|
100
100
|
this.wxAppSubsGuider = WXAPP_SUBS_GUIDER
|
|
101
101
|
|
|
102
102
|
taskTimeoutPromise(callBack, timeout = 2000){
|
|
103
103
|
return new Promise((resolve) => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const getCallBackRes = typeof callBack === 'function' && callBack()
|
|
106
106
|
return resolve(getCallBackRes || false)
|
|
107
107
|
}, timeout)
|
|
108
108
|
})
|
|
109
109
|
}
|
|
110
110
|
console.log('=================>', 'updateBusinessDomainAndApi')
|
|
111
111
|
|
|
112
112
|
checkStatusAndLogin(options = {}) {
|
|
113
113
|
|
|
114
114
|
checkJdStatusAndLogin(options = {
|
|
115
115
|
loginColor: {
|
|
116
116
|
bzi: WXAPP_BIZ_SHOP_LIGHT_KEY,
|
|
117
117
|
dpin: 0,
|
|
118
118
|
},
|
|
119
119
|
}){
|
|
120
120
|
return this.checkStatusAndLogin(options)
|
|
121
121
|
}
|
|
122
122
|
loginColor: {
|
|
123
123
|
bzi:WXAPP_BIZ_KEY,
|
|
124
124
|
dpin: 1,
|
|
125
125
|
},
|
|
126
126
|
setTimeout(() => {
|
|
127
127
|
console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
|
|
128
128
|
this.getLoginCookie(`${Date.now()}`)
|
|
129
129
|
},500)
|
|
130
130
|
this.getLoginCookie(`${Date.now()}`)
|
|
131
131
|
loginColor: {
|
|
132
132
|
bzi:WXAPP_BIZ_KEY,
|
|
133
133
|
dpin: 1,
|
|
134
134
|
},
|
|
135
135
|
setTimeout(() => {
|
|
136
136
|
console.log("微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
|
|
137
137
|
this.getLoginCookie(`${Date.now()}`)
|
|
138
138
|
},500)
|
|
139
139
|
|
|
140
140
|
doLoginForJdPin(options = {}) {
|
|
141
141
|
return this.doLogin({
|
|
142
142
|
loginColor: {
|
|
143
143
|
biz: WXAPP_BIZ_SHOP_LIGHT_KEY,
|
|
144
144
|
dpin: 0,
|
|
145
145
|
},
|
|
146
146
|
...options
|
|
147
147
|
})
|
|
148
148
|
}
|
|
149
149
|
return new Promise((resolve) => {
|
|
150
150
|
console.log("开始获取更新wxapp中的cookie信息", updateKey)
|
|
151
151
|
if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
|
|
152
152
|
console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
|
|
153
153
|
resolve({
|
|
154
154
|
wqCookie: this.config.wqCookie,
|
|
155
155
|
wqCookieStr: this.config.wqCookieStr,
|
|
156
156
|
})
|
|
157
157
|
}else {
|
|
158
158
|
if (isPublishToWxapp) {
|
|
159
159
|
const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
|
|
160
160
|
if (getWxappCookieObj) {
|
|
161
161
|
const getCookieObj = getWxappCookieObj['_data']
|
|
162
162
|
const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
|
|
163
163
|
const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
|
|
164
164
|
this.info.loginState = true
|
|
165
165
|
this.info.userInfo.wqCookie = wqCookieStr
|
|
166
166
|
this.info.userInfo.wqVisitkey = visitkey
|
|
167
167
|
console.log('获取用户完整cookie信息', getCookieObj)
|
|
168
168
|
const getUserAddress = this.wxAppUserInfoInstance.getAddress()
|
|
169
169
|
console.log('获取微信用户地址信息', getUserAddress)
|
|
170
170
|
if (getUserAddress) {
|
|
171
171
|
this.info.pageInfo.address = getUserAddress?.areaId
|
|
172
172
|
this.info.pageInfo.addressCommaStr = this.info.pageInfo
|
|
173
173
|
.address
|
|
174
174
|
? this.info.pageInfo.address.replace(/_/g, ',')
|
|
175
175
|
: ''
|
|
176
176
|
this.info.pageInfo.un_area = this.info.pageInfo.address
|
|
177
177
|
Taro.eventCenter.trigger(
|
|
178
178
|
TaroEventType.USER_AREA_UPDATE,
|
|
179
179
|
this.info.pageInfo.address,
|
|
180
180
|
)
|
|
181
181
|
}
|
|
182
182
|
if(this.miniAppLogInstance){
|
|
183
183
|
this.miniAppLogInstance.set({
|
|
184
184
|
account: pin,
|
|
185
185
|
unionid: wq_unionid,
|
|
186
186
|
openid: wxapp_openid,
|
|
187
187
|
})
|
|
188
188
|
}
|
|
189
189
|
this.config.wqCookie = wqCookie
|
|
190
190
|
this.config.wqCookieStr = wqCookieStr
|
|
191
191
|
this.config.getWqCookieKey = updateKey
|
|
192
192
|
console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
|
|
193
193
|
resolve({
|
|
194
194
|
wqCookie,
|
|
195
195
|
wqCookieStr,
|
|
196
196
|
})
|
|
197
197
|
}else {
|
|
198
198
|
console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
|
|
199
199
|
resolve({
|
|
200
200
|
wqCookie: false,
|
|
201
201
|
wqCookieStr: false,
|
|
202
202
|
})
|
|
203
203
|
}
|
|
204
204
|
}else {
|
|
205
205
|
resolve({
|
|
206
206
|
wqCookie: false,
|
|
207
207
|
wqCookieStr: false,
|
|
208
208
|
})
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
})
|
|
212
212
|
|
|
213
213
|
getAddressCachePromise = () => {
|
|
214
214
|
return Promise.reject("该方法只在APP内适用")
|
|
215
215
|
}
|
|
216
216
|
this.info.originQueryInfo = {
|
|
217
217
|
...query
|
|
218
218
|
}
|
|
@@ -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
|
|
|
15
17
|
|
|
16
18
|
PC_VIEW = 'pc-view',
|
|
17
19
|
PC_VIEW1 = 'pc-view1',
|
|
18
20
|
PC_VIEW2 = 'pc-view2',
|
|
19
21
|
M_VIEW = 'm-view',
|
|
20
22
|
M_BSC_VIEW = 'm-bsc-view',
|
|
21
23
|
SALE_VIEW = 'sale-view',
|
|
22
24
|
VIP_VIEW = 'vip-view',
|
|
23
25
|
M_SEARCH = 'm-search',
|
|
24
26
|
M_INTRODUCE = 'm-introduce',
|
|
25
27
|
|
|
26
28
|
MEMBER_SHOPCARD = 'member-shopcard',
|
|
27
29
|
M_MEMBER = 'm-member',
|
|
28
30
|
M_MEMBER_SAM_BIND_CARD = 'm-member-sam-bind-card',
|
|
29
31
|
M_MEMBER_WATSONS_BIND_CARD = 'm-member-watsons-bind-card',
|
|
30
32
|
M_SAM_CARD = 'm-sam-card',
|
|
31
33
|
M_SAM_CENTER = 'm-sam-center',
|
|
32
34
|
M_WATSONS_CARD = 'm-watsons-card',
|
|
33
35
|
|
|
34
36
|
M_LOTTERY = 'm-lottery',
|
|
35
37
|
M_COUPON = 'm-coupon',
|
|
36
38
|
M_WARES = 'm-wares',
|
|
37
39
|
M_FAST_SHOPPING = 'm-fast-shopping',
|
|
38
40
|
M_SPECIAL_SECKILL = 'm-special-seckill',
|
|
39
41
|
WEAPP_SHOP = 'weapp-shop',
|
|
40
42
|
WEAPP_PROMOTION = 'weapp-promotion',
|
|
41
43
|
M_VIDEOS = 'm-videos',
|
|
@@ -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 { isApp } from '../../utils/jm-common'
|
|
103
103
|
return new Promise((resolve, reject) => {
|
|
104
104
|
let platform: string = getPlatform()
|
|
105
105
|
if (platform === TokenPlatform.TYPE_JDAPP) {
|
|
106
106
|
ready('jmfe', 3000)
|
|
107
107
|
.then(() => {
|
|
108
108
|
console.log('window.jmfe已经存在:', window['jmfe'])
|
|
109
109
|
import('./token.jd')
|
|
110
110
|
.then((data) => {
|
|
111
111
|
console.log('data:', data)
|
|
112
112
|
resolve(data)
|
|
113
113
|
})
|
|
114
114
|
.catch((err) => {
|
|
115
115
|
reject(err)
|
|
116
116
|
})
|
|
117
117
|
})
|
|
118
118
|
.catch((e) => {
|
|
119
119
|
console.log('window.jmfe不存在')
|
|
120
120
|
reject(e)
|
|
121
121
|
})
|
|
122
122
|
}
|
|
123
123
|
else if (platform === TokenPlatform.TYPE_WQ) {
|
|
124
124
|
import('./token.wxapp')
|
|
125
125
|
.then((data) => {
|
|
126
126
|
console.log('data:', data)
|
|
127
127
|
resolve(data)
|
|
128
128
|
})
|
|
129
129
|
.catch((err) => {
|
|
130
130
|
reject(err)
|
|
131
131
|
})
|
|
132
132
|
} else {
|
|
133
133
|
import('./token')
|
|
134
134
|
.then((data) => {
|
|
135
135
|
console.log('data:', data)
|
|
136
136
|
resolve(data)
|
|
137
137
|
})
|
|
138
138
|
.catch((err) => {
|
|
139
139
|
reject(err)
|
|
140
140
|
})
|
|
141
141
|
}
|
|
142
142
|
})
|
|
143
143
|
console.log(e)
|
|
144
144
|
return {}
|
|
145
145
|
return new Promise((resolve) => {
|
|
146
146
|
loadTokenPromise
|
|
147
147
|
.then((proxy: any) => {
|
|
148
148
|
if (proxy?.isLogin) {
|
|
149
149
|
proxy?.isLogin().then((data: boolean) => {
|
|
150
150
|
resolve(data)
|
|
151
151
|
})
|
|
152
152
|
} else {
|
|
153
153
|
resolve(false)
|
|
154
154
|
}
|
|
155
155
|
})
|
|
156
156
|
.catch((err) => {
|
|
157
157
|
resolve(false)
|
|
158
158
|
})
|
|
159
159
|
})
|
|
160
160
|
return new Promise((resolve) => {
|
|
161
161
|
loadTokenPromise
|
|
162
162
|
.then((proxy: any) => {
|
|
163
163
|
if (proxy?.getIsvToken) {
|
|
164
164
|
proxy?.getIsvToken().then((data: string) => {
|
|
165
165
|
resolve(data)
|
|
166
166
|
})
|
|
167
167
|
} else {
|
|
168
168
|
resolve('')
|
|
169
169
|
}
|
|
170
170
|
})
|
|
171
171
|
.catch((err) => {
|
|
172
172
|
resolve('')
|
|
173
173
|
})
|
|
174
174
|
})
|
|
175
175
|
return new Promise((resolve) => {
|
|
176
176
|
loadTokenPromise
|
|
177
177
|
.then((proxy: any) => {
|
|
178
178
|
if (proxy?.toLogin) {
|
|
179
179
|
proxy?.toLogin(options)
|
|
180
180
|
resolve(true)
|
|
181
181
|
} else {
|
|
182
182
|
resolve(false)
|
|
183
183
|
}
|
|
184
184
|
})
|
|
185
185
|
.catch((err) => {
|
|
186
186
|
resolve(false)
|
|
187
187
|
})
|
|
188
188
|
})
|
|
189
189
|
let platform = TokenPlatform.TYPE_M
|
|
190
190
|
if (isApp('jd')) {
|
|
191
191
|
platform = TokenPlatform.TYPE_JDAPP
|
|
192
192
|
}
|
|
193
193
|
else if (isApp('wx') && isApp('mp')) {
|
|
194
194
|
platform = TokenPlatform.TYPE_WQ
|
|
195
195
|
}
|
|
196
196
|
return platform
|
|
197
197
|
let platform = getPlatform()
|
|
198
198
|
let source = platform
|
|
199
199
|
if (platform === TokenPlatform.TYPE_M || platform === TokenPlatform.TYPE_WQ) {
|
|
200
200
|
source = TokenPlatform.TYPE_JDAPP
|
|
201
201
|
}
|
|
202
202
|
return source
|
|
203
203
|
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
|
+
console.log('load token.jd')
|
|
51
51
|
return new Promise((resolve) => {
|
|
52
52
|
if (window['jmfe']) {
|
|
53
53
|
window['jmfe'].isJDAppLogin().then(({ data }) => {
|
|
54
54
|
if (data === '1') {
|
|
55
55
|
resolve(true)
|
|
56
56
|
} else if (data === '0') {
|
|
57
57
|
resolve(false)
|
|
58
58
|
}
|
|
59
59
|
})
|
|
60
60
|
} else {
|
|
61
61
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
62
62
|
resolve(false)
|
|
63
63
|
}
|
|
64
64
|
})
|
|
65
65
|
return requestIsvToken(window.location.href)
|
|
66
66
|
if (window['jmfe']) {
|
|
67
67
|
window['jmfe'].toLogin(options)
|
|
68
68
|
} else {
|
|
69
69
|
console.warn('jmfe对象不存在,可能没有提前动态引入jd-jssdk.js')
|
|
70
70
|
}
|
|
71
71
|
if (window['jmfe']) {
|
|
72
72
|
console.log('registerCode:', code)
|
|
73
73
|
window['jmfe'].registerCode(code)
|
|
74
74
|
} else {
|
|
75
75
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
76
76
|
}
|
|
77
77
|
return new Promise((resolve) => {
|
|
78
78
|
console.log('requestIsvToken:', url)
|
|
79
79
|
if (window['jmfe']) {
|
|
80
80
|
window['jmfe']
|
|
81
81
|
.requestIsvToken(url)
|
|
82
82
|
.then((result: any) => {
|
|
83
83
|
console.log('requestIsvToken result:' + JSON.stringify(result))
|
|
84
84
|
const { status, data, msg } = result
|
|
85
85
|
if (status === '0') {
|
|
86
86
|
resolve(data || '')
|
|
87
87
|
} else {
|
|
88
88
|
resolve('')
|
|
89
89
|
}
|
|
90
90
|
})
|
|
91
91
|
.catch((e: any) => {
|
|
92
92
|
console.log('requestIsvToken error:' + JSON.stringify(e))
|
|
93
93
|
resolve('')
|
|
94
94
|
})
|
|
95
95
|
} else {
|
|
96
96
|
console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
|
|
97
97
|
resolve('')
|
|
98
98
|
}
|
|
99
99
|
})
|