@conecli/cone-render 0.8.20-shop.21 → 0.8.20-shop.211

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 (163) hide show
  1. package/README.md +7 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/assets/icon_blue_info.svg +1 -0
  4. package/dist/common/const.ts +1 -1
  5. package/dist/common/environmentType.ts +1 -0
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/jdplayerSdk.ts +1 -0
  11. package/dist/common/jssdk.ts +1 -0
  12. package/dist/common/pageType.ts +1 -0
  13. package/dist/common/sgmCustomCode.ts +1 -0
  14. package/dist/common/token/index.h5.ts +1 -1
  15. package/dist/common/token/token.jd.ts +1 -1
  16. package/dist/common/token/token.ts +1 -1
  17. package/dist/common/wxappApi.jd.ts +1 -0
  18. package/dist/common/wxappApi.ts +1 -1
  19. package/dist/components/ErrorBoundary.tsx +1 -1
  20. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  21. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  22. package/dist/components/base/CountDown/index.module.scss +49 -44
  23. package/dist/components/base/CountDown/index.tsx +1 -1
  24. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  25. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  26. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  27. package/dist/components/base/CustomVideo/common.ts +1 -0
  28. package/dist/components/base/CustomVideo/index.module.scss +1 -1
  29. package/dist/components/base/CustomVideo/index.tsx +1 -1
  30. package/dist/components/base/Dialog/index.module.scss +16 -0
  31. package/dist/components/base/Dialog/index.tsx +1 -1
  32. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  33. package/dist/components/base/ExposureSmart/const.ts +1 -0
  34. package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
  35. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  36. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  37. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  38. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  39. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  40. package/dist/components/base/InViewRender/index.tsx +1 -1
  41. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  42. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  43. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  44. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  45. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  46. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  47. package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -20
  48. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  49. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  50. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  51. package/dist/components/base/NetworkDataError/const.ts +1 -1
  52. package/dist/components/base/NetworkDataError/index.module.scss +125 -69
  53. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  54. package/dist/components/base/Price/Base/index.module.scss +12 -0
  55. package/dist/components/base/Price/Base/index.tsx +1 -1
  56. package/dist/components/base/Price/Double/index.module.scss +32 -0
  57. package/dist/components/base/Price/Double/index.tsx +1 -1
  58. package/dist/components/base/Price/index.tsx +1 -1
  59. package/dist/components/base/Skeleton/index.tsx +1 -1
  60. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  61. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  62. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  63. package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
  64. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  65. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  66. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  67. package/dist/components/floorItem.jd.tsx +1 -1
  68. package/dist/components/floorItem.tsx +1 -1
  69. package/dist/components/floorItem.weapp.tsx +1 -1
  70. package/dist/components/isv/Floor/index.tsx +1 -1
  71. package/dist/components/remoteFloorItem.tsx +1 -0
  72. package/dist/interface/common.ts +1 -1
  73. package/dist/interface/component.ts +1 -1
  74. package/dist/interface/jumpEventReport.ts +1 -1
  75. package/dist/interface/service.ts +1 -1
  76. package/dist/interface/utils.ts +1 -1
  77. package/dist/jumpEventReport/base.ts +1 -1
  78. package/dist/jumpEventReport/const.ts +1 -1
  79. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  80. package/dist/jumpEventReport/index.h5.ts +1 -1
  81. package/dist/jumpEventReport/index.jd.ts +1 -1
  82. package/dist/jumpEventReport/index.ts +1 -1
  83. package/dist/jumpEventReport/index.weapp.ts +1 -1
  84. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  85. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  86. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  87. package/dist/jumpEventReport/web/report.ts +1 -1
  88. package/dist/jumpEventReport/web.base.ts +1 -1
  89. package/dist/jumpEventReport/web.jd.ts +1 -1
  90. package/dist/jumpEventReport/web.jdb.ts +1 -1
  91. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  92. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  93. package/dist/jumpEventReport/web.pc.ts +1 -0
  94. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  95. package/dist/jumpEventReport/web.tjm.ts +1 -0
  96. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  97. package/dist/language/en_US.json +178 -0
  98. package/dist/language/zh_CN.json +178 -0
  99. package/dist/language/zh_HK.json +178 -0
  100. package/dist/libs/taroAppReport.js +2 -2
  101. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -27
  102. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  103. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  104. package/dist/open/api/device.ts +1 -1
  105. package/dist/open/api/environment.ts +1 -1
  106. package/dist/open/api/index.ts +1 -1
  107. package/dist/open/api/jump/business.ts +1 -0
  108. package/dist/open/api/jump/index.ts +1 -0
  109. package/dist/open/api/jump/minPath.ts +1 -0
  110. package/dist/open/api/jump/side.ts +1 -0
  111. package/dist/open/api/jump/webUrl.ts +1 -0
  112. package/dist/open/api/jump copy.ts +1 -0
  113. package/dist/open/api/request.ts +1 -1
  114. package/dist/open/api/shopMember.ts +1 -1
  115. package/dist/open/api/track.ts +1 -1
  116. package/dist/open/api/util.ts +1 -1
  117. package/dist/open/components/index.ts +1 -1
  118. package/dist/sass/app.h5.scss +289 -212
  119. package/dist/sass/base.scss +195 -137
  120. package/dist/service/bMallConst.ts +1 -1
  121. package/dist/service/fetchGateway.ts +1 -1
  122. package/dist/service/fetchGateway.weapp.ts +1 -0
  123. package/dist/service/http/colorSign.ts +1 -1
  124. package/dist/service/http/const.ts +1 -1
  125. package/dist/service/http/h5Http.ts +1 -0
  126. package/dist/service/http/index.h5.ts +1 -0
  127. package/dist/service/requestServer.h5.ts +1 -0
  128. package/dist/service/requestServer.ts +1 -1
  129. package/dist/service/requestServer.weapp.ts +1 -0
  130. package/dist/utils/connectNativeJsBridge.ts +1 -1
  131. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  132. package/dist/utils/draExceptionAndProfile.ts +1 -1
  133. package/dist/utils/h5Utils.ts +1 -1
  134. package/dist/utils/index.h5.ts +1 -1
  135. package/dist/utils/index.ts +1 -1
  136. package/dist/utils/index.weapp.ts +1 -1
  137. package/dist/utils/intersectionObserver.ts +1 -1
  138. package/dist/utils/jm-common.js +1 -1
  139. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  140. package/dist/utils/jumpExtMapUtil.ts +1 -0
  141. package/dist/utils/sColor.js +1 -0
  142. package/dist/utils/sgmCodeUtils.ts +1 -0
  143. package/dist/utils/taroRenderUtil.ts +1 -0
  144. package/dist/utils/utils.ts +1 -1
  145. package/dist/wxapp/api/helper.js +1 -0
  146. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  147. package/dist/wxapp/common/user_info.js +1 -1
  148. package/dist/wxapp/components/launch-app/index.js +1 -0
  149. package/dist/wxapp/components/launch-app/index.json +5 -0
  150. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  151. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  152. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  153. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  154. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  155. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  156. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  157. package/package.json +148 -115
  158. package/dist/components/base/Skeleton/old.tsx +0 -1
  159. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  160. package/dist/open/api/jump.ts +0 -1
  161. package/dist/utils/memberFormatUtils.js +0 -1
  162. /package/dist/service/{bMallConst.wxapp.ts → bMallConst.weapp.ts} +0 -0
  163. /package/dist/service/http/{colorSign.wxapp.ts → colorSign.weapp.ts} +0 -0
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  routerInfo: {
3
2
  params: {},
4
3
  },
5
4
  nativeEvent: null,
6
5
  logPageParamStr: '',
7
6
  implements JumpEventReportInterFace.JumpEventReportInit
8
7
  public jingGouMiniState: boolean
9
8
  public logPageId: string
10
9
  public logPageParamStr: string
11
10
  public nativeEvent: any
12
11
  public routerInfo: JumpEventReportInterFace.RouterInfo
13
12
  public logPname: LogPnameInfo
14
13
  public jumpMiniPath: JumpEventReportInterFace.JumpMiniPath
15
14
  public jumpWebUrl: JumpEventReportInterFace.jumpWebUrl
16
15
  public sectionExposureInfo: object
17
16
  constructor(opt = {}) {
18
17
  this.logPageId = LogPageIdInfo.APP
19
18
  this.jingGouMiniState = false
20
19
  this.jumpMiniPath = JumpMiniPath
21
20
  this.jumpWebUrl = JumpWebUrl
22
21
  this.sectionExposureInfo = {}
23
22
  this.getConfig(opt)
24
23
  }
25
24
  getConfig(opt) {
26
25
  return Object.assign(this, {}, defaultConfig, opt)
27
26
  }
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.logPageId = pageId
37
36
  }
38
37
  reportInfoPv(_pageId, _opt = {}) {}
39
38
 
40
39
  getShopIdOrVenderIdParams(
41
40
  params: JumpEventReportInterFace.ShopIdsInfo = {},
42
41
  ): JumpEventReportInterFace.ShopIdsInfo {
43
42
  const setParams = {}
44
43
  params.shopId && (setParams['shopId'] = `${params.shopId}`)
45
44
  params.venderId && (setParams['venderId'] = `${params.venderId}`)
46
45
  return setParams
47
46
  }
48
47
 
49
48
  getShopIdsInfo(params = {}): JumpEventReportInterFace.ShopIdsInfo {
50
49
  let setParams = this.getShopIdOrVenderIdParams(params)
51
50
  setParams = {
52
51
  ...params,
53
52
  ...setParams,
54
53
  }
55
54
  return setParams
56
55
  }
57
56
 
58
57
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
59
58
  console.log('[降级H5] jdJumpToShopHome base')
60
59
  this.jdJumpToShopBase(shopInfo)
61
60
  }
62
61
 
63
62
  jdJumpToShopBase(shopInfo) {
64
63
  console.log('[降级H5] jdJumpToShopBase')
65
64
  this.jdNavigateToNative(
66
65
  `${this.jumpMiniPath.shop}?${objectToUrlEncode(
67
66
  this.getShopIdOrVenderIdParams(shopInfo),
68
67
  )}`,
69
68
  {
70
69
  ...shopInfo,
71
70
  },
72
71
  )
73
72
  }
74
73
 
75
74
  jdJumpToShopLight(shopInfo) {
76
75
  this.jdNavigateToNative(
77
76
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
78
77
  this.getShopIdOrVenderIdParams(shopInfo),
79
78
  )}`,
80
79
  {
81
80
  ...shopInfo,
82
81
  },
83
82
  )
84
83
  }
85
84
 
86
85
  jdJumpToProduct(skuIds, logEventInfo) {
87
86
  skuIds = skuIds.toString().trim()
88
87
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds
89
88
  this.jdNavigateToNative(
90
89
  `${this.jumpMiniPath.detail}?sku=${getSkuId}`,
91
90
  logEventInfo,
92
91
  )
93
92
  }
94
93
 
95
94
  jdJumpToFlashSaleTab(_logEventInfo) {
96
95
  console.log('跳转闪购', _logEventInfo)
97
96
  }
98
97
 
99
98
 
100
99
  jdJumpToShopMemberInfo(logEventInfo) {
101
100
  console.log('跳转修改会员信息页', logEventInfo)
102
101
  }
103
102
 
104
103
  jdJumpToShopMemberPointDetail(logEventInfo) {
105
104
  const venderId = global.info.queryInfo.venderId
106
105
  const shopId = global.info.queryInfo.shopId
107
106
  this.jdJumpToWeb(
108
107
  `${this.jumpWebUrl.shopMemberPointDetail}?venderId=${venderId}&shopId=${shopId}`,
109
108
  logEventInfo,
110
109
  )
111
110
  }
112
111
 
113
112
  jdJumpToShopMemberBenefit(logEventInfo) {
114
113
  const venderId = global.info.queryInfo.venderId
115
114
  const shopId = global.info.queryInfo.shopId
116
115
  this.jdJumpToWeb(
117
116
  `${this.jumpWebUrl.shopMemberBenefit}?venderId=${venderId}&shopId=${shopId}`,
118
117
  logEventInfo,
119
118
  )
120
119
  }
121
120
 
122
121
  jdJumpToShopMemberRule(logEventInfo) {
123
122
  const venderId = global.info.queryInfo.venderId
124
123
  const shopId = global.info.queryInfo.shopId
125
124
  console.log('会员规则页h5 global.info', global.info)
126
125
  this.jdJumpToWeb(
127
126
  `${this.jumpWebUrl.shopMemberRule}?venderId=${venderId}&shopId=${shopId}&sign=member`,
128
127
  logEventInfo,
129
128
  )
130
129
  }
131
130
 
132
131
  jdJumpToShopMemberCloseAccount(venderType, logEventInfo) {
133
132
  const venderId = global.info.queryInfo.venderId
134
133
  const shopId = global.info.queryInfo.shopId
135
134
  console.log('注销会员页h5 global.info', global.info)
136
135
  this.jdJumpToWeb(
137
136
  `${this.jumpWebUrl.shopMemberCloseAccount}?venderId=${venderId}&shopId=${shopId}&venderType=${venderType}`,
138
137
  logEventInfo,
139
138
  )
140
139
  }
141
140
 
142
141
  jdJumpToShopMemberPointExchange(venderType, levelZeroMenuUrl, logEventInfo) {
143
142
  const venderId = global.info.queryInfo.venderId
144
143
  const shopId = global.info.queryInfo.shopId
145
144
  const channel = JUMP_MEMBER_CHANNEL.H5
146
145
  this.jdJumpToWeb(
147
146
  `${this.jumpWebUrl.shopMemberPointExchange}?venderId=${venderId}&shopId=${shopId}&venderType=${venderType}&channel=${channel}&levelZeroMenuUrl=${levelZeroMenuUrl}`,
148
147
  logEventInfo,
149
148
  )
150
149
  }
151
150
 
152
151
  jdJumpToShopMemberBonusPurchase(customerLevel, logEventInfo) {
153
152
  const venderId = global.info.queryInfo.venderId
154
153
  const shopId = global.info.queryInfo.shopId
155
154
  this.jdJumpToWeb(
156
155
  `${this.jumpWebUrl.shopMemberBonusPurchase}?venderId=${venderId}&shopId=${shopId}`,
157
156
  logEventInfo,
158
157
  )
159
158
  }
160
159
 
161
160
  jdJumpToShopMemberGood(customerLevel, logEventInfo) {
162
161
  const venderId = global.info.queryInfo.venderId
163
162
  const shopId = global.info.queryInfo.shopId
164
163
  this.jdJumpToWeb(
165
164
  `${this.jumpWebUrl.shopMemberGood}?venderId=${venderId}&shopId=${shopId}&customerLevel=${customerLevel}`,
166
165
  logEventInfo,
167
166
  )
168
167
  }
169
168
 
170
169
  jdJumpToBeanDetail(logEventInfo) {
171
170
  console.log('this.jumpWebUrl.beanDetail', this.jumpWebUrl.beanDetail)
172
171
  this.jdJumpToWeb(
173
172
  `${this.jumpWebUrl.beanDetail}?source=dianpuhuiyuan`,
174
173
  logEventInfo,
175
174
  )
176
175
  }
177
176
 
178
177
  jdJumpToMyRedEnvelope(logEventInfo) {
179
178
  console.log('跳转红包页', logEventInfo)
180
179
  }
181
180
 
182
181
  jdJumpToMyCoupon(logEventInfo) {
183
182
  console.log('跳转优惠券页', logEventInfo)
184
183
  }
185
184
 
186
185
  jdJumpToNewH5MemberCard(logEventInfo?) {
187
186
  const venderId = global.info.queryInfo.venderId
188
187
  const shopId = global.info.queryInfo.shopId
189
188
  this.jdJumpToWeb(
190
189
  `${this.jumpWebUrl.shopH5MemberCardM}?venderId=${venderId}&shopId=${shopId}`,
191
190
  logEventInfo,
192
191
  )
193
192
  }
194
193
 
195
194
 
196
195
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
197
196
  this.jdJumpToWeb(
198
197
  `${this.jumpWebUrl.pages}?shopId=${shopId}&venderId=${venderId}&tabActive=home-product`,
199
198
  logEventInfo,
200
199
  )
201
200
  }
202
201
 
203
202
  jdJumpToTabAllProductInner(shopId, venderId, logEventInfo = {}) {
204
203
  this.jdJumpToTabAllProduct(shopId, venderId, logEventInfo)
205
204
  }
206
205
 
207
206
  jdJumpToAppHome(logEventInfo) {
208
207
  this.jdJumpToWeb(
209
208
  `${this.jumpWebUrl.mobileHome}?originReferer=shopx`,
210
209
  logEventInfo,
211
210
  )
212
211
  }
213
212
 
214
213
  jdJumpToShopSearch(queryParams) {
215
214
  const { shopId, categoryId, keyword, pageId, description, shopName } =
216
215
  queryParams
217
216
  const cateId = categoryId ? `&cateId=${categoryId}` : ''
218
217
  const addKeyWord = keyword ? `&keyword=${keyword}` : ''
219
218
  const addPageId = pageId ? `&pageId=${pageId}` : ''
220
219
  const searchDes = description ? `&description=${description}` : ''
221
220
  const shopNameDes = shopName ? `&shopName=${shopName}` : ''
222
221
  const searchType = categoryId ? 5 : keyword ? 4 : 3
223
222
  this.jdJumpToWeb(
224
223
  `${this.jumpWebUrl.shopSearch}?shopId=${shopId}&searchType=${searchType}${cateId}${addKeyWord}${addPageId}${searchDes}${shopNameDes}`,
225
224
  queryParams,
226
225
  )
227
226
  }
228
227
 
229
228
  jdJumpToOrderList() {
230
229
  console.warn(
231
230
  '触发基类的jdJumpToOrderList,这不是一个期望的结果,应该调用各端子类来实现',
232
231
  )
233
232
  }
234
233
 
235
234
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
236
235
  this.jdJumpToWeb(
237
236
  `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`,
238
237
  logEventInfo,
239
238
  )
240
239
  }
241
240
 
242
241
  jdJumpToWeb(
243
242
  spUrl,
244
243
  logEventInfo,
245
244
  successBack?: Function | undefined,
246
245
  failBack?: Function | undefined,
247
246
  ) {
248
247
  this.jdNavigateToNative(
249
248
  `${this.jumpMiniPath.h5}?encode_url=` + encodeURIComponent(spUrl),
250
249
  {
251
250
  ...logEventInfo,
252
251
  },
253
252
  successBack,
254
253
  failBack,
255
254
  )
256
255
  }
257
256
 
258
257
  jdJumpToWebInner(url, logEventInfo) {
259
258
  this.jdJumpToWeb(url, logEventInfo)
260
259
  }
261
260
 
262
261
  weappRedirectToWeb(
263
262
  url: string,
264
263
  logEventInfo: JumpEventReportInterFace.OptEventLogParams = {},
265
264
  ) {
266
265
  console.log('weappRedirectToWeb base:', url)
267
266
  }
268
267
 
269
268
  jdJumpToLive(liveInfo, logEventInfo = {}) {
270
269
  if (liveInfo?.liveId) {
271
270
  this.jdJumpToWeb(
272
271
  `${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?origin=30`,
273
272
  logEventInfo,
274
273
  )
275
274
  }
276
275
  }
277
276
 
278
277
  jdJumpToUgcContent(urlObj, logEventInfo = {}) {
279
278
  if (typeof urlObj === 'object') {
280
279
  this.jdJumpToWeb(
281
280
  `${this.jumpWebUrl.shopUseShareOrderUgcContent}?${objectToUrlEncode(
282
281
  urlObj,
283
282
  )}`,
284
283
  { logEventInfo },
285
284
  )
286
285
  } else {
287
286
  const getShopUgcParams = this.jdOpenAppParams(urlObj)
288
287
  console.log('getShopUgcParams=====', getShopUgcParams)
289
288
  if (getShopUgcParams) {
290
289
  getShopUgcParams['category'] && delete getShopUgcParams['category']
291
290
  getShopUgcParams['des'] && delete getShopUgcParams['des']
292
291
  this.jdJumpToWeb(
293
292
  `${this.jumpWebUrl.shopUseShareOrderUgcContent}?${objectToUrlEncode(
294
293
  getShopUgcParams as Object,
295
294
  )}`,
296
295
  { logEventInfo },
297
296
  )
298
297
  }
299
298
  }
300
299
  }
301
300
 
302
301
  jdJumpToShopActivity(shopInfo) {
303
302
  const getParams = Object.assign(
304
303
  {},
305
304
  {
306
305
  category: 'jump',
307
306
  des: 'jshopActivity',
308
307
  shopId: global.info.queryInfo.shopId,
309
308
  venderId: global.info.queryInfo.venderId,
310
309
  },
311
310
  shopInfo,
312
311
  )
313
312
  getParams['projectId'] &&
314
313
  (getParams['projectId'] = `${getParams['projectId']}`)
315
314
  }
316
315
 
317
316
  jdJumpToShopMember(shopInfo) {
318
317
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
319
318
  this.jdJumpToWeb(
320
319
  `${this.jumpWebUrl.wqShopMember}?${objectToUrlEncode(getShopInfo)}`,
321
320
  shopInfo,
322
321
  )
323
322
  }
324
323
 
325
324
  jdJumpToMemberTab(shopInfo?) {
326
325
  console.log('店内跳转会员tab', shopInfo)
327
326
  }
328
327
 
329
328
  jdJumpToShopMemberCard(shopInfo) {
330
329
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
331
330
  this.jdJumpToWeb(
332
331
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(getShopInfo)}`,
333
332
  shopInfo,
334
333
  )
335
334
  }
336
335
 
337
336
  jdJumpToTotalPromotion(shopInfo) {
338
337
  const { url, logEventInfo } = shopInfo
339
338
  if (this.isOpenJdAppUrl(url)) {
340
339
  const getOpenAppParams: any = this.jdOpenAppParams(url)
341
340
  if (getOpenAppParams) {
342
341
  if (getOpenAppParams?.activityId) {
343
342
  this.jdJumpToWeb(
344
343
  `${this.jumpWebUrl.totalPromotion}?activity_id=${getOpenAppParams?.activityId}`,
345
344
  shopInfo,
346
345
  )
347
346
  }
348
347
  }
349
348
  } else {
350
349
  this.jdJumpToWeb(url, logEventInfo)
351
350
  }
352
351
  }
353
352
 
354
353
  jdJumpToDongDongChat(paramInfo) {
355
354
  const { venderId = '1', entry = 'm_shop', ...otherInfo } = paramInfo
356
355
  const dongdongUrl = `${this.jumpWebUrl.dongDongChat}?venderId=${venderId}&entry=${entry}&sceneval=2`
357
356
  this.jdJumpToWeb(dongdongUrl, otherInfo)
358
357
  }
359
358
 
360
359
  jdJumpToShopDetail(shopInfo) {
361
360
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo)
362
361
  this.jdJumpToWeb(
363
362
  `${this.jumpWebUrl.shopIntroduce}?${objectToUrlEncode(getShopInfo)}`,
364
363
  shopInfo,
365
364
  )
366
365
  }
367
366
 
368
367
  jdJumpToMiniProgram({
369
368
  appId,
370
369
  path,
371
370
  param = {},
372
371
  }: JumpEventReportInterFace.LinkMiniParams) {
373
372
  const pageName = param['pageType'] || 'home'
374
373
  path = `pages/${pageName}/index`
375
374
  if (appId === global.info.pageInfo?.appId) {
376
375
  Taro.navigateTo({
377
376
  url: `/${path}?${objectToUrlEncode(param)}`,
378
377
  }).catch((err) => {
379
378
  console.warn('跳转小程序页面错误:', err)
380
379
  })
381
380
  } else {
382
381
  console.log('一个小程序跳转到另一个小程序暂无此业务')
383
382
  }
384
383
  }
385
384
 
386
385
  jdJumpToAppMiniProgram(
387
386
  path: string,
388
387
  param = {},
389
388
  successBack?: Function,
390
389
  failBack?: Function,
391
390
  ) {
392
391
  this.jdNavigateToNative(path, param, successBack, failBack)
393
392
  }
394
393
 
395
394
  jdJumpConfigUrl(detail, logEventInfo = {}) {
396
395
  const { configDataType, configDataValue } = detail
397
396
  switch (configDataType) {
398
397
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
399
398
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo)
400
399
  break
401
400
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
402
401
  this.jdJumpToWeb(
403
402
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
404
403
  logEventInfo,
405
404
  )
406
405
  break
407
406
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
408
407
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
409
408
  const getShopSearchParams = this.jdOpenAppParams(
410
409
  configDataValue.clickUrl,
411
410
  )
412
411
  getShopSearchParams &&
413
412
  this.jdJumpToShopSearch(
414
413
  Object.assign({}, getShopSearchParams, {
415
414
  logEventInfo,
416
415
  }),
417
416
  )
418
417
  } else {
419
418
  this.jdJumpToShopSearch(
420
419
  configDataValue['cid']
421
420
  ? Object.assign(
422
421
  {},
423
422
  {
424
423
  shopId: global.info.queryInfo.shopId,
425
424
  categoryId: configDataValue.cid,
426
425
  logEventInfo,
427
426
  },
428
427
  )
429
428
  : {
430
429
  shopId: global.info.queryInfo.shopId,
431
430
  logEventInfo,
432
431
  },
433
432
  )
434
433
  }
435
434
  break
436
435
  case LinkConfigType.CONFIG_TYPE_MEMBER:
437
436
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
438
437
  const getShopMemberParams = this.jdOpenAppParams(
439
438
  configDataValue.clickUrl,
440
439
  )
441
440
  getShopMemberParams &&
442
441
  this.jdJumpToShopMember(
443
442
  Object.assign({}, getShopMemberParams, {
444
443
  logEventInfo,
445
444
  }),
446
445
  )
447
446
  } else {
448
447
  this.jdJumpToShopMember({
449
448
  shopId: global.info.queryInfo.shopId,
450
449
  venderId: configDataValue.shopDetail,
451
450
  logEventInfo,
452
451
  })
453
452
  }
454
453
  break
455
454
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
456
455
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
457
456
  const getShopActivityParams = this.jdOpenAppParams(
458
457
  configDataValue.clickUrl,
459
458
  )
460
459
  getShopActivityParams &&
461
460
  this.jdJumpToShopActivity(
462
461
  Object.assign({}, getShopActivityParams, {
463
462
  logEventInfo,
464
463
  }),
465
464
  )
466
465
  } else if (configDataValue['projectId']) {
467
466
  this.jdJumpToShopActivity({
468
467
  projectId: configDataValue['projectId'],
469
468
  configDataValue,
470
469
  logEventInfo,
471
470
  })
472
471
  }
473
472
  break
474
473
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
475
474
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
476
475
  const _url = configDataValue.linkUrl
477
476
  if (
478
477
  _url.indexOf('to=') === -1 &&
479
478
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
480
479
  ) {
481
480
  const _shopId = _url.match(/\d+/g)[0]
482
481
  this.jdJumpToShopHome({
483
482
  shopId: `${_shopId}`,
484
483
  logEventInfo,
485
484
  })
486
485
  } else if (this.isOpenJdAppUrl(_url)) {
487
486
  const getOpenAppParams = this.jdOpenAppParams(_url)
488
487
  console.log('获取解析后的参数结果', getOpenAppParams)
489
488
  if (getOpenAppParams) {
490
489
  isJdApp
491
490
  ? this.jdNavigateToNative(
492
491
  Object.assign({}, getOpenAppParams, {
493
492
  logEventInfo,
494
493
  }),
495
494
  )
496
495
  : this.jdNavigateToNative(
497
496
  '',
498
497
  Object.assign({}, getOpenAppParams, {
499
498
  logEventInfo,
500
499
  }),
501
500
  )
502
501
  } else {
503
502
  this.jdNavigateToNative(
504
503
  '',
505
504
  Object.assign({}, getOpenAppParams, {
506
505
  logEventInfo,
507
506
  }),
508
507
  )
509
508
  }
510
509
  } else {
511
510
  this.jdJumpToWeb(_url, logEventInfo)
512
511
  }
513
512
  break
514
513
  }
515
514
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
516
515
  this.jdJumpToShopDetail({
517
516
  venderId: global.info.queryInfo.venderId,
518
517
  shopId: global.info.queryInfo.shopId,
519
518
  logEventInfo,
520
519
  })
521
520
  break
522
521
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
523
522
  this.jdJumpToShopHome({
524
523
  ...configDataValue,
525
524
  logEventInfo,
526
525
  })
527
526
  break
528
527
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
529
528
  break
530
529
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
531
530
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
532
531
  const getShoppingGuideParams = this.jdOpenAppParams(
533
532
  configDataValue.clickUrl,
534
533
  )
535
534
  getShoppingGuideParams &&
536
535
  this.jdJumpToShopActivity(
537
536
  Object.assign({}, getShoppingGuideParams, {
538
537
  logEventInfo,
539
538
  }),
540
539
  )
541
540
  }
542
541
  break
543
542
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
544
543
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '')
545
544
  const search = linkUrl.match(/\?.+/)
546
545
  if (search) {
547
546
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
548
547
  parseQueryUrlString(linkUrl)
549
548
  try {
550
549
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param)
551
550
  } catch (e) {
552
551
  console.warn('解析小程序 param 错误:', miniQueryData.param)
553
552
  }
554
553
  this.jdJumpToMiniProgram(miniQueryData)
555
554
  } else {
556
555
  console.warn('小程序地址错误:', linkUrl)
557
556
  }
558
557
  break
559
558
  }
560
559
  default:
561
560
  }
562
561
  }
563
562
 
564
563
  jdOpenAppParams(openAppUrl): Object | boolean {
565
564
  let getParams: boolean | Object = false
566
565
  if (this.isOpenJdAppUrl(openAppUrl)) {
567
566
  try {
568
567
  getParams = openAppUrl.replace(
569
568
  /openApp\.jdMobile:\/\/virtual\?params=/i,
570
569
  '',
571
570
  )
572
571
  getParams = JSON.parse(String(getParams))
573
572
  } catch (e) {
574
573
  console.log(e)
575
574
  }
576
575
  }
577
576
  return getParams
578
577
  }
579
578
  isOpenJdAppUrl(openAppUrl) {
580
579
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl)
581
580
  }
582
581
 
583
582
  creatParamToLogStr(eventParam) {
584
583
  return eventParam
585
584
  ? Object.keys(eventParam)
586
585
  .map((key) => {
587
586
  return `${key}_${eventParam[key]}`
588
587
  })
589
588
  .join('_')
590
589
  : ''
591
590
  }
592
591
 
593
592
  jdNavigateToNative(
594
593
  url: string,
595
594
  params: {
596
595
  logEventInfo?: object
597
596
  } = {},
598
597
  successBack?: Function | undefined,
599
598
  failBack?: Function | undefined,
600
599
  ) {
601
600
  const { logEventInfo } = params
602
601
  const getEparam = logEventInfo || params
603
602
  console.log('jdNavigateToNative params: ', params)
604
603
  console.log('logEventInfo params: ', logEventInfo)
605
604
  try {
606
605
  this.clickEventLog(getEparam)
607
606
  } catch (e) {
608
607
  console.log(e)
609
608
  }
610
609
  setTimeout(() => {
611
610
  Taro.navigateTo({
612
611
  url,
613
612
  })
614
613
  .then((res) => {
615
614
  typeof successBack === 'function' && successBack(res)
616
615
  console.log('navigateToWxapp.success', res)
617
616
  })
618
617
  .catch((err) => {
619
618
  typeof failBack === 'function' && failBack(err)
620
619
  console.log('navigateToWxapp.fail', err)
621
620
  })
622
621
  }, 200)
623
622
  }
624
623
 
625
624
  clickEventLog(
626
625
  opts: JumpEventReportInterFace.OptEventLogParams = {},
627
626
  clickKey = 'click',
628
627
  ) {
629
628
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
630
629
  if (eventId && jsonParam) {
631
630
  const { etModelInfo, logBaseInfo } = jsonParam
632
631
  const miniClickKey = clickKey === 'addToCart' ? 'addToCart' : 'click'
633
632
  const miniLogParams = {
634
633
  eid: eventId,
635
634
  elevel: eventLevel,
636
635
  ext: JSON.stringify(logBaseInfo || jsonParam),
637
636
  etModel: JSON.stringify(etModelInfo || {}),
638
637
  pname: this.logPname,
639
638
  pparam: JSON.stringify(this.routerInfo.params),
640
639
  target: this.routerInfo.path,
641
640
  event: this.nativeEvent,
642
641
  pageId: this.logPageId,
643
642
  ...otherParams,
644
643
  }
645
644
  console.log('点击埋点参数对象', miniLogParams, miniClickKey)
646
645
  global.miniAppLogInstance &&
647
646
  global.miniAppLogInstance[miniClickKey](miniLogParams)
648
647
  }
649
648
  }
650
649
 
651
650
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
652
651
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts
653
652
  if (eventId && jsonParam) {
654
653
  const { etModelInfo, logBaseInfo } = jsonParam
655
654
  const miniLogParams = {
656
655
  eid: eventId,
657
656
  elevel: eventLevel,
658
657
  ext: JSON.stringify(logBaseInfo || jsonParam),
659
658
  etModel: JSON.stringify(etModelInfo || {}),
660
659
  pname: this.logPname,
661
660
  pparam: JSON.stringify(this.routerInfo.params),
662
661
  target: this.routerInfo.path,
663
662
  pageId: this.logPageId,
664
663
  ...otherParams,
665
664
  }
666
665
  global.miniAppLogInstance &&
667
666
  global.miniAppLogInstance['exposure'](miniLogParams)
668
667
  }
669
668
  }
670
669
 
671
670
  initOpenTriggerExposure(type) {
672
671
  if (!this.sectionExposureInfo[type]) {
673
672
  Taro.nextTick(() => {
674
673
  setTimeout(() => {
675
674
  global.info.pageInfo.isExposureState = true
676
675
  taroEventInitExposure()
677
676
  this.sectionExposureInfo[`${type}`] = true
678
677
  }, 200)
679
678
  })
680
679
  }
681
680
  }
681
+ import Taro from '@tarojs/taro';
682
682
  JUMP_MEMBER_CHANNEL,
683
683
  SECTION_HOME_TAB_NAME_TYPE,
684
684
  SECTION_HOME_TAB_TYPE,
685
685
  SHOP_MENU_ID_NAME,
686
686
  SHOP_MENU_ID_TYPE,
687
687
  routerInfo: {
688
688
  params: {},
689
689
  },
690
690
  nativeEvent: null,
691
691
  logPageParamStr: '',
692
692
  public jingGouMiniState: boolean;
693
693
  public logPageId: string;
694
694
  public logPageParamStr: string;
695
695
  public nativeEvent: any;
696
696
  public routerInfo: JumpEventReportInterFace.RouterInfo;
697
697
  public logPname: LogPnameInfo;
698
698
  public jumpMiniPath: JumpEventReportInterFace.JumpMiniPath;
699
699
  public jumpWebUrl: JumpEventReportInterFace.jumpWebUrl;
700
700
  public sectionExposureInfo: object;
701
701
  public logPageIdInfo: any;
702
702
  public logPnameInfo: any;
703
703
  constructor(opt = {}) {
704
704
  this.logPageId = LogPageIdInfo.APP;
705
705
  this.logPageIdInfo = LogPageIdInfo;
706
706
  this.logPnameInfo = LogPnameInfo;
707
707
  this.jingGouMiniState = false;
708
708
  this.jumpMiniPath = JumpMiniPath;
709
709
  this.jumpWebUrl = JumpWebUrl;
710
710
  this.sectionExposureInfo = {};
711
711
  this.getConfig(opt);
712
712
  }
713
713
  getConfig(opt) {
714
714
  return Object.assign(this, {}, defaultConfig, opt);
715
715
  }
716
716
 
717
717
  updateInfo(routerInfo, logPname = LogPnameInfo.HOME, pageId = LogPageIdInfo.APP) {
718
718
  this.routerInfo = routerInfo;
719
719
  this.logPname = logPname;
720
720
  this.logPageId = pageId;
721
721
  }
722
722
  reportInfoPv(_pageId, _opt = {}) {}
723
723
 
724
724
  getShopIdOrVenderIdParams(
725
725
  params: JumpEventReportInterFace.ShopIdsInfo = {},
726
726
  ): JumpEventReportInterFace.ShopIdsInfo {
727
727
  const setParams = {};
728
728
  params.shopId && (setParams['shopId'] = `${params.shopId}`);
729
729
  params.venderId && (setParams['venderId'] = `${params.venderId}`);
730
730
  return setParams;
731
731
  }
732
732
 
733
733
  getShopIdsInfo(params = {}): JumpEventReportInterFace.ShopIdsInfo {
734
734
  let setParams = this.getShopIdOrVenderIdParams(params);
735
735
  setParams = {
736
736
  ...params,
737
737
  ...setParams,
738
738
  };
739
739
  return setParams;
740
740
  }
741
741
 
742
742
  jdJumpToShopHome(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
743
743
  console.log('[降级H5] jdJumpToShopHome base');
744
744
  const currentShopInfo = {
745
745
  shopId: global.info.queryInfo.shopId,
746
746
  venderId: global.info.queryInfo.venderId,
747
747
  };
748
748
  const restParams =
749
749
  (shopInfo?.shopId && shopInfo.shopId !== currentShopInfo.shopId) ||
750
750
  (shopInfo?.venderId && shopInfo.venderId !== currentShopInfo.venderId)
751
751
  ? {}
752
752
  : currentShopInfo;
753
753
  const getInfo = Object.assign({}, restParams, shopInfo);
754
754
  this.jdJumpToShopBase(getInfo);
755
755
  }
756
756
 
757
757
  jdJumpToShopHomeInner(shopInfo: JumpEventReportInterFace.ShopIdsInfo = {}) {
758
758
  this.jdJumpToShopHome(shopInfo);
759
759
  }
760
760
 
761
761
  jdJumpToShopBase(shopInfo) {
762
762
  console.log('[降级H5] jdJumpToShopBase');
763
763
  this.jdNavigateToNative(
764
764
  `${this.jumpMiniPath.shop}?${objectToUrlEncode(this.getShopIdOrVenderIdParams(shopInfo))}`,
765
765
  {
766
766
  ...shopInfo,
767
767
  },
768
768
  );
769
769
  }
770
770
 
771
771
  jdJumpToShopLight(shopInfo) {
772
772
  this.jdNavigateToNative(
773
773
  `${this.jumpMiniPath.shopLight}?${objectToUrlEncode(
774
774
  this.getShopIdOrVenderIdParams(shopInfo),
775
775
  )}`,
776
776
  {
777
777
  ...shopInfo,
778
778
  },
779
779
  );
780
780
  }
781
781
 
782
782
  jdJumpToProduct(skuIds, logEventInfo) {
783
783
  skuIds = skuIds.toString().trim();
784
784
  const getSkuId = skuIds.indexOf(',') !== -1 ? skuIds.split(',')[0] : skuIds;
785
785
  this.jdNavigateToNative(`${this.jumpMiniPath.detail}?sku=${getSkuId}`, logEventInfo);
786
786
  }
787
787
 
788
788
  jdJumpSkuInfoToProduct(skuInfo: any = {}, logEventInfo) {
789
789
  const getSkuId = skuInfo?.skuId;
790
790
  getSkuId &&
791
791
  this.jdNavigateToNative(`${this.jumpMiniPath.detail}?sku=${getSkuId}`, logEventInfo);
792
792
  }
793
793
 
794
794
  jdJumpToFlashSaleTab(_logEventInfo) {
795
795
  console.log('跳转闪购', _logEventInfo);
796
796
  }
797
797
 
798
798
 
799
799
  jdJumpToShopMemberInfo(logEventInfo) {
800
800
  console.log('跳转修改会员信息页', logEventInfo);
801
801
  }
802
802
 
803
803
  jdJumpToShopMemberPointDetail(logEventInfo) {
804
804
  const venderId = global.info.queryInfo.venderId;
805
805
  const shopId = global.info.queryInfo.shopId;
806
806
  this.jdJumpToWeb(
807
807
  `${this.jumpWebUrl.memberScores}?venderId=${venderId}&shopId=${shopId}`,
808
808
  logEventInfo,
809
809
  );
810
810
  }
811
811
 
812
812
  jdJumpToShopMemberBenefit(logEventInfo) {
813
813
  const venderId = global.info.queryInfo.venderId;
814
814
  const shopId = global.info.queryInfo.shopId;
815
815
  this.jdJumpToWeb(
816
816
  `${this.jumpWebUrl.memberBenefit}?venderId=${venderId}&shopId=${shopId}`,
817
817
  logEventInfo,
818
818
  );
819
819
  }
820
820
 
821
821
  jdJumpToShopMemberRule(logEventInfo) {
822
822
  const venderId = global.info.queryInfo.venderId;
823
823
  const shopId = global.info.queryInfo.shopId;
824
824
  console.log('会员规则页h5 global.info', global.info);
825
825
  this.jdJumpToWeb(
826
826
  `${this.jumpWebUrl.shopMemberRule}?venderId=${venderId}&shopId=${shopId}&sign=member`,
827
827
  logEventInfo,
828
828
  );
829
829
  }
830
830
 
831
831
  jdJumpToShopMemberCloseAccount(venderType, logEventInfo) {
832
832
  const venderId = global.info.queryInfo.venderId;
833
833
  const shopId = global.info.queryInfo.shopId;
834
834
  console.log('注销会员页h5 global.info', global.info);
835
835
  this.jdJumpToWeb(
836
836
  `${this.jumpWebUrl.shopMemberCloseAccount}?venderId=${venderId}&shopId=${shopId}&venderType=${venderType}`,
837
837
  logEventInfo,
838
838
  );
839
839
  }
840
840
 
841
841
  jdJumpToShopMemberPointExchange(venderType, levelZeroMenuUrl, logEventInfo) {
842
842
  const venderId = global.info.queryInfo.venderId;
843
843
  const shopId = global.info.queryInfo.shopId;
844
844
  const channel = JUMP_MEMBER_CHANNEL.H5;
845
845
  this.jdJumpToWeb(
846
846
  `${this.jumpWebUrl.shopMemberPointExchange}?venderId=${venderId}&shopId=${shopId}&venderType=${venderType}&channel=${channel}&levelZeroMenuUrl=${levelZeroMenuUrl}`,
847
847
  logEventInfo,
848
848
  );
849
849
  }
850
850
 
851
851
  jdJumpToShopMemberBonusPurchase(customerLevel, logEventInfo) {
852
852
  const venderId = global.info.queryInfo.venderId;
853
853
  const shopId = global.info.queryInfo.shopId;
854
854
  this.jdJumpToWeb(
855
855
  `${this.jumpWebUrl.shopMemberBonusPurchase}?venderId=${venderId}&shopId=${shopId}&customerLevel=${customerLevel}`,
856
856
  logEventInfo,
857
857
  );
858
858
  }
859
859
 
860
860
  jdJumpToShopMemberGood(customerLevel, logEventInfo) {
861
861
  const venderId = global.info.queryInfo.venderId;
862
862
  const shopId = global.info.queryInfo.shopId;
863
863
  this.jdJumpToWeb(
864
864
  `${this.jumpWebUrl.shopMemberGood}?venderId=${venderId}&shopId=${shopId}&customerLevel=${customerLevel}`,
865
865
  logEventInfo,
866
866
  );
867
867
  }
868
868
 
869
869
  jdJumpToBeanDetail(logEventInfo) {
870
870
  console.log('this.jumpWebUrl.beanDetail', this.jumpWebUrl.beanDetail);
871
871
  this.jdJumpToWeb(`${this.jumpWebUrl.beanDetail}?source=dianpuhuiyuan`, logEventInfo);
872
872
  }
873
873
 
874
874
  jdJumpToMyRedEnvelope(logEventInfo) {
875
875
  this.jdJumpToWeb(this.jumpWebUrl.myRedPacketList, logEventInfo);
876
876
  }
877
877
 
878
878
  jdJumpToMyCoupon(logEventInfo) {
879
879
  this.jdJumpToWeb(this.jumpWebUrl.myCouponList, logEventInfo);
880
880
  }
881
881
 
882
882
  jdJumpToNewH5MemberCard(logEventInfo?) {
883
883
  const venderId = global.info.queryInfo.venderId;
884
884
  const shopId = global.info.queryInfo.shopId;
885
885
  this.jdJumpToWeb(
886
886
  `${this.jumpWebUrl.shopH5MemberCardM}?venderId=${venderId}&shopId=${shopId}`,
887
887
  logEventInfo,
888
888
  );
889
889
  }
890
890
 
891
891
 
892
892
  jdJumpToTabAllProduct(shopId, venderId, logEventInfo = {}) {
893
893
  console.log('base.ts - jdJumpToTabAllProduct');
894
894
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
895
895
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
896
896
  this.jdJumpToWeb(
897
897
  `${this.jumpWebUrl.pages}?shopId=${shopId}&venderId=${venderId}&tabActive=home-product`,
898
898
  logEventInfo,
899
899
  );
900
900
  }
901
901
 
902
902
  jdJumpToTabAllProductInner(shopId, venderId, logEventInfo = {}) {
903
903
  if (typeof shopId === 'undefined') shopId = global.info.queryInfo.shopId;
904
904
  if (typeof venderId === 'undefined') venderId = global.info.queryInfo.venderId;
905
905
  this.jdJumpToTabAllProduct(shopId, venderId, logEventInfo);
906
906
  }
907
907
 
908
908
  jdJumpToTopTabBase(type, shopInfo = {}) {
909
909
  const getInfo = Object.assign(
910
910
  {},
911
911
  {
912
912
  shopId: global.info.queryInfo.shopId,
913
913
  venderId: global.info.queryInfo.venderId,
914
914
  },
915
915
  shopInfo,
916
916
  );
917
917
  this.jdJumpToWeb(
918
918
  `${this.jumpWebUrl.shopHome}?${objectToUrlEncode(
919
919
  this.getShopIdOrVenderIdParams(getInfo),
920
920
  )}&tabActive=${type}`,
921
921
  getInfo,
922
922
  );
923
923
  }
924
924
 
925
925
  jdJumpToTabNew(shopInfo = {}) {
926
926
  console.log('上新tab');
927
927
  this.jdJumpToTopTabBase(
928
928
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_NEW_PRODUCT],
929
929
  shopInfo,
930
930
  );
931
931
  }
932
932
 
933
933
  jdJumpToTabNewInner(shopInfo = {}) {
934
934
  this.jdJumpToTabNew(shopInfo);
935
935
  }
936
936
 
937
937
  jdJumpToTabRank(shopInfo = {}) {
938
938
  console.log('榜单tab');
939
939
  this.jdJumpToTopTabBase(SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_RANK], shopInfo);
940
940
  }
941
941
  jdJumpToTabRankInner(shopInfo = {}) {
942
942
  this.jdJumpToTabRank(shopInfo);
943
943
  }
944
944
  jdJumpToTabBuyerShow(shopInfo = {}) {
945
945
  console.log('买家秀tab');
946
946
  this.jdJumpToTopTabBase(
947
947
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_BUYER_SHOW],
948
948
  shopInfo,
949
949
  );
950
950
  }
951
951
  jdJumpToTabBuyerShowInner(shopInfo = {}) {
952
952
  this.jdJumpToTabBuyerShow(shopInfo);
953
953
  }
954
954
  jdJumpToTabActivity(shopInfo = {}) {
955
955
  console.log('活动tab');
956
956
  this.jdJumpToTopTabBase(
957
957
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY],
958
958
  shopInfo,
959
959
  );
960
960
  }
961
961
  jdJumpToTabActivityInner(shopInfo = {}) {
962
962
  this.jdJumpToTabActivity(shopInfo);
963
963
  }
964
964
  jdJumpToTabSecKill(shopInfo = {}) {
965
965
  console.log('秒杀tab');
966
966
  this.jdJumpToTopTabBase(
967
967
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_SECKILL],
968
968
  shopInfo,
969
969
  );
970
970
  }
971
971
  jdJumpToTabSecKillInner(shopInfo = {}) {
972
972
  this.jdJumpToTabSecKill(shopInfo);
973
973
  }
974
974
 
975
975
  jdJumpToBottomTabBase(type, shopInfo = {}) {
976
976
  this.jdJumpToTopTabBase(type, shopInfo);
977
977
  }
978
978
  jdJumpToBottomTabProduct(shopInfo = {}) {
979
979
  this.jdJumpToBottomTabBase(SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.PRODUCT], shopInfo);
980
980
  }
981
981
  jdJumpToBottomTabCategory(shopInfo = {}) {
982
982
  this.jdJumpToBottomTabBase(SHOP_MENU_ID_NAME[SHOP_MENU_ID_TYPE.CLASSIFY], shopInfo);
983
983
  }
984
984
  jdJumpToBottomTabFind(shopInfo = {}) {
985
985
  console.log('发现tab');
986
986
  }
987
987
  jdJumpToBottomTabBrandMember(shopInfo = {}) {
988
988
  const getInfo = Object.assign(
989
989
  {},
990
990
  {
991
991
  shopId: global.info.queryInfo.shopId,
992
992
  venderId: global.info.queryInfo.venderId,
993
993
  },
994
994
  shopInfo,
995
995
  );
996
996
  this.jdJumpToWeb(
997
997
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(this.getShopIdOrVenderIdParams(getInfo))}`,
998
998
  getInfo,
999
999
  );
1000
1000
  }
1001
1001
  jdJumpToBottomTabBrandMemberInner(shopInfo = {}) {
1002
1002
  this.jdJumpToBottomTabBrandMember(shopInfo);
1003
1003
  }
1004
1004
 
1005
1005
  jdJumpToAppHome(logEventInfo) {
1006
1006
  this.jdJumpToWeb(`${this.jumpWebUrl.mobileHome}?originReferer=shopx`, logEventInfo);
1007
1007
  }
1008
1008
 
1009
1009
  jdJumpToShopSearch(queryParams) {
1010
1010
  const getInfo = Object.assign(
1011
1011
  {},
1012
1012
  {
1013
1013
  shopId: global.info.queryInfo.shopId,
1014
1014
  venderId: global.info.queryInfo.venderId,
1015
1015
  },
1016
1016
  queryParams,
1017
1017
  );
1018
1018
  const {
1019
1019
  shopId,
1020
1020
  categoryId,
1021
1021
  keyword,
1022
1022
  pageId,
1023
1023
  description,
1024
1024
  shopName,
1025
1025
  keyWord,
1026
1026
  seller_actId,
1027
1027
  seller_actType,
1028
1028
  } = getInfo;
1029
1029
  const cateId = categoryId
1030
1030
  ? `&cateId=${typeof categoryId === 'string' ? categoryId?.trim() : categoryId}`
1031
1031
  : '';
1032
1032
  const addKeyWord = keyword || keyWord ? `&keyword=${keyword || keyWord}` : '';
1033
1033
  const addPageId = pageId ? `&pageId=${pageId}` : '';
1034
1034
  const searchDes = description ? `&description=${description}` : '';
1035
1035
  const shopNameDes = shopName ? `&shopName=${shopName}` : '';
1036
1036
  const searchType = categoryId ? 5 : keyword || keyWord ? 4 : 3;
1037
1037
  const activityId = seller_actId ? `&activityId=${seller_actId}` : '';
1038
1038
  const activityType = seller_actType ? `&activityType=${seller_actType}` : '';
1039
1039
  this.jdJumpToWeb(
1040
1040
  `${this.jumpWebUrl.shopSearch}?shopId=${shopId}&searchType=${searchType}${cateId}${addKeyWord}${addPageId}${searchDes}${shopNameDes}${activityId}${activityType}`,
1041
1041
  getInfo,
1042
1042
  );
1043
1043
  }
1044
1044
 
1045
1045
  jdJumpToSearch(shopId, suggestWord) {
1046
1046
  console.log('搜索中间页');
1047
1047
  }
1048
1048
 
1049
1049
  jdJumpToOrderList() {
1050
1050
  console.warn('触发基类的jdJumpToOrderList,这不是一个期望的结果,应该调用各端子类来实现');
1051
1051
  }
1052
1052
 
1053
1053
  jdJumpToCouponSearchProductList(couponId, logEventInfo = {}) {
1054
1054
  this.jdJumpToWeb(
1055
1055
  `${this.jumpWebUrl.couponSearch}?couponbatch=${couponId}&sceneval=2`,
1056
1056
  logEventInfo,
1057
1057
  );
1058
1058
  }
1059
1059
 
1060
1060
  jdJumpToWeb(
1061
1061
  spUrl,
1062
1062
  logEventInfo,
1063
1063
  successBack?: functionType | undefined,
1064
1064
  failBack?: functionType | undefined,
1065
1065
  ) {
1066
1066
  this.jdNavigateToNative(
1067
1067
  `${this.jumpMiniPath.h5}?encode_url=` + encodeURIComponent(spUrl),
1068
1068
  {
1069
1069
  ...logEventInfo,
1070
1070
  },
1071
1071
  successBack,
1072
1072
  failBack,
1073
1073
  );
1074
1074
  }
1075
1075
 
1076
1076
  jdJumpToWebInner(url, logEventInfo) {
1077
1077
  this.jdJumpToWeb(url, logEventInfo);
1078
1078
  }
1079
1079
 
1080
1080
  weappRedirectToWeb(url: string, logEventInfo: JumpEventReportInterFace.OptEventLogParams = {}) {
1081
1081
  console.log('weappRedirectToWeb base:', url, logEventInfo);
1082
1082
  }
1083
1083
 
1084
1084
  jdJumpToLive(liveInfo, logEventInfo = {}) {
1085
1085
  if (liveInfo?.liveId) {
1086
1086
  this.jdJumpToWeb(`${this.jumpWebUrl.mLive}/${liveInfo?.liveId}?origin=30`, logEventInfo);
1087
1087
  }
1088
1088
  }
1089
1089
 
1090
1090
  jdJumpToUgcContent(urlObj, logEventInfo = {}) {
1091
1091
  if (typeof urlObj === 'object') {
1092
1092
  this.jdJumpToWeb(
1093
1093
  `${this.jumpWebUrl.shopUseShareOrderUgcContent}?${objectToUrlEncode(urlObj)}`,
1094
1094
  { logEventInfo },
1095
1095
  );
1096
1096
  } else {
1097
1097
  const getShopUgcParams = this.jdOpenAppParams(urlObj);
1098
1098
  console.log('getShopUgcParams=====', getShopUgcParams);
1099
1099
  if (getShopUgcParams) {
1100
1100
  getShopUgcParams['category'] && delete getShopUgcParams['category'];
1101
1101
  getShopUgcParams['des'] && delete getShopUgcParams['des'];
1102
1102
  this.jdJumpToWeb(
1103
1103
  `${this.jumpWebUrl.shopUseShareOrderUgcContent}?${objectToUrlEncode(
1104
1104
  getShopUgcParams as object,
1105
1105
  )}`,
1106
1106
  { logEventInfo },
1107
1107
  );
1108
1108
  }
1109
1109
  }
1110
1110
  }
1111
1111
 
1112
1112
  jdJumpToShopActivity(shopInfo) {
1113
1113
  const getParams = Object.assign(
1114
1114
  {},
1115
1115
  {
1116
1116
  category: 'jump',
1117
1117
  des: 'jshopActivity',
1118
1118
  shopId: global.info.queryInfo.shopId,
1119
1119
  venderId: global.info.queryInfo.venderId,
1120
1120
  },
1121
1121
  shopInfo,
1122
1122
  );
1123
1123
  getParams['projectId'] && (getParams['projectId'] = `${getParams['projectId']}`);
1124
1124
  }
1125
1125
 
1126
1126
  jdJumpToShopMember(shopInfo) {
1127
1127
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo);
1128
1128
  this.jdJumpToWeb(`${this.jumpWebUrl.shopMember}?${objectToUrlEncode(getShopInfo)}`, shopInfo);
1129
1129
  }
1130
1130
 
1131
1131
  jdJumpToMemberTab(shopInfo?) {
1132
1132
  console.log('店内跳转会员tab', shopInfo);
1133
1133
  }
1134
1134
 
1135
1135
  jdJumpToShopMemberCard(shopInfo) {
1136
1136
  const { logEventInfo } = shopInfo;
1137
1137
  const getShopInfo = this.getShopIdOrVenderIdParams(shopInfo);
1138
1138
  this.jdJumpToWeb(
1139
1139
  `${this.jumpWebUrl.shopMember}?${objectToUrlEncode(getShopInfo)}`,
1140
1140
  logEventInfo,
1141
1141
  );
1142
1142
  }
1143
1143
 
1144
1144
  jdJumpToTotalPromotion(shopInfo) {
1145
1145
  const { url, logEventInfo } = shopInfo;
1146
1146
  if (this.isOpenJdAppUrl(url)) {
1147
1147
  const getOpenAppParams: any = this.jdOpenAppParams(url);
1148
1148
  if (getOpenAppParams) {
1149
1149
  if (getOpenAppParams?.activityId) {
1150
1150
  this.jdJumpToWeb(
1151
1151
  `${this.jumpWebUrl.totalPromotion}?activity_id=${getOpenAppParams?.activityId}`,
1152
1152
  shopInfo,
1153
1153
  );
1154
1154
  }
1155
1155
  }
1156
1156
  } else {
1157
1157
  this.jdJumpToWeb(url, logEventInfo);
1158
1158
  }
1159
1159
  }
1160
1160
 
1161
1161
  jdJumpToDongDongChatGroup(groupId, source = 'jdmini') {
1162
1162
  console.warn(
1163
1163
  'JdJumpToDongDongChatGroup method is invoked, but should be implemented in subclasses',
1164
1164
  );
1165
1165
  }
1166
1166
 
1167
1167
  jdJumpToDongDongChat(paramInfo) {
1168
1168
  const getInfo = Object.assign(
1169
1169
  {},
1170
1170
  {
1171
1171
  venderId: global.info.queryInfo.venderId,
1172
1172
  },
1173
1173
  paramInfo,
1174
1174
  );
1175
1175
  const { venderId = '1', entry = 'm_shop', ...otherInfo } = getInfo;
1176
1176
  const dongdongUrl = `${this.jumpWebUrl.dongDongChat}?venderId=${venderId}&entry=${entry}&sceneval=2`;
1177
1177
  this.jdJumpToWeb(dongdongUrl, otherInfo);
1178
1178
  }
1179
1179
 
1180
1180
  jdJumpToShopDetail(shopInfo) {
1181
1181
  const getInfo = Object.assign(
1182
1182
  {},
1183
1183
  {
1184
1184
  shopId: global.info.queryInfo.shopId,
1185
1185
  venderId: global.info.queryInfo.venderId,
1186
1186
  },
1187
1187
  shopInfo,
1188
1188
  );
1189
1189
  const getShopInfo = this.getShopIdOrVenderIdParams(getInfo);
1190
1190
  this.jdJumpToWeb(`${this.jumpWebUrl.shopIntroduce}?${objectToUrlEncode(getShopInfo)}`, getInfo);
1191
1191
  }
1192
1192
 
1193
1193
  jdJumpToShopLottery(shopTotalInfo) {
1194
1194
  const getInfo = Object.assign(
1195
1195
  {},
1196
1196
  {
1197
1197
  shopId: global.info.queryInfo.shopId,
1198
1198
  venderId: global.info.queryInfo.venderId,
1199
1199
  },
1200
1200
  shopTotalInfo,
1201
1201
  );
1202
1202
  const getShopInfo = this.getShopIdOrVenderIdParams(getInfo);
1203
1203
  this.jdJumpToWeb(`${this.jumpWebUrl.shopLottery}?${objectToUrlEncode(getShopInfo)}`, getInfo);
1204
1204
  }
1205
1205
 
1206
1206
  jdJumpToSageAuthorHome(shopTotalInfo) {
1207
1207
  const { logEventInfo, ...otherParams } = shopTotalInfo;
1208
1208
  const getInfo = Object.assign(
1209
1209
  {},
1210
1210
  {
1211
1211
  channel: 'shopHomePage',
1212
1212
  selectTab: '0',
1213
1213
  },
1214
1214
  otherParams,
1215
1215
  );
1216
1216
  this.jdJumpToWeb(`${this.jumpWebUrl.sageAuthorHome}?${objectToUrlEncode(getInfo)}`, {
1217
1217
  ...getInfo,
1218
1218
  ...logEventInfo,
1219
1219
  });
1220
1220
  }
1221
1221
 
1222
1222
  jdJumpToMiniProgram({ appId, path, param = {} }: JumpEventReportInterFace.LinkMiniParams) {
1223
1223
  const pageName = param['pageType'] || 'home';
1224
1224
  path = `pages/${pageName}/index`;
1225
1225
  if (appId === global.info.pageInfo?.appId) {
1226
1226
  Taro.navigateTo({
1227
1227
  url: `/${path}?${objectToUrlEncode(param)}`,
1228
1228
  }).catch((err) => {
1229
1229
  console.warn('跳转小程序页面错误:', err);
1230
1230
  });
1231
1231
  } else {
1232
1232
  console.log('一个小程序跳转到另一个小程序暂无此业务');
1233
1233
  }
1234
1234
  }
1235
1235
 
1236
1236
  jdJumpToAppMiniProgram(
1237
1237
  path: string,
1238
1238
  param = {},
1239
1239
  successBack?: functionType,
1240
1240
  failBack?: functionType,
1241
1241
  ) {
1242
1242
  this.jdNavigateToNative(path, param, successBack, failBack);
1243
1243
  }
1244
1244
 
1245
1245
  jdJumpConfigUrl(detail, logEventInfo = {}) {
1246
1246
  const { configDataType, configDataValue } = detail;
1247
1247
  switch (configDataType) {
1248
1248
  case LinkConfigType.CONFIG_TYPE_SKU_LIST:
1249
1249
  if (logEventInfo?.jsonParam?.logBaseInfo?.mInfo) {
1250
1250
  logEventInfo.jsonParam.logBaseInfo.mInfo.skuid = configDataValue.skuIds;
1251
1251
  }
1252
1252
  this.jdJumpToProduct(configDataValue.skuIds, logEventInfo);
1253
1253
  break;
1254
1254
  case LinkConfigType.CONFIG_TYPE_COUPON_LIST:
1255
1255
  this.jdJumpToWeb(
1256
1256
  `${this.jumpWebUrl.shopCoupon}?couponType=1&shopId=${global.info.queryInfo.shopId}&venderId=${global.info.queryInfo.venderId}`,
1257
1257
  logEventInfo,
1258
1258
  );
1259
1259
  break;
1260
1260
  case LinkConfigType.CONFIG_TYPE_CATEGORY:
1261
1261
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
1262
1262
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
1263
1263
  getShopSearchParams &&
1264
1264
  this.jdJumpToShopSearch(
1265
1265
  Object.assign({}, getShopSearchParams, {
1266
1266
  logEventInfo,
1267
1267
  }),
1268
1268
  );
1269
1269
  } else {
1270
1270
  this.jdJumpToShopSearch(
1271
1271
  configDataValue['cid']
1272
1272
  ? Object.assign(
1273
1273
  {},
1274
1274
  {
1275
1275
  shopId: global.info.queryInfo.shopId,
1276
1276
  categoryId: configDataValue.cid,
1277
1277
  logEventInfo,
1278
1278
  },
1279
1279
  )
1280
1280
  : {
1281
1281
  shopId: global.info.queryInfo.shopId,
1282
1282
  logEventInfo,
1283
1283
  },
1284
1284
  );
1285
1285
  }
1286
1286
  break;
1287
1287
  case LinkConfigType.CONFIG_TYPE_MEMBER:
1288
1288
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
1289
1289
  const getShopMemberParams = this.jdOpenAppParams(configDataValue.clickUrl);
1290
1290
  getShopMemberParams &&
1291
1291
  this.jdJumpToShopMember(
1292
1292
  Object.assign({}, getShopMemberParams, {
1293
1293
  logEventInfo,
1294
1294
  }),
1295
1295
  );
1296
1296
  } else {
1297
1297
  this.jdJumpToShopMember({
1298
1298
  shopId: global.info.queryInfo.shopId,
1299
1299
  venderId: configDataValue.shopDetail,
1300
1300
  logEventInfo,
1301
1301
  });
1302
1302
  }
1303
1303
  break;
1304
1304
  case LinkConfigType.CONFIG_TYPE_SHOP_ACTIVITY:
1305
1305
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
1306
1306
  const getShopActivityParams = this.jdOpenAppParams(configDataValue.clickUrl);
1307
1307
  getShopActivityParams &&
1308
1308
  this.jdJumpToShopActivity(
1309
1309
  Object.assign({}, getShopActivityParams, {
1310
1310
  logEventInfo,
1311
1311
  }),
1312
1312
  );
1313
1313
  } else if (configDataValue['projectId']) {
1314
1314
  this.jdJumpToShopActivity({
1315
1315
  projectId: configDataValue['projectId'],
1316
1316
  configDataValue,
1317
1317
  logEventInfo,
1318
1318
  });
1319
1319
  }
1320
1320
  break;
1321
1321
  case LinkConfigType.CONFIG_TYPE_CUSTOM_LINK:
1322
1322
  case LinkConfigType.CONFIG_TYPE_FINANCE_COUPON: {
1323
1323
  const _url = configDataValue.linkUrl;
1324
1324
  if (
1325
1325
  _url.indexOf('to=') === -1 &&
1326
1326
  _url.indexOf(`${domain.mshop.replace(/https?:/, '')}/?shopId=`) !== -1
1327
1327
  ) {
1328
1328
  const _shopId = _url.match(/\d+/g)[0];
1329
1329
  this.jdJumpToShopHome({
1330
1330
  shopId: `${_shopId}`,
1331
1331
  logEventInfo,
1332
1332
  });
1333
1333
  } else if (this.isOpenJdAppUrl(_url)) {
1334
1334
  const getOpenAppParams = this.jdOpenAppParams(_url);
1335
1335
  console.log('获取解析后的参数结果', getOpenAppParams);
1336
1336
  if (getOpenAppParams) {
1337
1337
  isJdApp
1338
1338
  ? this.jdNavigateToNative(
1339
1339
  Object.assign({}, getOpenAppParams, {
1340
1340
  logEventInfo,
1341
1341
  }),
1342
1342
  )
1343
1343
  : this.jdNavigateToNative(
1344
1344
  '',
1345
1345
  Object.assign({}, getOpenAppParams, {
1346
1346
  logEventInfo,
1347
1347
  }),
1348
1348
  );
1349
1349
  } else {
1350
1350
  this.jdNavigateToNative(
1351
1351
  '',
1352
1352
  Object.assign({}, getOpenAppParams, {
1353
1353
  logEventInfo,
1354
1354
  }),
1355
1355
  );
1356
1356
  }
1357
1357
  } else {
1358
1358
  this.jdJumpToWeb(_url, logEventInfo);
1359
1359
  }
1360
1360
  break;
1361
1361
  }
1362
1362
  case LinkConfigType.CONFIG_TYPE_JSHOP_DETAIL:
1363
1363
  this.jdJumpToShopDetail({
1364
1364
  venderId: global.info.queryInfo.venderId,
1365
1365
  shopId: global.info.queryInfo.shopId,
1366
1366
  logEventInfo,
1367
1367
  });
1368
1368
  break;
1369
1369
  case LinkConfigType.CONFIG_TYPE_SHOP_HOME:
1370
1370
  this.jdJumpToShopHome({
1371
1371
  ...configDataValue,
1372
1372
  logEventInfo,
1373
1373
  });
1374
1374
  break;
1375
1375
  case LinkConfigType.CONFIG_TYPE_ANCHOR_POINT:
1376
1376
  break;
1377
1377
  case LinkConfigType.CONFIG_TYPE_SHOPPING_GUIDE:
1378
1378
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
1379
1379
  const getShoppingGuideParams = this.jdOpenAppParams(configDataValue.clickUrl);
1380
1380
  getShoppingGuideParams &&
1381
1381
  this.jdJumpToShopActivity(
1382
1382
  Object.assign({}, getShoppingGuideParams, {
1383
1383
  logEventInfo,
1384
1384
  }),
1385
1385
  );
1386
1386
  }
1387
1387
  break;
1388
1388
  case LinkConfigType.CONFIG_TYPE_MINI_PROGRAM: {
1389
1389
  const linkUrl = decodeURIComponent(configDataValue?.linkUrl || '');
1390
1390
  const search = linkUrl.match(/\?.+/);
1391
1391
  if (search) {
1392
1392
  const miniQueryData: JumpEventReportInterFace.LinkMiniParams =
1393
1393
  parseQueryUrlString(linkUrl);
1394
1394
  try {
1395
1395
  miniQueryData.param = JSON.parse(<string>miniQueryData?.param);
1396
1396
  } catch (e) {
1397
1397
  console.warn('解析小程序 param 错误:', miniQueryData.param);
1398
1398
  }
1399
1399
  this.jdJumpToMiniProgram(miniQueryData);
1400
1400
  } else {
1401
1401
  console.warn('小程序地址错误:', linkUrl);
1402
1402
  }
1403
1403
  break;
1404
1404
  }
1405
1405
  case LinkConfigType.CONFIG_TYPE_SHOP_SEARCH: {
1406
1406
  if (this.isOpenJdAppUrl(configDataValue.clickUrl)) {
1407
1407
  const getShopSearchParams = this.jdOpenAppParams(configDataValue.clickUrl);
1408
1408
  console.log('base 获取店铺结果落地页链接解析后的参数结果', getShopSearchParams);
1409
1409
  getShopSearchParams &&
1410
1410
  this.jdJumpToShopSearch(
1411
1411
  Object.assign({}, getShopSearchParams, {
1412
1412
  logEventInfo,
1413
1413
  }),
1414
1414
  );
1415
1415
  } else {
1416
1416
  this.jdJumpToWeb(configDataValue.clickUrl, logEventInfo);
1417
1417
  }
1418
1418
  break;
1419
1419
  }
1420
1420
  default:
1421
1421
  }
1422
1422
  }
1423
1423
 
1424
1424
  jdOpenAppParams(openAppUrl): object | boolean {
1425
1425
  let getParams: boolean | object = false;
1426
1426
  if (this.isOpenJdAppUrl(openAppUrl)) {
1427
1427
  try {
1428
1428
  getParams = openAppUrl.replace(/openApp\.jdMobile:\/\/virtual\?params=/i, '');
1429
1429
  getParams = JSON.parse(String(getParams));
1430
1430
  } catch (e) {
1431
1431
  console.log(e);
1432
1432
  }
1433
1433
  }
1434
1434
  return getParams;
1435
1435
  }
1436
1436
  isOpenJdAppUrl(openAppUrl) {
1437
1437
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl);
1438
1438
  }
1439
1439
 
1440
1440
  creatParamToLogStr(eventParam) {
1441
1441
  return eventParam
1442
1442
  ? Object.keys(eventParam)
1443
1443
  .map((key) => {
1444
1444
  return `${key}_${eventParam[key]}`;
1445
1445
  })
1446
1446
  .join('_')
1447
1447
  : '';
1448
1448
  }
1449
1449
 
1450
1450
  jdNavigateToNative(
1451
1451
  url: string,
1452
1452
  params: {
1453
1453
  logEventInfo?: object;
1454
1454
  } = {},
1455
1455
  successBack?: functionType | undefined,
1456
1456
  failBack?: functionType | undefined,
1457
1457
  ) {
1458
1458
  const { logEventInfo } = params;
1459
1459
  const getEparam = logEventInfo || params;
1460
1460
  console.log('jdNavigateToNative params: ', params);
1461
1461
  console.log('logEventInfo params: ', logEventInfo);
1462
1462
  try {
1463
1463
  this.clickEventLog(getEparam);
1464
1464
  } catch (e) {
1465
1465
  console.log(e);
1466
1466
  }
1467
1467
  setTimeout(() => {
1468
1468
  Taro.navigateTo({
1469
1469
  url,
1470
1470
  })
1471
1471
  .then((res) => {
1472
1472
  typeof successBack === 'function' && successBack(res);
1473
1473
  console.log('navigateToWxapp.success', res);
1474
1474
  })
1475
1475
  .catch((err) => {
1476
1476
  typeof failBack === 'function' && failBack(err);
1477
1477
  console.log('navigateToWxapp.fail', err);
1478
1478
  });
1479
1479
  }, 200);
1480
1480
  }
1481
1481
 
1482
1482
  clickEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}, clickKey = 'click') {
1483
1483
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts;
1484
1484
  if (eventId && jsonParam) {
1485
1485
  const { etModelInfo, logBaseInfo } = jsonParam;
1486
1486
  let getJsonParam = logBaseInfo || jsonParam;
1487
1487
  if (etModelInfo && logBaseInfo) {
1488
1488
  getJsonParam = logBaseInfo;
1489
1489
  } else {
1490
1490
  if (Array.isArray(jsonParam)) {
1491
1491
  getJsonParam = jsonParam;
1492
1492
  } else {
1493
1493
  getJsonParam = Object.assign(
1494
1494
  {},
1495
1495
  {
1496
1496
  shopid: global.info.queryInfo?.shopId,
1497
1497
  },
1498
1498
  jsonParam,
1499
1499
  );
1500
1500
  }
1501
1501
  }
1502
1502
  const miniClickKey = clickKey === 'addToCart' ? 'addToCart' : 'click';
1503
1503
  const miniLogParams = {
1504
1504
  eid: eventId,
1505
1505
  elevel: eventLevel,
1506
1506
  ext: JSON.stringify(getJsonParam),
1507
1507
  etModel: JSON.stringify(etModelInfo || {}),
1508
1508
  pname: this.logPname,
1509
1509
  pparam: JSON.stringify(this.routerInfo.params),
1510
1510
  target: this.routerInfo.path,
1511
1511
  event: this.nativeEvent,
1512
1512
  pageId: this.logPageId,
1513
1513
  ...otherParams,
1514
1514
  };
1515
1515
  console.log('点击埋点参数对象', miniLogParams, miniClickKey);
1516
1516
  global.miniAppLogInstance && global.miniAppLogInstance[miniClickKey](miniLogParams);
1517
1517
  }
1518
1518
  }
1519
1519
 
1520
1520
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
1521
1521
  const { eventId, jsonParam, eventLevel = 3, ...otherParams } = opts;
1522
1522
  if (eventId && jsonParam) {
1523
1523
  const { etModelInfo, logBaseInfo } = jsonParam;
1524
1524
  let getJsonParam = {};
1525
1525
  if (etModelInfo && logBaseInfo) {
1526
1526
  getJsonParam = logBaseInfo;
1527
1527
  } else {
1528
1528
  if (Array.isArray(jsonParam)) {
1529
1529
  getJsonParam = jsonParam;
1530
1530
  } else {
1531
1531
  getJsonParam = Object.assign(
1532
1532
  {},
1533
1533
  {
1534
1534
  shopid: global.info.queryInfo?.shopId,
1535
1535
  },
1536
1536
  jsonParam,
1537
1537
  );
1538
1538
  }
1539
1539
  }
1540
1540
  const miniLogParams = {
1541
1541
  eid: eventId,
1542
1542
  elevel: eventLevel,
1543
1543
  ext: JSON.stringify(getJsonParam),
1544
1544
  etModel: JSON.stringify(etModelInfo || {}),
1545
1545
  pname: this.logPname,
1546
1546
  pparam: JSON.stringify(this.routerInfo.params),
1547
1547
  target: this.routerInfo.path,
1548
1548
  pageId: this.logPageId,
1549
1549
  ...otherParams,
1550
1550
  };
1551
1551
  global.miniAppLogInstance && global.miniAppLogInstance['exposure'](miniLogParams);
1552
1552
  }
1553
1553
  }
1554
1554
 
1555
1555
  initOpenTriggerExposure(type) {
1556
1556
  if (!this.sectionExposureInfo[type]) {
1557
1557
  Taro.nextTick(() => {
1558
1558
  setTimeout(() => {
1559
1559
  global.info.pageInfo.isExposureState = true;
1560
1560
  taroEventInitExposure();
1561
1561
  this.sectionExposureInfo[`${type}`] = true;
1562
1562
  }, 200);
1563
1563
  });
1564
1564
  }
1565
1565
  }