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