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