@conecli/cone-render 0.8.32 → 0.8.34

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.
@@ -1 +1 @@
1
- import global from '../common'
2
1
  if(mInfo == 'custom') return etModelInfo
3
2
  if(mInfo == 'custom') return etModelInfo
3
+ import global from '../common'
4
4
  return mInfo === 'custom' ? etModelInfo : this.getClickEventInfo(floorData,mInfo,etModelInfo,true,true)
5
5
  return mInfo === 'custom' ? etModelInfo : this.getExposureInfo(floorData,mInfo,etModelInfo,true,true)
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
2
2
 
3
3
  jdJumpToCoupon(
4
4
  nowUrlParams: JumpEventReportInterFace.CouponUrlParams,
5
5
  logInfo,
6
6
  ) {
7
7
  if (
8
8
  nowUrlParams.batchId &&
9
9
  (nowUrlParams.bindType === 1 || nowUrlParams.bindType === 3)
10
10
  ) {
11
11
  const couponUrlParams = {
12
12
  batch: nowUrlParams.batchId,
13
13
  kind: nowUrlParams.bindType,
14
14
  startTime: nowUrlParams.startTime,
15
15
  endTime: nowUrlParams.endTime,
16
16
  quangoufrom: 6,
17
17
  }
18
18
  this.jdNavigateToNative(
19
19
  `${this.jumpMiniPath.searchCoupon}?${objectToUrlEncode(
20
20
  couponUrlParams,
21
21
  )}`,
22
22
  {
23
23
  ...logInfo,
24
24
  },
25
25
  )
26
26
  } else if (
27
27
  nowUrlParams.batchId &&
28
28
  nowUrlParams.bindType !== 1 &&
29
29
  nowUrlParams.bindType !== 3
30
30
  ) {
31
31
  const couponUrlParams = {
32
32
  ...this.getShopIdOrVenderIdParams(global.info.queryInfo),
33
33
  sceneId: 1002,
34
34
  }
35
35
  this.jdNavigateToNative(
36
36
  `${this.jumpMiniPath.shop}?${objectToUrlEncode(couponUrlParams)}`,
37
37
  {
38
38
  ...logInfo,
39
39
  },
40
40
  )
41
41
  }
42
42
  }
43
43
 
44
44
  jdJumpToJTCoupon(
45
45
  nowUrlParams: JumpEventReportInterFace.CouponUrlParams,
46
46
  logInfo,
47
47
  ) {
48
48
  const couponUrlParams = {
49
49
  batch: nowUrlParams.batchId,
50
50
  kind: nowUrlParams.bindType,
51
51
  startTime: nowUrlParams.startTime,
52
52
  endTime: nowUrlParams.endTime,
53
53
  quangoufrom: 6,
54
54
  }
55
55
  this.jdNavigateToNative(
56
56
  `${this.jumpMiniPath.searchCoupon}?${objectToUrlEncode(couponUrlParams)}`,
57
57
  {
58
58
  ...logInfo,
59
59
  },
60
60
  )
61
61
  }
62
62
 
63
63
  jdJumpToRankList(contentId: string | number, rankType = 10, logEventInfo) {
64
64
  const rankUrl = `${this.jumpWebUrl.rank}?contentId=${contentId}&sku=&rankType=${rankType}&fromName=dcpws&hideAd=1`
65
65
  console.log(`rankUrl${rankUrl}`)
66
66
  this.jdJumpToWeb(rankUrl, {
67
67
  contentId,
68
68
  ...logEventInfo,
69
69
  })
70
70
  }
71
71
 
72
72
  jdJumpToShopDetall() {
73
73
  }
74
74
 
75
75
  jdJumpToActivityPlace(spUrl, logEventInfo) {
76
76
  this.jdJumpToWeb(spUrl, logEventInfo)
77
77
  }
78
78
 
79
79
  jdJumpToShopFans(fansParams, logEventInfo) {
80
80
  this.jdNavigateToNative(
81
81
  `${this.jumpMiniPath.shopFans}?${objectToUrlEncode(fansParams)}`,
82
82
  {
83
83
  ...logEventInfo,
84
84
  },
85
85
  )
86
86
  }
87
87
 
88
88
  jdJumpToShopActivity(shopInfo) {
89
89
  const getParams = Object.assign(
90
90
  {},
91
91
  {
92
92
  category: 'jump',
93
93
  des: 'jshopActivity',
94
94
  shopId: global.info.queryInfo.shopId,
95
95
  venderId: global.info.queryInfo.venderId,
96
96
  },
97
97
  shopInfo,
98
98
  )
99
99
  getParams['projectId'] &&
100
100
  (getParams['projectId'] = `${getParams['projectId']}`)
101
101
  }
102
102
 
103
103
  jdJumpToThreePlatform(spUrl, logEventInfo) {
104
104
  this.jdJumpToWeb(spUrl, logEventInfo)
105
105
  }
106
106
 
107
107
  jdJumpToMiniProgram({
108
108
  appId,
109
109
  path,
110
110
  param = {},
111
111
  }: JumpEventReportInterFace.LinkMiniParams) {
112
112
  const pageName = param['pageType'] || 'home'
113
113
  path = `pages/${pageName}/index`
114
114
  if (appId === global.info.pageInfo?.appId) {
115
115
  Taro.navigateTo({
116
116
  url: `/${path}?${objectToUrlEncode(param)}`,
117
117
  }).catch((err) => {
118
118
  console.warn('跳转小程序页面错误:', err)
119
119
  })
120
120
  } else {
121
121
  console.log('一个小程序跳转到另一个小程序暂无此业务')
122
122
  }
123
123
  }
124
124
 
125
125
  jdJumpToAppMiniProgram(
126
126
  path: string,
127
127
  param = {},
128
128
  successBack?: Function,
129
129
  failBack?: Function,
130
130
  ) {
131
131
  this.jdNavigateToNative(path, param, successBack, failBack)
132
132
  }
133
133
 
134
134
  jdNavigateToNative(
135
135
  url: string,
136
136
  params: {
137
137
  logEventInfo?: object
138
138
  } = {},
139
139
  successBack?: Function,
140
140
  failBack?: Function,
141
141
  ) {
142
142
  const { logEventInfo, ...otherParams } = params
143
143
  const getEparam = logEventInfo || params
144
144
  console.log('[降级H5] index jdNavigateToNative params: ', params)
145
145
  console.log('logEventInfo params: ', logEventInfo)
146
146
  try {
147
147
  this.clickEventLog(getEparam)
148
148
  } catch (e) {
149
149
  console.log(e)
150
150
  }
151
151
  setTimeout(() => {
152
152
  Taro.navigateTo({
153
153
  url: `${url}${otherParams ? '?' + objectToUrlEncode(otherParams) : ''}`,
154
154
  })
155
155
  .then((res) => {
156
156
  typeof successBack === 'function' && successBack(res)
157
157
  console.log('navigateToWxapp.success', res)
158
158
  })
159
159
  .catch((err) => {
160
160
  typeof failBack === 'function' && failBack(err)
161
161
  console.log('navigateToWxapp.fail', err)
162
162
  })
163
163
  }, 200)
164
164
  }
165
165
 
166
166
  clickEventLog(
167
167
  opts: JumpEventReportInterFace.OptEventLogParams = {},
168
168
  clickKey = 'click',
169
169
  ) {
170
170
  const { eventId, jsonParam, eventLevel = 3, skuId, ...otherParams } = opts
171
171
  if (eventId && jsonParam) {
172
172
  const { etModelInfo, logBaseInfo } = jsonParam
173
173
  const miniLogParams = {
174
174
  eid: eventId,
175
175
  elevel: eventLevel,
176
176
  eparam: JSON.stringify(logBaseInfo || jsonParam),
177
177
  ext: {
178
178
  et_model: JSON.stringify(etModelInfo || {}),
179
179
  },
180
180
  pageId: this.logPageId,
181
181
  pname: this.logPname,
182
182
  pparam: JSON.stringify(this.routerInfo.params),
183
183
  target: this.routerInfo.path,
184
184
  event: this.nativeEvent,
185
185
  ...otherParams,
186
186
  }
187
187
  if (clickKey === 'addToCart' && skuId) {
188
188
  miniLogParams['shoppingList'] = {
189
189
  [skuId]: 1,
190
190
  }
191
191
  }
192
192
  console.log('点击埋点参数对象', miniLogParams, clickKey)
193
193
  global.miniAppLogInstance &&
194
194
  global.miniAppLogInstance[clickKey](miniLogParams)
195
195
  } else {
196
196
  console.log('暂无埋点参数eventId和eventParam')
197
197
  }
198
198
  }
199
199
 
200
200
  exposureEventLog(opts: JumpEventReportInterFace.OptEventLogParams = {}) {
201
201
  return this.clickEventLog(opts, 'exposure')
202
202
  }
203
203
 
204
204
  jdJumpToSearch(shopId, suggestWord) {
205
205
  console.log(
206
206
  '� ~ file: index.ts ~ line 304 ~ JumpEventReportCenter ~ shopId, suggestWord',
207
207
  shopId,
208
208
  suggestWord,
209
209
  )
210
210
  }
211
211
 
212
212
  jdJumpToMyMessageBox() {}
213
213
 
214
214
  jdJumpToAppHome(params = {}) {
215
215
  this.jdJumpToAppMiniProgram(this.jumpMiniPath.jingGouHome, params)
216
216
  }
217
217
 
218
218
  jdJumpToShopHomeDetail({ shopId, venderId }) {
219
219
  console.log(
220
220
  '� ~ file: index.ts ~ line 327 ~ JumpEventReportCenter ~ shopId, verderId',
221
221
  shopId,
222
222
  venderId,
223
223
  )
224
224
  }