@conecli/cone-render 0.10.1-shop3.44 → 0.10.1-shop3.45

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 { Button, View } from '@tarojs/components';
2
1
  NetWorkErrorList,
3
2
  NetWorkErrorTip,
4
3
  NetWorkErrorSubTip,
5
4
  NetWorkShowType,
6
5
  NetWork_Image_Type,
7
6
  NetWorkStyleType,
8
7
  const {
9
8
  className = '',
10
9
  message = '',
11
10
  subMessage = '',
12
11
  btnLabel = global?.languageJsonData?.reload || '重新加载',
13
12
  backgroundColorWhite = false,
14
13
  netWorkDataType = NETWORK_DATA_TYPE.NORMAL,
15
14
  netWorkShowType = NetWorkShowType.FULL,
16
15
  netWorkImageType = NetWork_Image_Type.No_Data_Default_Tip,
17
16
  netWorkStyleType = NetWorkStyleType.OLD,
18
17
  refreshCallBackFn = null,
19
18
  viewMaxHeight = '',
20
19
  noPosition = false,
21
20
  } = props;
22
21
  const refershInitData = useCallback(() => {
23
22
  refreshCallBackFn && refreshCallBackFn(true);
24
23
  }, []);
25
24
  const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType];
26
25
  const useErrorSubTip = subMessage
27
26
  ? subMessage
28
27
  : message != ''
29
28
  ? ''
30
29
  : NetWorkErrorSubTip[netWorkDataType];
31
30
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {};
32
31
  const maxHeight = latestRes.displayHeight || 546;
33
32
  return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
34
33
  <View
35
34
  style={{
36
35
  maxHeight: viewMaxHeight !== '' ? viewMaxHeight : isMemberPage ? '100vh' : maxHeight,
37
36
  }}
38
37
  className={classNames(
39
38
  netWorkErrorStyle['d-shop-network'],
40
39
  {
41
40
  [netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
42
41
  },
43
42
  {
44
43
  [netWorkErrorStyle['d-shop-network-part']]: netWorkShowType === NetWorkShowType.PART,
45
44
  },
46
45
  {
47
46
  [netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
48
47
  },
49
48
  {
50
49
  [netWorkErrorStyle['d-shop-network-no-position']]: noPosition,
51
50
  },
52
51
  'flexible-center-box',
53
52
  className,
54
53
  )}
55
54
  >
56
55
  <View
57
56
  className={classNames(
58
57
  netWorkErrorStyle['d-error-content'],
59
58
  netWorkErrorStyle[`d-${netWorkStyleType}-style-content`],
60
59
  'd-error-content',
61
60
  )}
62
61
  >
63
62
  <View
64
63
  className={classNames(
65
64
  netWorkErrorStyle['d-error-type'],
66
65
  netWorkErrorStyle[`d-${netWorkDataType}`],
67
66
  netWorkErrorStyle[`d-${netWorkImageType}`],
68
67
  'd-error-type',
69
68
  )}
70
69
  />
71
70
  <View
72
71
  className={classNames(
73
72
  netWorkErrorStyle['d-error-tip'],
74
73
  netWorkErrorStyle[`d-${netWorkDataType}-tip`],
75
74
  'd-error-tip',
76
75
  )}
77
76
  >
78
77
  {useErrorTip}
79
78
  </View>
80
79
  {useErrorSubTip ? (
81
80
  <View
82
81
  className={classNames(
83
82
  netWorkErrorStyle['d-error-sub-tip'],
84
83
  netWorkErrorStyle[`d-${netWorkDataType}-sub-tip`],
85
84
  'd-error-sub-tip',
86
85
  )}
87
86
  >
88
87
  {useErrorSubTip}
89
88
  </View>
90
89
  ) : null}
91
90
  <View className={'flexible-horizontal-center-box'}>
92
91
  {refreshCallBackFn && (
93
92
  <Button
94
93
  onClick={refershInitData}
95
94
  className={classNames(
96
95
  netWorkErrorStyle['d-opt-btn'],
97
96
  'd-button-no-border',
98
97
  'd-opt-btn',
99
98
  )}
100
99
  plain
101
100
  size="mini"
102
101
  >
103
102
  {btnLabel}
104
103
  </Button>
105
104
  )}
106
105
  </View>
107
106
  </View>
108
107
  </View>
109
108
  ) : null;
109
+ import { Button, View } from '@tarojs/components';
110
110
  NetWorkErrorList,
111
111
  NetWorkErrorTip,
112
112
  NetWorkErrorSubTip,
113
113
  NetWorkShowType,
114
114
  NetWork_Image_Type,
115
115
  NetWorkStyleType,
116
116
  const {
117
117
  className = '',
118
118
  message = '',
119
119
  subMessage = '',
120
120
  btnLabel = global?.languageJsonData?.reload || '重新加载',
121
121
  backgroundColorWhite = false,
122
122
  netWorkDataType = NETWORK_DATA_TYPE.NORMAL,
123
123
  netWorkShowType = NetWorkShowType.FULL,
124
124
  netWorkImageType = NetWork_Image_Type.No_Data_Default_Tip,
125
125
  netWorkStyleType = NetWorkStyleType.OLD,
126
126
  refreshCallBackFn = null,
127
127
  viewMaxHeight = '',
128
128
  noPosition = false,
129
129
  } = props;
130
130
  const refershInitData = useCallback(() => {
131
131
  refreshCallBackFn && refreshCallBackFn(true);
132
132
  }, []);
133
133
  const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType];
134
134
  const useErrorSubTip = subMessage
135
135
  ? subMessage
136
136
  : message != ''
137
137
  ? ''
138
138
  : NetWorkErrorSubTip[netWorkDataType];
139
139
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {};
140
140
  const onePlusOneBottomPlaceHeight = global.info?.sysInfo?.onePlusOneBottomPlaceHeight
141
141
  ? global.info?.sysInfo?.onePlusOneBottomPlaceHeight + 20
142
142
  : 0;
143
143
  const maxHeight = latestRes.displayHeight || onePlusOneBottomPlaceHeight + 546;
144
144
  return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
145
145
  <View
146
146
  style={{
147
147
  maxHeight: viewMaxHeight !== '' ? viewMaxHeight : isMemberPage ? '100vh' : maxHeight,
148
148
  }}
149
149
  className={classNames(
150
150
  netWorkErrorStyle['d-shop-network'],
151
151
  {
152
152
  [netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
153
153
  },
154
154
  {
155
155
  [netWorkErrorStyle['d-shop-network-part']]: netWorkShowType === NetWorkShowType.PART,
156
156
  },
157
157
  {
158
158
  [netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
159
159
  },
160
160
  {
161
161
  [netWorkErrorStyle['d-shop-network-no-position']]: noPosition,
162
162
  },
163
163
  'flexible-center-box',
164
164
  className,
165
165
  )}
166
166
  >
167
167
  <View
168
168
  className={classNames(
169
169
  netWorkErrorStyle['d-error-content'],
170
170
  netWorkErrorStyle[`d-${netWorkStyleType}-style-content`],
171
171
  'd-error-content',
172
172
  )}
173
173
  >
174
174
  <View
175
175
  className={classNames(
176
176
  netWorkErrorStyle['d-error-type'],
177
177
  netWorkErrorStyle[`d-${netWorkDataType}`],
178
178
  netWorkErrorStyle[`d-${netWorkImageType}`],
179
179
  'd-error-type',
180
180
  )}
181
181
  />
182
182
  <View
183
183
  className={classNames(
184
184
  netWorkErrorStyle['d-error-tip'],
185
185
  netWorkErrorStyle[`d-${netWorkDataType}-tip`],
186
186
  'd-error-tip',
187
187
  )}
188
188
  >
189
189
  {useErrorTip}
190
190
  </View>
191
191
  {useErrorSubTip ? (
192
192
  <View
193
193
  className={classNames(
194
194
  netWorkErrorStyle['d-error-sub-tip'],
195
195
  netWorkErrorStyle[`d-${netWorkDataType}-sub-tip`],
196
196
  'd-error-sub-tip',
197
197
  )}
198
198
  >
199
199
  {useErrorSubTip}
200
200
  </View>
201
201
  ) : null}
202
202
  <View className={'flexible-horizontal-center-box'}>
203
203
  {refreshCallBackFn && (
204
204
  <Button
205
205
  onClick={refershInitData}
206
206
  className={classNames(
207
207
  netWorkErrorStyle['d-opt-btn'],
208
208
  'd-button-no-border',
209
209
  'd-opt-btn',
210
210
  )}
211
211
  plain
212
212
  size="mini"
213
213
  >
214
214
  {btnLabel}
215
215
  </Button>
216
216
  )}
217
217
  </View>
218
218
  </View>
219
219
  </View>
220
220
  ) : null;
@@ -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
  let pvObj: any = null;
26
25
  if (shopSpmBforMap[pageId]) {
27
26
  pvObj = new MPing.inputs.SpmPV({
28
27
  spm: `${shopSpmA}.${shopSpmBforMap[pageId]}`,
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
  } = opts;
75
74
  getReportObjReadyPromise()
76
75
  .then(() => {
77
76
  let clickObj: any = null;
78
77
  if (shopSpmCDforCode[eid] && shopSpmBforMap[pageId]) {
79
78
  const getSpmParams = {
80
79
  target,
81
80
  spm: `${shopSpmA}.${shopSpmBforMap[pageId]}.${shopSpmCDforCode[eid]}`,
82
81
  event_id: eid,
83
82
  page_id: pageId,
84
83
  page_name: pageName,
85
84
  json_param: jsonParam,
86
85
  ...flowMapParam,
87
86
  };
88
87
  eparam && (getSpmParams['event_param'] = jsonParam);
89
88
  pageParam && (getSpmParams['page_param'] = pageParam);
90
89
  isExpo && (getSpmParams['ma_switch_type'] = '1');
91
90
  clickObj = isExpo
92
91
  ? new MPing.inputs.SpmExposure(getSpmParams)
93
92
  : new MPing.inputs.SpmClick(getSpmParams);
94
93
  } else {
95
94
  clickObj = new MPing.inputs.Click(eid, {
96
95
  isExpo,
97
96
  target,
98
97
  ...flowMapParam,
99
98
  });
100
99
  clickObj.json_param = jsonParam;
101
100
  if (eparam) {
102
101
  clickObj.event_param = jsonParam;
103
102
  }
104
103
  clickObj.page_id = pageId;
105
104
  clickObj.page_name = pageName;
106
105
  pageParam && (clickObj.page_param = pageParam);
107
106
  elevel && (clickObj.event_level = elevel);
108
107
  clickObj.updateEventSeries();
109
108
  }
110
109
  clickObj && new MPing().send(clickObj);
111
110
  setTimeout(() => resolve(true), 200);
112
111
  })
113
112
  .catch((e) => {
114
113
  reject(e);
115
114
  });
116
115
  }).catch((err) => {
117
116
  console.log('上报异常', err);
118
117
  sgmCustomReport({
119
118
  code: 'reportErr',
120
119
  msg:
121
120
  '埋点js加载异常,导致MPing不存在,点击或者曝光具体上报参数如下==>' +
122
121
  JSON.stringify(opts) +
123
122
  '==异常参数说明==>' +
124
123
  err,
125
124
  });
126
125
  });
127
126
  const { jsonParam } = webLogParams;
128
127
  const { skuId } = opts;
129
128
  if (jsonParam && skuId) {
130
129
  try {
131
130
  let jsonObj = JSON.parse(jsonParam);
132
131
  jsonObj['skuid'] = skuId + '';
133
132
  webLogParams.jsonParam = JSON.stringify(jsonObj);
134
133
  } catch (e) {
135
134
  console.log(e);
136
135
  }
137
136
  }
138
137
  return reportClick(webLogParams);
138
+ import { sgmCustomReport } from '../../utils';
139
139
  new Promise((resolve, reject) => {
140
140
  if (window.MPing) {
141
141
  resolve(true);
142
142
  } else {
143
143
  if (isReportReadyError) {
144
144
  reject(false);
145
145
  } else {
146
146
  ready('MPing', 3000)
147
147
  .then(() => {
148
148
  isReportReadyError = false;
149
149
  resolve(true);
150
150
  })
151
151
  .catch(() => {
152
152
  isReportReadyError = true;
153
153
  reject(false);
154
154
  });
155
155
  }
156
156
  }
157
157
  });
158
158
  return new Promise((resolve, reject) => {
159
159
  const { pageId, pageParam, pTag, isSend = true, spmAllCode, spmCodeForB, ...otherParam } = opts;
160
160
  getReportObjReadyPromise()
161
161
  .then(() => {
162
162
  let pvObj: any = null;
163
163
  if (spmAllCode || shopSpmBforMap[pageId] || spmCodeForB) {
164
164
  pvObj = new MPing.inputs.SpmPV({
165
165
  spm: spmAllCode || `${shopSpmA}.${shopSpmBforMap[pageId] || spmCodeForB}`,
166
166
  page_id: pageId,
167
167
  page_param: pageParam,
168
168
  ...otherParam,
169
169
  });
170
170
  } else {
171
171
  pvObj = new MPing.inputs.PV({
172
172
  page_id: pageId,
173
173
  });
174
174
  pvObj.page_param = pageParam;
175
175
  otherParam &&
176
176
  Object.keys(otherParam).forEach((key) => {
177
177
  pvObj[key] = otherParam[key];
178
178
  });
179
179
  }
180
180
  if (isSend) {
181
181
  const mping = new MPing();
182
182
  mping.send(pvObj);
183
183
  setTimeout(() => resolve(true), 200);
184
184
  }
185
185
  })
186
186
  .catch((e) => {
187
187
  reject(e);
188
188
  });
189
189
  }).catch((err) => {
190
190
  console.log('上报异常', err);
191
191
  sgmCustomReport({
192
192
  code: 'reportErr',
193
193
  msg:
194
194
  '埋点js加载异常,导致MPing不存在,pv具体上报参数如下==>' +
195
195
  JSON.stringify(opts) +
196
196
  '==异常参数说明==>' +
197
197
  err,
198
198
  });
199
199
  });
200
200
  return new Promise((resolve, reject) => {
201
201
  const {
202
202
  eid,
203
203
  eparam,
204
204
  jsonParam,
205
205
  pageParam,
206
206
  flowMapParam = {},
207
207
  elevel,
208
208
  isExpo = false,
209
209
  target = null,
210
210
  pageId = 'TerminatorNew_All',
211
211
  spmAllCode,
212
212
  spmCodeForCD,
213
213
  } = opts;
214
214
  getReportObjReadyPromise()
215
215
  .then(() => {
216
216
  let clickObj: any = null;
217
217
  if (spmAllCode || (shopSpmBforMap[pageId] && (shopSpmCDforCode[eid] || spmCodeForCD))) {
218
218
  const getSpmParams = {
219
219
  target,
220
220
  spm:
221
221
  spmAllCode ||
222
222
  `${shopSpmA}.${shopSpmBforMap[pageId]}.${shopSpmCDforCode[eid] || spmCodeForCD}`,
223
223
  event_id: eid,
224
224
  page_id: pageId,
225
225
  page_name: pageName,
226
226
  json_param: jsonParam,
227
227
  ...flowMapParam,
228
228
  };
229
229
  eparam && (getSpmParams['event_param'] = jsonParam);
230
230
  pageParam && (getSpmParams['page_param'] = pageParam);
231
231
  isExpo && (getSpmParams['ma_switch_type'] = '1');
232
232
  clickObj = isExpo
233
233
  ? new MPing.inputs.SpmExposure(getSpmParams)
234
234
  : new MPing.inputs.SpmClick(getSpmParams);
235
235
  } else {
236
236
  clickObj = new MPing.inputs.Click(eid, {
237
237
  isExpo,
238
238
  target,
239
239
  ...flowMapParam,
240
240
  });
241
241
  clickObj.json_param = jsonParam;
242
242
  if (eparam) {
243
243
  clickObj.event_param = jsonParam;
244
244
  }
245
245
  clickObj.page_id = pageId;
246
246
  clickObj.page_name = pageName;
247
247
  pageParam && (clickObj.page_param = pageParam);
248
248
  elevel && (clickObj.event_level = elevel);
249
249
  clickObj.updateEventSeries();
250
250
  }
251
251
  clickObj && new MPing().send(clickObj);
252
252
  setTimeout(() => resolve(true), 200);
253
253
  })
254
254
  .catch((e) => {
255
255
  reject(e);
256
256
  });
257
257
  }).catch((err) => {
258
258
  console.log('上报异常', err);
259
259
  sgmCustomReport({
260
260
  code: 'reportErr',
261
261
  msg:
262
262
  '埋点js加载异常,导致MPing不存在,点击或者曝光具体上报参数如下==>' +
263
263
  JSON.stringify(opts) +
264
264
  '==异常参数说明==>' +
265
265
  err,
266
266
  });
267
267
  });
268
268
  const { jsonParam } = webLogParams;
269
269
  const { skuId } = opts;
270
270
  if (jsonParam && skuId) {
271
271
  try {
272
272
  let jsonObj = JSON.parse(jsonParam);
273
273
  jsonObj['skuid'] = skuId + '';
274
274
  webLogParams.jsonParam = JSON.stringify(jsonObj);
275
275
  } catch (e) {
276
276
  console.log(e);
277
277
  }
278
278
  }
279
279
  return reportClick(webLogParams);