@conecli/cone-render 0.10.1-shop3.42 → 0.10.1-shop3.43

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_SCENE = 'Shop_Scene',
19
18
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
20
19
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
21
20
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
22
21
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
23
22
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
24
23
  APP_SAGE = 'Shop_Person',
25
24
  APP_SAGE_POP = 'Shop_PersionPop',
26
25
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
27
26
  APP_SHOP_RANK = 'Shop_RankingList',
28
27
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
29
28
  APP_SHOP_SERVICE = 'Shop_Service',
30
29
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
31
30
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
32
31
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
33
32
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
34
33
  MOBILE = 'Shop_ShopMain',
35
34
  APP = 'TerminatorNew_All',
36
35
  APP_SAGE = 'Shop_Person',
37
36
  APP_SAGE_POP = 'Shop_PersionPop',
38
37
  WX_JDGW_SHOP = 'W_jdgwxcx_shop',
39
38
  APP_SHOP_DETAIL = 'Shop_ShopDetail',
40
39
  MOBILE_SEARCH = 'MShop_SearchResult',
41
40
  STOW_SHOP_VIEW = 'Shop_FollowShopMain',
42
41
  APP_SHOP_CARD = 'Shop_ShopCard',
43
42
  APP_SHOP_MEMBER = 'Shop_ShopMember',
44
43
  APP_SHOP_PAY_MEMBER = 'Shop_PayShopMember',
45
44
  APP_SHOP_SCENE = 'Shop_Scene',
46
45
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
47
46
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
48
47
  APP_SHOP_NEW_PRODUCT = 'Shop_ProductNew',
49
48
  APP_SHOP_NEW_PRODUCT_VIDEO = 'Shop_ProductNewVideo',
50
49
  APP_SHOP_NEW_PRODUCT_PREFERRED_GOODS = 'shop_preferredGoods',
51
50
  APP_SHOP_BUYER_SHOW = 'Shop_ShopBuyerShow',
52
51
  SALE_VIEW = 'Shop_NewActivity',
53
52
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
54
53
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
55
54
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
56
55
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
57
56
  APP_SHOP_RANK = 'Shop_RankingList',
58
57
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
59
58
  APP_SHOP_SERVICE = 'Shop_Service',
60
59
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
61
60
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
62
61
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
63
62
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
64
63
  ACTIVITY_INIT: 'activityInit',
65
64
  SHOP_HEADER: 'shopHeader',
66
65
  SHOP_FOOTER: 'shopFooter',
67
66
  SHOP_HOME: 'jshopMain',
68
67
  SHOP_FOLLOW_BTN: 'shopFollowBtn',
69
68
  SHOP_UNFOLLOW_BTN: 'shopUnFollowBtn',
70
69
  NETWORK_ERR: 'networkerr',
71
70
  RANK_LIST_MORE: 'Jx_Terminator_ShopRankListMore',
72
71
  RANK_LIST_TAG: 'Jx_Terminator_ShopRankListTag',
73
72
  RANK_LIST: 'Jx_Terminator_ShopRankList',
74
73
  EXPO_RANK_LIST: 'Jx_Terminator_Expo_shopRankList',
75
74
  [LogEventIds.SHOP_HOME]: 'Jx_Terminator_1620613767283|1',
76
75
  [LogEventIds.SHOP_FOLLOW_BTN]: 'Jx_Terminator_1620613767283|2',
77
76
  [LogEventIds.SHOP_UNFOLLOW_BTN]: 'Jx_Terminator_1620613767283|3',
78
77
  [LogEventIds.NETWORK_ERR]: 'Jx_Terminator_1620613767283|4',
79
78
  [LogEventIds.RANK_LIST_MORE]: 'Jx_Terminator_ShopRankListMore',
80
79
  [LogEventIds.RANK_LIST_TAG]: 'Jx_Terminator_ShopRankListTag',
81
80
  [LogEventIds.RANK_LIST]: 'Jx_Terminator_ShopRankList',
82
81
  [LogEventIds.EXPO_RANK_LIST]: 'Jx_Terminator_Expo_shopRankList',
82
+ export enum LogPnameInfo {
83
83
  HOME = 'home',
84
84
  MEMBER = 'member',
85
85
  CLASSIFY = 'classify',
86
86
  PROMOTION = 'promotion',
87
87
  WX_SHOP_HOME = 'wx_shop_home',
88
88
  APP_SHOP_DETAIL = 'app_Shop_ShopDetail',
89
89
  MOBILE_SEARCH = 'MShop_SearchResult',
90
90
  SALE_VIEW = 'Shop_NewActivity',
91
91
  STOW_SHOP_VIEW = 'Shop_FollowShopMain',
92
92
  APP_SHOP_NEW_PRODUCT = 'Shop_ProductNew',
93
93
  APP_SHOP_NEW_PRODUCT_VIDEO = 'Shop_ProductNewVideo',
94
94
  APP_SHOP_NEW_PRODUCT_PREFERRED_GOODS = 'shop_preferredGoods',
95
95
  APP_SHOP_BUYER_SHOW = 'Shop_ShopBuyerShow',
96
96
  APP_SHOP_CARD = 'Shop_ShopCard',
97
97
  APP_SHOP_MEMBER = 'Shop_ShopMember',
98
98
  APP_SHOP_PAY_MEMBER = 'Shop_PayShopMember',
99
99
  APP_SHOP_CATEGORY = 'Shop_Category',
100
100
  APP_SHOP_SCENE = 'Shop_Scene',
101
101
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
102
102
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
103
103
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
104
104
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
105
105
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
106
106
  APP_SAGE = 'Shop_Person',
107
107
  APP_SAGE_POP = 'Shop_PersionPop',
108
108
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
109
109
  APP_SHOP_RANK = 'Shop_RankingList',
110
110
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
111
111
  APP_SHOP_SERVICE = 'Shop_Service',
112
112
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
113
113
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
114
114
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
115
115
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
116
116
  MOBILE = 'Shop_ShopMain',
117
117
  APP = 'TerminatorNew_All',
118
118
  APP_SAGE = 'Shop_Person',
119
119
  APP_SAGE_POP = 'Shop_PersionPop',
120
120
  WX_JDGW_SHOP = 'W_jdgwxcx_shop',
121
121
  APP_SHOP_DETAIL = 'Shop_ShopDetail',
122
122
  MOBILE_SEARCH = 'MShop_SearchResult',
123
123
  STOW_SHOP_VIEW = 'Shop_FollowShopMain',
124
124
  APP_SHOP_CARD = 'Shop_ShopCard',
125
125
  APP_SHOP_MEMBER = 'Shop_ShopMember',
126
126
  APP_SHOP_PAY_MEMBER = 'Shop_PayShopMember',
127
127
  APP_SHOP_CATEGORY = 'Shop_Category',
128
128
  APP_SHOP_SCENE = 'Shop_Scene',
129
129
  SHOP_MEMBER_EXCHANGE_NEW = 'Shop_ShopMemberExchangedNew',
130
130
  SHOP_MEMBER_RECEIVED = 'Shop_ShopMemberReceived',
131
131
  APP_SHOP_NEW_PRODUCT = 'Shop_ProductNew',
132
132
  APP_SHOP_NEW_PRODUCT_VIDEO = 'Shop_ProductNewVideo',
133
133
  APP_SHOP_NEW_PRODUCT_PREFERRED_GOODS = 'shop_preferredGoods',
134
134
  APP_SHOP_BUYER_SHOW = 'Shop_ShopBuyerShow',
135
135
  SALE_VIEW = 'Shop_NewActivity',
136
136
  SHOP_MEMBER_SCORES = 'Shop_ShopMemberScores',
137
137
  SHOP_MEMBER_SCORE_RULE = 'Shop_ShopMemberScoreRule',
138
138
  SHOP_MEMBER_PRODUCT = 'Shop_ShopMemberProduct',
139
139
  APP_SHOP_APP_SECKILL = 'Shop_SeckillTab',
140
140
  APP_SHOP_RANK = 'Shop_RankingList',
141
141
  APP_SHOP_ACTIVITY = 'Shop_ActivityTab',
142
142
  APP_SHOP_SERVICE = 'Shop_Service',
143
143
  APP_SHOP_CLOSED_SHOP_GUIDE = 'Shop_ClosedShopGuide',
144
144
  APP_USER_SHOP_SALE_POP = 'Shop_SystemUserShopSalePop',
145
145
  SHOP_MEMBER_COUPON = 'Shop_BrandSubCoupon',
146
146
  APP_SHOP_CUSTOM = 'Shop_CustomPage',
147
147
  ACTIVITY_INIT: 'activityInit',
148
148
  SHOP_HEADER: 'shopHeader',
149
149
  SHOP_FOOTER: 'shopFooter',
150
150
  SHOP_HOME: 'jshopMain',
151
151
  SHOP_FOLLOW_BTN: 'shopFollowBtn',
152
152
  SHOP_UNFOLLOW_BTN: 'shopUnFollowBtn',
153
153
  NETWORK_ERR: 'networkerr',
154
154
  RANK_LIST_MORE: 'Jx_Terminator_ShopRankListMore',
155
155
  RANK_LIST_TAG: 'Jx_Terminator_ShopRankListTag',
156
156
  RANK_LIST: 'Jx_Terminator_ShopRankList',
157
157
  EXPO_RANK_LIST: 'Jx_Terminator_Expo_shopRankList',
158
158
  [LogEventIds.SHOP_HOME]: 'Jx_Terminator_1620613767283|1',
159
159
  [LogEventIds.SHOP_FOLLOW_BTN]: 'Jx_Terminator_1620613767283|2',
160
160
  [LogEventIds.SHOP_UNFOLLOW_BTN]: 'Jx_Terminator_1620613767283|3',
161
161
  [LogEventIds.NETWORK_ERR]: 'Jx_Terminator_1620613767283|4',
162
162
  [LogEventIds.RANK_LIST_MORE]: 'Jx_Terminator_ShopRankListMore',
163
163
  [LogEventIds.RANK_LIST_TAG]: 'Jx_Terminator_ShopRankListTag',
164
164
  [LogEventIds.RANK_LIST]: 'Jx_Terminator_ShopRankList',
165
165
  [LogEventIds.EXPO_RANK_LIST]: 'Jx_Terminator_Expo_shopRankList',
166
166
  [LogPageIdInfo.MOBILE]: 'b002165',
167
167
  [LogPageIdInfo.APP]: 'b002165',
168
168
  [LogPageIdInfo.APP_SHOP_CATEGORY]: 'b002489',
169
169
  [LogPageIdInfo.APP_SHOP_MEMBER]: 'b002504',
170
170
  [LogPageIdInfo.SALE_VIEW]: 'b002503',
171
171
  [LogPageIdInfo.APP_SHOP_DETAIL]: 'b002275',
172
172
  [LogPageIdInfo.MOBILE_SEARCH]: 'b002510',
173
173
  TerminatorNew_mPreSell_Expo: 'c00003931.Ter_mPreSell',
174
174
  TerminatorNew_mPreSell_Click: 'c00003931.Ter_mPreSell',
175
175
  TerminatorNew_mDynamicImage_Expo: 'c00003054.Ter_mDynamicImage',
176
176
  TerminatorNew_mDynamicImage_Click: 'c00003054.Ter_mDynamicImage',
177
177
  TerminatorNew_mPromotion_Expo: 'c00003051.Ter_mPromotion',
178
178
  TerminatorNew_mPromotion_Click: 'c00003051.Ter_mPromotion',
179
179
  TerminatorNew_TabSeriousWare_Tab_Expo: 'c00003049.Ter_mCollectionTab',
180
180
  TerminatorNew_TabSeriousWare_Tab_Click: 'c00003049.Ter_mCollectionTab',
181
181
  TerminatorNew_TabSeriousWare_Sku_Expo: 'c00003049.Ter_mCollectionSku',
182
182
  TerminatorNew_TabSeriousWare_Sku_Click: 'c00003049.Ter_mCollectionSku',
183
183
  TerminatorNew_TabSeriousWare_Pic_Expo: 'c00003049.Ter_CollectionImgs',
184
184
  TerminatorNew_TabSeriousWare_Pic_Click: 'c00003049.Ter_CollectionImgs',
185
185
  TerminatorNew_SgCoupon_Expo: 'c00003048.Ter_mSgCoupon',
186
186
  TerminatorNew_SgCoupon_Click: 'c00003048.Ter_mSgCoupon',
187
187
  TerminatorNew_smartNewProduct_Expo: 'c00003047.Ter_smartNewProduct',
188
188
  TerminatorNew_smartNewProduct_Click: 'c00003047.Ter_smartNewProduct',
189
189
  TerminatorNew_mMainPushNewProducts_Expo: 'c00003047.Ter_mFeaturedPickSku',
190
190
  TerminatorNew_mMainPushNewProducts_Click: 'c00003047.Ter_mFeaturedPickSku',
191
191
  TerminatorNew_smartPromoSku_Expo: 'c00003046.Ter_smartPromoSku',
192
192
  TerminatorNew_smartPromoSku_Click: 'c00003046.Ter_smartPromoSku',
193
193
  TerminatorNew_smartCoupon_Expo: 'c00003016.Ter_smartCoupon',
194
194
  TerminatorNew_smartCoupon_Click: 'c00003016.Ter_smartCoupon',
195
195
  TerminatorNew_smartNav_Expo: 'c00003013.Ter_smartNav',
196
196
  TerminatorNew_smartNav_Click: 'c00003013.Ter_smartNav',
197
197
  TerminatorNew_IsvModule_Expo: 'c00002955.Ter_IsvModule',
198
198
  TerminatorNew_IsvModule_Click: 'c00002955.Ter_IsvModule',
199
199
  TerminatorNew_mBanner_Expo: 'c00002954.Ter_mBanner',
200
200
  TerminatorNew_mBanner_Click: 'c00002954.Ter_mBanner',
201
201
  TerminatorNew_shopRankList_Expo: 'c00002953.Ter_shopRankList',
202
202
  TerminatorNew_shopRankList_Click: 'c00002953.Ter_shopRankList',
203
203
  TerminatorNew_mVideo_Expo: 'c00002952.Ter_mVideo',
204
204
  TerminatorNew_mVideo_Click: 'c00002952.Ter_mVideo',
205
205
  TerminatorNew_mCoupon_Expo: 'c00002951.Ter_mCoupon',
206
206
  TerminatorNew_mCoupon_Click: 'c00002951.Ter_mCoupon',
207
207
  TerminatorNew_mPictureHotspot_Expo: 'c00002950.Ter_mPictureHotspot',
208
208
  TerminatorNew_mPictureHotspot_Click: 'c00002950.Ter_mPictureHotspot',
209
209
  TerminatorNew_smartUnionProduct_Expo: 'c00002949.Ter_smartProduct',
210
210
  TerminatorNew_smartUnionProduct_Click: 'c00002949.Ter_smartProduct',
211
211
  TerminatorNew_mICommonGood_Expo: 'c00002949.Ter_mICommonGood',
212
212
  TerminatorNew_mICommonGood_Click: 'c00002949.Ter_mICommonGood',
213
213
  TerminatorNew_smartHotSaleProduct_Expo: 'c00002948.Ter_mHotSaleProduct',
214
214
  TerminatorNew_smartHotSaleProduct_Click: 'c00002948.Ter_mHotSaleProduct',
215
215
  TerminatorNew_smartSecondCate_Expo: 'c00002947.Ter_smartSecondCate',
216
216
  TerminatorNew_smartSecondCate_Click: 'c00002947.Ter_smartSecondCate',
217
217
  TerminatorNew_recfeedsku_Expo: 'c00002946.Ter_RecfeedSku',
218
218
  TerminatorNew_recfeedsku_Click: 'c00002946.Ter_RecfeedSku',
219
219
  TerminatorNew_recfeedskuAddCart_Click: 'c00002946.Ter_RecfeedAddCart',
220
220
  TerminatorNew_mMemberSprint_Expo: 'c00003930.Ter_mMemberSprint',
221
221
  TerminatorNew_mMemberSprint_Click: 'c00003930.Ter_mMemberSprint',
222
222
  TerminatorNew_mShopMembers_Expo: 'c00003929.Ter_mShopMembers',
223
223
  TerminatorNew_mShopMembers_Click: 'c00003929.Ter_mShopMembers',
224
224
  ShopDetail_Follow: 'c00004094.ShopDetail_Follow',
225
225
  ShopDetail_Share: 'c00004094.ShopDetail_Share',
226
226
  ShopDetail_QRcode: 'c00004095.ShopDetail_QRcode',
227
227
  ShopDetail_Licence: 'c00004095.ShopDetail_Licence',
228
228
  ShopDetail_AllProducts: 'c00004096.ShopDetail_AllSku',
229
229
  Shop_Category_skuexpo: 'c00004041.Shop_Category_sku',
230
230
  Shop_Category_sku: 'c00004041.Shop_Category_sku',
231
231
  Shop_Category_sortbtn: 'c00004041.Shop_Category_sort',
232
232
  Shop_Category_skuaddcart: 'c00004041.Shop_Category_addcar',
233
233
  Shop_Category_LV1: 'c00004041.Shop_Category_LV1',
234
234
  Shop_Category_LV2: 'c00004041.Shop_Category_LV2',
235
235
  Terminator_New_Mobile_Shop_listCategorySku_Click: 'c00004041.Ter_listCategorySku',
236
236
  Terminator_New_Mobile_Shop_listCategoryShowAllSku_Click: 'c00004041.Ter_listCateAllSku',
237
237
  Terminator_New_Mobile_Shop_listCategoryLV1_Click: 'c00004041.Ter_listCategoryLV1',
238
238
  Terminator_New_Mobile_Shop_navCategoryLV2_Click: 'c00004041.Ter_navCategoryLV2',
239
239
  Terminator_New_Mobile_Shop_navCategoryLV1_Click: 'c00004041.Ter_navCategoryLV1',
240
240
  MShop_ResultProduct: 'c00004120.MShop_ResultProduct',
241
241
  Terminator_New_Mobile_Shop_tab_Click: 'c00004040.Ter_Shoptab',
@@ -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, ...otherParam } = opts;
23
22
  getReportObjReadyPromise()
24
23
  .then(() => {
25
24
  const pv = new MPing.inputs.PV({
26
25
  page_id: pageId,
27
26
  });
28
27
  pv.page_param = pageParam;
29
28
  otherParam &&
30
29
  Object.keys(otherParam).forEach((key) => {
31
30
  pv[key] = otherParam[key];
32
31
  });
33
32
  if (isSend) {
34
33
  const mping = new MPing();
35
34
  mping.send(pv);
36
35
  setTimeout(() => resolve(true), 200);
37
36
  }
38
37
  })
39
38
  .catch((e) => {
40
39
  reject(e);
41
40
  });
42
41
  }).catch((err) => {
43
42
  console.log('上报异常', err);
44
43
  sgmCustomReport({
45
44
  code: 'reportErr',
46
45
  msg:
47
46
  '埋点js加载异常,导致MPing不存在,pv具体上报参数如下==>' +
48
47
  JSON.stringify(opts) +
49
48
  '==异常参数说明==>' +
50
49
  err,
51
50
  });
52
51
  });
53
52
  return new Promise((resolve, reject) => {
54
53
  const {
55
54
  eid,
56
55
  eparam,
57
56
  jsonParam,
58
57
  pageParam,
59
58
  flowMapParam = {},
60
59
  elevel,
61
60
  isExpo = false,
62
61
  target = null,
63
62
  pageId = 'TerminatorNew_All',
64
63
  } = opts;
65
64
  getReportObjReadyPromise()
66
65
  .then(() => {
67
66
  const click = new MPing.inputs.Click(eid, {
68
67
  isExpo,
69
68
  target,
70
69
  ...flowMapParam,
71
70
  });
72
71
  click.json_param = jsonParam;
73
72
  if (eparam) {
74
73
  click.event_param = jsonParam;
75
74
  }
76
75
  click.page_id = pageId;
77
76
  click.page_name = pageName;
78
77
  pageParam && (click.page_param = pageParam);
79
78
  elevel && (click.event_level = elevel);
80
79
  click.updateEventSeries();
81
80
  new MPing().send(click);
82
81
  setTimeout(() => resolve(true), 200);
83
82
  })
84
83
  .catch((e) => {
85
84
  reject(e);
86
85
  });
87
86
  }).catch((err) => {
88
87
  console.log('上报异常', err);
89
88
  sgmCustomReport({
90
89
  code: 'reportErr',
91
90
  msg:
92
91
  '埋点js加载异常,导致MPing不存在,点击或者曝光具体上报参数如下==>' +
93
92
  JSON.stringify(opts) +
94
93
  '==异常参数说明==>' +
95
94
  err,
96
95
  });
97
96
  });
98
97
  const { jsonParam } = webLogParams;
99
98
  const { skuId } = opts;
100
99
  if (jsonParam && skuId) {
101
100
  try {
102
101
  let jsonObj = JSON.parse(jsonParam);
103
102
  jsonObj['skuid'] = skuId + '';
104
103
  webLogParams.jsonParam = JSON.stringify(jsonObj);
105
104
  } catch (e) {
106
105
  console.log(e);
107
106
  }
108
107
  }
109
108
  return reportClick(webLogParams);
109
+ import { sgmCustomReport } from '../../utils';
110
110
  new Promise((resolve, reject) => {
111
111
  if (window.MPing) {
112
112
  resolve(true);
113
113
  } else {
114
114
  if (isReportReadyError) {
115
115
  reject(false);
116
116
  } else {
117
117
  ready('MPing', 3000)
118
118
  .then(() => {
119
119
  isReportReadyError = false;
120
120
  resolve(true);
121
121
  })
122
122
  .catch(() => {
123
123
  isReportReadyError = true;
124
124
  reject(false);
125
125
  });
126
126
  }
127
127
  }
128
128
  });
129
129
  return new Promise((resolve, reject) => {
130
130
  const { pageId, pageParam, pTag, isSend = true, ...otherParam } = opts;
131
131
  getReportObjReadyPromise()
132
132
  .then(() => {
133
133
  let pvObj: any = null;
134
134
  if (shopSpmBforMap[pageId]) {
135
135
  pvObj = new MPing.inputs.SpmPV({
136
136
  spm: `${shopSpmA}.${shopSpmBforMap[pageId]}`,
137
137
  page_id: pageId,
138
138
  page_param: pageParam,
139
139
  ...otherParam,
140
140
  });
141
141
  } else {
142
142
  pvObj = new MPing.inputs.PV({
143
143
  page_id: pageId,
144
144
  });
145
145
  pvObj.page_param = pageParam;
146
146
  otherParam &&
147
147
  Object.keys(otherParam).forEach((key) => {
148
148
  pvObj[key] = otherParam[key];
149
149
  });
150
150
  }
151
151
  if (isSend) {
152
152
  const mping = new MPing();
153
153
  mping.send(pvObj);
154
154
  setTimeout(() => resolve(true), 200);
155
155
  }
156
156
  })
157
157
  .catch((e) => {
158
158
  reject(e);
159
159
  });
160
160
  }).catch((err) => {
161
161
  console.log('上报异常', err);
162
162
  sgmCustomReport({
163
163
  code: 'reportErr',
164
164
  msg:
165
165
  '埋点js加载异常,导致MPing不存在,pv具体上报参数如下==>' +
166
166
  JSON.stringify(opts) +
167
167
  '==异常参数说明==>' +
168
168
  err,
169
169
  });
170
170
  });
171
171
  return new Promise((resolve, reject) => {
172
172
  const {
173
173
  eid,
174
174
  eparam,
175
175
  jsonParam,
176
176
  pageParam,
177
177
  flowMapParam = {},
178
178
  elevel,
179
179
  isExpo = false,
180
180
  target = null,
181
181
  pageId = 'TerminatorNew_All',
182
182
  } = opts;
183
183
  getReportObjReadyPromise()
184
184
  .then(() => {
185
185
  let clickObj: any = null;
186
186
  if (shopSpmCDforCode[eid] && shopSpmBforMap[pageId]) {
187
187
  const getSpmParams = {
188
188
  target,
189
189
  spm: `${shopSpmA}.${shopSpmBforMap[pageId]}.${shopSpmCDforCode[eid]}`,
190
190
  event_id: eid,
191
191
  page_id: pageId,
192
192
  page_name: pageName,
193
193
  json_param: jsonParam,
194
194
  ...flowMapParam,
195
195
  };
196
196
  eparam && (getSpmParams['event_param'] = jsonParam);
197
197
  pageParam && (getSpmParams['page_param'] = pageParam);
198
198
  isExpo && (getSpmParams['ma_switch_type'] = '1');
199
199
  clickObj = isExpo
200
200
  ? new MPing.inputs.SpmExposure(getSpmParams)
201
201
  : new MPing.inputs.SpmClick(getSpmParams);
202
202
  } else {
203
203
  clickObj = new MPing.inputs.Click(eid, {
204
204
  isExpo,
205
205
  target,
206
206
  ...flowMapParam,
207
207
  });
208
208
  clickObj.json_param = jsonParam;
209
209
  if (eparam) {
210
210
  clickObj.event_param = jsonParam;
211
211
  }
212
212
  clickObj.page_id = pageId;
213
213
  clickObj.page_name = pageName;
214
214
  pageParam && (clickObj.page_param = pageParam);
215
215
  elevel && (clickObj.event_level = elevel);
216
216
  clickObj.updateEventSeries();
217
217
  }
218
218
  clickObj && new MPing().send(clickObj);
219
219
  setTimeout(() => resolve(true), 200);
220
220
  })
221
221
  .catch((e) => {
222
222
  reject(e);
223
223
  });
224
224
  }).catch((err) => {
225
225
  console.log('上报异常', err);
226
226
  sgmCustomReport({
227
227
  code: 'reportErr',
228
228
  msg:
229
229
  '埋点js加载异常,导致MPing不存在,点击或者曝光具体上报参数如下==>' +
230
230
  JSON.stringify(opts) +
231
231
  '==异常参数说明==>' +
232
232
  err,
233
233
  });
234
234
  });
235
235
  const { jsonParam } = webLogParams;
236
236
  const { skuId } = opts;
237
237
  if (jsonParam && skuId) {
238
238
  try {
239
239
  let jsonObj = JSON.parse(jsonParam);
240
240
  jsonObj['skuid'] = skuId + '';
241
241
  webLogParams.jsonParam = JSON.stringify(jsonObj);
242
242
  } catch (e) {
243
243
  console.log(e);
244
244
  }
245
245
  }
246
246
  return reportClick(webLogParams);