@conecli/cone-render 0.9.1-shop2.7 → 0.9.1-shop2.9

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 (62) 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/sgmCustomCode.ts +1 -0
  9. package/dist/common/token/token.ts +1 -1
  10. package/dist/common/wxappApi.jd.ts +1 -0
  11. package/dist/components/ErrorBoundary.tsx +1 -1
  12. package/dist/components/base/CountDown/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  14. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  15. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  16. package/dist/components/base/Dialog/index.module.scss +5 -0
  17. package/dist/components/base/Dialog/index.tsx +1 -1
  18. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  19. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  20. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  21. package/dist/components/floorItem.jd.tsx +1 -1
  22. package/dist/components/floorItem.weapp.tsx +1 -1
  23. package/dist/components/remoteFloorItem.tsx +1 -1
  24. package/dist/interface/common.ts +1 -1
  25. package/dist/interface/component.ts +1 -1
  26. package/dist/interface/jumpEventReport.ts +1 -1
  27. package/dist/interface/service.ts +1 -1
  28. package/dist/interface/utils.ts +1 -1
  29. package/dist/jumpEventReport/base.ts +1 -1
  30. package/dist/jumpEventReport/const.ts +1 -1
  31. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  32. package/dist/jumpEventReport/index.h5.ts +1 -1
  33. package/dist/jumpEventReport/index.jd.ts +1 -1
  34. package/dist/jumpEventReport/index.weapp.ts +1 -1
  35. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  36. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  37. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  38. package/dist/jumpEventReport/web/report.ts +1 -1
  39. package/dist/jumpEventReport/web.base.ts +1 -1
  40. package/dist/jumpEventReport/web.jd.ts +1 -1
  41. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  42. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  43. package/dist/jumpEventReport/web.tjm.ts +1 -0
  44. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  45. package/dist/open/api/environment.ts +1 -1
  46. package/dist/open/api/jump copy.ts +1 -1
  47. package/dist/open/api/shopMember.ts +1 -1
  48. package/dist/open/api/track.ts +1 -1
  49. package/dist/open/api/util.ts +1 -1
  50. package/dist/sass/app.h5.scss +39 -3
  51. package/dist/service/requestServer.ts +1 -1
  52. package/dist/utils/connectNativeJsBridge.ts +1 -1
  53. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  54. package/dist/utils/draExceptionAndProfile.ts +1 -1
  55. package/dist/utils/h5Utils.ts +1 -1
  56. package/dist/utils/index.h5.ts +1 -1
  57. package/dist/utils/index.ts +1 -1
  58. package/dist/utils/index.weapp.ts +1 -1
  59. package/dist/utils/jm-common.js +1 -1
  60. package/dist/utils/sgmCodeUtils.ts +1 -0
  61. package/dist/utils/utils.ts +1 -1
  62. package/package.json +1 -1
@@ -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
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
70
72
  if (this.jingXiMiniState) {
71
73
  const batchParam = `coupon_batch=${couponId}`
72
74
  const detailUrl = `${this.jumpMiniPath.jxCouponSearch}?${batchParam}`
73
75
  this.jdJumpToMiniPage(detailUrl, logEventInfo)
74
76
  } else {
75
77
  super.jdJumpToCouponSearchProductList(couponId, logEventInfo)
76
78
  }
77
79
  }
@@ -0,0 +1 @@
1
+ import { JumpEventTJWebReport } from './web.tjm'
2
  routerInfo: {
1
3
  params: {},
2
4
  },
3
5
  nativeEvent: null,
4
6
  jumpConfig: {
5
7
  venderId: null,
6
8
  shopId: null,
7
9
  sourceValue: '',
8
10
  sourceType: 'App-H5',
9
11
  activityType: 'shopx',
10
12
  moduleId: 'none',
11
13
  entrance: 'none',
12
14
  },
13
15
  logPageParamStr: '',
14
16
  public logPageId: string
15
17
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
16
18
  constructor(opt = {}) {
17
19
  console.log('jdlite加载==========')
18
20
  super(opt)
19
21
  this.getConfig(opt)
20
22
  }
21
23
  tjOpenAppParams(openAppUrl): Object | boolean {
22
24
  let getParams: boolean | Object = false
23
25
  if (this.isOpenTjAppUrl(openAppUrl)) {
24
26
  try {
25
27
  getParams = openAppUrl.replace(
26
28
  /openApp\.jdlite:\/\/virtual\?params=/i,
27
29
  '',
28
30
  )
29
31
  getParams = JSON.parse(String(getParams))
30
32
  } catch (e) {
31
33
  console.log(e)
32
34
  }
33
35
  }
34
36
  return getParams
35
37
  }
36
38
  isOpenTjAppUrl(openAppUrl) {
37
39
  return /openApp\.jdlite:\/\/virtual\?params=/i.test(openAppUrl)
38
40
  }
39
41
 
40
42
  async jdJumpConfigUrl(detail, logEventInfo = {}) {
41
43
  const { configDataType, configDataValue } = detail
42
44
  console.log("测试tj app",detail)
43
45
  switch (configDataType) {
44
46
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
45
47
  this.jdJumpToProduct( configDataValue.skuIds, logEventInfo)
46
48
  break
47
49
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK: {
48
50
  const _url = configDataValue.linkUrl
49
51
  this.jdJumpToWeb(_url, logEventInfo)
50
52
  break
51
53
  }
52
54
  default:
53
55
  }
54
56
  }
55
57
 
56
58
  jdJumpToProduct(skuIds, logEventInfo) {
57
59
  skuIds = skuIds.toString().trim()
58
60
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
59
61
  this.jdNavigateToNative({
60
62
  category: "jump",
61
63
  des: "productDetail",
62
64
  skuId: getSkuId,
63
65
  logEventInfo,
64
66
  })
65
67
  }
66
68
 
67
69
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
68
70
  this.jdNavigateToNative(
69
71
  Object.assign(
70
72
  {},
71
73
  {
72
74
  category: "jump",
73
75
  des: "productList",
74
76
  from: "couponBatch",
75
77
  couponId: `${couponId}`,
76
78
  tip: "1",
77
79
  inlet: 0,
78
80
  quangoufrom: 2
79
81
  },
80
82
  logEventInfo,
81
83
  ),
82
84
  )
83
85
  }
84
86
 
85
87
  jdJumpToWeb(
86
88
  url,
87
89
  logEventInfo,
88
90
  successBack?: Function | undefined,
89
91
  failBack?: Function | undefined,
90
92
  ) {
91
93
  if (this.isOpenTjAppUrl(url)) {
92
94
  const getOpenAppParams = this.tjOpenAppParams(url)
93
95
  console.log(
94
96
  'tj web 获取自定义openApp链接解析后的参数结果',
95
97
  getOpenAppParams,
96
98
  )
97
99
  if (getOpenAppParams) {
98
100
  this.jdNavigateToNative(
99
101
  Object.assign({}, getOpenAppParams, {
100
102
  logEventInfo,
101
103
  }),
102
104
  )
103
105
  }
104
106
  } else {
105
107
  if(url.indexOf('tjshop') == -1) {
106
108
  url = url + this.getTjShopParam()
107
109
  }
108
110
  const changeUrl = /^\/\//.test(url) ? `https:${url}` : url
109
111
  this.jdNavigateToNative(
110
112
  {
111
113
  category: 'jump',
112
114
  des: 'm',
113
115
  url: changeUrl,
114
116
  logEventInfo,
115
117
  },
116
118
  OpenAppHost,
117
119
  successBack,
118
120
  failBack,
119
121
  )
120
122
  }
121
123
  }
122
124
  jdJumpToShopSearch(shopInfo) {
123
125
  const getInfo = Object.assign(
124
126
  {},
125
127
  {
126
128
  shopId: global.info.queryInfo.shopId,
127
129
  venderId: global.info.queryInfo.venderId,
128
130
  },
129
131
  shopInfo,
130
132
  )
131
133
  const { shopId, categoryId, keyword, pageId, description, shopName } =
132
134
  getInfo
133
135
  const cateId = categoryId ? `&cateId=${typeof categoryId === 'string' ? categoryId?.trim() : categoryId}` : ''
134
136
  const addKeyWord = keyword ? `&keyword=${keyword}` : ''
135
137
  const addPageId = pageId ? `&pageId=${pageId}` : ''
136
138
  const searchDes = description ? `&description=${description}` : ''
137
139
  const shopNameDes = shopName ? `&shopName=${shopName}` : ''
138
140
  const searchType = categoryId ? 5 : keyword ? 4 : 3
139
141
  super.jdNavigateToNative(
140
142
  `${this.jumpWebUrl.shopSearch}?shopId=${shopId}&searchType=${searchType}${cateId}${addKeyWord}${addPageId}${searchDes}${shopNameDes}`,
141
143
  getInfo,
142
144
  )
143
145
  }
144
146
 
145
147
  jdNavigateToNative(
146
148
  params,
147
149
  url = OpenAppHost,
148
150
  successBack?: Function | null,
149
151
  failBack?: Function | null,
150
152
  ) {
151
153
  console.log('tj web', params)
152
154
  const { logEventInfo , ...otherParams } = params
153
155
  console.log('tj web 获取open协议参数 jdNavigateToNative params: ',otherParams)
154
156
  console.log('logEventInfo params: ', logEventInfo)
155
157
  console.log('otherParams', otherParams)
156
158
  const paramsStr = JSON.stringify(otherParams)
157
159
  console.log('跳转web tj open协议', `${url}?params=${paramsStr}`)
158
160
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
159
161
  this.clickEventLog(logEventInfo || params)
160
162
  .then(() => {
161
163
  if (typeof successBack == 'function') {
162
164
  successBack(params)
163
165
  } else {
164
166
  try {
165
167
  const paramsStr = encodeURIComponent(JSON.stringify(otherParams))
166
168
  console.log(
167
169
  'success: 跳转web tj open协议',
168
170
  `${url}?params=${paramsStr}`,
169
171
  )
170
172
  window.location.href = `${url}?params=${paramsStr}`
171
173
  } catch (e) {
172
174
  console.log('跳转异常', e)
173
175
  }
174
176
  }
175
177
  })
176
178
  .catch((e) => {
177
179
  console.log('catch', e)
178
180
  typeof failBack == 'function' && failBack(params)
179
181
  })
180
182
  }
181
183
 
182
184
  clickEventLog(
183
185
  opts: JumpEventReportInterFace.OptEventLogParams = {},
184
186
  reportKey = 'click',
185
187
  ) {
186
188
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
187
189
  if (eventId && jsonParam) {
188
190
  const { etModelInfo, logBaseInfo } = jsonParam
189
191
  const webLogParams = {
190
192
  eid: eventId,
191
193
  elevel: eventLevel,
192
194
  eparam:JSON.stringify(logBaseInfo || jsonParam),
193
195
  jsonParam: JSON.stringify(logBaseInfo || jsonParam),
194
196
  etModel: JSON.stringify(etModelInfo || {}),
195
197
  pageId: this.logPageId,
196
198
  pageParam: this.logPageParamStr,
197
199
  ...otherParams,
198
200
  }
199
201
  return /click|exposure/.test(reportKey)
200
202
  ? reportClick(webLogParams)
201
203
  : reportToCart(opts,webLogParams)
202
204
  } else {
203
205
  console.log('暂无埋点参数eventId和eventParam')
204
206
  return Promise.resolve(false)
205
207
  }
206
208
  }
207
209
  getConfig(opt = {}) {
208
210
  return Object.assign(this, {}, defaultConfig, opt)
209
211
  }
@@ -0,0 +1 @@
1
+ import global from '../common'
2
  BUSINESS_TYPE,
1
3
  objectToUrlEncode,
2
4
  parseQueryUrlString,
3
5
  isTjScence,
4
6
  isTjM,
5
7
  isTjJxM,
6
8
  isH5AdnJxMini,
7
9
  tjChannel,
8
10
  public logPageId: string
9
11
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
10
12
  constructor(opt) {
11
13
  super(opt)
12
14
  this.getConfig(opt)
13
15
  console.log('加载特价/京喜m的跳转js文件....')
14
16
  }
15
17
 
16
18
  getTjShopParam () {
17
19
  const { tjshop } = global.info.queryInfo
18
20
  const tjshopParam = tjshop ? `&tjshop=${tjshop}` : ''
19
21
  const tjChannelStr = tjChannel ? `&tjChannel=${tjChannel}` : ''
20
22
  return `${tjshopParam}${tjChannelStr}`
21
23
  }
22
24
 
23
25
  jdJumpToProduct(skuIds, logEventInfo) {
24
26
  skuIds = skuIds.toString().trim()
25
27
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
26
28
  const { jingxiSdx, ...otherLogInfo } = logEventInfo
27
29
  let url = `${this.jumpWebUrl.detail}${getSkuId}.html`
28
30
  if (isTjScence) {
29
31
  if (isTjM) {
30
32
  url = `${this.jumpWebUrl.tjDetail}?wareId=${getSkuId}`
31
33
  } else if (isTjJxM) {
32
34
  const fd = getUrlQuery('_fd') ? `_fd=${getUrlQuery('_fd')}` : ''
33
35
  url = `${this.jumpWebUrl.jxDetail}?sku=${getSkuId}${fd}`
34
36
  }
35
37
  }
36
38
  if(jingxiSdx){
37
39
  this.jdNavigateToNative(
38
40
  `${url}?sdx=${jingxiSdx}`,
39
41
  otherLogInfo,
40
42
  )
41
43
  }else {
42
44
  this.jdNavigateToNative(
43
45
  url,
44
46
  logEventInfo,
45
47
  )
46
48
  }
47
49
  }
48
50
 
49
51
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
50
52
  const getInfo = Object.assign(
51
53
  {},
52
54
  {
53
55
  shopId: global.info.queryInfo.shopId,
54
56
  venderId: global.info.queryInfo.venderId,
55
57
  },
56
58
  shopInfo,
57
59
  )
58
60
  this.jdNavigateToNative(
59
61
  `${this.jumpWebUrl.mshop}?${objectToUrlEncode(
60
62
  this.getShopIdOrVenderIdParams(getInfo),
61
63
  )}${this.getTjShopParam()}`,
62
64
  {
63
65
  ...getInfo,
64
66
  },
65
67
  )
66
68
  }
67
69
 
68
70
  jdJumpToWeb(
69
71
  url,
70
72
  logEventInfo,
71
73
  successBack?: Function | undefined,
72
74
  failBack?: Function | undefined,
73
75
  ) {
74
76
  console.log('web.tjm.ts - jdJumpToWeb')
75
77
  if(url.indexOf('tjshop') == -1) {
76
78
  url = url + this.getTjShopParam()
77
79
  }
78
80
  this.jdNavigateToNative(
79
81
  url,
80
82
  {
81
83
  ...logEventInfo,
82
84
  },
83
85
  successBack,
84
86
  failBack,
85
87
  )
86
88
  }
87
89
 
88
90
  jdJumpConfigUrl(detail, logEventInfo = {}) {
89
91
  const { configDataType, configDataValue } = detail
90
92
  console.log(
91
93
  'jdJumpConfigUrl web.tj.base configDataType:',
92
94
  configDataType,
93
95
  configDataValue,
94
96
  )
95
97
  switch (configDataType) {
96
98
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
97
99
  if(logEventInfo?.jsonParam?.logBaseInfo?.mInfo){
98
100
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds
99
101
  }
100
102
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
101
103
  break
102
104
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
103
105
  this.jdJumpToWeb(
104
106
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
105
107
  {},
106
108
  )
107
109
  break
108
110
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
109
111
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
110
112
  const getShopSearchParams = this.jdOpenAppParams(
111
113
  configDataValue.clickUrl,
112
114
  )
113
115
  getShopSearchParams &&
114
116
  this.jdJumpToShopSearch(
115
117
  Object.assign({}, getShopSearchParams, {
116
118
  logEventInfo,
117
119
  }),
118
120
  )
119
121
  } else {
120
122
  this.jdJumpToShopSearch(
121
123
  configDataValue['cid']
122
124
  ? Object.assign(
123
125
  {},
124
126
  {
125
127
  shopId: global.info.queryInfo.shopId,
126
128
  categoryId: configDataValue.cid,
127
129
  ...configDataValue,
128
130
  logEventInfo,
129
131
  },
130
132
  )
131
133
  : {
132
134
  shopId: global.info.queryInfo.shopId,
133
135
  logEventInfo,
134
136
  },
135
137
  )
136
138
  }
137
139
  break
138
140
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
139
141
  this.jdJumpToShopCategory({
140
142
  ...configDataValue,
141
143
  logEventInfo,
142
144
  })
143
145
  break
144
146
  case LinkConfigType.CONFIG_TYPE_MEMBER:
145
147
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
146
148
  const getShopMemberParams = this.jdOpenAppParams(
147
149
  configDataValue.clickUrl,
148
150
  )
149
151
  getShopMemberParams &&
150
152
  this.jdJumpToShopMember(
151
153
  Object.assign({}, getShopMemberParams, {
152
154
  logEventInfo,
153
155
  }),
154
156
  )
155
157
  } else {
156
158
  this.jdJumpToShopMember({
157
159
  shopId: global.info.queryInfo.shopId,
158
160
  venderId: configDataValue.shopDetail,
159
161
  logEventInfo,
160
162
  })
161
163
  }
162
164
  break
163
165
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
164
166
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
165
167
  const getShopActivityParams = this.jdOpenAppParams(
166
168
  configDataValue.clickUrl,
167
169
  )
168
170
  if (
169
171
  getShopActivityParams &&
170
172
  getShopActivityParams['des'] == 'jshopActivity'
171
173
  ) {
172
174
  this.jdJumpToShopActivity({
173
175
  projectId: configDataValue['projectId'],
174
176
  configDataValue,
175
177
  logEventInfo,
176
178
  })
177
179
  }
178
180
  } else if (configDataValue['projectId']) {
179
181
  this.jdJumpToShopActivity({
180
182
  projectId: configDataValue['projectId'],
181
183
  configDataValue,
182
184
  logEventInfo,
183
185
  })
184
186
  }
185
187
  break
186
188
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
187
189
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON:
188
190
  let _url = configDataValue.linkUrl
189
191
  const isProductM = /item\.m\.jd\.com/.test(_url)
190
192
  const isProductPC = /item\.jd\.com/.test(_url)
191
193
  if (isTjScence) {
192
194
 
193
195
  if (/(pro|prodev)\.jd\.com(\/mall\/)/.test(_url)) {
194
196
  if (isH5AdnJxMini) {
195
197
  _url = _url.replace(
196
198
  /([prodev]|[pro])(\.jd\.com)(\/mall)/,
197
199
  "$1.m$2/mini"
198
200
  ) + `appCode=${getUrlQuery('appCode')}&wxAppName=jx`
199
201
  } else {
200
202
  _url = _url.replace(
201
203
  /([prodev]|[pro])(\.jd\.com)(\/mall)/,
202
204
  "$1.m$2/jdlite"
203
205
  )
204
206
  }
205
207
  } else if (/(pro|prodev)\.(m\.jd|jd)\.com(\/mall\/)/.test(_url)) {
206
208
  if (isH5AdnJxMini) {
207
209
  _url = _url.replace(
208
210
  /([prodev]|[pro])(\.m\.jd\.com)(\/mall)/,
209
211
  "$1$2/mini"
210
212
  ) + `appCode=${getUrlQuery('appCode')}&wxAppName=jx`
211
213
  } else {
212
214
  _url = _url.replace(
213
215
  /([prodev]|[pro])(\.m\.jd\.com)(\/mall)/,
214
216
  "$1$2/jdlite"
215
217
  )
216
218
  }
217
219
  }
218
220
  }
219
221
  if (
220
222
  _url.indexOf('to=') === -1 &&
221
223
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
222
224
  ) {
223
225
  const _shopId = _url.match(/\d+/g)[0]
224
226
  this.jdJumpToShopHome({
225
227
  shopId: `${_shopId}`,
226
228
  logEventInfo,
227
229
  })
228
230
  } else if (this.isOpenJdAppUrl(_url)) {
229
231
  const getOpenAppParams: any = this.jdOpenAppParams(_url)
230
232
  if (getOpenAppParams) {
231
233
  if (getOpenAppParams.jumpTab == 'allProduct') {
232
234
  this.jdJumpToTabAllProduct(
233
235
  global.info.queryInfo.shopId,
234
236
  global.info.queryInfo.venderId,
235
237
  )
236
238
  } else if (
237
239
  getOpenAppParams.des == 'productList' &&
238
240
  getOpenAppParams.from == 'couponBatch'
239
241
  ) {
240
242
  this.jdJumpToCouponSearchProductList(getOpenAppParams?.couponId)
241
243
  } else if (getOpenAppParams.des == 'vapp') {
242
244
  this.jdJumpToWeb(
243
245
  `https:
244
246
  getOpenAppParams.category
245
247
  }&des=${getOpenAppParams.des}&vapptype=${
246
248
  getOpenAppParams.vapptype
247
249
  }&appId=${getOpenAppParams.appId}&path=${
248
250
  getOpenAppParams.path
249
251
  }&param=${encodeURI(JSON.stringify(getOpenAppParams.param))}`,
250
252
  logEventInfo,
251
253
  )
252
254
  } else {
253
255
  this.jdNavigateToNative(
254
256
  '',
255
257
  Object.assign({}, getOpenAppParams, {
256
258
  logEventInfo,
257
259
  }),
258
260
  )
259
261
  }
260
262
  }
261
263
  } else if (isProductM || isProductPC) {
262
264
  const skuid = _url.match(/\d+/g)[0]
263
265
  if (skuid) {
264
266
  this.jdJumpToProduct(skuid, logEventInfo)
265
267
  }
266
268
  } else {
267
269
  this.jdJumpToWeb(_url, logEventInfo)
268
270
  }
269
271
  break
270
272
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
271
273
  this.jdJumpToShopDetail({
272
274
  venderId: global.info.queryInfo.venderId,
273
275
  shopId: global.info.queryInfo.shopId,
274
276
  logEventInfo,
275
277
  })
276
278
  break
277
279
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
278
280
  this.jdJumpToShopHome({
279
281
  ...configDataValue,
280
282
  logEventInfo,
281
283
  })
282
284
  break
283
285
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
284
286
  break
285
287
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
286
288
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
287
289
  const getShoppingGuideParams = this.jdOpenAppParams(
288
290
  configDataValue.clickUrl,
289
291
  )
290
292
  getShoppingGuideParams &&
291
293
  this.jdJumpToShopActivity(
292
294
  Object.assign({}, getShoppingGuideParams, {
293
295
  logEventInfo,
294
296
  }),
295
297
  )
296
298
  }
297
299
  break
298
300
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
299
301
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
300
302
  const search = linkUrl.match(/\?.+/)
301
303
  if (search) {
302
304
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
303
305
  parseQueryUrlString(linkUrl)
304
306
  try {
305
307
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
306
308
  } catch (e) {
307
309
  console.warn('解析小程序 param 错误:', miniQueryData.param)
308
310
  }
309
311
  this.jdJumpToMiniProgram(miniQueryData)
310
312
  } else {
311
313
  console.warn('小程序地址错误:', linkUrl)
312
314
  }
313
315
  break
314
316
  }
315
317
  default:
316
318
  }
317
319
  }
318
320
 
319
321
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
320
322
  if(isTjM) return
321
323
  let batchParam = isTjScence ? `coupon_batch=${couponId}` : `couponbatch=${couponId}`
322
324
  this.jdJumpToWeb(
323
325
  `${this.jumpWebUrl.jxCouponSearch}?${batchParam}&sceneval=2`,
324
326
  logEventInfo,
325
327
  )
326
328
  }
327
329
 
328
330
  jdNavigateToNative(
329
331
  url: string,
330
332
  params: {
331
333
  logEventInfo?: object
332
334
  } = {},
333
335
  successBack?: Function | undefined,
334
336
  failBack?: Function | undefined,
335
337
  ) {
336
338
  const { logEventInfo } = params
337
339
  const getEparam = logEventInfo || params
338
340
  if(url.indexOf('tjshop') == -1) {
339
341
  url = url + this.getTjShopParam()
340
342
  }
341
343
  console.log(`url:::::::${url}`)
342
344
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
343
345
  this.clickEventLog(getEparam)
344
346
  .then(() => {
345
347
  typeof successBack == 'function'
346
348
  ? successBack(url)
347
349
  : (window.location.href = url)
348
350
  })
349
351
  .catch(() => {
350
352
  typeof failBack == 'function' && failBack(url)
351
353
  })
352
354
  }