@conecli/cone-render 0.9.1-shop2.4 → 0.9.1-shop2.40

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