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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/assets/icon_blue_info.svg +1 -0
  3. package/dist/common/const.ts +1 -1
  4. package/dist/common/environmentType.ts +1 -0
  5. package/dist/common/index.h5.ts +1 -1
  6. package/dist/common/index.jd.ts +1 -1
  7. package/dist/common/index.ts +1 -1
  8. package/dist/common/index.weapp.ts +1 -1
  9. package/dist/common/jdplayerSdk.ts +1 -0
  10. package/dist/common/pageType.ts +1 -1
  11. package/dist/common/sgmCustomCode.ts +1 -0
  12. package/dist/common/token/token.jd.ts +1 -1
  13. package/dist/common/token/token.ts +1 -1
  14. package/dist/common/wxappApi.jd.ts +1 -0
  15. package/dist/components/ErrorBoundary.tsx +1 -1
  16. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  17. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  18. package/dist/components/base/CountDown/index.module.scss +49 -44
  19. package/dist/components/base/CountDown/index.tsx +1 -1
  20. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  21. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  22. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  23. package/dist/components/base/CustomVideo/common.ts +1 -0
  24. package/dist/components/base/CustomVideo/index.tsx +1 -1
  25. package/dist/components/base/Dialog/index.module.scss +16 -0
  26. package/dist/components/base/Dialog/index.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/index.h5.module.scss +12 -2
  28. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  29. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  30. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  31. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  32. package/dist/components/base/InViewRender/index.tsx +1 -1
  33. package/dist/components/base/ItemViewExposureSmart/index.module.scss +2 -2
  34. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  35. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  36. package/dist/components/base/LazyLoadImage/index.h5.module.scss +23 -20
  37. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  38. package/dist/components/base/MobileCommonHeader/index.module.scss +8 -0
  39. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  40. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  41. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  42. package/dist/components/base/Price/Base/index.tsx +1 -1
  43. package/dist/components/base/Price/Double/index.module.scss +8 -0
  44. package/dist/components/base/Price/Double/index.tsx +1 -1
  45. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  46. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  47. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  48. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  49. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  50. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  51. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  52. package/dist/components/floorItem.jd.tsx +1 -1
  53. package/dist/components/floorItem.tsx +1 -1
  54. package/dist/components/floorItem.weapp.tsx +1 -1
  55. package/dist/components/isv/Floor/index.tsx +1 -1
  56. package/dist/components/remoteFloorItem.tsx +1 -1
  57. package/dist/interface/common.ts +1 -1
  58. package/dist/interface/component.ts +1 -1
  59. package/dist/interface/jumpEventReport.ts +1 -1
  60. package/dist/interface/service.ts +1 -1
  61. package/dist/interface/utils.ts +1 -1
  62. package/dist/jumpEventReport/base.ts +1 -1
  63. package/dist/jumpEventReport/const.ts +1 -1
  64. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  65. package/dist/jumpEventReport/index.h5.ts +1 -1
  66. package/dist/jumpEventReport/index.jd.ts +1 -1
  67. package/dist/jumpEventReport/index.weapp.ts +1 -1
  68. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  69. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  70. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  71. package/dist/jumpEventReport/web/report.ts +1 -1
  72. package/dist/jumpEventReport/web.base.ts +1 -1
  73. package/dist/jumpEventReport/web.jd.ts +1 -1
  74. package/dist/jumpEventReport/web.jdb.ts +1 -1
  75. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  76. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  77. package/dist/jumpEventReport/web.pc.ts +1 -1
  78. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  79. package/dist/jumpEventReport/web.tjm.ts +1 -0
  80. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  81. package/dist/modules/ContainerFloorList/index.h5.module.scss +30 -1
  82. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  83. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  84. package/dist/open/api/device.ts +1 -1
  85. package/dist/open/api/environment.ts +1 -1
  86. package/dist/open/api/index.ts +1 -1
  87. package/dist/open/api/jump copy.ts +1 -1
  88. package/dist/open/api/request.ts +1 -1
  89. package/dist/open/api/shopMember.ts +1 -1
  90. package/dist/open/api/track.ts +1 -1
  91. package/dist/open/api/util.ts +1 -1
  92. package/dist/open/components/index.ts +1 -1
  93. package/dist/sass/app.h5.scss +274 -212
  94. package/dist/sass/base.scss +195 -137
  95. package/dist/service/fetchGateway.ts +1 -1
  96. package/dist/service/http/colorSign.ts +1 -1
  97. package/dist/service/http/const.ts +1 -1
  98. package/dist/service/http/h5Http.ts +1 -0
  99. package/dist/service/http/index.h5.ts +1 -0
  100. package/dist/service/requestServer.h5.ts +1 -0
  101. package/dist/service/requestServer.ts +1 -1
  102. package/dist/utils/connectNativeJsBridge.ts +1 -1
  103. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  104. package/dist/utils/draExceptionAndProfile.ts +1 -1
  105. package/dist/utils/h5Utils.ts +1 -1
  106. package/dist/utils/index.h5.ts +1 -1
  107. package/dist/utils/index.ts +1 -1
  108. package/dist/utils/index.weapp.ts +1 -1
  109. package/dist/utils/jm-common.js +1 -1
  110. package/dist/utils/jumpExtMapUtil.js +1 -0
  111. package/dist/utils/sColor.js +1 -0
  112. package/dist/utils/sgmCodeUtils.ts +1 -0
  113. package/dist/utils/taroRenderUtil.ts +1 -1
  114. package/dist/utils/utils.ts +1 -1
  115. package/package.json +26 -3
  116. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  117. package/dist/utils/memberFormatUtils.js +0 -1
@@ -1 +1 @@
1
- import {JdJumpJdApp} from './jdJumpJdApp'
2
1
  routerInfo: {
3
2
  params: {},
4
3
  },
5
4
  nativeEvent: null,
6
5
  jumpConfig: {
7
6
  venderId: null,
8
7
  shopId: null,
9
8
  sourceValue: '',
10
9
  sourceType: 'App-H5',
11
10
  activityType: 'shopx',
12
11
  moduleId: 'none',
13
12
  entrance: 'none',
14
13
  },
15
14
  logPageParamStr: '',
16
15
  public logPageId: string
17
16
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
18
17
  constructor(opt = {}) {
19
18
  console.log('jdb加载==========')
20
19
  super(opt)
21
20
  this.getConfig(opt)
22
21
  }
23
22
  jdbOpenAppParams(openAppUrl): Object | boolean {
24
23
  let getParams: boolean | Object = false
25
24
  if (this.isOpenJdbAppUrl(openAppUrl)) {
26
25
  try {
27
26
  getParams = openAppUrl.replace(
28
27
  /openApp\.jdbmall:\/\/virtual\?params=/i,
29
28
  '',
30
29
  )
31
30
  getParams = JSON.parse(String(getParams))
32
31
  } catch (e) {
33
32
  console.log(e)
34
33
  }
35
34
  }
36
35
  return getParams
37
36
  }
38
37
  isOpenJdbAppUrl(openAppUrl) {
39
38
  return /openApp\.jdbmall:\/\/virtual\?params=/i.test(openAppUrl)
40
39
  }
41
40
 
42
41
  async jdJumpConfigUrl(detail, logEventInfo = {}) {
43
42
  const {configDataType, configDataValue} = detail
44
43
  switch (configDataType) {
45
44
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
46
45
  this.jdJumpToProduct(
47
46
  {
48
47
  ...configDataValue,
49
48
  skuId: configDataValue.skuIds,
50
49
  skuUniformBizInfo: {buId: configDataValue.buId},
51
50
  },
52
51
  logEventInfo,
53
52
  )
54
53
  break
55
54
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK: {
56
55
  const _url = configDataValue.linkUrl
57
56
  if (this.isOpenJdbAppUrl(_url)) {
58
57
  const getOpenAppParams = this.jdbOpenAppParams(_url)
59
58
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
60
59
  if (getOpenAppParams) {
61
60
  this.jdNavigateToNative(
62
61
  Object.assign({}, getOpenAppParams, {
63
62
  logEventInfo,
64
63
  }),
65
64
  )
66
65
  }
67
66
  } else {
68
67
  const win = window.parent !== window ? window.parent : window;
69
68
  win.location.href = _url
70
69
  }
71
70
  break
72
71
  }
73
72
  default:
74
73
  }
75
74
  }
76
75
 
77
76
  jdJumpToProduct(skuParams, logEventInfo) {
78
77
  if (typeof skuParams !== 'object') {
79
78
  console.error('万商app跳转商品详情参数需要对象,详情请查看文档')
80
79
  return
81
80
  }
82
81
 
83
82
  let {skuId, bMallTag = '1', skuUniformBizInfo} = skuParams
84
83
  skuId = skuId.toString().trim()
85
84
  let url = 'https://b2b.m.jd'
86
85
  url = url + `.com/goods-detail/#/pages/index/index?skuId=${skuId}&bMallTag=${bMallTag}&skuSourceInfo=${encodeURIComponent(JSON.stringify(skuUniformBizInfo))}`
87
86
  if(/jdjchshopapp/i.test(navigator.userAgent)) {
88
87
  const {browser} = window['@jd/jdb-jssdk-b2b'] || {}
89
88
  if (browser) {
90
89
  browser.openPage({
91
90
  url,
92
91
  })
93
92
  }
94
93
  }else {
95
94
  const win = window.parent !== window ? window.parent : window;
96
95
  win.location.href = url
97
96
  }
98
97
  }
99
98
 
100
99
  jdNavigateToNative(
101
100
  params: {},
102
101
  url = OpenAppHost,
103
102
  successBack?: Function | null,
104
103
  failBack?: Function | null,
105
104
  ) {
106
105
  console.log('jdb web', params)
107
106
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
108
107
  Object.assign(
109
108
  {},
110
109
  {
111
110
  param: {},
112
111
  },
113
112
  params,
114
113
  )
115
114
  const {logEventInfo, ...otherParams} = getResParams
116
115
  console.log(
117
116
  'jdb web 获取open协议参数 jdNavigateToNative params: ',
118
117
  otherParams,
119
118
  )
120
119
  console.log('logEventInfo params: ', logEventInfo)
121
120
  console.log('otherParams', otherParams)
122
121
  const paramsStr = JSON.stringify(otherParams)
123
122
  console.log('跳转web jdb open协议', `${url}?params=${paramsStr}`)
124
123
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
125
124
  this.clickEventLog(logEventInfo || getResParams)
126
125
  .then(() => {
127
126
  if (typeof successBack == 'function') {
128
127
  successBack(getResParams)
129
128
  } else {
130
129
  try {
131
130
  const paramsStr = JSON.stringify(otherParams)
132
131
  console.log(
133
132
  'success: 跳转web jdb open协议',
134
133
  `${url}?params=${paramsStr}`,
135
134
  )
136
135
  window.location.href = `${url}?params=${paramsStr}`
137
136
  } catch (e) {
138
137
  console.log('跳转异常', e)
139
138
  }
140
139
  }
141
140
  })
142
141
  .catch((e) => {
143
142
  console.log('catch', e)
144
143
  typeof failBack == 'function' && failBack(getResParams)
145
144
  })
146
145
  }
147
146
 
148
147
  clickEventLog(
149
148
  opts: JumpEventReportInterFace.OptEventLogParams = {},
150
149
  reportKey = 'click',
151
150
  ) {
152
151
  const {eventId, jsonParam, eventLevel = 3, ...otherParams} = opts
153
152
  if (eventId && jsonParam) {
154
153
  const {etModelInfo, logBaseInfo} = jsonParam
155
154
  let getJsonParam = {}
156
155
  if (etModelInfo && logBaseInfo) {
157
156
  getJsonParam = logBaseInfo
158
157
  } else {
159
158
  if (Array.isArray(jsonParam)){
160
159
  getJsonParam = jsonParam
161
160
  } else {
162
161
  getJsonParam = Object.assign(
163
162
  {},
164
163
  {
165
164
  shopid: global.info.queryInfo?.shopId,
166
165
  },
167
166
  jsonParam,
168
167
  )
169
168
  }
170
169
  }
171
170
  const webLogParams = {
172
171
  eid: eventId,
173
172
  elevel: eventLevel,
174
173
  eparam: JSON.stringify(getJsonParam),
175
174
  jsonParam: JSON.stringify(getJsonParam),
176
175
  etModel: JSON.stringify(etModelInfo || {}),
177
176
  pageId: this.logPageId,
178
177
  pageParam: this.logPageParamStr,
179
178
  ...otherParams,
180
179
  }
181
180
  return /click|exposure/.test(reportKey)
182
181
  ? reportClick(webLogParams)
183
182
  : reportToCart(opts, webLogParams)
184
183
  } else {
185
184
  console.log('暂无埋点参数eventId和eventParam')
186
185
  return Promise.resolve(false)
187
186
  }
188
187
  }
189
188
  getConfig(opt = {}) {
190
189
  return Object.assign(this, {}, defaultConfig, opt)
191
190
  }
191
+ import {JdJumpJdApp} from './jdJumpJdApp'
192
192
  routerInfo: {
193
193
  params: {},
194
194
  },
195
195
  nativeEvent: null,
196
196
  jumpConfig: {
197
197
  venderId: null,
198
198
  shopId: null,
199
199
  sourceValue: '',
200
200
  sourceType: 'App-H5',
201
201
  activityType: 'shopx',
202
202
  moduleId: 'none',
203
203
  entrance: 'none',
204
204
  },
205
205
  logPageParamStr: '',
206
206
  public logPageId: string
207
207
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
208
208
  constructor(opt = {}) {
209
209
  console.log('jdb加载==========')
210
210
  super(opt)
211
211
  this.getConfig(opt)
212
212
  }
213
213
  jdbOpenAppParams(openAppUrl): Object | boolean {
214
214
  let getParams: boolean | Object = false
215
215
  if (this.isOpenJdbAppUrl(openAppUrl)) {
216
216
  try {
217
217
  getParams = openAppUrl.replace(
218
218
  /openApp\.jdbmall:\/\/virtual\?params=/i,
219
219
  '',
220
220
  )
221
221
  getParams = JSON.parse(String(getParams))
222
222
  } catch (e) {
223
223
  console.log(e)
224
224
  }
225
225
  }
226
226
  return getParams
227
227
  }
228
228
  isOpenJdbAppUrl(openAppUrl) {
229
229
  return /openApp\.jdbmall:\/\/virtual\?params=/i.test(openAppUrl)
230
230
  }
231
231
 
232
232
  async jdJumpConfigUrl(detail, logEventInfo = {}) {
233
233
  const {configDataType, configDataValue} = detail
234
234
  switch (configDataType) {
235
235
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
236
236
  this.jdJumpToProduct(
237
237
  {
238
238
  ...configDataValue,
239
239
  skuId: configDataValue.skuIds,
240
240
  skuUniformBizInfo: {buId: configDataValue.buId},
241
241
  },
242
242
  logEventInfo,
243
243
  )
244
244
  break
245
245
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK: {
246
246
  const _url = configDataValue.linkUrl
247
247
  if (this.isOpenJdbAppUrl(_url)) {
248
248
  const getOpenAppParams = this.jdbOpenAppParams(_url)
249
249
  console.log('jd web 获取自定义链接解析后的参数结果', getOpenAppParams)
250
250
  if (getOpenAppParams) {
251
251
  this.jdNavigateToNative(
252
252
  Object.assign({}, getOpenAppParams, {
253
253
  logEventInfo,
254
254
  }),
255
255
  )
256
256
  }
257
257
  } else {
258
258
  const win = window.parent !== window ? window.parent : window;
259
259
  win.location.href = _url
260
260
  }
261
261
  break
262
262
  }
263
263
  default:
264
264
  }
265
265
  }
266
266
 
267
267
  jdJumpToProduct(skuParams, logEventInfo) {
268
268
  if (typeof skuParams !== 'object') {
269
269
  console.error('万商app跳转商品详情参数需要对象,详情请查看文档')
270
270
  return
271
271
  }
272
272
 
273
273
  let {skuId, bMallTag = '1', skuUniformBizInfo} = skuParams
274
274
  skuId = skuId.toString().trim()
275
275
  let url = 'https://b2b.m.jd'
276
276
  url = url + `.com/goods-detail/#/pages/index/index?skuId=${skuId}&bMallTag=${bMallTag}&skuSourceInfo=${encodeURIComponent(JSON.stringify(skuUniformBizInfo))}`
277
277
  if(/jdjchshopapp/i.test(navigator.userAgent)) {
278
278
  const {browser} = window['@jd/jdb-jssdk-b2b'] || {}
279
279
  if (browser) {
280
280
  browser.openPage({
281
281
  url,
282
282
  })
283
283
  }
284
284
  }else {
285
285
  const win = window.parent !== window ? window.parent : window;
286
286
  win.location.href = url
287
287
  }
288
288
  }
289
289
 
290
290
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
291
291
  this.jdJumpToProduct(skuInfo, logEventInfo)
292
292
  }
293
293
 
294
294
  jdNavigateToNative(
295
295
  params: {},
296
296
  url = OpenAppHost,
297
297
  successBack?: Function | null,
298
298
  failBack?: Function | null,
299
299
  ) {
300
300
  console.log('jdb web', params)
301
301
  const getResParams: JumpEventReportInterFace.JdMiniJumpParams =
302
302
  Object.assign(
303
303
  {},
304
304
  {
305
305
  param: {},
306
306
  },
307
307
  params,
308
308
  )
309
309
  const {logEventInfo, ...otherParams} = getResParams
310
310
  console.log(
311
311
  'jdb web 获取open协议参数 jdNavigateToNative params: ',
312
312
  otherParams,
313
313
  )
314
314
  console.log('logEventInfo params: ', logEventInfo)
315
315
  console.log('otherParams', otherParams)
316
316
  const paramsStr = JSON.stringify(otherParams)
317
317
  console.log('跳转web jdb open协议', `${url}?params=${paramsStr}`)
318
318
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
319
319
  this.clickEventLog(logEventInfo || getResParams)
320
320
  .then(() => {
321
321
  if (typeof successBack == 'function') {
322
322
  successBack(getResParams)
323
323
  } else {
324
324
  try {
325
325
  const paramsStr = JSON.stringify(otherParams)
326
326
  console.log(
327
327
  'success: 跳转web jdb open协议',
328
328
  `${url}?params=${paramsStr}`,
329
329
  )
330
330
  window.location.href = `${url}?params=${paramsStr}`
331
331
  } catch (e) {
332
332
  console.log('跳转异常', e)
333
333
  }
334
334
  }
335
335
  })
336
336
  .catch((e) => {
337
337
  console.log('catch', e)
338
338
  typeof failBack == 'function' && failBack(getResParams)
339
339
  })
340
340
  }
341
341
 
342
342
  clickEventLog(
343
343
  opts: JumpEventReportInterFace.OptEventLogParams = {},
344
344
  reportKey = 'click',
345
345
  ) {
346
346
  const {eventId, jsonParam, eventLevel = 3, ...otherParams} = opts
347
347
  if (eventId && jsonParam) {
348
348
  const {etModelInfo, logBaseInfo} = jsonParam
349
349
  let getJsonParam = {}
350
350
  if (etModelInfo && logBaseInfo) {
351
351
  getJsonParam = logBaseInfo
352
352
  } else {
353
353
  if (Array.isArray(jsonParam)){
354
354
  getJsonParam = jsonParam
355
355
  } else {
356
356
  getJsonParam = Object.assign(
357
357
  {},
358
358
  {
359
359
  shopid: global.info.queryInfo?.shopId,
360
360
  },
361
361
  jsonParam,
362
362
  )
363
363
  }
364
364
  }
365
365
  const webLogParams = {
366
366
  eid: eventId,
367
367
  elevel: eventLevel,
368
368
  eparam: JSON.stringify(getJsonParam),
369
369
  jsonParam: JSON.stringify(getJsonParam),
370
370
  etModel: JSON.stringify(etModelInfo || {}),
371
371
  pageId: this.logPageId,
372
372
  pageParam: this.logPageParamStr,
373
373
  ...otherParams,
374
374
  }
375
375
  return /click|exposure/.test(reportKey)
376
376
  ? reportClick(webLogParams)
377
377
  : reportToCart(opts, webLogParams)
378
378
  } else {
379
379
  console.log('暂无埋点参数eventId和eventParam')
380
380
  return Promise.resolve(false)
381
381
  }
382
382
  }
383
383
  getConfig(opt = {}) {
384
384
  return Object.assign(this, {}, defaultConfig, opt)
385
385
  }
@@ -0,0 +1 @@
1
+ import global from '../common'
2
  isH5AdnJxMini,
1
3
  public jingXiMiniState: boolean
2
4
  constructor(opt) {
3
5
  super(opt)
4
6
  this.jingXiMiniState = false
5
7
  this.getConfig(opt)
6
8
  console.log(
7
9
  'window.shopGlobalSwitch:',
8
10
  JSON.stringify(window.shopGlobalSwitch),
9
11
  )
10
12
  this.init()
11
13
  }
12
14
  getConfig(opt) {
13
15
  return Object.assign(this, {}, defaultConfig, super.getConfig(opt), opt)
14
16
  }
15
17
 
16
18
  async init() {
17
19
  if (window.isJingxiMiniViewState) {
18
20
  this.jingXiMiniState = true
19
21
  global.info.isJingxiMiniViewState = true
20
22
  } else {
21
23
  console.log(
22
24
  '初始化进行小程序环境检查, 当前是否是京喜小程序',
23
25
  isH5AdnJxMini
24
26
  )
25
27
  if (isH5AdnJxMini) {
26
28
  console.log('进入了 isH5AdnJxMini 的 else if')
27
29
  this.jingXiMiniState = true
28
30
  global.info.isJingxiMiniViewState = true
29
31
  window.isJingxiMiniViewState = true
30
32
  } else {
31
33
  console.log('进入了 this.isH5OpenToWxapp 的esle')
32
34
  }
33
35
  }
34
36
  }
35
37
 
36
38
  jdJumpToMiniPage(pageUrl, logEventInfo, type = 'navigateTo') {
37
39
  this.jdNavigateToNative(
38
40
  pageUrl,
39
41
  logEventInfo,
40
42
  () => {
41
43
  console.log('JD.wxappext.goto',pageUrl)
42
44
  wx?.miniProgram[type] &&
43
45
  wx?.miniProgram[type]({
44
46
  url: pageUrl,
45
47
  })
46
48
  },
47
49
  () => {
48
50
  console.log('JD.wxappext.goto2')
49
51
  wx?.miniProgram[type] &&
50
52
  wx?.miniProgram[type]({
51
53
  url: pageUrl,
52
54
  })
53
55
  },
54
56
  )
55
57
  }
56
58
 
57
59
  jdJumpToWebInner(url, logEventInfo) {
58
60
  super.jdJumpToWeb(url, logEventInfo)
59
61
  }
60
62
 
61
63
  jdJumpToProduct(skuIds, logEventInfo) {
62
64
  if (this.jingXiMiniState) {
63
65
  const detailUrl = `${this.jumpMiniPath.jxDetail}?sku=${skuIds}`
64
66
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
65
67
  } else {
66
68
  super.jdJumpToProduct(skuIds, logEventInfo)
67
69
  }
68
70
  }
69
71
 
70
72
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
71
73
  const getSkuId = skuInfo?.skuId;
72
74
  this.jdJumpToProduct(getSkuId, logEventInfo)
73
75
  }
74
76
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
75
77
  if (this.jingXiMiniState) {
76
78
  const batchParam = `coupon_batch=${couponId}`
77
79
  const detailUrl = `${this.jumpMiniPath.jxCouponSearch}?${batchParam}`
78
80
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
79
81
  } else {
80
82
  super.jdJumpToCouponSearchProductList(couponId, logEventInfo)
81
83
  }
82
84
  }
@@ -1 +1 @@
1
- import global from '../common'
2
1
  BUSINESS_TYPE,
3
2
  SHOP_MENU_ID_TYPE,
4
3
  SHOP_MENU_ID_NAME,
5
4
  SECTION_HOME_TAB_TYPE,
6
5
  SECTION_HOME_TAB_NAME_TYPE,
7
6
  objectToUrlEncode,
8
7
  parseQueryUrlString,
9
8
  filterUrlQueryData,
10
9
  routerInfo: {
11
10
  params: {},
12
11
  },
13
12
  nativeEvent: null,
14
13
  jumpConfig: {
15
14
  venderId: null,
16
15
  shopId: null,
17
16
  sourceValue: '',
18
17
  sourceType: 'M-H5',
19
18
  activityType: 'shopx',
20
19
  moduleId: 'none',
21
20
  entrance: 'none',
22
21
  },
23
22
  logPageParamStr: '',
24
23
  public logPageId: string
25
24
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
26
25
  getConfig(opt) {
27
26
  return Object.assign(this, {}, defaultConfig, opt)
28
27
  }
29
28
  updateInfo(
30
29
  routerInfo,
31
30
  logPname = LogPnameInfo.HOME,
32
31
  pageId = LogPageIdInfo.APP,
33
32
  ) {
34
33
  this.routerInfo = routerInfo
35
34
  this.logPname = logPname
36
35
  this.jumpConfig = Object.assign(
37
36
  {},
38
37
  this.jumpConfig,
39
38
  filterUrlQueryData(routerInfo?.params || {}),
40
39
  )
41
40
  this.logPageId = pageId
42
41
  }
43
42
 
44
43
  jdJumpToProduct(skuIds, logEventInfo) {
45
44
  skuIds = skuIds.toString().trim()
46
45
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
47
46
  let url = `${this.jumpWebUrl.pcDetail}${getSkuId}.html`
48
47
  this.jdNavigateToNative(url, logEventInfo)
49
48
  }
50
49
 
51
50
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
52
51
  const getInfo = Object.assign(
53
52
  {},
54
53
  {
55
54
  shopId: global.info.queryInfo.shopId,
56
55
  venderId: global.info.queryInfo.venderId,
57
56
  },
58
57
  shopInfo,
59
58
  )
60
59
  let url = `${this.jumpWebUrl.pages}/index-${global.info.queryInfo.shopId}.html`
61
60
  this.jdNavigateToNative(url, {
62
61
  ...getInfo,
63
62
  })
64
63
  }
65
64
 
66
65
  getPcSearchUrl = (cateId) => {
67
66
  const flag = document.querySelector('#JSHOP_CHANNEL_FLAG')?.value
68
67
  const appId =
69
68
  document.querySelector('#J_AppId')?.value ||
70
69
  document.querySelector('#pageInstance_appId')?.value
71
70
  return flag === 'yao'
72
71
  ? this.jumpWebUrl.pages + '/view_shop_search-' + appId + '.html'
73
72
  : this.jumpWebUrl.pages +
74
73
  '/view_search-' +
75
74
  appId +
76
75
  '-' +
77
76
  cateId +
78
77
  '-99-1-20-1.html'
79
78
  }
80
79
 
81
80
  jdJumpToShopSearch(shopInfo) {
82
81
  const getInfo = Object.assign(
83
82
  {},
84
83
  {
85
84
  shopId: global.info.queryInfo.shopId,
86
85
  venderId: global.info.queryInfo.venderId,
87
86
  },
88
87
  shopInfo,
89
88
  )
90
89
  const { categoryId } = getInfo
91
90
  const url = `${this.getPcSearchUrl(categoryId)}`
92
91
  this.jdJumpToWeb(url, getInfo)
93
92
  }
94
93
 
95
94
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
96
95
  console.log('web.base.ts - jdJumpToTabAllProduct')
97
96
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId
98
97
  if (typeof venderId === 'undefined')
99
98
  venderId = global.info.queryInfo.venderId
100
99
  const url = `${this.jumpWebUrl.pages}/index-${shopId}.html`
101
100
  this.jdJumpToWeb(url, logEventInfo)
102
101
  }
103
102
 
104
103
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
105
104
  const url = `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`
106
105
  this.jdJumpToWeb(url, logEventInfo)
107
106
  }
107
+ import global from '../common'
108
108
  BUSINESS_TYPE,
109
109
  SHOP_MENU_ID_TYPE,
110
110
  SHOP_MENU_ID_NAME,
111
111
  SECTION_HOME_TAB_TYPE,
112
112
  SECTION_HOME_TAB_NAME_TYPE,
113
113
  objectToUrlEncode,
114
114
  parseQueryUrlString,
115
115
  filterUrlQueryData,
116
116
  routerInfo: {
117
117
  params: {},
118
118
  },
119
119
  nativeEvent: null,
120
120
  jumpConfig: {
121
121
  venderId: null,
122
122
  shopId: null,
123
123
  sourceValue: '',
124
124
  sourceType: 'M-H5',
125
125
  activityType: 'shopx',
126
126
  moduleId: 'none',
127
127
  entrance: 'none',
128
128
  },
129
129
  logPageParamStr: '',
130
130
  public logPageId: string
131
131
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
132
132
  getConfig(opt) {
133
133
  return Object.assign(this, {}, defaultConfig, opt)
134
134
  }
135
135
  updateInfo(
136
136
  routerInfo,
137
137
  logPname = LogPnameInfo.HOME,
138
138
  pageId = LogPageIdInfo.APP,
139
139
  ) {
140
140
  this.routerInfo = routerInfo
141
141
  this.logPname = logPname
142
142
  this.jumpConfig = Object.assign(
143
143
  {},
144
144
  this.jumpConfig,
145
145
  filterUrlQueryData(routerInfo?.params || {}),
146
146
  )
147
147
  this.logPageId = pageId
148
148
  }
149
149
 
150
150
  jdJumpToProduct(skuIds, logEventInfo) {
151
151
  skuIds = skuIds.toString().trim()
152
152
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
153
153
  let url = `${this.jumpWebUrl.pcDetail}${getSkuId}.html`
154
154
  this.jdNavigateToNative(url, logEventInfo)
155
155
  }
156
156
 
157
157
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
158
158
  const getSkuId = skuInfo?.skuId;
159
159
  this.jdJumpToProduct(getSkuId, logEventInfo)
160
160
  }
161
161
 
162
162
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
163
163
  const getInfo = Object.assign(
164
164
  {},
165
165
  {
166
166
  shopId: global.info.queryInfo.shopId,
167
167
  venderId: global.info.queryInfo.venderId,
168
168
  },
169
169
  shopInfo,
170
170
  )
171
171
  let url = `${this.jumpWebUrl.pages}/index-${global.info.queryInfo.shopId}.html`
172
172
  this.jdNavigateToNative(url, {
173
173
  ...getInfo,
174
174
  })
175
175
  }
176
176
 
177
177
  getPcSearchUrl = (cateId) => {
178
178
  const flag = document.querySelector('#JSHOP_CHANNEL_FLAG')?.value
179
179
  const appId =
180
180
  document.querySelector('#J_AppId')?.value ||
181
181
  document.querySelector('#pageInstance_appId')?.value
182
182
  return flag === 'yao'
183
183
  ? this.jumpWebUrl.pages + '/view_shop_search-' + appId + '.html'
184
184
  : this.jumpWebUrl.pages +
185
185
  '/view_search-' +
186
186
  appId +
187
187
  '-' +
188
188
  cateId +
189
189
  '-99-1-20-1.html'
190
190
  }
191
191
 
192
192
  jdJumpToShopSearch(shopInfo) {
193
193
  const getInfo = Object.assign(
194
194
  {},
195
195
  {
196
196
  shopId: global.info.queryInfo.shopId,
197
197
  venderId: global.info.queryInfo.venderId,
198
198
  },
199
199
  shopInfo,
200
200
  )
201
201
  const { categoryId } = getInfo
202
202
  const url = `${this.getPcSearchUrl(categoryId)}`
203
203
  this.jdJumpToWeb(url, getInfo)
204
204
  }
205
205
 
206
206
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
207
207
  console.log('web.base.ts - jdJumpToTabAllProduct')
208
208
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId
209
209
  if (typeof venderId === 'undefined')
210
210
  venderId = global.info.queryInfo.venderId
211
211
  const url = `${this.jumpWebUrl.pages}/index-${shopId}.html`
212
212
  this.jdJumpToWeb(url, logEventInfo)
213
213
  }
214
214
 
215
215
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
216
216
  const url = `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`
217
217
  this.jdJumpToWeb(url, logEventInfo)
218
218
  }