@conecli/cone-render 0.10.1-shop3.5 → 0.10.1-shop3.51
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 +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.ts +1 -1
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- 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.tsx +1 -1
- package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
- package/dist/components/base/CustomScrollView/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/Dialog/index.module.scss +11 -0
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- 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/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +118 -72
- 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 +24 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/debug/DebugLayout/index.module.scss +2 -2
- package/dist/components/floorItem.weapp.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/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.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.tjm.ts +1 -1
- 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 -56
- 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/environment.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/util.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +278 -224
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -0
- package/dist/service/fetchJsonp.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 -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 -0
- 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/jumpExtMapUtil.h5.ts +1 -0
- package/dist/utils/jumpExtMapUtil.ts +1 -0
- package/dist/utils/log.ts +1 -0
- package/dist/utils/{sColor.js → sColor.ts} +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/package.json +160 -141
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/utils/priceUtils.js +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
|
public loadJsSdkList: Array<any>
|
|
18
17
|
public loadJsSdkListCachePromise: any
|
|
19
18
|
this.config = {}
|
|
20
19
|
this.loadJsSdkList = []
|
|
21
20
|
this.loadJsSdkListCachePromise = {}
|
|
22
21
|
this.renderedIsvComponents = {}
|
|
23
22
|
|
|
24
23
|
taskTimeoutPromise(callBack, timeout = 2000){
|
|
25
24
|
return new Promise((resolve) => {
|
|
26
25
|
setTimeout(() => {
|
|
27
26
|
const getCallBackRes = typeof callBack === 'function' && callBack()
|
|
28
27
|
return resolve(getCallBackRes || false)
|
|
29
28
|
}, timeout)
|
|
30
29
|
})
|
|
31
30
|
}
|
|
32
31
|
removeJdAndroidRquestEventForTouchStart(){}
|
|
33
32
|
this.info.sysInfo['wifiVideoAutoPlay'] = false
|
|
34
33
|
getAPPUseStraightCorner () {
|
|
35
34
|
return Promise.resolve(false)
|
|
36
35
|
}
|
|
37
36
|
checkStatusAndLogin(options = {}) {
|
|
38
37
|
|
|
39
38
|
checkJdStatusAndLogin(options){
|
|
40
39
|
return this.checkStatusAndLogin(options)
|
|
41
40
|
}
|
|
42
41
|
|
|
43
42
|
doLoginForJdPin(options = {}) {
|
|
44
43
|
return this.doLogin(options)
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
getLoginCookie(updateKey = 'wxapp') {
|
|
48
47
|
return new Promise((resolve) => {
|
|
49
48
|
console.log("开始获取更新wxapp中的cookie信息", updateKey)
|
|
50
49
|
if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
|
|
51
50
|
console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
|
|
52
51
|
resolve({
|
|
53
52
|
wqCookie: this.config.wqCookie,
|
|
54
53
|
wqCookieStr: this.config.wqCookieStr,
|
|
55
54
|
})
|
|
56
55
|
}else {
|
|
57
56
|
if (isPublishToWxapp) {
|
|
58
57
|
const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
|
|
59
58
|
if (getWxappCookieObj) {
|
|
60
59
|
const getCookieObj = getWxappCookieObj['_data']
|
|
61
60
|
const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
|
|
62
61
|
const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
|
|
63
62
|
this.info.loginState = true
|
|
64
63
|
this.info.userInfo.wqCookie = wqCookieStr
|
|
65
64
|
this.info.userInfo.wqVisitkey = visitkey
|
|
66
65
|
console.log('获取用户完整cookie信息', getCookieObj)
|
|
67
66
|
const getUserAddress = this.wxAppUserInfoInstance.getAddress()
|
|
68
67
|
console.log('获取微信用户地址信息', getUserAddress)
|
|
69
68
|
if (getUserAddress) {
|
|
70
69
|
this.info.pageInfo.address = getUserAddress?.areaId
|
|
71
70
|
this.info.pageInfo.addressCommaStr = this.info.pageInfo
|
|
72
71
|
.address
|
|
73
72
|
? this.info.pageInfo.address.replace(/_/g, ',')
|
|
74
73
|
: ''
|
|
75
74
|
this.info.pageInfo.un_area = this.info.pageInfo.address
|
|
76
75
|
Taro.eventCenter.trigger(
|
|
77
76
|
TaroEventType.USER_AREA_UPDATE,
|
|
78
77
|
this.info.pageInfo.address,
|
|
79
78
|
)
|
|
80
79
|
}
|
|
81
80
|
if(this.miniAppLogInstance){
|
|
82
81
|
this.miniAppLogInstance.set({
|
|
83
82
|
account: pin,
|
|
84
83
|
unionid: wq_unionid,
|
|
85
84
|
openid: wxapp_openid,
|
|
86
85
|
})
|
|
87
86
|
}
|
|
88
87
|
this.config.wqCookie = wqCookie
|
|
89
88
|
this.config.wqCookieStr = wqCookieStr
|
|
90
89
|
this.config.getWqCookieKey = updateKey
|
|
91
90
|
console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
|
|
92
91
|
resolve({
|
|
93
92
|
wqCookie,
|
|
94
93
|
wqCookieStr,
|
|
95
94
|
})
|
|
96
95
|
}else {
|
|
97
96
|
console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
|
|
98
97
|
resolve({
|
|
99
98
|
wqCookie: false,
|
|
100
99
|
wqCookieStr: false,
|
|
101
100
|
})
|
|
102
101
|
}
|
|
103
102
|
}else {
|
|
104
103
|
resolve({
|
|
105
104
|
wqCookie: false,
|
|
106
105
|
wqCookieStr: false,
|
|
107
106
|
})
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
})
|
|
111
110
|
}
|
|
112
111
|
return this.getLoginCookie()
|
|
113
112
|
|
|
114
113
|
getAddressCachePromise = () => {
|
|
115
114
|
return Promise.reject("该方法只在APP内适用")
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
getDynamicConfig(key: string){
|
|
119
118
|
console.warn('调用默认的 getDynamicConfig(),注意,此方法还未实现!')
|
|
120
119
|
return null
|
|
121
120
|
}
|
|
122
121
|
renderNextTickLoadSdk(){
|
|
123
122
|
console.warn("暂未实现 index.ts")
|
|
124
123
|
}
|
|
125
124
|
loadOtherSdk(){
|
|
126
125
|
console.warn("暂未实现 index.ts")
|
|
127
126
|
}
|
|
128
127
|
loadItemSdkPromise(jsInfo = {}) {
|
|
129
128
|
console.warn('暂未实现 index.ts')
|
|
130
129
|
}
|
|
130
|
+
import Taro from '@tarojs/taro';
|
|
131
131
|
WXAPP_LOGIN,
|
|
132
132
|
WXAPP_BIZ,
|
|
133
133
|
WXAPP_USER_INFO,
|
|
134
134
|
WXAPP_NAVIGATOR,
|
|
135
135
|
WXAPP_REPORT_GDT,
|
|
136
136
|
WXAPP_PARAMS_SIGN,
|
|
137
137
|
BUSINESS_TYPE,
|
|
138
138
|
SHOP_MENU_ID_TYPE,
|
|
139
139
|
SHOP_MENU_ID_NAME,
|
|
140
140
|
SECTION_HOME_TAB_NAME_TYPE,
|
|
141
141
|
SECTION_HOME_TAB_TYPE,
|
|
142
142
|
WXAPP_BIZ_KEY,
|
|
143
143
|
WX_BUSINESS_TYPE,
|
|
144
144
|
TaroEventType,
|
|
145
145
|
getSystemInfos,
|
|
146
146
|
getTaroStorageKeyValue,
|
|
147
147
|
getWxAppCookieStr,
|
|
148
148
|
languageNowType,
|
|
149
149
|
abTestLabels: {},
|
|
150
150
|
nonSellableSkuids: {},
|
|
151
151
|
loginState: jdUserLoginState,
|
|
152
152
|
cookiesStr: '',
|
|
153
153
|
userInfo: userPinKey,
|
|
154
154
|
isImmersive: false,
|
|
155
155
|
pageInfo: {
|
|
156
156
|
wxBusinessType: WX_BUSINESS_TYPE.SHOP,
|
|
157
157
|
address: '',
|
|
158
158
|
addressCommaStr: '',
|
|
159
159
|
un_area: '',
|
|
160
160
|
userLbsAddress: '',
|
|
161
161
|
vapptype: '1',
|
|
162
162
|
pageType: 'home',
|
|
163
163
|
dataType: BUSINESS_TYPE.ONLINE,
|
|
164
164
|
floorExposureInfo: {},
|
|
165
165
|
floorVideInfo: {},
|
|
166
166
|
productVideInfo: {},
|
|
167
167
|
tabsLoadAllDataInfo: {
|
|
168
168
|
[SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: false,
|
|
169
169
|
[SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY]]: true,
|
|
170
170
|
},
|
|
171
171
|
updateShopInfosAllState: false,
|
|
172
172
|
isVipShop: false,
|
|
173
173
|
isJdShowNativeImmersivePlayer: false,
|
|
174
174
|
...shopConfig,
|
|
175
175
|
pageScrollTop: 0,
|
|
176
176
|
pageIdxHeightInfo: {
|
|
177
177
|
list: [],
|
|
178
178
|
},
|
|
179
179
|
shopNavBarHeight: 0,
|
|
180
180
|
},
|
|
181
181
|
defaultQueryLogInfo: {
|
|
182
182
|
sourceType: 'JDshop',
|
|
183
183
|
sourceValue: '',
|
|
184
184
|
moduleId: 'none',
|
|
185
185
|
entrance: 'none',
|
|
186
186
|
},
|
|
187
187
|
sysInfo: {
|
|
188
188
|
windowWidth: 0,
|
|
189
189
|
windowHeight: 0,
|
|
190
190
|
netWorkType: '4g',
|
|
191
191
|
jdBottomBarHeight: 0,
|
|
192
192
|
jdNativeHeaderHeight: 0,
|
|
193
193
|
},
|
|
194
194
|
queryInfo: {},
|
|
195
195
|
shopInfo: {},
|
|
196
196
|
openAppData: {},
|
|
197
197
|
public info: CommonInterFace.BaseConfigInfo;
|
|
198
198
|
public config: {
|
|
199
199
|
[key: string]: any;
|
|
200
200
|
};
|
|
201
201
|
public lazyContainer: CommonInterFace.lazyContainer;
|
|
202
202
|
public renderedIsvComponents: CommonInterFace.renderedIsvComponents;
|
|
203
203
|
public rootEleNode: HTMLElement | null;
|
|
204
204
|
public miniApplogUtil: CommonInterFace.MiniApplogUtil;
|
|
205
205
|
public miniAppLogInstance: CommonInterFace.MiniAppLog | null;
|
|
206
206
|
public checkStatusAndLoginPromise: object | null;
|
|
207
207
|
public wxAppLoginInstance: CommonInterFace.WxAppLogin;
|
|
208
208
|
public wxAppBizInstance: CommonInterFace.WxAppUserInfo;
|
|
209
209
|
public wxAppUserInfoInstance: CommonInterFace.WxAppUserInfo;
|
|
210
210
|
public wxAppReportGDTInstance: CommonInterFace.WxAppReportGDT;
|
|
211
211
|
public wxAppNavigatorInstance: CommonInterFace.WxAppNavigator;
|
|
212
212
|
public wxAppParamsSignInstance: CommonInterFace.wxAppParamsSign;
|
|
213
213
|
public loadJsSdkList: Array<any>;
|
|
214
214
|
public loadJsSdkListCachePromise: any;
|
|
215
215
|
public languageJsonData: any | null;
|
|
216
216
|
constructor(opt) {
|
|
217
217
|
this.info = this._getConfig(opt);
|
|
218
218
|
this.config = {};
|
|
219
219
|
this.lazyContainer = {
|
|
220
220
|
[SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: {
|
|
221
221
|
appLazyContainerList: [],
|
|
222
222
|
appLazyFinishContainerList: [],
|
|
223
223
|
},
|
|
224
224
|
[SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]]: {
|
|
225
225
|
appLazyContainerList: [],
|
|
226
226
|
appLazyFinishContainerList: [],
|
|
227
227
|
},
|
|
228
228
|
};
|
|
229
229
|
this.loadJsSdkList = [];
|
|
230
230
|
this.loadJsSdkListCachePromise = {};
|
|
231
231
|
this.renderedIsvComponents = {};
|
|
232
232
|
this.rootEleNode = null;
|
|
233
233
|
this.miniApplogUtil = MiniAppLogUtil;
|
|
234
234
|
this.miniAppLogInstance = null;
|
|
235
235
|
this.checkStatusAndLoginPromise = null;
|
|
236
236
|
this.wxAppLoginInstance = WXAPP_LOGIN;
|
|
237
237
|
this.wxAppBizInstance = WXAPP_BIZ;
|
|
238
238
|
this.wxAppUserInfoInstance = WXAPP_USER_INFO;
|
|
239
239
|
this.wxAppReportGDTInstance = WXAPP_REPORT_GDT;
|
|
240
240
|
this.wxAppNavigatorInstance = WXAPP_NAVIGATOR;
|
|
241
241
|
this.wxAppParamsSignInstance = WXAPP_PARAMS_SIGN;
|
|
242
242
|
this.languageJsonData = langeJsonDataForCn;
|
|
243
243
|
}
|
|
244
244
|
_getConfig(opt) {
|
|
245
245
|
return Object.assign({}, DefaultConfig, opt);
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
jmfeReayPromise(): Promise<any> {
|
|
249
249
|
return Promise.reject(false);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
taskTimeoutPromise(callBack, timeout = 2000) {
|
|
253
253
|
return new Promise((resolve) => {
|
|
254
254
|
setTimeout(() => {
|
|
255
255
|
const getCallBackRes = typeof callBack === 'function' && callBack();
|
|
256
256
|
return resolve(getCallBackRes || false);
|
|
257
257
|
}, timeout);
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
260
|
removeJdAndroidRquestEventForTouchStart() {}
|
|
261
261
|
|
|
262
262
|
updateBusinessDomainAndApi(domain, api) {
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
getFullScreenHeight(systemInfo) {
|
|
266
266
|
const { screenHeight, statusBarHeight, isAndroid } = systemInfo;
|
|
267
267
|
let result = screenHeight;
|
|
268
268
|
if (statusBarHeight > 20 && isAndroid) {
|
|
269
269
|
result = screenHeight + statusBarHeight;
|
|
270
270
|
}
|
|
271
271
|
return result;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
274
|
getTabBarHeight(systemInfo) {
|
|
275
275
|
const { statusBarHeight, isAndroid, isIOS } = systemInfo;
|
|
276
276
|
let result = 50;
|
|
277
277
|
if (statusBarHeight > 20) {
|
|
278
278
|
if (isIOS) {
|
|
279
279
|
result = 84;
|
|
280
280
|
} else if (isAndroid) {
|
|
281
281
|
result = 53;
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
return result;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
getSystemInfo() {
|
|
288
288
|
const info: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfos() || {};
|
|
289
289
|
const actualNavBarHeight = (info?.navBarHeight || 0) + (info?.navBarExtendHeight || 0);
|
|
290
290
|
const headerHeight = actualNavBarHeight + (info?.statusBarHeight || 0);
|
|
291
291
|
const fullScreenHeight = this.getFullScreenHeight(info);
|
|
292
292
|
const tabBarHeight = this.getTabBarHeight(info);
|
|
293
293
|
const safeContentHeight = fullScreenHeight - headerHeight;
|
|
294
294
|
this.info.sysInfo = {
|
|
295
295
|
...this.info.sysInfo,
|
|
296
296
|
...info,
|
|
297
297
|
actualNavBarHeight,
|
|
298
298
|
headerHeight,
|
|
299
299
|
fullScreenHeight,
|
|
300
300
|
tabBarHeight,
|
|
301
301
|
safeContentHeight,
|
|
302
302
|
languageType: languageNowType,
|
|
303
303
|
};
|
|
304
304
|
if (this.info.sysInfo['hostVersionName']) {
|
|
305
305
|
this.info.sysInfo['hostAppVersion'] = Number(
|
|
306
306
|
this.info.sysInfo['hostVersionName'].replace(/\./g, ''),
|
|
307
307
|
);
|
|
308
308
|
}
|
|
309
309
|
this.info.sysInfo['wifiVideoAutoPlay'] = false;
|
|
310
310
|
this.getNetWorkType();
|
|
311
311
|
}
|
|
312
312
|
async updateMPaasConfig() {}
|
|
313
313
|
|
|
314
314
|
getNetWorkType() {
|
|
315
315
|
Taro.getNetworkType().then((getRes) => {
|
|
316
316
|
getRes && getRes.networkType && (this.info.sysInfo['netWorkType'] = getRes.networkType);
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
319
|
getAPPUseStraightCorner() {
|
|
320
320
|
return Promise.resolve(false);
|
|
321
321
|
}
|
|
322
322
|
checkStatusAndLogin(options = {}) {
|
|
323
323
|
this.checkStatusAndLoginPromise = new Promise((resolve, reject) => {
|
|
324
324
|
console.log('微信小程序登录状态及获取cookie状态的promise,之前登录状态', this.info.loginState);
|
|
325
325
|
this.toLogin(options)
|
|
326
326
|
.then((res) => {
|
|
327
327
|
console.log('微信小程序登录状态结果,成功', res);
|
|
328
328
|
this.info.loginState = true;
|
|
329
329
|
resolve(res);
|
|
330
330
|
})
|
|
331
331
|
.catch((err) => {
|
|
332
332
|
console.log('微信小程序登录异常状态结果', err);
|
|
333
333
|
this.doLogin(options)
|
|
334
334
|
.then((res2) => {
|
|
335
335
|
console.log('微信小程序wxDoLogin强制登陆成功:', res2);
|
|
336
336
|
this.info.loginState = true;
|
|
337
337
|
resolve(res2);
|
|
338
338
|
})
|
|
339
339
|
.catch((err2) => {
|
|
340
340
|
console.log('微信小程序wxDoLogin强制登陆失败:', err2);
|
|
341
341
|
this.checkStatusAndLoginPromise = null;
|
|
342
342
|
reject(err2);
|
|
343
343
|
});
|
|
344
344
|
});
|
|
345
345
|
});
|
|
346
346
|
return this.checkStatusAndLoginPromise;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
checkJdStatusAndLogin(options) {
|
|
350
350
|
return this.checkStatusAndLogin(options);
|
|
351
351
|
}
|
|
352
352
|
|
|
353
353
|
toLogin(options = {}): Promise<any> {
|
|
354
354
|
return this.wxAppLoginInstance
|
|
355
355
|
.getLoginPromise({
|
|
356
356
|
mode: 'silent',
|
|
357
357
|
loginColor: {
|
|
358
358
|
biz: WXAPP_BIZ_KEY,
|
|
359
359
|
dpin: 0,
|
|
360
360
|
},
|
|
361
361
|
...options,
|
|
362
362
|
})
|
|
363
363
|
.then((res) => {
|
|
364
364
|
console.log('微信app登录返回信息,微信侧返回code为0表示成功', res);
|
|
365
365
|
this.getLoginCookie();
|
|
366
366
|
})
|
|
367
367
|
.catch((err) => {
|
|
368
368
|
console.log('微信app登录异常返回信息', err);
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
doLogin(options = {}) {
|
|
373
373
|
return this.wxAppLoginInstance
|
|
374
374
|
.doLogin({
|
|
375
375
|
loginColor: {
|
|
376
376
|
biz: WXAPP_BIZ_KEY,
|
|
377
377
|
dpin: 0,
|
|
378
378
|
},
|
|
379
379
|
...options,
|
|
380
380
|
})
|
|
381
381
|
.then((res) => {
|
|
382
382
|
this.getLoginCookie();
|
|
383
383
|
console.log('微信小程序强制登录返回信息,微信侧返回code为0表示成功', res);
|
|
384
384
|
return res;
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
doLoginForJdPin(options = {}) {
|
|
389
389
|
return this.doLogin(options);
|
|
390
390
|
}
|
|
391
391
|
|
|
392
392
|
getLoginCookie(updateKey = 'wxapp') {
|
|
393
393
|
return new Promise((resolve) => {
|
|
394
394
|
console.log('开始获取更新wxapp中的cookie信息', updateKey);
|
|
395
395
|
if (
|
|
396
396
|
this.config.wqCookie &&
|
|
397
397
|
this.config.wqCookieStr &&
|
|
398
398
|
this.config.getWqCookieKey === updateKey
|
|
399
399
|
) {
|
|
400
400
|
console.log('已有存储wxapp中的cookie信息,直接返回', this.config);
|
|
401
401
|
resolve({
|
|
402
402
|
wqCookie: this.config.wqCookie,
|
|
403
403
|
wqCookieStr: this.config.wqCookieStr,
|
|
404
404
|
});
|
|
405
405
|
} else {
|
|
406
406
|
if (isPublishToWxapp) {
|
|
407
407
|
const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null;
|
|
408
408
|
if (getWxappCookieObj) {
|
|
409
409
|
const getCookieObj = getWxappCookieObj['_data'];
|
|
410
410
|
const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj);
|
|
411
411
|
const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie;
|
|
412
412
|
this.info.loginState = true;
|
|
413
413
|
this.info.userInfo.wqCookie = wqCookieStr;
|
|
414
414
|
this.info.userInfo.wqVisitkey = visitkey;
|
|
415
415
|
console.log('获取用户完整cookie信息', getCookieObj);
|
|
416
416
|
const getUserAddress = this.wxAppUserInfoInstance.getAddress();
|
|
417
417
|
console.log('获取微信用户地址信息', getUserAddress);
|
|
418
418
|
if (getUserAddress) {
|
|
419
419
|
this.info.pageInfo.address = getUserAddress?.areaId;
|
|
420
420
|
this.info.pageInfo.addressCommaStr = this.info.pageInfo.address
|
|
421
421
|
? this.info.pageInfo.address.replace(/_/g, ',')
|
|
422
422
|
: '';
|
|
423
423
|
this.info.pageInfo.un_area = this.info.pageInfo.address;
|
|
424
424
|
Taro.eventCenter.trigger(TaroEventType.USER_AREA_UPDATE, {
|
|
425
425
|
area: this.info.pageInfo.address,
|
|
426
426
|
});
|
|
427
427
|
}
|
|
428
428
|
if (this.miniAppLogInstance) {
|
|
429
429
|
this.miniAppLogInstance.set({
|
|
430
430
|
account: pin,
|
|
431
431
|
unionid: wq_unionid,
|
|
432
432
|
openid: wxapp_openid,
|
|
433
433
|
});
|
|
434
434
|
}
|
|
435
435
|
this.config.wqCookie = wqCookie;
|
|
436
436
|
this.config.wqCookieStr = wqCookieStr;
|
|
437
437
|
this.config.getWqCookieKey = updateKey;
|
|
438
438
|
console.log('解析wxapp中的cookie信息成功,返回后存储', this.config);
|
|
439
439
|
resolve({
|
|
440
440
|
wqCookie,
|
|
441
441
|
wqCookieStr,
|
|
442
442
|
});
|
|
443
443
|
} else {
|
|
444
444
|
console.log('解析wxapp中的cookie信息异常,返回异常结果', this.config);
|
|
445
445
|
resolve({
|
|
446
446
|
wqCookie: false,
|
|
447
447
|
wqCookieStr: false,
|
|
448
448
|
});
|
|
449
449
|
}
|
|
450
450
|
} else {
|
|
451
451
|
resolve({
|
|
452
452
|
wqCookie: false,
|
|
453
453
|
wqCookieStr: false,
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
|
|
461
461
|
checkLoginStatus() {
|
|
462
462
|
return this.getLoginCookie();
|
|
463
463
|
}
|
|
464
464
|
|
|
465
465
|
getAddressCachePromise() {
|
|
466
466
|
return Promise.reject('该方法只在APP内适用');
|
|
467
467
|
}
|
|
468
468
|
|
|
469
469
|
getLbsAddressCachePromise() {
|
|
470
470
|
return Promise.resolve({
|
|
471
471
|
status: '-1005',
|
|
472
472
|
msg: '暂未实现,获取失败',
|
|
473
473
|
});
|
|
474
474
|
}
|
|
475
475
|
|
|
476
476
|
getDynamicConfig(key: string) {
|
|
477
477
|
console.warn('调用默认的 getDynamicConfig(),注意,此方法还未实现!');
|
|
478
478
|
return null;
|
|
479
479
|
}
|
|
480
480
|
|
|
481
481
|
updatePageAndLogInfo(updateQuery = {}) {
|
|
482
482
|
const createUpdateQueryInfo: {
|
|
483
483
|
query: {
|
|
484
484
|
shopId?: string | number;
|
|
485
485
|
venderId?: string | number;
|
|
486
486
|
};
|
|
487
487
|
updateShopInfoState: boolean;
|
|
488
488
|
} = Object.assign(
|
|
489
489
|
{},
|
|
490
490
|
{
|
|
491
491
|
query: {},
|
|
492
492
|
updateShopInfoState: false,
|
|
493
493
|
},
|
|
494
494
|
updateQuery,
|
|
495
495
|
);
|
|
496
496
|
console.log(
|
|
497
497
|
'获取当前下发的店铺查询参数',
|
|
498
498
|
updateQuery,
|
|
499
499
|
'获取之前保存的shopInfo店铺查询参数',
|
|
500
500
|
this.info?.shopInfo,
|
|
501
501
|
);
|
|
502
502
|
const { query, updateShopInfoState } = createUpdateQueryInfo;
|
|
503
503
|
const { shopId, venderId } = query;
|
|
504
504
|
if (updateShopInfoState) {
|
|
505
505
|
this.info.queryInfo = {
|
|
506
506
|
...this.info.queryInfo,
|
|
507
507
|
...query,
|
|
508
508
|
};
|
|
509
509
|
if (shopId && venderId) {
|
|
510
510
|
this.info.shopInfo = {
|
|
511
511
|
shopId: `${shopId}`,
|
|
512
512
|
venderId: `${venderId}`,
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
} else {
|
|
516
516
|
this.info.queryInfo = {
|
|
517
517
|
...query,
|
|
518
518
|
};
|
|
519
519
|
if (
|
|
520
520
|
this.info.shopInfo?.shopId &&
|
|
521
521
|
this.info.shopInfo?.venderId &&
|
|
522
522
|
(this.info.shopInfo.shopId == shopId || this.info.shopInfo.venderId == venderId)
|
|
523
523
|
) {
|
|
524
524
|
this.info.queryInfo.shopId = this.info.shopInfo.shopId;
|
|
525
525
|
this.info.queryInfo.venderId = this.info.shopInfo.venderId;
|
|
526
526
|
console.log(
|
|
527
527
|
'当前存储的店铺shopId和venderId与下发的店铺信息shopId或者venderId为同一个,补充shopId或者venderId查询参数',
|
|
528
528
|
this.info.queryInfo,
|
|
529
529
|
);
|
|
530
530
|
}
|
|
531
531
|
}
|
|
532
532
|
this.info.queryInfo['shopId'] &&
|
|
533
533
|
(this.info.queryInfo['shopId'] = `${this.info.queryInfo['shopId']}`);
|
|
534
534
|
this.info.queryInfo['venderId'] &&
|
|
535
535
|
(this.info.queryInfo['venderId'] = `${this.info.queryInfo['venderId']}`);
|
|
536
536
|
console.log(
|
|
537
537
|
'默认==获取店铺下发查询参数\n',
|
|
538
538
|
query,
|
|
539
539
|
'\n获取店铺最后查询参数\n',
|
|
540
540
|
this.info.queryInfo,
|
|
541
541
|
'\n是否为更新店铺状态\n',
|
|
542
542
|
updateShopInfoState,
|
|
543
543
|
);
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
checkJingGouWxappEnv() {
|
|
547
547
|
return false;
|
|
548
548
|
}
|
|
549
549
|
renderNextTickLoadSdk() {
|
|
550
550
|
console.warn('暂未实现 index.ts');
|
|
551
551
|
}
|
|
552
552
|
loadOtherSdk() {
|
|
553
553
|
console.warn('暂未实现 index.ts');
|
|
554
554
|
}
|
|
555
555
|
loadItemSdkPromise(jsInfo = {}) {
|
|
556
556
|
console.warn('暂未实现 index.ts');
|
|
557
557
|
}
|
|
558
558
|
createLanguageProimse() {
|
|
559
559
|
return Promise.reject({
|
|
560
560
|
msg: '暂未实现',
|
|
561
561
|
});
|
|
562
562
|
}
|