@conecli/cone-render 0.10.1-shop3.5 → 0.10.1-shop3.50

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 (99) hide show
  1. package/README.md +1 -1
  2. package/dist/common/accessibility.h5.ts +1 -0
  3. package/dist/common/accessibility.ts +0 -0
  4. package/dist/common/const.ts +1 -1
  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.weapp.tsx +1 -0
  10. package/dist/common/jssdk.ts +1 -1
  11. package/dist/common/jssdk.weapp.ts +1 -0
  12. package/dist/common/pageType.ts +1 -1
  13. package/dist/common/token/index.h5.ts +1 -1
  14. package/dist/common/token/token.jd.ts +1 -1
  15. package/dist/common/wxappApi.ts +1 -1
  16. package/dist/components/ErrorBoundary.tsx +1 -1
  17. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  18. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  19. package/dist/components/base/CountDown/index.tsx +1 -1
  20. package/dist/components/base/CustomScrollView/index-back.tsx +1 -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/CustomVideo/index.weapp.tsx +1 -0
  24. package/dist/components/base/Dialog/index.module.scss +11 -0
  25. package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
  26. package/dist/components/base/InViewRender/index.tsx +1 -1
  27. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  28. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  29. package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
  30. package/dist/components/base/NetworkDataError/const.ts +1 -1
  31. package/dist/components/base/NetworkDataError/index.module.scss +118 -72
  32. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  33. package/dist/components/base/Price/Base/index.module.scss +12 -0
  34. package/dist/components/base/Price/Base/index.tsx +1 -1
  35. package/dist/components/base/Price/Double/index.module.scss +24 -0
  36. package/dist/components/base/Price/Double/index.tsx +1 -1
  37. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  38. package/dist/components/floorItem.weapp.tsx +1 -1
  39. package/dist/interface/common.ts +1 -1
  40. package/dist/interface/component.ts +1 -1
  41. package/dist/interface/jumpEventReport.ts +1 -1
  42. package/dist/jumpEventReport/base.ts +1 -1
  43. package/dist/jumpEventReport/const.ts +1 -1
  44. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  45. package/dist/jumpEventReport/index.h5.ts +1 -1
  46. package/dist/jumpEventReport/index.jd.ts +1 -1
  47. package/dist/jumpEventReport/index.weapp.ts +1 -1
  48. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  49. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  50. package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
  51. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  52. package/dist/jumpEventReport/web/report.ts +1 -1
  53. package/dist/jumpEventReport/web.base.ts +1 -1
  54. package/dist/jumpEventReport/web.jd.ts +1 -1
  55. package/dist/jumpEventReport/web.pc.ts +1 -1
  56. package/dist/jumpEventReport/web.tjm.ts +1 -1
  57. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  58. package/dist/language/en_US.json +231 -0
  59. package/dist/language/zh_CN.json +231 -0
  60. package/dist/language/zh_HK.json +231 -0
  61. package/dist/libs/taroAppReport.js +2 -2
  62. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -56
  63. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  64. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  65. package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
  66. package/dist/open/api/environment.ts +1 -1
  67. package/dist/open/api/shopMember.ts +1 -1
  68. package/dist/open/api/shopMember.weapp.ts +1 -0
  69. package/dist/open/api/util.ts +1 -1
  70. package/dist/open/index.ts +1 -1
  71. package/dist/sass/app.h5.scss +278 -224
  72. package/dist/service/fetchGateway.ts +1 -1
  73. package/dist/service/fetchGateway.weapp.ts +1 -0
  74. package/dist/service/fetchJsonp.weapp.ts +1 -0
  75. package/dist/service/http/colorSign.ts +1 -1
  76. package/dist/service/http/const.ts +1 -1
  77. package/dist/service/http/h5Http.ts +1 -1
  78. package/dist/service/http/httpInterceptors.weapp.ts +1 -0
  79. package/dist/service/requestServer.h5.ts +1 -1
  80. package/dist/service/requestServer.ts +1 -1
  81. package/dist/service/requestServer.weapp.ts +1 -0
  82. package/dist/utils/connectNativeJsBridge.ts +1 -1
  83. package/dist/utils/h5Utils.ts +1 -1
  84. package/dist/utils/harmonyCallRouter.h5.ts +1 -0
  85. package/dist/utils/harmonyCallRouter.ts +0 -0
  86. package/dist/utils/index.h5.ts +1 -1
  87. package/dist/utils/index.ts +1 -1
  88. package/dist/utils/index.weapp.ts +1 -1
  89. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  90. package/dist/utils/jumpExtMapUtil.ts +1 -0
  91. package/dist/utils/log.ts +1 -0
  92. package/dist/utils/{sColor.js → sColor.ts} +1 -1
  93. package/dist/utils/sColor.weapp.ts +1 -0
  94. package/dist/utils/utils.ts +1 -1
  95. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  96. package/dist/wxapp/common/user_info.js +1 -1
  97. package/package.json +160 -141
  98. package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
  99. package/dist/utils/priceUtils.js +0 -1
@@ -1 +1 @@
1
- import Taro from "@tarojs/taro";
2
1
  WXAPP_LOGIN,
3
2
  WXAPP_BIZ,
4
3
  WXAPP_USER_INFO,
5
4
  WXAPP_NAVIGATOR,
6
5
  WXAPP_REPORT_GDT,
7
6
  WXAPP_PARAMS_SIGN,
8
7
  WXAPP_FINGER_REPORT,
9
8
  WXAPP_REPORT_MANAGE,
10
9
  WXAPP_SUBS_GUIDER,
11
10
  BUSINESS_TYPE,
12
11
  SHOP_MENU_ID_TYPE,
13
12
  SHOP_MENU_ID_NAME,
14
13
  SECTION_HOME_TAB_NAME_TYPE,
15
14
  SECTION_HOME_TAB_TYPE,
16
15
  TaroEventType,
17
16
  WX_BUSINESS_TYPE,
18
17
  WXAPP_BIZ_KEY,
19
18
  WXAPP_BIZ_SHOP_LIGHT_KEY,
20
19
  getSystemInfos,
21
20
  getTaroStorageKeyValue,
22
21
  getWxAppCookieStr,
23
22
  objectToUrlEncode,
24
23
  loginState: jdUserLoginState,
25
24
  cookiesStr: "",
26
25
  userInfo: userPinKey,
27
26
  pageInfo: {
28
27
  wxBusinessType: WX_BUSINESS_TYPE.SHOP,
29
28
  address: "",
30
29
  addressCommaStr: "",
31
30
  un_area: "",
32
31
  vapptype: "1",
33
32
  pageType: "home",
34
33
  dataType: BUSINESS_TYPE.ONLINE,
35
34
  floorExposureInfo: {},
36
35
  floorVideInfo: {},
37
36
  productVideInfo: {},
38
37
  tabsLoadAllDataInfo: {
39
38
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]:
40
39
  false,
41
40
  [SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY]]: true,
42
41
  },
43
42
  updateShopInfosAllState: false,
44
43
  isVipShop: false,
45
44
  isJdShowNativeImmersivePlayer: false,
46
45
  ...shopConfig,
47
46
  pageScrollTop: 0,
48
47
  pageIdxHeightInfo: {
49
48
  list: [],
50
49
  },
51
50
  shopNavBarHeight: 0,
52
51
  },
53
52
  defaultQueryLogInfo: {
54
53
  sourceType: "JDshop",
55
54
  sourceValue: "",
56
55
  moduleId: "none",
57
56
  entrance: "none",
58
57
  },
59
58
  originQueryInfo: {},
60
59
  sysInfo: {
61
60
  windowWidth: 0,
62
61
  windowHeight: 0,
63
62
  netWorkType: "4g",
64
63
  jdBottomBarHeight: 0,
65
64
  jdNativeHeaderHeight: 0,
66
65
  },
67
66
  queryInfo: {},
68
67
  shopInfo: {},
69
68
  openAppData: {},
70
69
  public info: CommonInterFace.BaseConfigInfo;
71
70
  public config: {
72
71
  [key: string]: any;
73
72
  };
74
73
  public lazyContainer: CommonInterFace.lazyContainer;
75
74
  public rootEleNode: HTMLElement | null;
76
75
  public miniApplogUtil: CommonInterFace.MiniApplogUtil;
77
76
  public miniAppLogInstance: CommonInterFace.MiniAppLog | null;
78
77
  public checkStatusAndLoginPromise: object | null;
79
78
  public wxAppLoginInstance: CommonInterFace.WxAppLogin;
80
79
  public wxAppBizInstance: CommonInterFace.WxAppUserInfo;
81
80
  public wxAppUserInfoInstance: CommonInterFace.WxAppUserInfo;
82
81
  public wxAppReportManageInstance: CommonInterFace.wxAppReportManage;
83
82
  public wxAppReportGDTInstance: CommonInterFace.WxAppReportGDT;
84
83
  public wxAppNavigatorInstance: CommonInterFace.WxAppNavigator;
85
84
  public wxAppParamsSignInstance: CommonInterFace.wxAppParamsSign;
86
85
  public wxAppFingerReportInstance: CommonInterFace.wxAppParamsSign;
87
86
  public wxAppSubsGuider: CommonInterFace.wxAppParamsSign;
88
87
  public loadJsSdkList: Array<any>
89
88
  public loadJsSdkListCachePromise: any
90
89
  constructor(opt) {
91
90
  this.info = this._getConfig(opt);
92
91
  this.config = {};
93
92
  this.lazyContainer = {
94
93
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: {
95
94
  appLazyContainerList: [],
96
95
  appLazyFinishContainerList: [],
97
96
  },
98
97
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]]: {
99
98
  appLazyContainerList: [],
100
99
  appLazyFinishContainerList: [],
101
100
  },
102
101
  };
103
102
  this.loadJsSdkList = []
104
103
  this.loadJsSdkListCachePromise = {}
105
104
  this.rootEleNode = null;
106
105
  this.miniApplogUtil = MiniAppLogUtil;
107
106
  this.miniAppLogInstance = null;
108
107
  this.checkStatusAndLoginPromise = null;
109
108
  this.wxAppLoginInstance = WXAPP_LOGIN;
110
109
  this.wxAppBizInstance = WXAPP_BIZ;
111
110
  this.wxAppUserInfoInstance = WXAPP_USER_INFO;
112
111
  this.wxAppReportManageInstance = WXAPP_REPORT_MANAGE;
113
112
  this.wxAppReportGDTInstance = WXAPP_REPORT_GDT;
114
113
  this.wxAppNavigatorInstance = WXAPP_NAVIGATOR;
115
114
  this.wxAppParamsSignInstance = WXAPP_PARAMS_SIGN;
116
115
  this.wxAppFingerReportInstance = WXAPP_FINGER_REPORT
117
116
  ? new WXAPP_FINGER_REPORT()
118
117
  : {};
119
118
  this.wxAppSubsGuider = WXAPP_SUBS_GUIDER;
120
119
  }
121
120
  _getConfig(opt) {
122
121
  return Object.assign({}, DefaultConfig, opt);
123
122
  }
124
123
 
125
124
  taskTimeoutPromise(callBack, timeout = 2000) {
126
125
  return new Promise((resolve) => {
127
126
  setTimeout(() => {
128
127
  const getCallBackRes = typeof callBack === "function" && callBack();
129
128
  return resolve(getCallBackRes || false);
130
129
  }, timeout);
131
130
  });
132
131
  }
133
132
 
134
133
  updateBusinessDomainAndApi(domain, api) {
135
134
  console.log("=================>", "updateBusinessDomainAndApi");
136
135
  }
137
136
 
138
137
  getFullScreenHeight(systemInfo) {
139
138
  const { screenHeight, statusBarHeight, isAndroid } = systemInfo;
140
139
  let result = screenHeight;
141
140
  if (statusBarHeight > 20 && isAndroid) {
142
141
  result = screenHeight + statusBarHeight;
143
142
  }
144
143
  return result;
145
144
  }
146
145
 
147
146
  getTabBarHeight(systemInfo) {
148
147
  const { statusBarHeight, isAndroid, isIOS } = systemInfo;
149
148
  let result = 50;
150
149
  if (statusBarHeight > 20) {
151
150
  if (isIOS) {
152
151
  result = 84;
153
152
  } else if (isAndroid) {
154
153
  result = 53;
155
154
  }
156
155
  }
157
156
  return result;
158
157
  }
159
158
 
160
159
  getSystemInfo() {
161
160
  const info: UtilsInterFace.taroGetSystemInfoSyncRes =
162
161
  getSystemInfos() || {};
163
162
  const actualNavBarHeight =
164
163
  (info?.navBarHeight || 0) + (info?.navBarExtendHeight || 0);
165
164
  const headerHeight = actualNavBarHeight + (info?.statusBarHeight || 0);
166
165
  const fullScreenHeight = this.getFullScreenHeight(info);
167
166
  const tabBarHeight = this.getTabBarHeight(info);
168
167
  const safeContentHeight = fullScreenHeight - headerHeight;
169
168
  this.info.sysInfo = {
170
169
  ...this.info.sysInfo,
171
170
  ...info,
172
171
  actualNavBarHeight,
173
172
  headerHeight,
174
173
  fullScreenHeight,
175
174
  tabBarHeight,
176
175
  safeContentHeight,
177
176
  };
178
177
  if (this.info.sysInfo["hostVersionName"]) {
179
178
  this.info.sysInfo["hostAppVersion"] = Number(
180
179
  this.info.sysInfo["hostVersionName"].replace(/\./g, "")
181
180
  );
182
181
  }
183
182
  this.info.sysInfo["wifiVideoAutoPlay"] = false;
184
183
  this.getNetWorkType();
185
184
  console.log("获取系统信息", this.info.sysInfo);
186
185
  }
187
186
  async updateMPaasConfig() {}
188
187
 
189
188
  getNetWorkType() {
190
189
  Taro.getNetworkType().then((getRes) => {
191
190
  getRes &&
192
191
  getRes.networkType &&
193
192
  (this.info.sysInfo["netWorkType"] = getRes.networkType);
194
193
  });
195
194
  }
196
195
  getAPPUseStraightCorner () {
197
196
  return Promise.resolve(false)
198
197
  }
199
198
 
200
199
  checkStatusAndLogin(options = {}) {
201
200
  this.checkStatusAndLoginPromise = new Promise((resolve, reject) => {
202
201
  console.log(
203
202
  "微信小程序登录状态及获取cookie状态的promise,之前登录状态",
204
203
  this.info.loginState
205
204
  );
206
205
  this.toLogin(options)
207
206
  .then((res) => {
208
207
  console.log("微信小程序登录状态结果,成功", res);
209
208
  this.info.loginState = true;
210
209
  resolve(res);
211
210
  })
212
211
  .catch((err) => {
213
212
  console.log("微信小程序登录异常状态结果", err);
214
213
  this.doLogin(options)
215
214
  .then((res2) => {
216
215
  console.log("微信小程序wxDoLogin强制登陆成功:", res2);
217
216
  this.info.loginState = true;
218
217
  resolve(res2);
219
218
  })
220
219
  .catch((err2) => {
221
220
  console.log("微信小程序wxDoLogin强制登陆失败:", err2);
222
221
  this.checkStatusAndLoginPromise = null;
223
222
  reject(err2);
224
223
  });
225
224
  });
226
225
  });
227
226
  return this.checkStatusAndLoginPromise;
228
227
  }
229
228
 
230
229
  checkJdStatusAndLogin(
231
230
  options = {
232
231
  loginColor: {
233
232
  biz: WXAPP_BIZ_SHOP_LIGHT_KEY,
234
233
  dpin: 0,
235
234
  },
236
235
  }
237
236
  ) {
238
237
  return this.checkStatusAndLogin(options);
239
238
  }
240
239
 
241
240
  toLogin(options = {}): Promise<any> {
242
241
  return this.wxAppLoginInstance
243
242
  .getLoginPromise({
244
243
  mode: "common",
245
244
  loginColor: {
246
245
  biz: WXAPP_BIZ_KEY,
247
246
  dpin: 1,
248
247
  },
249
248
  ...options,
250
249
  })
251
250
  .then((res) => {
252
251
  console.log("微信app登录返回信息,微信侧返回code为0表示成功", res);
253
252
  setTimeout(() => {
254
253
  console.log(
255
254
  "微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie"
256
255
  );
257
256
  this.getLoginCookie(`${Date.now()}`);
258
257
  }, 500);
259
258
  })
260
259
  .catch((err) => {
261
260
  console.log("微信app登录异常返回信息,也获取cookie", err);
262
261
  this.getLoginCookie(`${Date.now()}`);
263
262
  });
264
263
  }
265
264
 
266
265
  doLogin(options = {}) {
267
266
  const getParams = {
268
267
  loginColor: {
269
268
  biz: WXAPP_BIZ_KEY,
270
269
  dpin: 1,
271
270
  },
272
271
  ...options,
273
272
  };
274
273
  if (isPublishToWxapp) {
275
274
  getParams[
276
275
  "returnUrl"
277
276
  ] = `/pages/shopx/pages/index/index?${objectToUrlEncode({
278
277
  ...this.info.originQueryInfo,
279
278
  loadShopxType: "redirect",
280
279
  })}`;
281
280
  }
282
281
  return this.wxAppLoginInstance.doLogin(getParams).then((res) => {
283
282
  console.log("微信小程序强制登录返回信息,微信侧返回code为0表示成功", res);
284
283
  setTimeout(() => {
285
284
  console.log(
286
285
  "微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie"
287
286
  );
288
287
  this.getLoginCookie(`${Date.now()}`);
289
288
  }, 500);
290
289
  return res;
291
290
  });
292
291
  }
293
292
 
294
293
  doLoginForJdPin(options = {}) {
295
294
  return this.doLogin({
296
295
  loginColor: {
297
296
  biz: WXAPP_BIZ_SHOP_LIGHT_KEY,
298
297
  dpin: 0,
299
298
  },
300
299
  ...options,
301
300
  });
302
301
  }
303
302
 
304
303
  getLoginCookie(updateKey = "wxapp") {
305
304
  return new Promise((resolve) => {
306
305
  console.log("开始获取更新wxapp中的cookie信息", updateKey);
307
306
  if (
308
307
  this.config.wqCookie &&
309
308
  this.config.wqCookieStr &&
310
309
  this.config.getWqCookieKey === updateKey
311
310
  ) {
312
311
  console.log("已有存储wxapp中的cookie信息,直接返回", this.config);
313
312
  resolve({
314
313
  wqCookie: this.config.wqCookie,
315
314
  wqCookieStr: this.config.wqCookieStr,
316
315
  });
317
316
  } else {
318
317
  if (isPublishToWxapp) {
319
318
  const getWxappCookieObj = getTaroStorageKeyValue("cookies") || null;
320
319
  if (getWxappCookieObj) {
321
320
  const getCookieObj = getWxappCookieObj["_data"];
322
321
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj);
323
322
  const {
324
323
  pin = "",
325
324
  visitkey = "-1",
326
325
  wq_unionid = "",
327
326
  wxapp_openid = "",
328
327
  } = wqCookie;
329
328
  this.info.loginState = true;
330
329
  this.info.userInfo.wqCookie = wqCookieStr;
331
330
  this.info.userInfo.wqVisitkey = visitkey;
332
331
  console.log("获取用户完整cookie信息", getCookieObj);
333
332
  const getUserAddress = this.wxAppUserInfoInstance.getAddress();
334
333
  console.log("获取微信用户地址信息", getUserAddress);
335
334
  if (getUserAddress) {
336
335
  this.info.pageInfo.address = getUserAddress?.areaId;
337
336
  this.info.pageInfo.addressCommaStr = this.info.pageInfo.address
338
337
  ? this.info.pageInfo.address.replace(/_/g, ",")
339
338
  : "";
340
339
  this.info.pageInfo.un_area = this.info.pageInfo.address;
341
340
  Taro.eventCenter.trigger(
342
341
  TaroEventType.USER_AREA_UPDATE,
343
342
  this.info.pageInfo.address
344
343
  );
345
344
  }
346
345
  if (this.miniAppLogInstance) {
347
346
  this.miniAppLogInstance.set({
348
347
  account: pin,
349
348
  unionid: wq_unionid,
350
349
  openid: wxapp_openid,
351
350
  });
352
351
  }
353
352
  this.config.wqCookie = wqCookie;
354
353
  this.config.wqCookieStr = wqCookieStr;
355
354
  this.config.getWqCookieKey = updateKey;
356
355
  console.log("解析wxapp中的cookie信息成功,返回后存储", this.config);
357
356
  resolve({
358
357
  wqCookie,
359
358
  wqCookieStr,
360
359
  });
361
360
  } else {
362
361
  console.log(
363
362
  "解析wxapp中的cookie信息异常,返回异常结果",
364
363
  this.config
365
364
  );
366
365
  resolve({
367
366
  wqCookie: false,
368
367
  wqCookieStr: false,
369
368
  });
370
369
  }
371
370
  } else {
372
371
  resolve({
373
372
  wqCookie: false,
374
373
  wqCookieStr: false,
375
374
  });
376
375
  }
377
376
  }
378
377
  });
379
378
  }
380
379
 
381
380
 
382
381
  checkLoginStatus() {
383
382
  return this.getLoginCookie();
384
383
  }
385
384
 
386
385
  getAddressCachePromise = () => {
387
386
  return Promise.reject("该方法只在APP内适用");
388
387
  };
389
388
 
390
389
  updatePageAndLogInfo(updateQuery = {}) {
391
390
  const createUpdateQueryInfo: {
392
391
  query: {
393
392
  shopId?: string | number;
394
393
  venderId?: string | number;
395
394
  };
396
395
  updateShopInfoState: boolean;
397
396
  } = Object.assign(
398
397
  {},
399
398
  {
400
399
  query: {},
401
400
  updateShopInfoState: false,
402
401
  },
403
402
  updateQuery
404
403
  );
405
404
  console.log(
406
405
  "获取当前下发的店铺查询参数",
407
406
  updateQuery,
408
407
  "获取之前保存的shopInfo店铺查询参数",
409
408
  this.info?.shopInfo
410
409
  );
411
410
  const { query, updateShopInfoState } = createUpdateQueryInfo;
412
411
  const { shopId, venderId } = query;
413
412
  if (updateShopInfoState) {
414
413
  this.info.queryInfo = {
415
414
  ...this.info.queryInfo,
416
415
  ...query,
417
416
  };
418
417
  if (shopId && venderId) {
419
418
  this.info.shopInfo = {
420
419
  shopId: `${shopId}`,
421
420
  venderId: `${venderId}`,
422
421
  };
423
422
  }
424
423
  } else {
425
424
  this.info.queryInfo = {
426
425
  ...query,
427
426
  };
428
427
  this.info.originQueryInfo = {
429
428
  ...query,
430
429
  };
431
430
  if (
432
431
  this.info.shopInfo?.shopId &&
433
432
  this.info.shopInfo?.venderId &&
434
433
  (this.info.shopInfo.shopId == shopId ||
435
434
  this.info.shopInfo.venderId == venderId)
436
435
  ) {
437
436
  this.info.queryInfo.shopId = this.info.shopInfo.shopId;
438
437
  this.info.queryInfo.venderId = this.info.shopInfo.venderId;
439
438
  console.log(
440
439
  "当前存储的店铺shopId和venderId与下发的店铺信息shopId或者venderId为同一个,补充shopId或者venderId查询参数",
441
440
  this.info.queryInfo
442
441
  );
443
442
  }
444
443
  }
445
444
  this.info.queryInfo["shopId"] &&
446
445
  (this.info.queryInfo["shopId"] = `${this.info.queryInfo["shopId"]}`);
447
446
  this.info.queryInfo["venderId"] &&
448
447
  (this.info.queryInfo["venderId"] = `${this.info.queryInfo["venderId"]}`);
449
448
  console.log(
450
449
  "weapp===获取店铺下发查询参数\n",
451
450
  query,
452
451
  "\n获取店铺最后查询参数\n",
453
452
  this.info.queryInfo,
454
453
  "\n是否为更新店铺状态\n",
455
454
  updateShopInfoState
456
455
  );
457
456
  }
458
457
 
459
458
  getDynamicConfig(key: string) {
460
459
  console.warn(
461
460
  "调用微信小程序的 getDynamicConfig(),注意,此方法还未实现!"
462
461
  );
463
462
  return null;
464
463
  }
465
464
  renderNextTickLoadSdk(){
466
465
  console.warn("暂未实现 index.weapp.ts")
467
466
  }
468
467
  loadOtherSdk(){
469
468
  console.warn('暂未实现 index.weapp.ts')
470
469
  }
471
470
  loadItemSdkPromise() {
472
471
  console.warn('暂未实现 index.weapp.ts')
473
472
  }
473
+ import Taro from '@tarojs/taro';
474
474
  WXAPP_LOGIN,
475
475
  WXAPP_BIZ,
476
476
  WXAPP_USER_INFO,
477
477
  WXAPP_NAVIGATOR,
478
478
  WXAPP_REPORT_GDT,
479
479
  WXAPP_PARAMS_SIGN,
480
480
  WXAPP_FINGER_REPORT,
481
481
  WXAPP_REPORT_MANAGE,
482
482
  WXAPP_SUBS_GUIDER,
483
483
  WXAPP_ADDRESS_V2_API,
484
484
  BUSINESS_TYPE,
485
485
  SHOP_MENU_ID_TYPE,
486
486
  SHOP_MENU_ID_NAME,
487
487
  SECTION_HOME_TAB_NAME_TYPE,
488
488
  SECTION_HOME_TAB_TYPE,
489
489
  TaroEventType,
490
490
  WX_BUSINESS_TYPE,
491
491
  WXAPP_BIZ_KEY,
492
492
  WXAPP_BIZ_SHOP_LIGHT_KEY,
493
493
  getSystemInfos,
494
494
  getTaroStorageKeyValue,
495
495
  getWxAppCookieStr,
496
496
  objectToUrlEncode,
497
497
  languageNowType,
498
498
  abTestLabels: {},
499
499
  nonSellableSkuids: {},
500
500
  loginState: jdUserLoginState,
501
501
  cookiesStr: '',
502
502
  userInfo: userPinKey,
503
503
  isImmersive: false,
504
504
  pageInfo: {
505
505
  wxBusinessType: WX_BUSINESS_TYPE.SHOP,
506
506
  address: '',
507
507
  addressCommaStr: '',
508
508
  un_area: '',
509
509
  userLbsAddress: '',
510
510
  vapptype: '1',
511
511
  pageType: 'home',
512
512
  dataType: BUSINESS_TYPE.ONLINE,
513
513
  floorExposureInfo: {},
514
514
  floorVideInfo: {},
515
515
  productVideInfo: {},
516
516
  tabsLoadAllDataInfo: {
517
517
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: false,
518
518
  [SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY]]: true,
519
519
  },
520
520
  updateShopInfosAllState: false,
521
521
  isVipShop: false,
522
522
  isJdShowNativeImmersivePlayer: false,
523
523
  ...shopConfig,
524
524
  pageScrollTop: 0,
525
525
  pageIdxHeightInfo: {
526
526
  list: [],
527
527
  },
528
528
  shopNavBarHeight: 0,
529
529
  },
530
530
  defaultQueryLogInfo: {
531
531
  sourceType: 'JDshop',
532
532
  sourceValue: '',
533
533
  moduleId: 'none',
534
534
  entrance: 'none',
535
535
  },
536
536
  originQueryInfo: {},
537
537
  sysInfo: {
538
538
  windowWidth: 0,
539
539
  windowHeight: 0,
540
540
  netWorkType: '4g',
541
541
  jdBottomBarHeight: 0,
542
542
  jdNativeHeaderHeight: 0,
543
543
  },
544
544
  queryInfo: {},
545
545
  shopInfo: {},
546
546
  openAppData: {},
547
547
  public info: CommonInterFace.BaseConfigInfo;
548
548
  public config: {
549
549
  [key: string]: any;
550
550
  };
551
551
  public lazyContainer: CommonInterFace.lazyContainer;
552
552
  public rootEleNode: HTMLElement | null;
553
553
  public miniApplogUtil: CommonInterFace.MiniApplogUtil;
554
554
  public miniAppLogInstance: CommonInterFace.MiniAppLog | null;
555
555
  public checkStatusAndLoginPromise: object | null;
556
556
  public wxAppLoginInstance: CommonInterFace.WxAppLogin;
557
557
  public wxAppBizInstance: CommonInterFace.WxAppUserInfo;
558
558
  public wxAppUserInfoInstance: CommonInterFace.WxAppUserInfo;
559
559
  public wxAppReportManageInstance: CommonInterFace.wxAppReportManage;
560
560
  public wxAppReportGDTInstance: CommonInterFace.WxAppReportGDT;
561
561
  public wxAppNavigatorInstance: CommonInterFace.WxAppNavigator;
562
562
  public wxAppParamsSignInstance: CommonInterFace.wxAppParamsSign;
563
563
  public wxAppFingerReportInstance: CommonInterFace.wxAppParamsSign;
564
564
  public wxAppSubsGuider: CommonInterFace.wxAppParamsSign;
565
565
  public wxAppAddressV2apiInstance: CommonInterFace.wxAppAddressV2api;
566
566
  public loadJsSdkList: Array<any>;
567
567
  public loadJsSdkListCachePromise: any;
568
568
  public lbsAddressCachePromise: Promise<any> | null;
569
569
  public languageJsonData: any | null;
570
570
  constructor(opt) {
571
571
  this.info = this._getConfig(opt);
572
572
  this.config = {};
573
573
  this.lazyContainer = {
574
574
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN]]: {
575
575
  appLazyContainerList: [],
576
576
  appLazyFinishContainerList: [],
577
577
  },
578
578
  [SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]]: {
579
579
  appLazyContainerList: [],
580
580
  appLazyFinishContainerList: [],
581
581
  },
582
582
  };
583
583
  this.loadJsSdkList = [];
584
584
  this.loadJsSdkListCachePromise = {};
585
585
  this.rootEleNode = null;
586
586
  this.miniApplogUtil = MiniAppLogUtil;
587
587
  this.miniAppLogInstance = null;
588
588
  this.checkStatusAndLoginPromise = null;
589
589
  this.wxAppLoginInstance = WXAPP_LOGIN;
590
590
  this.wxAppBizInstance = WXAPP_BIZ;
591
591
  this.wxAppUserInfoInstance = WXAPP_USER_INFO;
592
592
  this.wxAppReportManageInstance = WXAPP_REPORT_MANAGE;
593
593
  this.wxAppReportGDTInstance = WXAPP_REPORT_GDT;
594
594
  this.wxAppNavigatorInstance = WXAPP_NAVIGATOR;
595
595
  this.wxAppParamsSignInstance = WXAPP_PARAMS_SIGN;
596
596
  this.wxAppFingerReportInstance = WXAPP_FINGER_REPORT ? new WXAPP_FINGER_REPORT() : {};
597
597
  this.wxAppSubsGuider = WXAPP_SUBS_GUIDER;
598
598
  this.wxAppAddressV2apiInstance = WXAPP_ADDRESS_V2_API;
599
599
  this.lbsAddressCachePromise = null;
600
600
  this.languageJsonData = langeJsonDataForCn;
601
601
  }
602
602
  _getConfig(opt) {
603
603
  return Object.assign({}, DefaultConfig, opt);
604
604
  }
605
605
 
606
606
  jmfeReayPromise(): Promise<any> {
607
607
  return Promise.reject(false);
608
608
  }
609
609
 
610
610
  taskTimeoutPromise(callBack, timeout = 2000) {
611
611
  return new Promise((resolve) => {
612
612
  setTimeout(() => {
613
613
  const getCallBackRes = typeof callBack === 'function' && callBack();
614
614
  return resolve(getCallBackRes || false);
615
615
  }, timeout);
616
616
  });
617
617
  }
618
618
 
619
619
  updateBusinessDomainAndApi(domain, api) {
620
620
  console.log('=================>', 'updateBusinessDomainAndApi');
621
621
  }
622
622
 
623
623
  getFullScreenHeight(systemInfo) {
624
624
  const { screenHeight, statusBarHeight, isAndroid } = systemInfo;
625
625
  let result = screenHeight;
626
626
  if (statusBarHeight > 20 && isAndroid) {
627
627
  result = screenHeight + statusBarHeight;
628
628
  }
629
629
  return result;
630
630
  }
631
631
 
632
632
  getTabBarHeight(systemInfo) {
633
633
  const { statusBarHeight, isAndroid, isIOS } = systemInfo;
634
634
  let result = 50;
635
635
  if (statusBarHeight > 20) {
636
636
  if (isIOS) {
637
637
  result = 84;
638
638
  } else if (isAndroid) {
639
639
  result = 53;
640
640
  }
641
641
  }
642
642
  return result;
643
643
  }
644
644
 
645
645
  getSystemInfo() {
646
646
  const info: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfos() || {};
647
647
  const actualNavBarHeight = (info?.navBarHeight || 0) + (info?.navBarExtendHeight || 0);
648
648
  const headerHeight = actualNavBarHeight + (info?.statusBarHeight || 0);
649
649
  const fullScreenHeight = this.getFullScreenHeight(info);
650
650
  const tabBarHeight = this.getTabBarHeight(info);
651
651
  const safeContentHeight = fullScreenHeight - headerHeight;
652
652
  this.info.sysInfo = {
653
653
  ...this.info.sysInfo,
654
654
  ...info,
655
655
  actualNavBarHeight,
656
656
  headerHeight,
657
657
  fullScreenHeight,
658
658
  tabBarHeight,
659
659
  safeContentHeight,
660
660
  languageType: languageNowType,
661
661
  };
662
662
  if (this.info.sysInfo['hostVersionName']) {
663
663
  this.info.sysInfo['hostAppVersion'] = Number(
664
664
  this.info.sysInfo['hostVersionName'].replace(/\./g, ''),
665
665
  );
666
666
  }
667
667
  if (isPublishToWxapp) {
668
668
  this.getAddressCachePromise();
669
669
  this.getLbsAddressCachePromise();
670
670
  }
671
671
  this.info.sysInfo['wifiVideoAutoPlay'] = false;
672
672
  this.getNetWorkType();
673
673
  console.log('获取系统信息', this.info.sysInfo);
674
674
  }
675
675
  async updateMPaasConfig() {}
676
676
 
677
677
  getNetWorkType() {
678
678
  Taro.getNetworkType().then((getRes) => {
679
679
  getRes && getRes.networkType && (this.info.sysInfo['netWorkType'] = getRes.networkType);
680
680
  });
681
681
  }
682
682
  getAPPUseStraightCorner() {
683
683
  return Promise.resolve(false);
684
684
  }
685
685
 
686
686
  checkStatusAndLogin(options = {}) {
687
687
  this.checkStatusAndLoginPromise = new Promise((resolve, reject) => {
688
688
  console.log('微信小程序登录状态及获取cookie状态的promise,之前登录状态', this.info.loginState);
689
689
  this.toLogin(options)
690
690
  .then((res) => {
691
691
  console.log('微信小程序登录状态结果,成功', res);
692
692
  this.info.loginState = true;
693
693
  resolve(res);
694
694
  })
695
695
  .catch((err) => {
696
696
  console.log('微信小程序登录异常状态结果', err);
697
697
  this.doLogin(options)
698
698
  .then((res2) => {
699
699
  console.log('微信小程序wxDoLogin强制登陆成功:', res2);
700
700
  this.info.loginState = true;
701
701
  resolve(res2);
702
702
  })
703
703
  .catch((err2) => {
704
704
  console.log('微信小程序wxDoLogin强制登陆失败:', err2);
705
705
  this.checkStatusAndLoginPromise = null;
706
706
  reject(err2);
707
707
  });
708
708
  });
709
709
  });
710
710
  return this.checkStatusAndLoginPromise;
711
711
  }
712
712
 
713
713
  checkJdStatusAndLogin(
714
714
  options = {
715
715
  loginColor: {
716
716
  biz: WXAPP_BIZ_SHOP_LIGHT_KEY,
717
717
  dpin: 0,
718
718
  },
719
719
  },
720
720
  ) {
721
721
  return this.checkStatusAndLogin(options);
722
722
  }
723
723
 
724
724
  toLogin(options = {}): Promise<any> {
725
725
  return this.wxAppLoginInstance
726
726
  .getLoginPromise({
727
727
  mode: 'common',
728
728
  loginColor: {
729
729
  biz: WXAPP_BIZ_KEY,
730
730
  dpin: 1,
731
731
  },
732
732
  ...options,
733
733
  })
734
734
  .then((res) => {
735
735
  console.log('微信app登录返回信息,微信侧返回code为0表示成功', res);
736
736
  setTimeout(() => {
737
737
  console.log(
738
738
  '微信app登录返回成功后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie',
739
739
  );
740
740
  this.getLoginCookie(`${Date.now()}`);
741
741
  }, 500);
742
742
  })
743
743
  .catch((err) => {
744
744
  console.log('微信app登录异常返回信息,也获取cookie', err);
745
745
  this.getLoginCookie(`${Date.now()}`);
746
746
  });
747
747
  }
748
748
 
749
749
  doLogin(options = {}) {
750
750
  const getParams = {
751
751
  loginColor: {
752
752
  biz: WXAPP_BIZ_KEY,
753
753
  dpin: 1,
754
754
  },
755
755
  ...options,
756
756
  };
757
757
  if (isPublishToWxapp) {
758
758
  getParams['returnUrl'] = `/pages/shopx/pages/index/index?${objectToUrlEncode({
759
759
  ...this.info.originQueryInfo,
760
760
  loadShopxType: 'redirect',
761
761
  })}`;
762
762
  }
763
763
  return this.wxAppLoginInstance.doLogin(getParams).then((res) => {
764
764
  console.log('微信小程序强制登录返回信息,微信侧返回code为0表示成功', res);
765
765
  setTimeout(() => {
766
766
  console.log('微信强制登录后,后台会写入cookie,有延迟,这里延迟500ms去获取最新cookie');
767
767
  this.getLoginCookie(`${Date.now()}`);
768
768
  }, 500);
769
769
  return res;
770
770
  });
771
771
  }
772
772
 
773
773
  doLoginForJdPin(options = {}) {
774
774
  return this.doLogin({
775
775
  loginColor: {
776
776
  biz: WXAPP_BIZ_SHOP_LIGHT_KEY,
777
777
  dpin: 0,
778
778
  },
779
779
  ...options,
780
780
  });
781
781
  }
782
782
 
783
783
  getLoginCookie(updateKey = 'wxapp') {
784
784
  return new Promise(async (resolve) => {
785
785
  console.log('开始获取更新wxapp中的cookie信息', updateKey);
786
786
  if (
787
787
  this.config.wqCookie &&
788
788
  this.config.wqCookieStr &&
789
789
  this.config.getWqCookieKey === updateKey
790
790
  ) {
791
791
  console.log('已有存储wxapp中的cookie信息,直接返回', this.config);
792
792
  resolve({
793
793
  wqCookie: this.config.wqCookie,
794
794
  wqCookieStr: this.config.wqCookieStr,
795
795
  });
796
796
  } else {
797
797
  if (isPublishToWxapp) {
798
798
  const getWxappCookieObj = getTaroStorageKeyValue('cookies') || null;
799
799
  if (getWxappCookieObj) {
800
800
  const getCookieObj = getWxappCookieObj['_data'];
801
801
  const { wqCookie, wqCookieStr } = getWxAppCookieStr(getCookieObj);
802
802
  const { pin = '', visitkey = '-1', wq_unionid = '', wxapp_openid = '' } = wqCookie;
803
803
  this.info.loginState = true;
804
804
  this.info.userInfo.wqCookie = wqCookieStr;
805
805
  this.info.userInfo.wqVisitkey = visitkey;
806
806
  console.log('获取用户完整cookie信息', getCookieObj);
807
807
  if (this.miniAppLogInstance) {
808
808
  this.miniAppLogInstance.set({
809
809
  account: pin,
810
810
  unionid: wq_unionid,
811
811
  openid: wxapp_openid,
812
812
  });
813
813
  }
814
814
  this.config.wqCookie = wqCookie;
815
815
  this.config.wqCookieStr = wqCookieStr;
816
816
  this.config.getWqCookieKey = updateKey;
817
817
  console.log('解析wxapp中的cookie信息成功,返回后存储', this.config);
818
818
  resolve({
819
819
  wqCookie,
820
820
  wqCookieStr,
821
821
  });
822
822
  } else {
823
823
  console.log('解析wxapp中的cookie信息异常,返回异常结果', this.config);
824
824
  resolve({
825
825
  wqCookie: false,
826
826
  wqCookieStr: false,
827
827
  });
828
828
  }
829
829
  } else {
830
830
  resolve({
831
831
  wqCookie: false,
832
832
  wqCookieStr: false,
833
833
  });
834
834
  }
835
835
  }
836
836
  });
837
837
  }
838
838
 
839
839
 
840
840
  checkLoginStatus() {
841
841
  return this.getLoginCookie();
842
842
  }
843
843
 
844
844
  getAddressCachePromise = () => {
845
845
  return new Promise((resolve) => {
846
846
  if (this.info.sysInfo?.area) {
847
847
  resolve({
848
848
  lat: this.info.sysInfo?.lat,
849
849
  lng: this.info.sysInfo?.lng,
850
850
  area: this.info.sysInfo?.area,
851
851
  });
852
852
  } else {
853
853
  const getUserAddress = this.wxAppUserInfoInstance.getAddress();
854
854
  console.info('京购原生获取用户基地址信息', getUserAddress);
855
855
  if (getUserAddress) {
856
856
  const { areaId = '', latitude, longitude } = getUserAddress;
857
857
  this.info.sysInfo['lat'] = `${latitude || ''}`;
858
858
  this.info.sysInfo['lng'] = `${longitude || ''}`;
859
859
  if (areaId && areaId !== '') {
860
860
  this.info.pageInfo.address = areaId;
861
861
  this.info.pageInfo.addressCommaStr = areaId.replace(/_/g, ',');
862
862
  this.info.pageInfo.un_area = areaId;
863
863
  Taro.eventCenter.trigger(TaroEventType.USER_AREA_UPDATE, {
864
864
  area: areaId,
865
865
  });
866
866
  this.info.sysInfo['area'] = areaId;
867
867
  }
868
868
  resolve({
869
869
  lat: this.info.sysInfo['lat'],
870
870
  lng: this.info.sysInfo['lng'],
871
871
  area: areaId,
872
872
  });
873
873
  } else {
874
874
  resolve({ lat: '', lng: '', area: '' });
875
875
  }
876
876
  }
877
877
  });
878
878
  };
879
879
 
880
880
  getLbsAddressCachePromise(): Promise<{
881
881
  ok: boolean;
882
882
  msg?: string;
883
883
  realTimeArea: string;
884
884
  data?: any;
885
885
  }> {
886
886
  if (!this.lbsAddressCachePromise) {
887
887
  this.lbsAddressCachePromise = new Promise((resolve) => {
888
888
  const getWxappLbsAddressInfo = this.wxAppUserInfoInstance.getLbsAddress();
889
889
  console.info('京购原生获取用户基于lbs的缓存地址信息', getWxappLbsAddressInfo);
890
890
  if (getWxappLbsAddressInfo && getWxappLbsAddressInfo?.areaId !== '') {
891
891
  this.info.pageInfo.userLbsAddress = getWxappLbsAddressInfo?.areaId;
892
892
  Taro.eventCenter.trigger(TaroEventType.USER_AREA_UPDATE, {
893
893
  realTimeArea: this.info.pageInfo.userLbsAddress,
894
894
  });
895
895
  resolve({
896
896
  ok: true,
897
897
  realTimeArea: getWxappLbsAddressInfo?.areaId || '',
898
898
  });
899
899
  } else {
900
900
  this.wxAppAddressV2apiInstance
901
901
  .fetchLbsAddr({
902
902
  token: 'W23b9sUlcnhCPZxQ2daYMkDqrTL0TeDw9tbDm5lVMVA=',
903
903
  from: 'wxapp_shop_real_area',
904
904
  })
905
905
  .then((res) => {
906
906
  console.info('微信京购里面获取静默实时lbs地址信息结果', res);
907
907
  const { provinceId, cityId, countyId, townId } = res;
908
908
  let realTimeArea = '';
909
909
  if (provinceId) {
910
910
  realTimeArea = `${provinceId}_${cityId || 0}_${countyId || 0}_${townId || 0}`;
911
911
  this.info.pageInfo.userLbsAddress = realTimeArea;
912
912
  Taro.eventCenter.trigger(TaroEventType.USER_AREA_UPDATE, {
913
913
  realTimeArea: realTimeArea,
914
914
  });
915
915
  } else {
916
916
  this.lbsAddressCachePromise = null;
917
917
  }
918
918
  const getValidRealTimeArea = realTimeArea !== '';
919
919
  resolve({
920
920
  ok: getValidRealTimeArea,
921
921
  msg: getValidRealTimeArea
922
922
  ? '成功'
923
923
  : '根据微信底层接口获取静默实时lbs地址信息异常,详情见data',
924
924
  data: getValidRealTimeArea ? null : res,
925
925
  realTimeArea: realTimeArea,
926
926
  });
927
927
  })
928
928
  .catch((err) => {
929
929
  console.warn('微信京购里面获取静默实时lbs地址信息异常', err);
930
930
  this.lbsAddressCachePromise = null;
931
931
  resolve({
932
932
  ok: false,
933
933
  msg: '微信京购里面获取静默实时lbs地址信息异常',
934
934
  realTimeArea: '',
935
935
  });
936
936
  });
937
937
  }
938
938
  });
939
939
  }
940
940
  return this.lbsAddressCachePromise;
941
941
  }
942
942
 
943
943
  updatePageAndLogInfo(updateQuery = {}) {
944
944
  const createUpdateQueryInfo: {
945
945
  query: {
946
946
  shopId?: string | number;
947
947
  venderId?: string | number;
948
948
  };
949
949
  updateShopInfoState: boolean;
950
950
  } = Object.assign(
951
951
  {},
952
952
  {
953
953
  query: {},
954
954
  updateShopInfoState: false,
955
955
  },
956
956
  updateQuery,
957
957
  );
958
958
  console.log(
959
959
  '获取当前下发的店铺查询参数',
960
960
  updateQuery,
961
961
  '获取之前保存的shopInfo店铺查询参数',
962
962
  this.info?.shopInfo,
963
963
  );
964
964
  const { query, updateShopInfoState } = createUpdateQueryInfo;
965
965
  const { shopId, venderId } = query;
966
966
  if (updateShopInfoState) {
967
967
  this.info.queryInfo = {
968
968
  ...this.info.queryInfo,
969
969
  ...query,
970
970
  };
971
971
  if (shopId && venderId) {
972
972
  this.info.shopInfo = {
973
973
  shopId: `${shopId}`,
974
974
  venderId: `${venderId}`,
975
975
  };
976
976
  }
977
977
  } else {
978
978
  this.info.queryInfo = {
979
979
  ...query,
980
980
  };
981
981
  this.info.originQueryInfo = {
982
982
  ...query,
983
983
  };
984
984
  if (
985
985
  this.info.shopInfo?.shopId &&
986
986
  this.info.shopInfo?.venderId &&
987
987
  (this.info.shopInfo.shopId == shopId || this.info.shopInfo.venderId == venderId)
988
988
  ) {
989
989
  this.info.queryInfo.shopId = this.info.shopInfo.shopId;
990
990
  this.info.queryInfo.venderId = this.info.shopInfo.venderId;
991
991
  console.log(
992
992
  '当前存储的店铺shopId和venderId与下发的店铺信息shopId或者venderId为同一个,补充shopId或者venderId查询参数',
993
993
  this.info.queryInfo,
994
994
  );
995
995
  }
996
996
  }
997
997
  this.info.queryInfo['shopId'] &&
998
998
  (this.info.queryInfo['shopId'] = `${this.info.queryInfo['shopId']}`);
999
999
  this.info.queryInfo['venderId'] &&
1000
1000
  (this.info.queryInfo['venderId'] = `${this.info.queryInfo['venderId']}`);
1001
1001
  console.log(
1002
1002
  'weapp===获取店铺下发查询参数\n',
1003
1003
  query,
1004
1004
  '\n获取店铺最后查询参数\n',
1005
1005
  this.info.queryInfo,
1006
1006
  '\n是否为更新店铺状态\n',
1007
1007
  updateShopInfoState,
1008
1008
  );
1009
1009
  }
1010
1010
 
1011
1011
  getDynamicConfig(key: string) {
1012
1012
  console.warn('调用微信小程序的 getDynamicConfig(),注意,此方法还未实现!');
1013
1013
  return null;
1014
1014
  }
1015
1015
  renderNextTickLoadSdk() {
1016
1016
  console.warn('暂未实现 index.weapp.ts');
1017
1017
  }
1018
1018
  loadOtherSdk() {
1019
1019
  console.warn('暂未实现 index.weapp.ts');
1020
1020
  }
1021
1021
  loadItemSdkPromise() {
1022
1022
  console.warn('暂未实现 index.weapp.ts');
1023
1023
  }
1024
1024
  createLanguageProimse() {
1025
1025
  return Promise.reject({
1026
1026
  msg: '暂未实现',
1027
1027
  });
1028
1028
  }