@conecli/cone-render 0.9.1-shop2.9 → 0.10.1-beta.0
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/assets/icon_blue_info.svg +1 -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.ts +1 -0
- package/dist/common/sgmCustomCode.ts +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/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/NetworkDataError/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/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/sass/app.h5.scss +5 -0
- package/dist/utils/connectNativeJsBridge.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/utils.ts +1 -1
- package/package.json +42 -39
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
package/dist/common/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
floorVideInfo: {},
|
|
3
2
|
productVideInfo: {},
|
|
4
3
|
isVipShop: false,
|
|
5
4
|
isJdShowNativeImmersivePlayer: false,
|
|
6
5
|
pageIdxHeightInfo: {
|
|
7
6
|
list: []
|
|
8
7
|
},
|
|
9
8
|
jdBottomBarHeight: 0,
|
|
10
9
|
jdNativeHeaderHeight: 0,
|
|
11
10
|
openAppData: {}
|
|
12
11
|
public config: {
|
|
13
12
|
[key: string]: any
|
|
14
13
|
}
|
|
15
14
|
public lazyContainer: CommonInterFace.lazyContainer
|
|
16
15
|
public renderedIsvComponents: CommonInterFace.renderedIsvComponents
|
|
17
16
|
this.config = {}
|
|
18
17
|
this.renderedIsvComponents = {}
|
|
19
18
|
|
|
20
19
|
taskTimeoutPromise(callBack, timeout = 2000){
|
|
21
20
|
return new Promise((resolve) => {
|
|
22
21
|
setTimeout(() => {
|
|
23
22
|
const getCallBackRes = typeof callBack === 'function' && callBack()
|
|
24
23
|
return resolve(getCallBackRes || false)
|
|
25
24
|
}, timeout)
|
|
26
25
|
})
|
|
27
26
|
}
|
|
28
27
|
removeJdAndroidRquestEventForTouchStart(){}
|
|
29
28
|
checkStatusAndLogin(options = {}) {
|
|
30
29
|
|
|
31
30
|
checkJdStatusAndLogin(options){
|
|
32
31
|
return this.checkStatusAndLogin(options)
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
doLoginForJdPin(options = {}) {
|
|
36
35
|
return this.doLogin(options)
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
getLoginCookie(updateKey = 'wxapp') {
|
|
40
39
|
return new Promise((resolve) => {
|
|
41
40
|
console.log("开始获取更新wxapp中的cookie信息", updateKey)
|
|
42
41
|
if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
|
|
43
42
|
console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
|
|
44
43
|
resolve({
|
|
45
44
|
wqCookie: this.config.wqCookie,
|
|
46
45
|
wqCookieStr: this.config.wqCookieStr,
|
|
47
46
|
})
|
|
48
47
|
}else {
|
|
49
48
|
if (isPublishToWxapp) {
|
|
50
49
|
const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
|
|
51
50
|
if (getWxappCookieObj) {
|
|
52
51
|
const getCookieObj = getWxappCookieObj['_data']
|
|
53
52
|
const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
|
|
54
53
|
const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
|
|
55
54
|
this.info.loginState = true
|
|
56
55
|
this.info.userInfo.wqCookie = wqCookieStr
|
|
57
56
|
this.info.userInfo.wqVisitkey = visitkey
|
|
58
57
|
console.log('获取用户完整cookie信息', getCookieObj)
|
|
59
58
|
const getUserAddress = this.wxAppUserInfoInstance.getAddress()
|
|
60
59
|
console.log('获取微信用户地址信息', getUserAddress)
|
|
61
60
|
if (getUserAddress) {
|
|
62
61
|
this.info.pageInfo.address = getUserAddress?.areaId
|
|
63
62
|
this.info.pageInfo.addressCommaStr = this.info.pageInfo
|
|
64
63
|
.address
|
|
65
64
|
? this.info.pageInfo.address.replace(/_/g, ',')
|
|
66
65
|
: ''
|
|
67
66
|
this.info.pageInfo.un_area = this.info.pageInfo.address
|
|
68
67
|
Taro.eventCenter.trigger(
|
|
69
68
|
TaroEventType.USER_AREA_UPDATE,
|
|
70
69
|
this.info.pageInfo.address,
|
|
71
70
|
)
|
|
72
71
|
}
|
|
73
72
|
if(this.miniAppLogInstance){
|
|
74
73
|
this.miniAppLogInstance.set({
|
|
75
74
|
account: pin,
|
|
76
75
|
unionid: wq_unionid,
|
|
77
76
|
openid: wxapp_openid,
|
|
78
77
|
})
|
|
79
78
|
}
|
|
80
79
|
this.config.wqCookie = wqCookie
|
|
81
80
|
this.config.wqCookieStr = wqCookieStr
|
|
82
81
|
this.config.getWqCookieKey = updateKey
|
|
83
82
|
console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
|
|
84
83
|
resolve({
|
|
85
84
|
wqCookie,
|
|
86
85
|
wqCookieStr,
|
|
87
86
|
})
|
|
88
87
|
}else {
|
|
89
88
|
console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
|
|
90
89
|
resolve({
|
|
91
90
|
wqCookie: false,
|
|
92
91
|
wqCookieStr: false,
|
|
93
92
|
})
|
|
94
93
|
}
|
|
95
94
|
}else {
|
|
96
95
|
resolve({
|
|
97
96
|
wqCookie: false,
|
|
98
97
|
wqCookieStr: false,
|
|
99
98
|
})
|
|
100
99
|
}
|
|
101
100
|
}
|
|
102
101
|
})
|
|
103
102
|
}
|
|
104
103
|
return this.getLoginCookie()
|
|
105
104
|
|
|
106
105
|
getAddressCachePromise = () => {
|
|
107
106
|
return Promise.reject("该方法只在APP内适用")
|
|
108
107
|
}
|
|
108
|
+
import Taro from '@tarojs/taro'
|
|
109
109
|
floorVideInfo: {},
|
|
110
110
|
productVideInfo: {},
|
|
111
111
|
isVipShop: false,
|
|
112
112
|
isJdShowNativeImmersivePlayer: false,
|
|
113
113
|
pageIdxHeightInfo: {
|
|
114
114
|
list: []
|
|
115
115
|
},
|
|
116
116
|
jdBottomBarHeight: 0,
|
|
117
117
|
jdNativeHeaderHeight: 0,
|
|
118
118
|
openAppData: {}
|
|
119
119
|
public config: {
|
|
120
120
|
[key: string]: any
|
|
121
121
|
}
|
|
122
122
|
public lazyContainer: CommonInterFace.lazyContainer
|
|
123
123
|
public renderedIsvComponents: CommonInterFace.renderedIsvComponents
|
|
124
124
|
this.config = {}
|
|
125
125
|
this.renderedIsvComponents = {}
|
|
126
126
|
|
|
127
127
|
taskTimeoutPromise(callBack, timeout = 2000){
|
|
128
128
|
return new Promise((resolve) => {
|
|
129
129
|
setTimeout(() => {
|
|
130
130
|
const getCallBackRes = typeof callBack === 'function' && callBack()
|
|
131
131
|
return resolve(getCallBackRes || false)
|
|
132
132
|
}, timeout)
|
|
133
133
|
})
|
|
134
134
|
}
|
|
135
135
|
removeJdAndroidRquestEventForTouchStart(){}
|
|
136
136
|
this.info.sysInfo['wifiVideoAutoPlay'] = false
|
|
137
137
|
checkStatusAndLogin(options = {}) {
|
|
138
138
|
|
|
139
139
|
checkJdStatusAndLogin(options){
|
|
140
140
|
return this.checkStatusAndLogin(options)
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
doLoginForJdPin(options = {}) {
|
|
144
144
|
return this.doLogin(options)
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
getLoginCookie(updateKey = 'wxapp') {
|
|
148
148
|
return new Promise((resolve) => {
|
|
149
149
|
console.log("开始获取更新wxapp中的cookie信息", updateKey)
|
|
150
150
|
if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
|
|
151
151
|
console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
|
|
152
152
|
resolve({
|
|
153
153
|
wqCookie: this.config.wqCookie,
|
|
154
154
|
wqCookieStr: this.config.wqCookieStr,
|
|
155
155
|
})
|
|
156
156
|
}else {
|
|
157
157
|
if (isPublishToWxapp) {
|
|
158
158
|
const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
|
|
159
159
|
if (getWxappCookieObj) {
|
|
160
160
|
const getCookieObj = getWxappCookieObj['_data']
|
|
161
161
|
const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
|
|
162
162
|
const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
|
|
163
163
|
this.info.loginState = true
|
|
164
164
|
this.info.userInfo.wqCookie = wqCookieStr
|
|
165
165
|
this.info.userInfo.wqVisitkey = visitkey
|
|
166
166
|
console.log('获取用户完整cookie信息', getCookieObj)
|
|
167
167
|
const getUserAddress = this.wxAppUserInfoInstance.getAddress()
|
|
168
168
|
console.log('获取微信用户地址信息', getUserAddress)
|
|
169
169
|
if (getUserAddress) {
|
|
170
170
|
this.info.pageInfo.address = getUserAddress?.areaId
|
|
171
171
|
this.info.pageInfo.addressCommaStr = this.info.pageInfo
|
|
172
172
|
.address
|
|
173
173
|
? this.info.pageInfo.address.replace(/_/g, ',')
|
|
174
174
|
: ''
|
|
175
175
|
this.info.pageInfo.un_area = this.info.pageInfo.address
|
|
176
176
|
Taro.eventCenter.trigger(
|
|
177
177
|
TaroEventType.USER_AREA_UPDATE,
|
|
178
178
|
this.info.pageInfo.address,
|
|
179
179
|
)
|
|
180
180
|
}
|
|
181
181
|
if(this.miniAppLogInstance){
|
|
182
182
|
this.miniAppLogInstance.set({
|
|
183
183
|
account: pin,
|
|
184
184
|
unionid: wq_unionid,
|
|
185
185
|
openid: wxapp_openid,
|
|
186
186
|
})
|
|
187
187
|
}
|
|
188
188
|
this.config.wqCookie = wqCookie
|
|
189
189
|
this.config.wqCookieStr = wqCookieStr
|
|
190
190
|
this.config.getWqCookieKey = updateKey
|
|
191
191
|
console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
|
|
192
192
|
resolve({
|
|
193
193
|
wqCookie,
|
|
194
194
|
wqCookieStr,
|
|
195
195
|
})
|
|
196
196
|
}else {
|
|
197
197
|
console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
|
|
198
198
|
resolve({
|
|
199
199
|
wqCookie: false,
|
|
200
200
|
wqCookieStr: false,
|
|
201
201
|
})
|
|
202
202
|
}
|
|
203
203
|
}else {
|
|
204
204
|
resolve({
|
|
205
205
|
wqCookie: false,
|
|
206
206
|
wqCookieStr: false,
|
|
207
207
|
})
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
})
|
|
211
211
|
}
|
|
212
212
|
return this.getLoginCookie()
|
|
213
213
|
|
|
214
214
|
getAddressCachePromise = () => {
|
|
215
215
|
return Promise.reject("该方法只在APP内适用")
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
getDynamicConfig(key: string){
|
|
219
219
|
console.warn('调用默认的 getDynamicConfig(),注意,此方法还未实现!')
|
|
220
220
|
return null
|
|
221
221
|
}
|