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