@conecli/cone-render 0.8.19 → 0.8.20-beta.0

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 (91) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.jd.ts +1 -1
  5. package/dist/common/isvStorage/index.h5.ts +1 -0
  6. package/dist/common/isvStorage/index.ts +1 -0
  7. package/dist/common/token/const.ts +1 -0
  8. package/dist/common/token/index.h5.ts +1 -0
  9. package/dist/common/token/index.ts +1 -0
  10. package/dist/common/token/token.jd.ts +1 -0
  11. package/dist/common/token/token.ts +1 -0
  12. package/dist/common/token/token.wxapp.ts +1 -0
  13. package/dist/components/base/CommonFloorHead/index.module.scss +1 -1
  14. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  15. package/dist/components/base/CustomVideo/const.ts +1 -0
  16. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  17. package/dist/components/base/CustomVideo/index.tsx +1 -1
  18. package/dist/components/base/Dialog/index.module.scss +6 -2
  19. package/dist/components/base/Dialog/index.tsx +1 -1
  20. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  21. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  22. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  23. package/dist/components/base/NetworkDataError/const.ts +1 -1
  24. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  25. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  26. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  27. package/dist/components/base/Price/Base/index.module.scss +136 -0
  28. package/dist/components/base/Price/Base/index.tsx +1 -0
  29. package/dist/components/base/Price/Double/index.module.scss +158 -0
  30. package/dist/components/base/Price/Double/index.tsx +1 -0
  31. package/dist/components/base/Price/index.tsx +1 -1
  32. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  33. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  34. package/dist/components/floorItem.jd.tsx +1 -0
  35. package/dist/components/floorItem.tsx +1 -1
  36. package/dist/components/isv/Floor/index.tsx +1 -1
  37. package/dist/interface/component.ts +1 -1
  38. package/dist/interface/jumpEventReport.ts +1 -1
  39. package/dist/interface/service.ts +1 -1
  40. package/dist/jumpEventReport/base.ts +1 -1
  41. package/dist/jumpEventReport/const.ts +1 -1
  42. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  43. package/dist/jumpEventReport/index.h5.ts +1 -1
  44. package/dist/jumpEventReport/index.weapp.ts +1 -1
  45. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  46. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  47. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  48. package/dist/jumpEventReport/web/report.ts +1 -1
  49. package/dist/jumpEventReport/web.base.ts +1 -1
  50. package/dist/jumpEventReport/web.jd.ts +1 -1
  51. package/dist/jumpEventReport/web.jdb.ts +1 -0
  52. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  53. package/dist/libs/taroAppReport.js +2 -2
  54. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  55. package/dist/open/api/index.ts +1 -1
  56. package/dist/open/api/jump/business.ts +1 -0
  57. package/dist/open/api/jump/index.ts +1 -0
  58. package/dist/open/api/jump/minPath.ts +1 -0
  59. package/dist/open/api/jump/side.ts +1 -0
  60. package/dist/open/api/jump/webUrl.ts +1 -0
  61. package/dist/open/api/jump copy.ts +1 -0
  62. package/dist/open/api/moduleUtil.ts +1 -1
  63. package/dist/open/api/request.ts +1 -0
  64. package/dist/open/api/shopMember.ts +1 -0
  65. package/dist/open/api/userToken.ts +1 -0
  66. package/dist/service/bMallConst.ts +1 -0
  67. package/dist/service/bMallConst.wxapp.ts +1 -0
  68. package/dist/service/fetchGateway.ts +1 -0
  69. package/dist/service/fetchJsonp.ts +1 -0
  70. package/dist/service/http/colorSign.ts +1 -0
  71. package/dist/service/http/colorSign.wxapp.ts +1 -0
  72. package/dist/service/http/const.ts +1 -0
  73. package/dist/service/http/http.ts +1 -0
  74. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  75. package/dist/service/http/httpInterceptors.ts +1 -0
  76. package/dist/service/http/index.ts +1 -0
  77. package/dist/service/requestServer.ts +1 -0
  78. package/dist/utils/connectNativeJsBridge.ts +1 -1
  79. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  80. package/dist/utils/h5Utils.ts +1 -1
  81. package/dist/utils/index.h5.ts +1 -1
  82. package/dist/utils/index.ts +1 -1
  83. package/dist/utils/index.weapp.ts +1 -1
  84. package/dist/utils/jm-common.js +1 -1
  85. package/dist/utils/memberFormatUtils.js +1 -0
  86. package/dist/utils/priceUtils.js +1 -0
  87. package/dist/utils/ready.ts +1 -0
  88. package/dist/utils/utils.ts +1 -1
  89. package/package.json +5 -4
  90. package/dist/components/base/Price/index.module.scss +0 -136
  91. package/dist/open/api/jump.ts +0 -1
@@ -1 +1 @@
1
- import { domain } from '../../api'
1
+ import { domain } from '../../api'
2
2
  shop: '/pages/shop/index/index',
3
3
  detail: '/pages/gold/item/pages/detail/index',
4
4
  searchCoupon: '/pages/search/subPackages/coupon/coupon',
5
5
  h5: '/pages/h5/index',
6
6
  jingGouHome: '/pages/index/index',
7
7
  shopFans: '/pages/shopfans/pages/index/index',
8
8
  shopLight: '/pages/shoplight/pages/index/index',
9
9
  couponSearch: '/pages/search/subPackages/coupon/coupon',
10
10
  shopx: '/pages/shopx/pages/index/index',
11
11
  mshop: domain.mshop,
12
12
  pages: domain.pages,
13
13
  couponSearch: `${domain.mobileSo}/list/couponSearch.action`,
14
14
  shopSecondActivity: `${domain.sale}/m/h5/`,
15
15
  shopLight: `${domain.sale}/liteshop/index.html`,
16
16
  detail: `${domain.mobileDetail}/product/`,
17
17
  mobileHome: `${domain.mobileHome}`,
18
18
  rank: `${domain.ranking}/comLandingPage/comLandingPage`,
19
19
  wqShopMember: `${domain.wqshop}/mshop/QueryShopMemberInfo`,
20
20
  wqShopDetail: `${domain.wqshop}/mshop/GetShopIntroduce`,
21
21
  wqShopSearch: `${domain.wqshop}/mshop/SearchList`,
22
22
  shopMember: `${domain.shopMember}/shopcard`,
23
23
  shopMemberPointDetail: `${domain.shopMember}/member/membersPoint`,
24
24
  shopMemberBenefit: `${domain.shopMember}/shopbenefit`,
25
25
  shopMemberRule: `${domain.shopMember}/member/membersRule`,
26
26
  shopMemberCloseAccount: `${domain.shopMember}/member/memberCloseAccount`,
27
27
  shopMemberPointExchange: `${domain.shopMember}/memberpoint`,
28
28
  shopMemberBonusPurchase: `${domain.shopMember}/bonuspurchase`,
29
29
  shopMemberGood: `${domain.shopMember}/member/membersGood`,
30
30
  beanDetail: `${domain.bean}/beanDetail/index.action`,
31
31
  totalPromotion: `${domain.mobileSo}/list/itemSearch.action`,
32
32
  mLive: `${domain.lives}/#`,
33
33
  shopHome: `${domain.pages}/shop/home`,
34
34
  shopIntroduce: `${domain.pages}/shop/introduce`,
35
35
  shopSearch: `${domain.pages}/shop/search`,
36
36
  shopLottery: `${domain.pages}/shop/lottery`,
37
37
  shopCoupon: `${domain.pages}/shop/coupon`,
38
38
  shopWares: `${domain.pages}/shop/wares`,
39
39
  shopFastShopping: `${domain.pages}/shop/fastShopping`,
40
40
  shopSpeciSeckill: `${domain.pages}/shop/specialSeckill`,
41
41
  shopVideos: `${domain.pages}/shop/videos`,
42
42
  shopUseShareOrderUgcContent: `${domain.capturehomeshare}/aha/ugcShare.html`,
43
43
  dongDongChat: `${domain.jdcs}/chat/index.action`,
44
44
  samCenter: `${domain.pages}/shop/samCenter`,
45
45
  samCard: `${domain.pages}/shop/samCard`,
46
46
  shopH5MemberCardAPP: `${domain.pages}/member/shopcard`,
47
47
  shopH5MemberCardM: `${domain.pages}/member/m/shopcard`,
@@ -1 +1 @@
1
- export enum LogPnameInfo {
1
+ export enum LogPnameInfo {
2
2
  HOME = 'home',
3
3
  MEMBER = 'member',
4
4
  CLASSIFY = 'classify',
5
5
  PROMOTION = 'promotion',
6
6
  WX_SHOP_HOME = 'wx_shop_home',
7
7
  APP_SHOP_DETAIL = 'app_Shop_ShopDetail',
8
8
  APP_SHOP_MEMBER = 'Shop_ShopCard',
9
9
  MOBILE_SEARCH = 'MShop_SearchResult',
10
10
  APP_SHOP_MEMBER = 'Shop_ShopCard'
@@ -1 +1 @@
1
- const pageName = window.location.origin + window.location.pathname
1
+ import { sgmCustomReport } from '../../utils'
2
2
  if (window.MPing) {
3
3
  resolve(true)
4
4
  } else {
5
5
  if (isReportReadyError) {
6
6
  reject(false)
7
7
  } else {
8
8
  ready('MPing', 3000).then(() => {
9
9
  isReportReadyError = false
10
10
  resolve(true)
11
11
  }).catch(() => {
12
12
  isReportReadyError = true
13
13
  reject(false)
14
14
  })
15
15
  }
16
16
  }
17
17
  return new Promise((resolve, reject) => {
18
18
  const { pageId, pageParam, pTag, ...otherParam } = opts
19
19
  getReportObjReadyPromise().then(() => {
20
20
  const pv = new MPing.inputs.PV({
21
21
  page_id: pageId,
22
22
  })
23
23
  pv.page_param = pageParam
24
24
  otherParam &&
25
25
  Object.keys(otherParam).forEach((key) => {
26
26
  pv[key] = otherParam[key]
27
27
  })
28
28
  if (window.wqlog && pTag) {
29
29
  wqlog('wqmodule.send', 'pv', {
30
30
  ptag: pTag,
31
31
  })
32
32
  console.log('wqmodule.send-pv pTag 上报完毕', pTag)
33
33
  }
34
34
  const mping = new MPing()
35
35
  mping.send(pv)
36
36
  setTimeout(() => resolve(true), 200)
37
37
  }).catch(e => {
38
38
  reject(e)
39
39
  })
40
40
  }).catch(err => {
41
41
  console.log("上报异常", err)
42
42
  sgmCustomReport({
43
43
  code: 'reportErr',
44
44
  msg: '埋点js加载异常,导致MPing不存在,pv具体上报参数如下==>' + JSON.stringify(opts),
45
45
  })
46
46
  })
47
47
  return new Promise((resolve, reject) => {
48
48
  const {
49
49
  eid,
50
50
  eparam,
51
51
  jsonParam,
52
52
  pageParam,
53
53
  pTag,
54
54
  etModel,
55
55
  exposureState,
56
56
  elevel,
57
57
  pageId = 'TerminatorNew_All',
58
58
  } = opts
59
59
  getReportObjReadyPromise().then(() => {
60
60
  const click = new MPing.inputs.Click(eid)
61
61
  click.json_param = jsonParam
62
62
  if(eparam) {
63
63
  click.event_param = jsonParam
64
64
  }
65
65
  click.et_model = etModel
66
66
  click.page_id = pageId
67
67
  click.page_name = pageName
68
68
  pageParam && (click.page_param = pageParam)
69
69
  if (window.wqlog && pTag) {
70
70
  const sendTypeKey = exposureState
71
71
  ? 'wg_wx.000003'
72
72
  : 'wg_wx.000001'
73
73
  wqlog('wqmodule.send', sendTypeKey, {
74
74
  ptag: pTag,
75
75
  })
76
76
  console.log(
77
77
  `wqmodule.send-exposureState ${exposureState} pTag 上报完毕01是点击03是曝光`,
78
78
  pTag,
79
79
  sendTypeKey,
80
80
  )
81
81
  }
82
82
  elevel && (click.event_level = elevel)
83
83
  click.updateEventSeries()
84
84
  new MPing().send(click)
85
85
  setTimeout(() => resolve(true), 200)
86
86
  }).catch(e => {
87
87
  reject(e)
88
88
  })
89
89
  }).catch(err => {
90
90
  console.log("上报异常", err)
91
91
  sgmCustomReport({
92
92
  code: 'reportErr',
93
93
  msg: '埋点js加载异常,导致MPing不存在,click具体上报参数如下==>' + JSON.stringify(opts),
94
94
  })
95
95
  })
96
96
  return new Promise((resolve, reject) => {
97
97
  const {
98
98
  eid,
99
99
  eparam,
100
100
  jsonParam,
101
101
  pageParam,
102
102
  skuId,
103
103
  pageId = 'TerminatorNew_All',
104
104
  } = opts
105
105
  getReportObjReadyPromise().then(() => {
106
106
  const cart = new MPing.inputs.AddCart(eid, skuId)
107
107
  cart.event_param = eparam
108
108
  cart.json_param = jsonParam
109
109
  cart.page_id = pageId
110
110
  cart.page_name = pageName
111
111
  pageParam && (cart.page_param = pageParam)
112
112
  const mping = new MPing()
113
113
  mping.send(cart)
114
114
  setTimeout(() => resolve(true), 200)
115
115
  }).catch(e => {
116
116
  reject(e)
117
117
  })
118
118
  }).catch(err => {
119
119
  console.log("上报异常", err)
120
120
  sgmCustomReport({
121
121
  code: 'reportErr',
122
122
  msg: '埋点js加载异常,导致MPing不存在,toCart具体上报参数如下==>' + JSON.stringify(opts),
123
123
  })
124
124
  })
@@ -1 +1 @@
1
- import global from '../common'
1
+ import global from '../common'
2
2
  objectToUrlEncode,
3
3
  parseQueryUrlString,
4
4
  filterUrlQueryData,
5
5
  routerInfo: {
6
6
  params: {},
7
7
  },
8
8
  nativeEvent: null,
9
9
  jumpConfig: {
10
10
  venderId: null,
11
11
  shopId: null,
12
12
  sourceValue: '',
13
13
  sourceType: 'M-H5',
14
14
  activityType: 'shopx',
15
15
  moduleId: 'none',
16
16
  entrance: 'none',
17
17
  },
18
18
  logPageParamStr: '',
19
19
  public logPageId: string
20
20
  public jumpConfig: JumpEventReportInterFace.JumpH5ReportConfig
21
21
  getConfig(opt) {
22
22
  return Object.assign(this, {}, defaultConfig, opt)
23
23
  }
24
24
  updateInfo(
25
25
  routerInfo,
26
26
  logPname = LogPnameInfo.HOME,
27
27
  pageId = LogPageIdInfo.APP,
28
28
  ) {
29
29
  this.routerInfo = routerInfo
30
30
  this.logPname = logPname
31
31
  this.jumpConfig = Object.assign(
32
32
  {},
33
33
  this.jumpConfig,
34
34
  filterUrlQueryData(routerInfo?.params || {}),
35
35
  )
36
36
  this.logPageId = pageId
37
37
  }
38
38
 
39
39
  reportInfoPv(
40
40
  pageId = LogPageIdInfo.APP,
41
41
  opt: {
42
42
  pageParam?: any
43
43
  } = {},
44
44
  ) {
45
45
  const { pageParam } = opt
46
46
  const pageParamStr =
47
47
  typeof pageParam === 'object' ? JSON.stringify(pageParam) : pageParam
48
48
  this.logPageParamStr = pageParamStr
49
49
  ? pageParamStr
50
50
  : JSON.stringify(this.jumpConfig)
51
51
  return reportPV({
52
52
  pageId,
53
53
  pageParam: this.logPageParamStr,
54
54
  ...opt,
55
55
  })
56
56
  }
57
57
 
58
58
  jdJumpToProduct(skuIds, logEventInfo) {
59
59
  skuIds = skuIds.toString().trim()
60
60
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
61
61
  this.jdNavigateToNative(
62
62
  `${this.jumpWebUrl.detail}${getSkuId}.html`,
63
63
  logEventInfo,
64
64
  )
65
65
  }
66
66
 
67
67
  jdJumpToRankList(contentId: string | number, rankType = 10, logEventInfo) {
68
68
  const rankUrl = `${this.jumpWebUrl.rank}?contentId=${contentId}&sku=&rankType=${rankType}&fromName=dcpws&hideAd=1`
69
69
  this.jdNavigateToNative(rankUrl, {
70
70
  contentId,
71
71
  ...logEventInfo,
72
72
  })
73
73
  }
74
74
 
75
75
  jdJumpToShopCategory(shopInfo) {
76
76
  this.jdNavigateToNative(
77
77
  `${this.jumpWebUrl.shopHome}?${objectToUrlEncode(
78
78
  this.getShopIdOrVenderIdParams(shopInfo),
79
79
  )}&tabActive=classify`,
80
80
  {
81
81
  ...shopInfo,
82
82
  },
83
83
  )
84
84
  }
85
85
 
86
86
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
87
87
  this.jdNavigateToNative(
88
88
  `${this.jumpWebUrl.mshop}?${objectToUrlEncode(
89
89
  this.getShopIdOrVenderIdParams(shopInfo),
90
90
  )}`,
91
91
  {
92
92
  ...shopInfo,
93
93
  },
94
94
  )
95
95
  }
96
96
 
97
97
  jdJumpToShopLight(shopInfo) {
98
98
  this.jdNavigateToNative(
99
99
  `${this.jumpWebUrl.shopLight}?${objectToUrlEncode(
100
100
  this.getShopIdOrVenderIdParams(shopInfo),
101
101
  )}`,
102
102
  {
103
103
  ...shopInfo,
104
104
  },
105
105
  )
106
106
  }
107
107
 
108
108
  jdJumpToShopMember(shopInfo) {
109
109
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
110
110
  this.jdJumpToWeb(
111
111
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(
112
112
  getShopInfo,
113
113
  )}&venderType=1&channel=406`,
114
114
  shopInfo,
115
115
  )
116
116
  }
117
117
 
118
118
  jdJumpToShopMemberCard(shopInfo) {
119
119
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
120
120
  this.jdJumpToWeb(
121
121
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(getShopInfo)}`,
122
122
  shopInfo,
123
123
  )
124
124
  }
125
125
 
126
126
  jdJumpToTotalPromotion(shopInfo) {
127
127
  const { url, logEventInfo } = shopInfo
128
128
  if (this.isOpenJdAppUrl(url)) {
129
129
  const getOpenAppParams: any = this.jdOpenAppParams(url)
130
130
  if (getOpenAppParams) {
131
131
  if (getOpenAppParams?.activityId) {
132
132
  this.jdJumpToWeb(
133
133
  `${this.jumpWebUrl.totalPromotion}?activity_id=${getOpenAppParams?.activityId}`,
134
134
  shopInfo,
135
135
  )
136
136
  }
137
137
  }
138
138
  } else {
139
139
  this.jdJumpToWeb(url, logEventInfo)
140
140
  }
141
141
  }
142
142
 
143
143
  jdJumpToDongDongChat(paramInfo) {
144
144
  const { venderId = '1', entry = 'm_shop', ...otherInfo } = paramInfo
145
145
  const dongdongUrl = `${this.jumpWebUrl.dongDongChat}?venderId=${venderId}&entry=${entry}&sceneval=2`
146
146
  this.jdJumpToWeb(dongdongUrl, otherInfo)
147
147
  }
148
148
 
149
149
  jdJumpToShopDetail(shopInfo) {
150
150
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
151
151
  this.jdJumpToWeb(
152
152
  `${this.jumpWebUrl.shopIntroduce}?${objectToUrlEncode(getShopInfo)}`,
153
153
  shopInfo,
154
154
  )
155
155
  }
156
156
 
157
157
  jdJumpToShopSearch(shopInfo) {
158
158
  const getInfo = Object.assign(
159
159
  {},
160
160
  {
161
161
  shopId: global.info.queryInfo.shopId,
162
162
  venderId: global.info.queryInfo.venderId,
163
163
  },
164
164
  shopInfo,
165
165
  )
166
166
  const { shopId, categoryId, keyword, pageId, description, shopName } =
167
167
  getInfo
168
168
  const cateId = categoryId ? `&cateId=${typeof categoryId === 'string' ? categoryId?.trim() : categoryId}` : ''
169
169
  const addKeyWord = keyword ? `&keyword=${keyword}` : ''
170
170
  const addPageId = pageId ? `&pageId=${pageId}` : ''
171
171
  const searchDes = description ? `&description=${description}` : ''
172
172
  const shopNameDes = shopName ? `&shopName=${shopName}` : ''
173
173
  const searchType = categoryId ? 5 : keyword ? 4 : 3
174
174
  this.jdJumpToWeb(
175
175
  `${this.jumpWebUrl.shopSearch}?shopId=${shopId}&searchType=${searchType}${cateId}${addKeyWord}${addPageId}${searchDes}${shopNameDes}`,
176
176
  getInfo,
177
177
  )
178
178
  }
179
179
 
180
180
  jdJumpToWeb(
181
181
  url,
182
182
  logEventInfo,
183
183
  successBack?: Function | undefined,
184
184
  failBack?: Function | undefined,
185
185
  ) {
186
186
  this.jdNavigateToNative(
187
187
  url,
188
188
  {
189
189
  ...logEventInfo,
190
190
  },
191
191
  successBack,
192
192
  failBack,
193
193
  )
194
194
  }
195
195
 
196
196
  jdJumpToWebInner(url, logEventInfo) {
197
197
  this.jdJumpToWeb(url, logEventInfo)
198
198
  }
199
199
 
200
200
  jdJumpToLive(liveInfo, logEventInfo = {}) {
201
201
  if (liveInfo?.liveId) {
202
202
  this.jdJumpToWeb(
203
203
  `${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?origin=30`,
204
204
  logEventInfo,
205
205
  )
206
206
  }
207
207
  }
208
208
 
209
209
  jdJumpToShopActivity(shopInfo) {
210
210
  const { configDataValue, logEventInfo, projectId } = shopInfo
211
211
  if (projectId && configDataValue) {
212
212
  this.jdJumpToWeb(
213
213
  `${this.jumpWebUrl.shopSecondActivity}${configDataValue.data}.html`,
214
214
  logEventInfo,
215
215
  )
216
216
  }
217
217
  }
218
218
 
219
219
  jdJumpToActivityPlace(spUrl, logEventInfo) {
220
220
  this.jdNavigateToNative(spUrl, logEventInfo)
221
221
  }
222
222
 
223
223
  jdJumpConfigUrl(detail, logEventInfo = {}) {
224
224
  const { configDataType, configDataValue } = detail
225
225
  console.log(
226
226
  'jdJumpConfigUrl web.base configDataType:',
227
227
  configDataType,
228
228
  configDataValue,
229
229
  )
230
230
  switch (configDataType) {
231
231
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
232
232
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
233
233
  break
234
234
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
235
235
  this.jdJumpToWeb(
236
236
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
237
237
  {},
238
238
  )
239
239
  break
240
240
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
241
241
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
242
242
  const getShopSearchParams = this.jdOpenAppParams(
243
243
  configDataValue.clickUrl,
244
244
  )
245
245
  getShopSearchParams &&
246
246
  this.jdJumpToShopSearch(
247
247
  Object.assign({}, getShopSearchParams, {
248
248
  logEventInfo,
249
249
  }),
250
250
  )
251
251
  } else {
252
252
  this.jdJumpToShopSearch(
253
253
  configDataValue['cid']
254
254
  ? Object.assign(
255
255
  {},
256
256
  {
257
257
  shopId: global.info.queryInfo.shopId,
258
258
  categoryId: configDataValue.cid,
259
259
  ...configDataValue,
260
260
  logEventInfo,
261
261
  },
262
262
  )
263
263
  : {
264
264
  shopId: global.info.queryInfo.shopId,
265
265
  logEventInfo,
266
266
  },
267
267
  )
268
268
  }
269
269
  break
270
270
  case LinkConfigType.CONFIG_TYPE_CATEGORY_PAGE:
271
271
  this.jdJumpToShopCategory({
272
272
  ...configDataValue,
273
273
  logEventInfo,
274
274
  })
275
275
  break
276
276
  case LinkConfigType.CONFIG_TYPE_MEMBER:
277
277
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
278
278
  const getShopMemberParams = this.jdOpenAppParams(
279
279
  configDataValue.clickUrl,
280
280
  )
281
281
  getShopMemberParams &&
282
282
  this.jdJumpToShopMember(
283
283
  Object.assign({}, getShopMemberParams, {
284
284
  logEventInfo,
285
285
  }),
286
286
  )
287
287
  } else {
288
288
  this.jdJumpToShopMember({
289
289
  shopId: global.info.queryInfo.shopId,
290
290
  venderId: configDataValue.shopDetail,
291
291
  logEventInfo,
292
292
  })
293
293
  }
294
294
  break
295
295
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
296
296
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
297
297
  const getShopActivityParams = this.jdOpenAppParams(
298
298
  configDataValue.clickUrl,
299
299
  )
300
300
  if (
301
301
  getShopActivityParams &&
302
302
  getShopActivityParams['des'] == 'jshopActivity'
303
303
  ) {
304
304
  this.jdJumpToShopActivity({
305
305
  projectId: configDataValue['projectId'],
306
306
  configDataValue,
307
307
  logEventInfo,
308
308
  })
309
309
  }
310
310
  } else if (configDataValue['projectId']) {
311
311
  this.jdJumpToShopActivity({
312
312
  projectId: configDataValue['projectId'],
313
313
  configDataValue,
314
314
  logEventInfo,
315
315
  })
316
316
  }
317
317
  break
318
318
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
319
319
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON:
320
320
  const _url = configDataValue.linkUrl
321
321
  const isProductM = /item\.m\.jd\.com/.test(_url)
322
322
  const isProductPC = /item\.jd\.com/.test(_url)
323
323
  if (
324
324
  _url.indexOf('to=') === -1 &&
325
325
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
326
326
  ) {
327
327
  const _shopId = _url.match(/\d+/g)[0]
328
328
  this.jdJumpToShopHome({
329
329
  shopId: `${_shopId}`,
330
330
  logEventInfo,
331
331
  })
332
332
  } else if (this.isOpenJdAppUrl(_url)) {
333
333
  const getOpenAppParams: any = this.jdOpenAppParams(_url)
334
334
  if (getOpenAppParams) {
335
335
  if (getOpenAppParams.jumpTab == 'allProduct') {
336
336
  this.jdJumpToTabAllProduct(
337
337
  global.info.queryInfo.shopId,
338
338
  global.info.queryInfo.venderId,
339
339
  )
340
340
  } else if (
341
341
  getOpenAppParams.des == 'productList' &&
342
342
  getOpenAppParams.from == 'couponBatch'
343
343
  ) {
344
344
  this.jdJumpToCouponSearchProductList(getOpenAppParams?.couponId)
345
345
  } else if (getOpenAppParams.des == 'vapp') {
346
346
  this.jdJumpToWeb(
347
347
  `https:
348
348
  getOpenAppParams.category
349
349
  }&des=${getOpenAppParams.des}&vapptype=${
350
350
  getOpenAppParams.vapptype
351
351
  }&appId=${getOpenAppParams.appId}&path=${
352
352
  getOpenAppParams.path
353
353
  }&param=${encodeURI(JSON.stringify(getOpenAppParams.param))}`,
354
354
  logEventInfo,
355
355
  )
356
356
  } else {
357
357
  this.jdNavigateToNative(
358
358
  '',
359
359
  Object.assign({}, getOpenAppParams, {
360
360
  logEventInfo,
361
361
  }),
362
362
  )
363
363
  }
364
364
  }
365
365
  } else if (isProductM || isProductPC) {
366
366
  const skuid = _url.match(/\d+/g)[0]
367
367
  if (skuid) {
368
368
  this.jdJumpToProduct(skuid, logEventInfo)
369
369
  }
370
370
  } else {
371
371
  this.jdJumpToWeb(_url, logEventInfo)
372
372
  }
373
373
  break
374
374
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
375
375
  this.jdJumpToShopDetail({
376
376
  venderId: global.info.queryInfo.venderId,
377
377
  shopId: global.info.queryInfo.shopId,
378
378
  logEventInfo,
379
379
  })
380
380
  break
381
381
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
382
382
  this.jdJumpToShopHome({
383
383
  ...configDataValue,
384
384
  logEventInfo,
385
385
  })
386
386
  break
387
387
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
388
388
  break
389
389
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
390
390
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
391
391
  const getShoppingGuideParams = this.jdOpenAppParams(
392
392
  configDataValue.clickUrl,
393
393
  )
394
394
  getShoppingGuideParams &&
395
395
  this.jdJumpToShopActivity(
396
396
  Object.assign({}, getShoppingGuideParams, {
397
397
  logEventInfo,
398
398
  }),
399
399
  )
400
400
  }
401
401
  break
402
402
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
403
403
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
404
404
  const search = linkUrl.match(/\?.+/)
405
405
  if (search) {
406
406
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
407
407
  parseQueryUrlString(linkUrl)
408
408
  try {
409
409
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
410
410
  } catch (e) {
411
411
  console.warn('解析小程序 param 错误:', miniQueryData.param)
412
412
  }
413
413
  this.jdJumpToMiniProgram(miniQueryData)
414
414
  } else {
415
415
  console.warn('小程序地址错误:', linkUrl)
416
416
  }
417
417
  break
418
418
  }
419
419
  default:
420
420
  }
421
421
  }
422
422
 
423
423
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
424
424
  this.jdJumpToWeb(
425
425
  `${this.jumpWebUrl.shopHome}?shopId=${shopId}&venderId=${venderId}&tabActive=home-product`,
426
426
  logEventInfo,
427
427
  )
428
428
  }
429
429
 
430
430
  jdJumpToTabAllProductInner(shopId, venderId, logEventInfo = {}) {
431
431
  this.jdJumpToTabAllProduct(shopId, venderId, logEventInfo)
432
432
  }
433
433
 
434
434
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
435
435
  this.jdJumpToWeb(
436
436
  `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`,
437
437
  logEventInfo,
438
438
  )
439
439
  }
440
440
 
441
441
  jdNavigateToNative(
442
442
  url: string,
443
443
  params: {
444
444
  logEventInfo?: object
445
445
  } = {},
446
446
  successBack?: Function | undefined,
447
447
  failBack?: Function | undefined,
448
448
  ) {
449
449
  const { logEventInfo } = params
450
450
  const getEparam = logEventInfo || params
451
451
  console.log(`url:::::::${url}`)
452
452
  global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE &&
453
453
  this.clickEventLog(getEparam)
454
454
  .then(() => {
455
455
  typeof successBack == 'function'
456
456
  ? successBack(url)
457
457
  : (window.location.href = url)
458
458
  })
459
459
  .catch(() => {
460
460
  typeof failBack == 'function' && failBack(url)
461
461
  })
462
462
  }
463
463
 
464
464
  clickEventLog(
465
465
  opts: JumpEventReportInterFace.OptEventLogParams = {},
466
466
  reportKey = 'click',
467
467
  ) {
468
468
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
469
469
  ;/TerminatorNew_/.test(`${eventId}`) &&
470
470
  console.log(`当前h5的楼层模块eventId为====${eventId}`)
471
471
  if (eventId && jsonParam) {
472
472
  const { etModelInfo, logBaseInfo } = jsonParam
473
473
  const getJsonParam =
474
474
  etModelInfo && logBaseInfo
475
475
  ? logBaseInfo
476
476
  : Object.assign(
477
477
  {},
478
478
  {
479
479
  shopid: global.info.queryInfo?.shopId,
480
480
  },
481
481
  jsonParam,
482
482
  )
483
483
  const webLogParams = {
484
484
  eid: eventId,
485
485
  elevel: eventLevel,
486
486
  jsonParam: JSON.stringify(getJsonParam),
487
487
  etModel: JSON.stringify(etModelInfo || {}),
488
488
  pageId: this.logPageId,
489
489
  pageParam: this.logPageParamStr,
490
490
  ...otherParams,
491
491
  }
492
492
  return /click|exposure/.test(reportKey)
493
493
  ? reportClick(webLogParams)
494
494
  : reportToCart(opts)
495
495
  } else {
496
496
  console.log('暂无埋点参数eventId和jsonParam')
497
497
  return Promise.resolve(false)
498
498
  }
499
499
  }
500
500
 
501
501
  exposureEventLog(opts) {
502
502
  return global.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
503
503
  ? this.clickEventLog(
504
504
  {
505
505
  ...opts,
506
506
  exposureState: true,
507
507
  },
508
508
  'exposure',
509
509
  )
510
510
  : Promise.resolve(false)
511
511
  }