@conecli/cone-render 0.10.1-shop3.52 → 0.10.1-shop3.53

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
- export enum LogPnameInfo {
2
1
  HOME = 'home',
3
2
  MEMBER = 'member',
4
3
  CLASSIFY = 'classify',
5
4
  PROMOTION = 'promotion',
6
5
  WX_SHOP_HOME = 'wx_shop_home',
7
6
  APP_SHOP_DETAIL = 'app_Shop_ShopDetail',
8
7
  MOBILE_SEARCH = 'MShop_SearchResult',
9
8
  SALE_VIEW = 'Shop_NewActivity',
10
9
  STOW_SHOP_VIEW = 'Shop_FollowShopMain',
11
10
  APP_SHOP_NEW_PRODUCT = 'Shop_ProductNew',
12
11
  APP_SHOP_NEW_PRODUCT_VIDEO = 'Shop_ProductNewVideo',
13
12
  APP_SHOP_NEW_PRODUCT_PREFERRED_GOODS = 'shop_preferredGoods',
14
13
  APP_SHOP_BUYER_SHOW = 'Shop_ShopBuyerShow',
15
14
  APP_SHOP_CARD = 'Shop_ShopCard',
16
15
  APP_SHOP_MEMBER = 'Shop_ShopMember',
17
16
  APP_SHOP_PAY_MEMBER = 'Shop_PayShopMember',
18
17
  APP_SHOP_CATEGORY = 'Shop_Category',
19
18
  APP_SHOP_SCENE = 'Shop_Scene',
20
19
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
21
20
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
22
21
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
23
22
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
24
23
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
25
24
  APP_SAGE = 'Shop_Person',
26
25
  APP_SAGE_POP = 'Shop_PersionPop',
27
26
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
28
27
  APP_SHOP_RANK = 'Shop_RankingList',
29
28
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
30
29
  APP_SHOP_SERVICE = 'Shop_Service',
31
30
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
32
31
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
33
32
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
34
33
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
35
34
  APP_BRAND_HOT_SALE = 'Shop_BrandHotSale',
36
35
  MOBILE = 'Shop_ShopMain',
37
36
  APP = 'TerminatorNew_All',
38
37
  APP_BRAND_HOT_SALE = 'Shop_BrandHotSale',
39
38
  APP_SAGE = 'Shop_Person',
40
39
  APP_SAGE_POP = 'Shop_PersionPop',
41
40
  WX_JDGW_SHOP = 'W_jdgwxcx_shop',
42
41
  APP_SHOP_DETAIL = 'Shop_ShopDetail',
43
42
  MOBILE_SEARCH = 'MShop_SearchResult',
44
43
  STOW_SHOP_VIEW = 'Shop_FollowShopMain',
45
44
  APP_SHOP_CARD = 'Shop_ShopCard',
46
45
  APP_SHOP_MEMBER = 'Shop_ShopMember',
47
46
  APP_SHOP_PAY_MEMBER = 'Shop_PayShopMember',
48
47
  APP_SHOP_CATEGORY = 'Shop_Category',
49
48
  APP_SHOP_SCENE = 'Shop_ShopSceneBuy',
50
49
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
51
50
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
52
51
  APP_SHOP_NEW_PRODUCT = 'Shop_ProductNew',
53
52
  APP_SHOP_NEW_PRODUCT_VIDEO = 'Shop_ProductNewVideo',
54
53
  APP_SHOP_NEW_PRODUCT_PREFERRED_GOODS = 'shop_preferredGoods',
55
54
  APP_SHOP_BUYER_SHOW = 'Shop_ShopBuyerShow',
56
55
  SALE_VIEW = 'Shop_NewActivity',
57
56
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
58
57
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
59
58
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
60
59
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
61
60
  APP_SHOP_RANK = 'Shop_RankingList',
62
61
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
63
62
  APP_SHOP_SERVICE = 'Shop_Service',
64
63
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
65
64
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
66
65
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
67
66
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
68
67
  ACTIVITY_INIT: 'activityInit',
69
68
  SHOP_HEADER: 'shopHeader',
70
69
  SHOP_FOOTER: 'shopFooter',
71
70
  SHOP_HOME: 'jshopMain',
72
71
  SHOP_FOLLOW_BTN: 'shopFollowBtn',
73
72
  SHOP_UNFOLLOW_BTN: 'shopUnFollowBtn',
74
73
  NETWORK_ERR: 'networkerr',
75
74
  RANK_LIST_MORE: 'Jx_Terminator_ShopRankListMore',
76
75
  RANK_LIST_TAG: 'Jx_Terminator_ShopRankListTag',
77
76
  RANK_LIST: 'Jx_Terminator_ShopRankList',
78
77
  EXPO_RANK_LIST: 'Jx_Terminator_Expo_shopRankList',
79
78
  [LogEventIds.SHOP_HOME]: 'Jx_Terminator_1620613767283|1',
80
79
  [LogEventIds.SHOP_FOLLOW_BTN]: 'Jx_Terminator_1620613767283|2',
81
80
  [LogEventIds.SHOP_UNFOLLOW_BTN]: 'Jx_Terminator_1620613767283|3',
82
81
  [LogEventIds.NETWORK_ERR]: 'Jx_Terminator_1620613767283|4',
83
82
  [LogEventIds.RANK_LIST_MORE]: 'Jx_Terminator_ShopRankListMore',
84
83
  [LogEventIds.RANK_LIST_TAG]: 'Jx_Terminator_ShopRankListTag',
85
84
  [LogEventIds.RANK_LIST]: 'Jx_Terminator_ShopRankList',
86
85
  [LogEventIds.EXPO_RANK_LIST]: 'Jx_Terminator_Expo_shopRankList',
86
+ export enum LogPnameInfo {
87
87
  HOME = 'home',
88
88
  MEMBER = 'member',
89
89
  CLASSIFY = 'classify',
90
90
  PROMOTION = 'promotion',
91
91
  WX_SHOP_HOME = 'wx_shop_home',
92
92
  APP_SHOP_DETAIL = 'app_Shop_ShopDetail',
93
93
  MOBILE_SEARCH = 'MShop_SearchResult',
94
94
  SALE_VIEW = 'Shop_NewActivity',
95
95
  STOW_SHOP_VIEW = 'Shop_FollowShopMain',
96
96
  APP_SHOP_NEW_PRODUCT = 'Shop_ProductNew',
97
97
  APP_SHOP_NEW_PRODUCT_VIDEO = 'Shop_ProductNewVideo',
98
98
  APP_SHOP_NEW_PRODUCT_PREFERRED_GOODS = 'shop_preferredGoods',
99
99
  APP_SHOP_BUYER_SHOW = 'Shop_ShopBuyerShow',
100
100
  APP_SHOP_CARD = 'Shop_ShopCard',
101
101
  APP_SHOP_MEMBER = 'Shop_ShopMember',
102
102
  APP_SHOP_PAY_MEMBER = 'Shop_PayShopMember',
103
103
  APP_SHOP_CATEGORY = 'Shop_Category',
104
104
  APP_SHOP_SCENE = 'Shop_Scene',
105
105
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
106
106
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
107
107
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
108
108
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
109
109
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
110
110
  APP_SAGE = 'Shop_Person',
111
111
  APP_SAGE_POP = 'Shop_PersionPop',
112
112
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
113
113
  APP_SHOP_RANK = 'Shop_RankingList',
114
114
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
115
115
  APP_SHOP_SERVICE = 'Shop_Service',
116
116
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
117
117
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
118
118
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
119
119
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
120
120
  APP_BRAND_HOT_SALE = 'Shop_BrandHotSale',
121
121
  MOBILE = 'Shop_ShopMain',
122
122
  APP = 'TerminatorNew_All',
123
123
  APP_BRAND_HOT_SALE = 'Shop_BrandHotSale',
124
124
  APP_SAGE = 'Shop_Person',
125
125
  APP_SAGE_POP = 'Shop_PersionPop',
126
126
  WX_JDGW_SHOP = 'W_jdgwxcx_shop',
127
127
  APP_SHOP_DETAIL = 'Shop_ShopDetail',
128
128
  MOBILE_SEARCH = 'MShop_SearchResult',
129
129
  STOW_SHOP_VIEW = 'Shop_FollowShopMain',
130
130
  APP_SHOP_CARD = 'Shop_ShopCard',
131
131
  APP_SHOP_MEMBER = 'Shop_ShopMember',
132
132
  APP_SHOP_PAY_MEMBER = 'Shop_PayShopMember',
133
133
  APP_SHOP_CATEGORY = 'Shop_Category',
134
134
  APP_SHOP_SCENE = 'Shop_ShopSceneBuy',
135
135
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
136
136
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
137
137
  APP_SHOP_NEW_PRODUCT = 'Shop_ProductNew',
138
138
  APP_SHOP_NEW_PRODUCT_VIDEO = 'Shop_ProductNewVideo',
139
139
  APP_SHOP_NEW_PRODUCT_PREFERRED_GOODS = 'shop_preferredGoods',
140
140
  APP_SHOP_BUYER_SHOW = 'Shop_ShopBuyerShow',
141
141
  SALE_VIEW = 'Shop_NewActivity',
142
142
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
143
143
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
144
144
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
145
145
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
146
146
  APP_SHOP_RANK = 'Shop_RankingList',
147
147
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
148
148
  APP_SHOP_SERVICE = 'Shop_Service',
149
149
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
150
150
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
151
151
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
152
152
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
153
153
  ACTIVITY_INIT: 'activityInit',
154
154
  SHOP_HEADER: 'shopHeader',
155
155
  SHOP_FOOTER: 'shopFooter',
156
156
  SHOP_HOME: 'jshopMain',
157
157
  SHOP_FOLLOW_BTN: 'shopFollowBtn',
158
158
  SHOP_UNFOLLOW_BTN: 'shopUnFollowBtn',
159
159
  NETWORK_ERR: 'networkerr',
160
160
  RANK_LIST_MORE: 'Jx_Terminator_ShopRankListMore',
161
161
  RANK_LIST_TAG: 'Jx_Terminator_ShopRankListTag',
162
162
  RANK_LIST: 'Jx_Terminator_ShopRankList',
163
163
  EXPO_RANK_LIST: 'Jx_Terminator_Expo_shopRankList',
164
164
  [LogEventIds.SHOP_HOME]: 'Jx_Terminator_1620613767283|1',
165
165
  [LogEventIds.SHOP_FOLLOW_BTN]: 'Jx_Terminator_1620613767283|2',
166
166
  [LogEventIds.SHOP_UNFOLLOW_BTN]: 'Jx_Terminator_1620613767283|3',
167
167
  [LogEventIds.NETWORK_ERR]: 'Jx_Terminator_1620613767283|4',
168
168
  [LogEventIds.RANK_LIST_MORE]: 'Jx_Terminator_ShopRankListMore',
169
169
  [LogEventIds.RANK_LIST_TAG]: 'Jx_Terminator_ShopRankListTag',
170
170
  [LogEventIds.RANK_LIST]: 'Jx_Terminator_ShopRankList',
171
171
  [LogEventIds.EXPO_RANK_LIST]: 'Jx_Terminator_Expo_shopRankList',
172
172
  [LogPageIdInfo.MOBILE]: 'b002165',
173
173
  [LogPageIdInfo.APP]: 'b002165',
174
174
  [LogPageIdInfo.APP_SHOP_CATEGORY]: 'b002489',
175
175
  [LogPageIdInfo.APP_SHOP_MEMBER]: 'b002504',
176
176
  [LogPageIdInfo.SALE_VIEW]: 'b002503',
177
177
  [LogPageIdInfo.APP_SHOP_DETAIL]: 'b002275',
178
178
  [LogPageIdInfo.MOBILE_SEARCH]: 'b002510',
@@ -1 +1 @@
1
- import { sgmCustomReport } from '../../utils';
2
1
  new Promise((resolve, reject) => {
3
2
  if (window.MPing) {
4
3
  resolve(true);
5
4
  } else {
6
5
  if (isReportReadyError) {
7
6
  reject(false);
8
7
  } else {
9
8
  ready('MPing', 3000)
10
9
  .then(() => {
11
10
  isReportReadyError = false;
12
11
  resolve(true);
13
12
  })
14
13
  .catch(() => {
15
14
  isReportReadyError = true;
16
15
  reject(false);
17
16
  });
18
17
  }
19
18
  }
20
19
  });
21
20
  return new Promise((resolve, reject) => {
22
21
  const { pageId, pageParam, pTag, isSend = true, spmAllCode, spmCodeForB, ...otherParam } = opts;
23
22
  getReportObjReadyPromise()
24
23
  .then(() => {
25
24
  let pvObj: any = null;
26
25
  if (spmAllCode || shopSpmBforMap[pageId] || spmCodeForB) {
27
26
  pvObj = new MPing.inputs.SpmPV({
28
27
  spm: spmAllCode || `${shopSpmA}.${shopSpmBforMap[pageId] || spmCodeForB}`,
29
28
  page_id: pageId,
30
29
  page_param: pageParam,
31
30
  ...otherParam,
32
31
  });
33
32
  } else {
34
33
  pvObj = new MPing.inputs.PV({
35
34
  page_id: pageId,
36
35
  });
37
36
  pvObj.page_param = pageParam;
38
37
  otherParam &&
39
38
  Object.keys(otherParam).forEach((key) => {
40
39
  pvObj[key] = otherParam[key];
41
40
  });
42
41
  }
43
42
  if (isSend) {
44
43
  const mping = new MPing();
45
44
  mping.send(pvObj);
46
45
  setTimeout(() => resolve(true), 200);
47
46
  }
48
47
  })
49
48
  .catch((e) => {
50
49
  reject(e);
51
50
  });
52
51
  }).catch((err) => {
53
52
  console.log('上报异常', err);
54
53
  sgmCustomReport({
55
54
  code: 'reportErr',
56
55
  msg:
57
56
  '埋点js加载异常,导致MPing不存在,pv具体上报参数如下==>' +
58
57
  JSON.stringify(opts) +
59
58
  '==异常参数说明==>' +
60
59
  err,
61
60
  });
62
61
  });
63
62
  return new Promise((resolve, reject) => {
64
63
  const {
65
64
  eid,
66
65
  eparam,
67
66
  jsonParam,
68
67
  pageParam,
69
68
  flowMapParam = {},
70
69
  elevel,
71
70
  isExpo = false,
72
71
  target = null,
73
72
  pageId = 'TerminatorNew_All',
74
73
  spmAllCode,
75
74
  spmCodeForCD,
76
75
  } = opts;
77
76
  getReportObjReadyPromise()
78
77
  .then(() => {
79
78
  let clickObj: any = null;
80
79
  if (spmAllCode || (shopSpmBforMap[pageId] && (shopSpmCDforCode[eid] || spmCodeForCD))) {
81
80
  const getSpmParams = {
82
81
  target,
83
82
  spm:
84
83
  spmAllCode ||
85
84
  `${shopSpmA}.${shopSpmBforMap[pageId]}.${shopSpmCDforCode[eid] || spmCodeForCD}`,
86
85
  event_id: eid,
87
86
  page_id: pageId,
88
87
  page_name: pageName,
89
88
  json_param: jsonParam,
90
89
  ...flowMapParam,
91
90
  };
92
91
  eparam && (getSpmParams['event_param'] = jsonParam);
93
92
  pageParam && (getSpmParams['page_param'] = pageParam);
94
93
  isExpo && (getSpmParams['ma_switch_type'] = '1');
95
94
  clickObj = isExpo
96
95
  ? new MPing.inputs.SpmExposure(getSpmParams)
97
96
  : new MPing.inputs.SpmClick(getSpmParams);
98
97
  } else {
99
98
  clickObj = new MPing.inputs.Click(eid, {
100
99
  isExpo,
101
100
  target,
102
101
  ...flowMapParam,
103
102
  });
104
103
  clickObj.json_param = jsonParam;
105
104
  if (eparam) {
106
105
  clickObj.event_param = jsonParam;
107
106
  }
108
107
  clickObj.page_id = pageId;
109
108
  clickObj.page_name = pageName;
110
109
  pageParam && (clickObj.page_param = pageParam);
111
110
  elevel && (clickObj.event_level = elevel);
112
111
  clickObj.updateEventSeries();
113
112
  }
114
113
  clickObj && new MPing().send(clickObj);
115
114
  setTimeout(() => resolve(true), 200);
116
115
  })
117
116
  .catch((e) => {
118
117
  reject(e);
119
118
  });
120
119
  }).catch((err) => {
121
120
  console.log('上报异常', err);
122
121
  sgmCustomReport({
123
122
  code: 'reportErr',
124
123
  msg:
125
124
  '埋点js加载异常,导致MPing不存在,点击或者曝光具体上报参数如下==>' +
126
125
  JSON.stringify(opts) +
127
126
  '==异常参数说明==>' +
128
127
  err,
129
128
  });
130
129
  });
131
130
  const { jsonParam } = webLogParams;
132
131
  const { skuId } = opts;
133
132
  if (jsonParam && skuId) {
134
133
  try {
135
134
  let jsonObj = JSON.parse(jsonParam);
136
135
  jsonObj['skuid'] = skuId + '';
137
136
  webLogParams.jsonParam = JSON.stringify(jsonObj);
138
137
  } catch (e) {
139
138
  console.log(e);
140
139
  }
141
140
  }
142
141
  return reportClick(webLogParams);
142
+ import { sgmCustomReport } from '../../utils';
143
143
  new Promise((resolve, reject) => {
144
144
  if (window.MPing) {
145
145
  resolve(true);
146
146
  } else {
147
147
  if (isReportReadyError) {
148
148
  reject(false);
149
149
  } else {
150
150
  ready('MPing', 3000)
151
151
  .then(() => {
152
152
  isReportReadyError = false;
153
153
  resolve(true);
154
154
  })
155
155
  .catch(() => {
156
156
  isReportReadyError = true;
157
157
  reject(false);
158
158
  });
159
159
  }
160
160
  }
161
161
  });
162
162
  return new Promise((resolve, reject) => {
163
163
  const { pageId, pageParam, pTag, isSend = true,pvForSpm = false, spmAllCode, spmCodeForB, ...otherParam } = opts;
164
164
  getReportObjReadyPromise()
165
165
  .then(() => {
166
166
  let pvObj: any = null;
167
167
  if (spmAllCode || shopSpmBforMap[pageId] || spmCodeForB) {
168
168
  pvObj = new MPing.inputs.SpmPV({
169
169
  spm: spmAllCode || `${shopSpmA}.${shopSpmBforMap[pageId] || spmCodeForB}`,
170
170
  page_param: pageParam,
171
171
  ...otherParam,
172
172
  });
173
173
  !pvForSpm && pageId && (pvObj.page_id = pageId);
174
174
  } else {
175
175
  pvObj = new MPing.inputs.PV({
176
176
  page_id: pageId,
177
177
  });
178
178
  pvObj.page_param = pageParam;
179
179
  otherParam &&
180
180
  Object.keys(otherParam).forEach((key) => {
181
181
  pvObj[key] = otherParam[key];
182
182
  });
183
183
  }
184
184
  if (isSend) {
185
185
  const mping = new MPing();
186
186
  mping.send(pvObj);
187
187
  setTimeout(() => resolve(true), 200);
188
188
  }
189
189
  })
190
190
  .catch((e) => {
191
191
  reject(e);
192
192
  });
193
193
  }).catch((err) => {
194
194
  console.log('上报异常', err);
195
195
  sgmCustomReport({
196
196
  code: 'reportErr',
197
197
  msg:
198
198
  '埋点js加载异常,导致MPing不存在,pv具体上报参数如下==>' +
199
199
  JSON.stringify(opts) +
200
200
  '==异常参数说明==>' +
201
201
  err,
202
202
  });
203
203
  });
204
204
  return new Promise((resolve, reject) => {
205
205
  const {
206
206
  eid,
207
207
  eparam,
208
208
  jsonParam,
209
209
  pageParam,
210
210
  flowMapParam = {},
211
211
  elevel,
212
212
  isExpo = false,
213
213
  target = null,
214
214
  pageId = 'TerminatorNew_All',
215
215
  spmAllCode,
216
216
  spmCodeForCD,
217
217
  } = opts;
218
218
  getReportObjReadyPromise()
219
219
  .then(() => {
220
220
  let clickObj: any = null;
221
221
  if (spmAllCode || (shopSpmBforMap[pageId] && (shopSpmCDforCode[eid] || spmCodeForCD))) {
222
222
  const getSpmParams = {
223
223
  target,
224
224
  spm:
225
225
  spmAllCode ||
226
226
  `${shopSpmA}.${shopSpmBforMap[pageId]}.${shopSpmCDforCode[eid] || spmCodeForCD}`,
227
227
  page_name: pageName,
228
228
  json_param: jsonParam,
229
229
  ...flowMapParam,
230
230
  };
231
231
  eid && (getSpmParams['event_id'] = eid);
232
232
  eid && pageId && (getSpmParams['page_id'] = pageId);
233
233
  eparam && (getSpmParams['event_param'] = jsonParam);
234
234
  pageParam && (getSpmParams['page_param'] = pageParam);
235
235
  isExpo && (getSpmParams['ma_switch_type'] = '1');
236
236
  clickObj = isExpo
237
237
  ? new MPing.inputs.SpmExposure(getSpmParams)
238
238
  : new MPing.inputs.SpmClick(getSpmParams);
239
239
  } else {
240
240
  clickObj = new MPing.inputs.Click(eid, {
241
241
  isExpo,
242
242
  target,
243
243
  ...flowMapParam,
244
244
  });
245
245
  clickObj.json_param = jsonParam;
246
246
  if (eparam) {
247
247
  clickObj.event_param = jsonParam;
248
248
  }
249
249
  clickObj.page_id = pageId;
250
250
  clickObj.page_name = pageName;
251
251
  pageParam && (clickObj.page_param = pageParam);
252
252
  elevel && (clickObj.event_level = elevel);
253
253
  clickObj.updateEventSeries();
254
254
  }
255
255
  clickObj && new MPing().send(clickObj);
256
256
  setTimeout(() => resolve(true), 200);
257
257
  })
258
258
  .catch((e) => {
259
259
  reject(e);
260
260
  });
261
261
  }).catch((err) => {
262
262
  console.log('上报异常', err);
263
263
  sgmCustomReport({
264
264
  code: 'reportErr',
265
265
  msg:
266
266
  '埋点js加载异常,导致MPing不存在,点击或者曝光具体上报参数如下==>' +
267
267
  JSON.stringify(opts) +
268
268
  '==异常参数说明==>' +
269
269
  err,
270
270
  });
271
271
  });
272
272
  const { jsonParam } = webLogParams;
273
273
  const { skuId } = opts;
274
274
  if (jsonParam && skuId) {
275
275
  try {
276
276
  let jsonObj = JSON.parse(jsonParam);
277
277
  jsonObj['skuid'] = skuId + '';
278
278
  webLogParams.jsonParam = JSON.stringify(jsonObj);
279
279
  } catch (e) {
280
280
  console.log(e);
281
281
  }
282
282
  }
283
283
  return reportClick(webLogParams);