@conecli/cone-render 0.9.1-shop2.8 → 0.9.1-shop2.9

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 (39) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/environmentType.ts +1 -0
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.jd.ts +1 -1
  5. package/dist/common/index.ts +1 -1
  6. package/dist/common/index.weapp.ts +1 -1
  7. package/dist/common/sgmCustomCode.ts +1 -0
  8. package/dist/common/wxappApi.jd.ts +1 -0
  9. package/dist/components/ErrorBoundary.tsx +1 -1
  10. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  11. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  12. package/dist/components/floorItem.jd.tsx +1 -1
  13. package/dist/components/floorItem.weapp.tsx +1 -1
  14. package/dist/components/remoteFloorItem.tsx +1 -1
  15. package/dist/interface/common.ts +1 -1
  16. package/dist/interface/component.ts +1 -1
  17. package/dist/interface/jumpEventReport.ts +1 -1
  18. package/dist/interface/service.ts +1 -1
  19. package/dist/interface/utils.ts +1 -1
  20. package/dist/jumpEventReport/base.ts +1 -1
  21. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  22. package/dist/jumpEventReport/index.h5.ts +1 -1
  23. package/dist/jumpEventReport/index.jd.ts +1 -1
  24. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  25. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  26. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  27. package/dist/jumpEventReport/web.tjm.ts +1 -0
  28. package/dist/open/api/environment.ts +1 -1
  29. package/dist/open/api/track.ts +1 -1
  30. package/dist/service/requestServer.ts +1 -1
  31. package/dist/utils/draExceptionAndProfile.ts +1 -1
  32. package/dist/utils/h5Utils.ts +1 -1
  33. package/dist/utils/index.h5.ts +1 -1
  34. package/dist/utils/index.ts +1 -1
  35. package/dist/utils/index.weapp.ts +1 -1
  36. package/dist/utils/jm-common.js +1 -1
  37. package/dist/utils/sgmCodeUtils.ts +1 -0
  38. package/dist/utils/utils.ts +1 -1
  39. package/package.json +1 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  floorVideInfo: {},
3
2
  productVideInfo: {},
4
3
  isJdShowNativeImmersivePlayer: false,
5
4
  pageIdxHeightInfo: {
6
5
  list: []
7
6
  },
8
7
  jdBottomBarHeight: 0,
9
8
  jdNativeHeaderHeight: 0,
10
9
  shopInfo: {},
11
10
  openAppData: {}
12
11
  public config: object
13
12
  this.config = {}
14
13
 
15
14
  doLoginForJdPin(options = {}) {
16
15
  return this.doLogin(options)
17
16
  }
18
17
  return new Promise((resolve, reject) => {
19
18
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
20
19
  jd.requestWebCookie({
21
20
  needpin: 1,
22
21
  success: (res) => {
23
22
  console.log(res)
24
23
  const { ticket, pt_pin } = res
25
24
  console.log('requestWebCookie.success', res)
26
25
  this.info.userInfo = {
27
26
  pin: pt_pin,
28
27
  encodePin: encodeURIComponent(pt_pin),
29
28
  ptkey: ticket,
30
29
  }
31
30
  this.miniAppLogInstance &&
32
31
  this.miniAppLogInstance.set({
33
32
  account: pt_pin,
34
33
  })
35
34
  this.info.loginState = true
36
35
  resolve(res)
37
36
  },
38
37
  fail(res) {
39
38
  console.log('requestWebCookie.fail', res)
40
39
  reject(res)
41
40
  },
42
41
  })
43
42
  } else {
44
43
  resolve({
45
44
  pin: '',
46
45
  ptkey: '',
47
46
  mock: true
48
47
  })
49
48
  }
50
49
  })
51
50
  this.checkLoginStatus().then(res => {
52
51
  console.log(
53
52
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
54
53
  res,
55
54
  )
56
55
  resolve(res)
57
56
  }).catch(err => {
58
57
  console.warn(
59
58
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
60
59
  err,
61
60
  )
62
61
  this.toLogin().then(res => {
63
62
  resolve(res)
64
63
  }).catch(err => {
65
64
  reject(err)
66
65
  })
67
66
  })
68
67
  return this.checkStatusAndLoginPromise
69
68
  return new Promise((resolve,reject) => {
70
69
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
71
70
  jd.hasUserLogined({
72
71
  success: (res) => {
73
72
  console.log('hasUserLogined.success: ', res)
74
73
  if (res.status === 1) {
75
74
  this.getLoginCookie()
76
75
  resolve(res)
77
76
  }else {
78
77
  reject(res)
79
78
  }
80
79
  },
81
80
  fail: (res) => {
82
81
  console.warn('hasUserLogined.fail: ', res)
83
82
  reject(res)
84
83
  },
85
84
  })
86
85
  } else {
87
86
  reject(false)
88
87
  }
89
88
  })
90
89
 
91
90
  getAddressCachePromise = () => {
92
91
  return Promise.reject("该方法只在APP内适用")
92
+ import Taro from '@tarojs/taro'
93
93
  WXAPP_LOGIN,
94
94
  WXAPP_BIZ,
95
95
  WXAPP_USER_INFO,
96
96
  WXAPP_NAVIGATOR,
97
97
  WXAPP_REPORT_GDT,
98
98
  WXAPP_PARAMS_SIGN,
99
99
  WXAPP_FINGER_REPORT,
100
100
  WXAPP_REPORT_MANAGE,
101
101
  BUSINESS_TYPE,
102
102
  SHOP_MENU_ID_TYPE,
103
103
  SHOP_MENU_ID_NAME,
104
104
  SECTION_HOME_TAB_NAME_TYPE,
105
105
  SECTION_HOME_TAB_TYPE,
106
106
  TaroEventType,
107
107
  WX_BUSINESS_TYPE,
108
108
  WXAPP_BIZ_KEY,
109
109
  getSystemInfos,
110
110
  getTaroStorageKeyValue,
111
111
  getWxAppCookieStr,
112
112
  objectToUrlEncode,
113
113
  floorVideInfo: {},
114
114
  productVideInfo: {},
115
115
  updateShopInfosAllState: false,
116
116
  isJdShowNativeImmersivePlayer: false,
117
117
  pageIdxHeightInfo: {
118
118
  list: []
119
119
  },
120
120
  originQueryInfo: {},
121
121
  jdBottomBarHeight: 0,
122
122
  jdNativeHeaderHeight: 0,
123
123
  shopInfo: {},
124
124
  openAppData: {}
125
125
  public info: CommonInterFace.BaseConfigInfo
126
126
  public config: {
127
127
  [key: string]: any
128
128
  }
129
129
  public lazyContainer: CommonInterFace.lazyContainer
130
130
  public rootEleNode: HTMLElement | null
131
131
  public miniApplogUtil: CommonInterFace.MiniApplogUtil
132
132
  public miniAppLogInstance: CommonInterFace.MiniAppLog | null
133
133
  public checkStatusAndLoginPromise: object | null
134
134
  public wxAppLoginInstance: CommonInterFace.WxAppLogin
135
135
  public wxAppBizInstance: CommonInterFace.WxAppUserInfo
136
136
  public wxAppUserInfoInstance: CommonInterFace.WxAppUserInfo
137
137
  public wxAppReportManageInstance: CommonInterFace.wxAppReportManage
138
138
  public wxAppReportGDTInstance: CommonInterFace.WxAppReportGDT
139
139
  public wxAppNavigatorInstance: CommonInterFace.WxAppNavigator
140
140
  public wxAppParamsSignInstance: CommonInterFace.wxAppParamsSign
141
141
  public wxAppFingerReportInstance: CommonInterFace.wxAppParamsSign
142
142
  public wxAppSubsGuider: CommonInterFace.wxAppParamsSign
143
143
  constructor(opt) {
144
144
  this.info = this._getConfig(opt)
145
145
  this.config = {}
146
146
  this.lazyContainer = {
147
147
  [SECTION_HOME_TAB_NAME_TYPE[
148
148
  SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
149
149
  ]]: {
150
150
  appLazyContainerList: [],
151
151
  appLazyFinishContainerList: [],
152
152
  },
153
153
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]]:
154
154
  {
155
155
  appLazyContainerList: [],
156
156
  appLazyFinishContainerList: [],
157
157
  },
158
158
  }
159
159
  this.rootEleNode = null
160
160
  this.miniApplogUtil = MiniAppLogUtil
161
161
  this.miniAppLogInstance = null
162
162
  this.checkStatusAndLoginPromise = null
163
163
  this.wxAppLoginInstance = WXAPP_LOGIN
164
164
  this.wxAppBizInstance = WXAPP_BIZ
165
165
  this.wxAppUserInfoInstance = WXAPP_USER_INFO
166
166
  this.wxAppReportManageInstance = WXAPP_REPORT_MANAGE
167
167
  this.wxAppReportGDTInstance = WXAPP_REPORT_GDT
168
168
  this.wxAppNavigatorInstance = WXAPP_NAVIGATOR
169
169
  this.wxAppParamsSignInstance = WXAPP_PARAMS_SIGN
170
170
  this.wxAppFingerReportInstance = WXAPP_FINGER_REPORT ? new WXAPP_FINGER_REPORT() : {}
171
171
  this.wxAppSubsGuider = null
172
172
  }
173
173
 
174
174
  taskTimeoutPromise(callBack, timeout = 2000){
175
175
  return new Promise((resolve) => {
176
176
  setTimeout(() => {
177
177
  const getCallBackRes = typeof callBack === 'function' && callBack()
178
178
  return resolve(getCallBackRes || false)
179
179
  }, timeout)
180
180
  })
181
181
  }
182
182
 
183
183
  getTabBarHeight(systemInfo) {
184
184
  const { statusBarHeight, isAndroid, isIOS } = systemInfo
185
185
  let result = 50
186
186
  if (statusBarHeight > 20) {
187
187
  if (isIOS) {
188
188
  result = 84
189
189
  } else if (isAndroid) {
190
190
  result = 53
191
191
  }
192
192
  }
193
193
  return result
194
194
  }
195
195
 
196
196
  getSystemInfo() {
197
197
  const info: UtilsInterFace.taroGetSystemInfoSyncRes =
198
198
  getSystemInfos() || {}
199
199
  const actualNavBarHeight =
200
200
  (info?.navBarHeight || 0) + (info?.navBarExtendHeight || 0)
201
201
  const headerHeight = actualNavBarHeight + (info?.statusBarHeight || 0)
202
202
  const fullScreenHeight = this.getFullScreenHeight(info)
203
203
  const tabBarHeight = this.getTabBarHeight(info)
204
204
  const safeContentHeight = fullScreenHeight - headerHeight
205
205
  this.info.sysInfo = {
206
206
  ...this.info.sysInfo,
207
207
  ...info,
208
208
  actualNavBarHeight,
209
209
  headerHeight,
210
210
  fullScreenHeight,
211
211
  tabBarHeight,
212
212
  safeContentHeight,
213
213
  }
214
214
  if (this.info.sysInfo['hostVersionName']) {
215
215
  this.info.sysInfo['hostAppVersion'] = Number(
216
216
  this.info.sysInfo['hostVersionName'].replace(/\./g, ''),
217
217
  )
218
218
  }
219
219
  console.log('获取系统信息', this.info.sysInfo)
220
220
  this.getNetWorkType()
221
221
  }
222
222
 
223
223
  getNetWorkType() {
224
224
  Taro.getNetworkType().then((getRes) => {
225
225
  getRes &&
226
226
  getRes.networkType &&
227
227
  (this.info.sysInfo['netWorkType'] = getRes.networkType)
228
228
  })
229
229
  }
230
230
 
231
231
  checkStatusAndLogin(options = {}) {
232
232
  this.checkStatusAndLoginPromise = new Promise((resolve, reject) => {
233
233
  console.log(
234
234
  '微信小程序登录状态及获取cookie状态的promise,之前登录状态',
235
235
  this.info.loginState,
236
236
  )
237
237
  this.toLogin(options)
238
238
  .then((res) => {
239
239
  console.log('微信小程序登录状态结果,成功', res)
240
240
  this.info.loginState = true
241
241
  resolve(res)
242
242
  })
243
243
  .catch((err) => {
244
244
  console.log('微信小程序登录异常状态结果', err)
245
245
  this.doLogin(options)
246
246
  .then((res2) => {
247
247
  console.log(
248
248
  '微信小程序wxDoLogin强制登陆成功:',
249
249
  res2,
250
250
  )
251
251
  this.info.loginState = true
252
252
  resolve(res2)
253
253
  })
254
254
  .catch((err2) => {
255
255
  console.log(
256
256
  '微信小程序wxDoLogin强制登陆失败:',
257
257
  err2,
258
258
  )
259
259
  this.checkStatusAndLoginPromise = null
260
260
  reject(err2)
261
261
  })
262
262
  })
263
263
  })
264
264
  return this.checkStatusAndLoginPromise
265
265
  }
266
266
 
267
267
  checkJdStatusAndLogin(options){
268
268
  return this.checkStatusAndLogin(options)
269
269
  }
270
270
 
271
271
  doLoginForJdPin(options = {}) {
272
272
  return this.doLogin(options)
273
273
  }
274
274
 
275
275
  toLogin(options = {}): Promise<any> {
276
276
  return this.wxAppLoginInstance
277
277
  .getLoginPromise({
278
278
  mode: 'silent',
279
279
  loginColor: {
280
280
  biz: WXAPP_BIZ_KEY,
281
281
  dpin: 0,
282
282
  },
283
283
  ...options,
284
284
  })
285
285
  .then((res) => {
286
286
  console.log(
287
287
  '微信app登录返回信息,微信侧返回code为0表示成功',
288
288
  res,
289
289
  )
290
290
  setTimeout(() => {
291
291
  console.log("微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie")
292
292
  this.getLoginCookie(`${Date.now()}`)
293
293
  },500)
294
294
  })
295
295
  .catch((err) => {
296
296
  console.log('微信app登录异常返回信息,也获取cookie', err)
297
297
  this.getLoginCookie(`${Date.now()}`)
298
298
  })
299
299
  }
300
300
 
301
301
  doLogin(options) {
302
302
  console.log('触发松果小程序 doLogin() new new')
303
303
  return new Promise((resolve, reject) => {
304
304
  jd.login({
305
305
  success: (res) => {
306
306
  if (res.code) {
307
307
  console.log("[common]松果小程序登录成功", res.code)
308
308
  jd.redirectTo({
309
309
  url: `/pages/shopx/pages/index/index?${objectToUrlEncode({
310
310
  ...this.info.originQueryInfo
311
311
  })}`
312
312
  })
313
313
  resolve(res)
314
314
  } else {
315
315
  console.error("[common]松果小程序登录失败", res.errMsg)
316
316
  reject()
317
317
  }
318
318
  },
319
319
  fail: (res) => {
320
320
  console.error("[common]松果小程序登录失败", res.errMsg)
321
321
  reject()
322
322
  }
323
323
  })
324
324
  })
325
325
  }
326
326
 
327
327
  getLoginCookie(updateKey = 'wxapp') {
328
328
  return new Promise((resolve) => {
329
329
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
330
330
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
331
331
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
332
332
  resolve({
333
333
  wqCookie: this.config.wqCookie,
334
334
  wqCookieStr: this.config.wqCookieStr,
335
335
  })
336
336
  }else {
337
337
  if (isPublishToWxapp) {
338
338
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
339
339
  if (getWxappCookieObj) {
340
340
  const getCookieObj = getWxappCookieObj['_data']
341
341
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
342
342
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
343
343
  this.info.loginState = true
344
344
  this.info.userInfo.wqCookie = wqCookieStr
345
345
  this.info.userInfo.wqVisitkey = visitkey
346
346
  console.log('获取用户完整cookie信息', getCookieObj)
347
347
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
348
348
  console.log('获取微信用户地址信息', getUserAddress)
349
349
  if (getUserAddress) {
350
350
  this.info.pageInfo.address = getUserAddress?.areaId
351
351
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
352
352
  .address
353
353
  ? this.info.pageInfo.address.replace(/_/g, ',')
354
354
  : ''
355
355
  this.info.pageInfo.un_area = this.info.pageInfo.address
356
356
  Taro.eventCenter.trigger(
357
357
  TaroEventType.USER_AREA_UPDATE,
358
358
  this.info.pageInfo.address,
359
359
  )
360
360
  }
361
361
  if(this.miniAppLogInstance){
362
362
  this.miniAppLogInstance.set({
363
363
  account: pin,
364
364
  unionid: wq_unionid,
365
365
  openid: wxapp_openid,
366
366
  })
367
367
  }
368
368
  this.config.wqCookie = wqCookie
369
369
  this.config.wqCookieStr = wqCookieStr
370
370
  this.config.getWqCookieKey = updateKey
371
371
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
372
372
  resolve({
373
373
  wqCookie,
374
374
  wqCookieStr,
375
375
  })
376
376
  }else {
377
377
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
378
378
  resolve({
379
379
  wqCookie: false,
380
380
  wqCookieStr: false,
381
381
  })
382
382
  }
383
383
  }else {
384
384
  resolve({
385
385
  wqCookie: false,
386
386
  wqCookieStr: false,
387
387
  })
388
388
  }
389
389
  }
390
390
  })
391
391
  }
392
392
 
393
393
 
394
394
  checkLoginStatus() {
395
395
  return this.getLoginCookie()
396
396
  }
397
397
 
398
398
  getAddressCachePromise = () => {
399
399
  return Promise.reject("该方法只在APP内适用")
400
400
  }
401
401
 
402
402
  updatePageAndLogInfo(updateQuery = {}) {
403
403
  const createUpdateQueryInfo: {
404
404
  query: {
405
405
  shopId?: string | number
406
406
  venderId?: string | number
407
407
  },
408
408
  updateShopInfoState: boolean,
409
409
  } = Object.assign({}, {
410
410
  query: {},
411
411
  updateShopInfoState: false
412
412
  }, updateQuery)
413
413
  console.log("获取当前下发的店铺查询参数",updateQuery, '获取之前保存的shopInfo店铺查询参数', this.info?.shopInfo)
414
414
  const {query, updateShopInfoState} = createUpdateQueryInfo
415
415
  const {shopId, venderId} = query
416
416
  if (updateShopInfoState) {
417
417
  this.info.queryInfo = {
418
418
  ...this.info.queryInfo,
419
419
  ...query,
420
420
  }
421
421
  if(shopId && venderId){
422
422
  this.info.shopInfo = {
423
423
  shopId: `${shopId}`,
424
424
  venderId: `${venderId}`
425
425
  }
426
426
  }
427
427
  } else {
428
428
  this.info.queryInfo = {
429
429
  ...query
430
430
  }
431
431
  this.info.originQueryInfo = {
432
432
  ...query
433
433
  }
434
434
  if(this.info.shopInfo?.shopId && this.info.shopInfo?.venderId && (this.info.shopInfo.shopId == shopId || this.info.shopInfo.venderId == venderId)){
435
435
  this.info.queryInfo.shopId = this.info.shopInfo.shopId
436
436
  this.info.queryInfo.venderId = this.info.shopInfo.venderId
437
437
  console.log("当前存储的店铺shopId和venderId与下发的店铺信息shopId或者venderId为同一个,补充shopId或者venderId查询参数", this.info.queryInfo)
438
438
  }
439
439
  }
440
440
  this.info.queryInfo['shopId'] &&
441
441
  (this.info.queryInfo['shopId'] = `${this.info.queryInfo['shopId']}`)
442
442
  this.info.queryInfo['venderId'] &&
443
443
  (this.info.queryInfo[
444
444
  'venderId'
445
445
  ] = `${this.info.queryInfo['venderId']}`)
446
446
  console.log(
447
447
  'weapp===获取店铺下发查询参数\n',
448
448
  query,
449
449
  '\n获取店铺最后查询参数\n',
450
450
  this.info.queryInfo,
451
451
  '\n是否为更新店铺状态\n',
452
452
  updateShopInfoState
453
453
  )
454
454
  }
@@ -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
  removeJdAndroidRquestEventForTouchStart(){}
20
19
 
21
20
  doLoginForJdPin(options = {}) {
22
21
  return this.doLogin(options)
23
22
  }
24
23
 
25
24
  getLoginCookie(updateKey = 'wxapp') {
26
25
  return new Promise((resolve) => {
27
26
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
28
27
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
29
28
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
30
29
  resolve({
31
30
  wqCookie: this.config.wqCookie,
32
31
  wqCookieStr: this.config.wqCookieStr,
33
32
  })
34
33
  }else {
35
34
  if (isPublishToWxapp) {
36
35
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
37
36
  if (getWxappCookieObj) {
38
37
  const getCookieObj = getWxappCookieObj['_data']
39
38
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
40
39
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
41
40
  this.info.loginState = true
42
41
  this.info.userInfo.wqCookie = wqCookieStr
43
42
  this.info.userInfo.wqVisitkey = visitkey
44
43
  console.log('获取用户完整cookie信息', getCookieObj)
45
44
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
46
45
  console.log('获取微信用户地址信息', getUserAddress)
47
46
  if (getUserAddress) {
48
47
  this.info.pageInfo.address = getUserAddress?.areaId
49
48
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
50
49
  .address
51
50
  ? this.info.pageInfo.address.replace(/_/g, ',')
52
51
  : ''
53
52
  this.info.pageInfo.un_area = this.info.pageInfo.address
54
53
  Taro.eventCenter.trigger(
55
54
  TaroEventType.USER_AREA_UPDATE,
56
55
  this.info.pageInfo.address,
57
56
  )
58
57
  }
59
58
  if(this.miniAppLogInstance){
60
59
  this.miniAppLogInstance.set({
61
60
  account: pin,
62
61
  unionid: wq_unionid,
63
62
  openid: wxapp_openid,
64
63
  })
65
64
  }
66
65
  this.config.wqCookie = wqCookie
67
66
  this.config.wqCookieStr = wqCookieStr
68
67
  this.config.getWqCookieKey = updateKey
69
68
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
70
69
  resolve({
71
70
  wqCookie,
72
71
  wqCookieStr,
73
72
  })
74
73
  }else {
75
74
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
76
75
  resolve({
77
76
  wqCookie: false,
78
77
  wqCookieStr: false,
79
78
  })
80
79
  }
81
80
  }else {
82
81
  resolve({
83
82
  wqCookie: false,
84
83
  wqCookieStr: false,
85
84
  })
86
85
  }
87
86
  }
88
87
  })
89
88
  }
90
89
  return this.getLoginCookie()
91
90
 
92
91
  getAddressCachePromise = () => {
93
92
  return Promise.reject("该方法只在APP内适用")
94
93
  }
94
+ import Taro from '@tarojs/taro'
95
95
  floorVideInfo: {},
96
96
  productVideInfo: {},
97
97
  isVipShop: false,
98
98
  isJdShowNativeImmersivePlayer: false,
99
99
  pageIdxHeightInfo: {
100
100
  list: []
101
101
  },
102
102
  jdBottomBarHeight: 0,
103
103
  jdNativeHeaderHeight: 0,
104
104
  openAppData: {}
105
105
  public config: {
106
106
  [key: string]: any
107
107
  }
108
108
  public lazyContainer: CommonInterFace.lazyContainer
109
109
  public renderedIsvComponents: CommonInterFace.renderedIsvComponents
110
110
  this.config = {}
111
111
  this.renderedIsvComponents = {}
112
112
 
113
113
  taskTimeoutPromise(callBack, timeout = 2000){
114
114
  return new Promise((resolve) => {
115
115
  setTimeout(() => {
116
116
  const getCallBackRes = typeof callBack === 'function' && callBack()
117
117
  return resolve(getCallBackRes || false)
118
118
  }, timeout)
119
119
  })
120
120
  }
121
121
  removeJdAndroidRquestEventForTouchStart(){}
122
122
  checkStatusAndLogin(options = {}) {
123
123
 
124
124
  checkJdStatusAndLogin(options){
125
125
  return this.checkStatusAndLogin(options)
126
126
  }
127
127
 
128
128
  doLoginForJdPin(options = {}) {
129
129
  return this.doLogin(options)
130
130
  }
131
131
 
132
132
  getLoginCookie(updateKey = 'wxapp') {
133
133
  return new Promise((resolve) => {
134
134
  console.log("开始获取更新wxapp中的cookie信息", updateKey)
135
135
  if(this.config.wqCookie && this.config.wqCookieStr && this.config.getWqCookieKey === updateKey){
136
136
  console.log("已有存储wxapp中的cookie信息,直接返回",this.config)
137
137
  resolve({
138
138
  wqCookie: this.config.wqCookie,
139
139
  wqCookieStr: this.config.wqCookieStr,
140
140
  })
141
141
  }else {
142
142
  if (isPublishToWxapp) {
143
143
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null
144
144
  if (getWxappCookieObj) {
145
145
  const getCookieObj = getWxappCookieObj['_data']
146
146
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj)
147
147
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie
148
148
  this.info.loginState = true
149
149
  this.info.userInfo.wqCookie = wqCookieStr
150
150
  this.info.userInfo.wqVisitkey = visitkey
151
151
  console.log('获取用户完整cookie信息', getCookieObj)
152
152
  const getUserAddress = this.wxAppUserInfoInstance.getAddress()
153
153
  console.log('获取微信用户地址信息', getUserAddress)
154
154
  if (getUserAddress) {
155
155
  this.info.pageInfo.address = getUserAddress?.areaId
156
156
  this.info.pageInfo.addressCommaStr = this.info.pageInfo
157
157
  .address
158
158
  ? this.info.pageInfo.address.replace(/_/g, ',')
159
159
  : ''
160
160
  this.info.pageInfo.un_area = this.info.pageInfo.address
161
161
  Taro.eventCenter.trigger(
162
162
  TaroEventType.USER_AREA_UPDATE,
163
163
  this.info.pageInfo.address,
164
164
  )
165
165
  }
166
166
  if(this.miniAppLogInstance){
167
167
  this.miniAppLogInstance.set({
168
168
  account: pin,
169
169
  unionid: wq_unionid,
170
170
  openid: wxapp_openid,
171
171
  })
172
172
  }
173
173
  this.config.wqCookie = wqCookie
174
174
  this.config.wqCookieStr = wqCookieStr
175
175
  this.config.getWqCookieKey = updateKey
176
176
  console.log("解析wxapp中的cookie信息成功,返回后存储",this.config)
177
177
  resolve({
178
178
  wqCookie,
179
179
  wqCookieStr,
180
180
  })
181
181
  }else {
182
182
  console.log("解析wxapp中的cookie信息异常,返回异常结果",this.config)
183
183
  resolve({
184
184
  wqCookie: false,
185
185
  wqCookieStr: false,
186
186
  })
187
187
  }
188
188
  }else {
189
189
  resolve({
190
190
  wqCookie: false,
191
191
  wqCookieStr: false,
192
192
  })
193
193
  }
194
194
  }
195
195
  })
196
196
  }
197
197
  return this.getLoginCookie()
198
198
 
199
199
  getAddressCachePromise = () => {
200
200
  return Promise.reject("该方法只在APP内适用")
201
201
  }