@conecli/cone-render 0.9.1-shop2.3 → 0.9.1-shop2.31

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