@conecli/cone-render 0.8.38 → 0.8.39

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 (61) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  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/jssdk.ts +1 -0
  8. package/dist/common/pageType.ts +1 -0
  9. package/dist/common/token/index.h5.ts +1 -1
  10. package/dist/common/token/token.jd.ts +1 -1
  11. package/dist/common/wxappApi.ts +1 -1
  12. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  14. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  15. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  16. package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
  17. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  18. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  19. package/dist/components/base/Price/Double/index.tsx +1 -1
  20. package/dist/components/base/Price/index.tsx +1 -1
  21. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  22. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  23. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  24. package/dist/components/floorItem.tsx +1 -1
  25. package/dist/components/isv/Floor/index.tsx +1 -1
  26. package/dist/components/remoteFloorItem.tsx +1 -1
  27. package/dist/interface/common.ts +1 -1
  28. package/dist/interface/component.ts +1 -1
  29. package/dist/interface/jumpEventReport.ts +1 -1
  30. package/dist/interface/service.ts +1 -1
  31. package/dist/jumpEventReport/base.ts +1 -1
  32. package/dist/jumpEventReport/const.ts +1 -1
  33. package/dist/jumpEventReport/index.h5.ts +1 -1
  34. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  35. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  36. package/dist/jumpEventReport/web.base.ts +1 -1
  37. package/dist/jumpEventReport/web.jd.ts +1 -1
  38. package/dist/jumpEventReport/web.pc.ts +1 -0
  39. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  40. package/dist/open/api/environment.ts +1 -1
  41. package/dist/open/api/index.ts +1 -1
  42. package/dist/open/components/index.ts +1 -1
  43. package/dist/service/fetchGateway.ts +1 -1
  44. package/dist/service/http/const.ts +1 -1
  45. package/dist/service/requestServer.ts +1 -1
  46. package/dist/utils/h5Utils.ts +1 -1
  47. package/dist/utils/index.h5.ts +1 -1
  48. package/dist/utils/index.ts +1 -1
  49. package/dist/utils/index.weapp.ts +1 -1
  50. package/dist/utils/utils.ts +1 -1
  51. package/dist/wxapp/api/helper.js +1 -0
  52. package/dist/wxapp/components/launch-app/index.js +1 -0
  53. package/dist/wxapp/components/launch-app/index.json +5 -0
  54. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  55. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  56. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  57. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  58. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  59. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  60. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  61. package/package.json +1 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  urlCookie
3
2
  public config: {
4
3
  [key: string]: any
5
4
  }
6
5
  public lazyContainer: CommonInterFace.lazyContainer
7
6
  this.config = {}
8
7
  pin: cookie.get('pin') || ''
9
8
  })
10
9
  if(!this.checkStatusAndLoginPromise){
11
10
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
12
11
  try {
13
12
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
14
13
  if(getLoginState){
15
14
  resolve(true)
16
15
  }else {
17
16
  this.toLogin(options)
18
17
  reject(false)
19
18
  }
20
19
  }catch (e) {
21
20
  this.toLogin(options)
22
21
  reject(false)
23
22
  }
24
23
  })
25
24
  return this.checkStatusAndLoginPromise
26
25
  }else {
27
26
  return this.checkStatusAndLoginPromise.then(() => {
28
27
  return Promise.resolve(true)
29
28
  }).catch (() => {
30
29
  this.toLogin(options)
31
30
  return Promise.reject(true)
32
31
  })
33
32
  }
34
33
 
35
34
  doCheckLoginStateAndForApiCheck() {
36
35
  if(this.info.loginState){
37
36
  return Promise.resolve(true)
38
37
  }else {
39
38
  return new Promise((resolve, reject) => {
40
39
  if(this.info.isJingGouMiniViewState){
41
40
  const getWqAuthToken = cookie.get("wq_auth_token")
42
41
  if(getWqAuthToken){
43
42
  this.info.loginState = true
44
43
  resolve(true)
45
44
  }else {
46
45
  reject(false)
47
46
  }
48
47
  }else{
49
48
  Taro.request({
50
49
  url: api.isLogin,
51
50
  jsonp:true,
52
51
  timeout: 3000,
53
52
  success: (res) => {
54
53
  const {statusCode,data} = res
55
54
  if (statusCode === 200 && data?.islogin && Number(data.islogin) === 1) {
56
55
  this.info.loginState = true
57
56
  resolve(true);
58
57
  } else {
59
58
  reject(false)
60
59
  }
61
60
  },
62
61
  fail:(err) => {
63
62
  console.log("登录检查异常", err)
64
63
  reject(false)
65
64
  }
66
65
  })
67
66
  }
68
67
  })
69
68
  }
70
69
  }
71
70
 
72
71
  try {
73
72
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
74
73
  if(getLoginState){
75
74
  const { pin } = await this.getLoginCookie();
76
75
  this.info.userInfo = {
77
76
  pin,
78
77
  encodePin: encodeURIComponent(pin),
79
78
  ptkey: '',
80
79
  }
81
80
  resolve(true)
82
81
  }else {
83
82
  reject(false)
84
83
  }
85
84
  }catch (e) {
86
85
  reject(false)
87
86
  }
88
87
  })
89
88
  if(un_area && un_area.length > 0){
90
89
  this.info.pageInfo.address = un_area
91
90
  this.info.pageInfo.un_area = un_area
92
91
  this.info.pageInfo.addressCommaStr = un_area.replace(/_/g, ',')
93
92
  }
93
+ import Taro from '@tarojs/taro'
94
94
  isJdApp,
95
95
  jdAppVersion,
96
96
  jdAppVersionStr,
97
97
  isString,
98
98
  isObject,
99
99
  serialize,
100
100
  urlCookie,
101
101
  BUSINESS_TYPE,
102
102
  SECTION_HOME_TAB_TYPE,
103
103
  SECTION_HOME_TAB_NAME_TYPE,
104
104
  WXAPP_BIZ_KEY,
105
105
  WX_BUSINESS_TYPE,
106
106
  const designWidth = 750
107
107
  return (
108
108
  Math.ceil(
109
109
  (((parseInt(String(size), 10) / 40) * 750) / designWidth) * 10000,
110
110
  ) /
111
111
  10000 +
112
112
  'rem'
113
113
  )
114
114
  loginState: false,
115
115
  cookiesStr: '',
116
116
  userInfo: userPinKey,
117
117
  isJingGouMiniViewState: false,
118
118
  pageInfo: {
119
119
  wxBusinessType: WX_BUSINESS_TYPE.NO,
120
120
  address: '',
121
121
  addressCommaStr: '',
122
122
  un_area: '',
123
123
  vapptype: '1',
124
124
  pageType: 'home',
125
125
  isExposureState: false,
126
126
  moduleId: '',
127
127
  entrance: '',
128
128
  dataType: BUSINESS_TYPE.ONLINE,
129
129
  floorExposureInfo: {},
130
130
  floorVideInfo: {},
131
131
  tabsLoadAllDataInfo: {
132
132
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]:
133
133
  false,
134
134
  },
135
135
  updateShopInfosAllState: false,
136
136
  isVipShop: false,
137
137
  ...shopConfig,
138
138
  pageScrollTop: 0,
139
139
  shopNavBarHeight: 0,
140
140
  },
141
141
  defaultQueryLogInfo: {
142
142
  sourceType: 'JDshop',
143
143
  sourceValue: '',
144
144
  moduleId: 'none',
145
145
  entrance: 'none',
146
146
  },
147
147
  sysInfo: {
148
148
  windowWidth: isPc ? 375 : 0,
149
149
  containerWidth: isPc ? 375 : 0,
150
150
  windowHeight: 0,
151
151
  netWorkType: '4g',
152
152
  },
153
153
  queryInfo: {},
154
154
  shopInfo: {},
155
155
  public info: CommonInterFace.BaseConfigInfo
156
156
  public config: {
157
157
  [key: string]: any
158
158
  }
159
159
  public lazyContainer: CommonInterFace.lazyContainer
160
160
  public renderedIsvComponents: CommonInterFace.renderedIsvComponents
161
161
  public rootEleNode: HTMLElement | null
162
162
  public checkStatusAndLoginPromise: object | null
163
163
  constructor(opt) {
164
164
  this.info = this._getConfig(opt)
165
165
  this.config = {}
166
166
  this.lazyContainer = {
167
167
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: {
168
168
  appLazyContainerList: [],
169
169
  appLazyFinishContainerList: [],
170
170
  },
171
171
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]]: {
172
172
  appLazyContainerList: [],
173
173
  appLazyFinishContainerList: [],
174
174
  },
175
175
  }
176
176
  this.renderedIsvComponents = {}
177
177
  this.rootEleNode = document.querySelector('body')
178
178
  this.checkStatusAndLoginPromise = null
179
179
  }
180
180
  _getConfig(opt) {
181
181
  return Object.assign({}, DefaultConfig, opt)
182
182
  }
183
183
 
184
184
  updateBusinessDomainAndApi(domain, api) {
185
185
  }
186
186
 
187
187
  getSystemInfo() {
188
188
  const info: UtilsInterFace.taroGetSystemInfoSyncRes = isPc
189
189
  ? {}
190
190
  : getSystemInfos()
191
191
  this.info.sysInfo = {
192
192
  actualNavBarHeight: 0,
193
193
  ...this.info.sysInfo,
194
194
  ...info,
195
195
  safeContentHeight: info.screenHeight,
196
196
  headerHeight: 0,
197
197
  tabBarHeight: 0,
198
198
  }
199
199
  if (isJdApp) {
200
200
  this.info.sysInfo['hostVersionName'] = jdAppVersionStr
201
201
  this.info.sysInfo['hostAppVersion'] = jdAppVersion
202
202
  this.getAddressCachePromise()
203
203
  }
204
204
  this.getNetWorkType()
205
205
  }
206
206
 
207
207
  getNetWorkType() {
208
208
  Taro.getNetworkType().then((getRes) => {
209
209
  getRes &&
210
210
  getRes.networkType &&
211
211
  (this.info.sysInfo['netWorkType'] = getRes.networkType)
212
212
  })
213
213
  }
214
214
  registerCode(code: string) {
215
215
  if (window?.jmfe) {
216
216
  console.log('registerCode:', code)
217
217
  window.jmfe.registerCode(code)
218
218
  } else {
219
219
  console.warn('jmfe对象不存在,可能没有提前引入jd-jssdk.js')
220
220
  }
221
221
  }
222
222
  getCacheAddressRouter() {
223
223
  if (!window.jmfe) return
224
224
  if (isAndroidDevice) {
225
225
  return window.jmfe.callRouter({
226
226
  jdRouter: '1',
227
227
  routerURL: 'router://JDAddressModule/getCacheAddress',
228
228
  routerParam: { sceneId: 'basicShoppingProcess' },
229
229
  })
230
230
  } else {
231
231
  return window.jmfe.callRouter({
232
232
  jdRouter: '1',
233
233
  routerURL: 'router://JDBAddressCacheManagerModule/getCacheAddress',
234
234
  routerParam: { sceneId: 'basicShoppingProcess' },
235
235
  })
236
236
  }
237
237
  }
238
238
 
239
239
  getAddressCachePromise() {
240
240
  return new Promise((resolve, reject) => {
241
241
  if (
242
242
  this?.info?.sysInfo?.lat &&
243
243
  this?.info?.sysInfo?.lng &&
244
244
  this?.info?.sysInfo?.area
245
245
  ) {
246
246
  resolve({
247
247
  lat: this.info.sysInfo.lat,
248
248
  lng: this.info.sysInfo.lng,
249
249
  area: this?.info?.sysInfo?.area,
250
250
  })
251
251
  } else {
252
252
  ready('jmfe', 3000)
253
253
  .then(() => {
254
254
  this.registerCode(JSSDK_APP_WEBVIEW_CODE)
255
255
  this.getCacheAddressRouter()
256
256
  .then(({ status, data }) => {
257
257
  if (status === '0' && data) {
258
258
  let area = '',
259
259
  lat = this?.info?.sysInfo?.lat || '',
260
260
  lng = this?.info?.sysInfo?.lng || ''
261
261
  if (
262
262
  (data?.lat || data?.latitude) &&
263
263
  (data?.lng || data?.longitude)
264
264
  ) {
265
265
  lat = data.lat || data.latitude
266
266
  lng = data.lng || data.longitude
267
267
  this.info.sysInfo['lat'] = lat
268
268
  this.info.sysInfo['lng'] = lng
269
269
  }
270
270
  if (data.provinceId) {
271
271
  area = `${data.provinceId}_${data.cityId || 0}_${
272
272
  data.countyId || 0
273
273
  }_${data.townId || 0}`
274
274
  this.info.pageInfo['address'] = area
275
275
  this.info.pageInfo['addressCommaStr'] = area.replace(
276
276
  /_/g,
277
277
  ',',
278
278
  )
279
279
  }
280
280
  resolve({
281
281
  lat: lat,
282
282
  lng: lng,
283
283
  area: area,
284
284
  })
285
285
  } else {
286
286
  resolve({ lat: '', lng: '', area: '' })
287
287
  }
288
288
  })
289
289
  .catch(() => {
290
290
  reject(null)
291
291
  })
292
292
  })
293
293
  .catch(() => {
294
294
  console.log('window.jmfe不存在')
295
295
  reject(null)
296
296
  })
297
297
  }
298
298
  })
299
299
  }
300
300
 
301
301
  toLogin(options) {
302
302
  return this.info.isJingGouMiniViewState
303
303
  ? this.toWxAppLogin(options)
304
304
  : this.toWebLogin(options)
305
305
  }
306
306
 
307
307
  doLogin(options) {
308
308
  return this.toLogin(options)
309
309
  }
310
310
 
311
311
  toWebLogin(options) {
312
312
  let params: {
313
313
  returnurl: string
314
314
  } = {
315
315
  returnurl: '',
316
316
  }
317
317
  const loginUrl = isPc
318
318
  ? `//passport.jd.com/new/login.aspx`
319
319
  : `${domain.mobileLogin}/user/login.action`
320
320
  const defaultParams = {
321
321
  appid: '100',
322
322
  returnurl: window.location.href,
323
323
  }
324
324
  if (isString(options)) {
325
325
  params = Object.assign({}, defaultParams, {
326
326
  returnurl: options,
327
327
  })
328
328
  } else if (isObject(options)) {
329
329
  params = Object.assign({}, defaultParams, options)
330
330
  } else {
331
331
  params = defaultParams
332
332
  }
333
333
  params.returnurl = encodeURIComponent(params.returnurl)
334
334
  let getFullUrl = loginUrl + '?' + serialize(params)
335
335
  if (isPc) {
336
336
  getFullUrl = getFullUrl.replace(/returnurl/, 'ReturnUrl')
337
337
  }
338
338
  return Promise.resolve({
339
339
  h5ToUrl: true,
340
340
  url: getFullUrl,
341
341
  }).then(() => {
342
342
  window.location.href = getFullUrl
343
343
  })
344
344
  }
345
345
 
346
346
  toWxAppLogin(options) {
347
347
  console.log('微信京购小程序中h5登录跳转', options)
348
348
  return Promise.resolve(true).then(() => {
349
349
  window.location.href = `${
350
350
  domain.wq
351
351
  }/pinbind/pintokenredirect?biz=${WXAPP_BIZ_KEY}&url=${encodeURIComponent(
352
352
  window.location.href,
353
353
  )}`
354
354
  })
355
355
  }
356
356
 
357
357
  getLoginCookie() {
358
358
  return Promise.resolve({
359
359
  pin: cookie.get('pin') || '',
360
360
  })
361
361
  }
362
362
 
363
363
  clearLoginCookie() {
364
364
  cookie.remove('pin')
365
365
  }
366
366
 
367
367
  checkStatusAndLogin(options = {}) {
368
368
  if (!this.checkStatusAndLoginPromise) {
369
369
  this.checkStatusAndLoginPromise = new Promise(async (resolve, reject) => {
370
370
  try {
371
371
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
372
372
  if (getLoginState) {
373
373
  resolve(true)
374
374
  } else {
375
375
  this.toLogin(options)
376
376
  reject(false)
377
377
  }
378
378
  } catch (e) {
379
379
  this.toLogin(options)
380
380
  reject(false)
381
381
  }
382
382
  })
383
383
  return this.checkStatusAndLoginPromise
384
384
  } else {
385
385
  return this.checkStatusAndLoginPromise
386
386
  .then(() => {
387
387
  return Promise.resolve(true)
388
388
  })
389
389
  .catch(() => {
390
390
  this.toLogin(options)
391
391
  return Promise.reject(true)
392
392
  })
393
393
  }
394
394
  }
395
395
 
396
396
  doCheckLoginStateAndForApiCheck() {
397
397
  if (this.info.loginState) {
398
398
  return Promise.resolve(true)
399
399
  } else {
400
400
  return new Promise((resolve, reject) => {
401
401
  if (this.info.isJingGouMiniViewState) {
402
402
  const getWqAuthToken = cookie.get('wq_auth_token')
403
403
  if (getWqAuthToken) {
404
404
  this.info.loginState = true
405
405
  resolve(true)
406
406
  } else {
407
407
  reject(false)
408
408
  }
409
409
  } else {
410
410
  Taro.request({
411
411
  url: api.isLogin,
412
412
  jsonp: true,
413
413
  timeout: 3000,
414
414
  success: (res) => {
415
415
  const { statusCode, data } = res
416
416
  if (
417
417
  statusCode === 200 &&
418
418
  data?.islogin &&
419
419
  Number(data.islogin) === 1
420
420
  ) {
421
421
  this.info.loginState = true
422
422
  resolve(true)
423
423
  } else {
424
424
  reject(false)
425
425
  }
426
426
  },
427
427
  fail: (err) => {
428
428
  console.log('登录检查异常', err)
429
429
  reject(false)
430
430
  },
431
431
  })
432
432
  }
433
433
  })
434
434
  }
435
435
  }
436
436
 
437
437
  checkLoginStatus() {
438
438
  return new Promise(async (resolve, reject) => {
439
439
  try {
440
440
  const getLoginState = await this.doCheckLoginStateAndForApiCheck()
441
441
  if (getLoginState) {
442
442
  const { pin } = await this.getLoginCookie()
443
443
  this.info.userInfo = {
444
444
  pin,
445
445
  encodePin: encodeURIComponent(pin),
446
446
  ptkey: '',
447
447
  }
448
448
  resolve(true)
449
449
  } else {
450
450
  reject(false)
451
451
  }
452
452
  } catch (e) {
453
453
  reject(false)
454
454
  }
455
455
  })
456
456
  }
457
457
 
458
458
  updatePageAndLogInfo(updateQuery = {}) {
459
459
  const createUpdateQueryInfo: {
460
460
  query: {
461
461
  shopId?: string | number
462
462
  venderId?: string | number
463
463
  }
464
464
  updateShopInfoState: boolean
465
465
  } = Object.assign(
466
466
  {},
467
467
  {
468
468
  query: {},
469
469
  updateShopInfoState: false,
470
470
  },
471
471
  updateQuery,
472
472
  )
473
473
  console.log(
474
474
  '获取当前下发的店铺查询参数',
475
475
  updateQuery,
476
476
  '获取之前保存的shopInfo店铺查询参数',
477
477
  this.info?.shopInfo,
478
478
  )
479
479
  const { query, updateShopInfoState } = createUpdateQueryInfo
480
480
  const { shopId, venderId, un_area } = query
481
481
  if (updateShopInfoState) {
482
482
  this.info.queryInfo = {
483
483
  ...this.info.queryInfo,
484
484
  ...query,
485
485
  }
486
486
  if (shopId && venderId) {
487
487
  this.info.shopInfo = {
488
488
  shopId: `${shopId}`,
489
489
  venderId: `${venderId}`,
490
490
  }
491
491
  }
492
492
  } else {
493
493
  this.info.queryInfo = {
494
494
  ...query,
495
495
  }
496
496
  if (
497
497
  this.info.shopInfo?.shopId &&
498
498
  this.info.shopInfo?.venderId &&
499
499
  (this.info.shopInfo.shopId == shopId ||
500
500
  this.info.shopInfo.venderId == venderId)
501
501
  ) {
502
502
  this.info.queryInfo.shopId = this.info.shopInfo.shopId
503
503
  this.info.queryInfo.venderId = this.info.shopInfo.venderId
504
504
  console.log(
505
505
  '当前存储的店铺shopId和venderId与下发的店铺信息shopId或者venderId为同一个,补充shopId或者venderId查询参数',
506
506
  this.info.queryInfo,
507
507
  )
508
508
  }
509
509
  }
510
510
  this.info.queryInfo['shopId'] &&
511
511
  (this.info.queryInfo['shopId'] = `${this.info.queryInfo['shopId']}`)
512
512
  this.info.queryInfo['venderId'] &&
513
513
  (this.info.queryInfo['venderId'] = `${this.info.queryInfo['venderId']}`)
514
514
  console.log(
515
515
  'h5==获取店铺下发查询参数\n',
516
516
  query,
517
517
  '\n获取店铺最后查询参数\n',
518
518
  this.info.queryInfo,
519
519
  '\n是否为更新店铺状态\n',
520
520
  updateShopInfoState,
521
521
  )
522
522
  const changeArea =
523
523
  un_area && un_area.length > 0 ? un_area : ipLoc_djd ? ipLoc_djd : ''
524
524
  if (changeArea) {
525
525
  this.info.pageInfo.address = changeArea
526
526
  this.info.pageInfo.un_area = changeArea
527
527
  this.info.pageInfo.addressCommaStr = changeArea.replace(/_/g, ',')
528
528
  }
529
529
  if (urlCookie['wq_auth_token']) {
530
530
  try {
531
531
  this.info.userInfo.wqAuthToken = urlCookie['wq_auth_token']
532
532
  console.log(
533
533
  'url中获取cookie内wq_auth_token下发成功,将会在接口中的cookie携带',
534
534
  urlCookie['wq_auth_token'],
535
535
  )
536
536
  cookie.set('wq_auth_token', this.info.userInfo.wqAuthToken, {
537
537
  domain: '.jd.com',
538
538
  path: '/',
539
539
  expires: new Date(Date.now() + 4 * 60 * 60 * 1000),
540
540
  })
541
541
  } catch (e) {
542
542
  console.log(
543
543
  'url中转换解析下发的cookie失败,这里主要是京购下面访问h5会携带',
544
544
  )
545
545
  }
546
546
  }
547
547
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  public config: object
3
2
  this.config = {}
4
3
  return new Promise((resolve, reject) => {
5
4
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
6
5
  jd.requestWebCookie({
7
6
  needpin: 1,
8
7
  success: (res) => {
9
8
  console.log(res)
10
9
  const { ticket, pt_pin } = res
11
10
  console.log('requestWebCookie.success', res)
12
11
  this.info.userInfo = {
13
12
  pin: pt_pin,
14
13
  encodePin: encodeURIComponent(pt_pin),
15
14
  ptkey: ticket,
16
15
  }
17
16
  this.miniAppLogInstance &&
18
17
  this.miniAppLogInstance.set({
19
18
  account: pt_pin,
20
19
  })
21
20
  this.info.loginState = true
22
21
  resolve(res)
23
22
  },
24
23
  fail(res) {
25
24
  console.log('requestWebCookie.fail', res)
26
25
  reject(res)
27
26
  },
28
27
  })
29
28
  } else {
30
29
  resolve({
31
30
  pin: '',
32
31
  ptkey: '',
33
32
  mock: true
34
33
  })
35
34
  }
36
35
  })
37
36
  this.checkLoginStatus().then(res => {
38
37
  console.log(
39
38
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
40
39
  res,
41
40
  )
42
41
  resolve(res)
43
42
  }).catch(err => {
44
43
  console.warn(
45
44
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
46
45
  err,
47
46
  )
48
47
  this.toLogin().then(res => {
49
48
  resolve(res)
50
49
  }).catch(err => {
51
50
  reject(err)
52
51
  })
53
52
  })
54
53
  return this.checkStatusAndLoginPromise
55
54
  return new Promise((resolve,reject) => {
56
55
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
57
56
  jd.hasUserLogined({
58
57
  success: (res) => {
59
58
  console.log('hasUserLogined.success: ', res)
60
59
  if (res.status === 1) {
61
60
  this.getLoginCookie()
62
61
  resolve(res)
63
62
  }else {
64
63
  reject(res)
65
64
  }
66
65
  },
67
66
  fail: (res) => {
68
67
  console.warn('hasUserLogined.fail: ', res)
69
68
  reject(res)
70
69
  },
71
70
  })
72
71
  } else {
73
72
  reject(false)
74
73
  }
75
74
  })
75
+ import Taro from '@tarojs/taro'
76
76
  floorVideInfo: {},
77
77
  public config: object
78
78
  this.config = {}
79
79
  return new Promise((resolve, reject) => {
80
80
  if (typeof jd !== 'undefined' && jd.requestWebCookie) {
81
81
  jd.requestWebCookie({
82
82
  needpin: 1,
83
83
  success: (res) => {
84
84
  console.log(res)
85
85
  const { ticket, pt_pin } = res
86
86
  console.log('requestWebCookie.success', res)
87
87
  this.info.userInfo = {
88
88
  pin: pt_pin,
89
89
  encodePin: encodeURIComponent(pt_pin),
90
90
  ptkey: ticket,
91
91
  }
92
92
  this.miniAppLogInstance &&
93
93
  this.miniAppLogInstance.set({
94
94
  account: pt_pin,
95
95
  })
96
96
  this.info.loginState = true
97
97
  resolve(res)
98
98
  },
99
99
  fail(res) {
100
100
  console.log('requestWebCookie.fail', res)
101
101
  reject(res)
102
102
  },
103
103
  })
104
104
  } else {
105
105
  resolve({
106
106
  pin: '',
107
107
  ptkey: '',
108
108
  mock: true
109
109
  })
110
110
  }
111
111
  })
112
112
  this.checkLoginStatus().then(res => {
113
113
  console.log(
114
114
  'jdLoadCheckStatusAndLogin hasUserLogined.success: ',
115
115
  res,
116
116
  )
117
117
  resolve(res)
118
118
  }).catch(err => {
119
119
  console.warn(
120
120
  'jdLoadCheckStatusAndLogin hasUserLogined.fail: ',
121
121
  err,
122
122
  )
123
123
  this.toLogin().then(res => {
124
124
  resolve(res)
125
125
  }).catch(err => {
126
126
  reject(err)
127
127
  })
128
128
  })
129
129
  return this.checkStatusAndLoginPromise
130
130
  return new Promise((resolve,reject) => {
131
131
  if (typeof jd !== 'undefined' && jd.hasUserLogined) {
132
132
  jd.hasUserLogined({
133
133
  success: (res) => {
134
134
  console.log('hasUserLogined.success: ', res)
135
135
  if (res.status === 1) {
136
136
  this.getLoginCookie()
137
137
  resolve(res)
138
138
  }else {
139
139
  reject(res)
140
140
  }
141
141
  },
142
142
  fail: (res) => {
143
143
  console.warn('hasUserLogined.fail: ', res)
144
144
  reject(res)
145
145
  },
146
146
  })
147
147
  } else {
148
148
  reject(false)
149
149
  }
150
150
  })
151
151
 
152
152
  getAddressCachePromise = () => {
153
153
  return Promise.reject("该方法只在APP内适用")