@conecli/cone-render 0.9.1-isv2.0 → 0.9.1-isv2.1

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