@conecli/cone-render 0.9.1-shop2.1 → 0.9.1-shop2.3

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 {
2
1
  isApp,
3
2
  isIOS,
4
3
  getAppVersion,
5
4
  version,
6
5
  getUUID,
7
6
  getUrlQuery,
8
7
  assign,
9
8
  isString,
10
9
  isObject,
11
10
  serialize,
12
11
  isAndroid, versionCompare,
13
12
  CHANNEL_TYPE,
14
13
  JDShopViewBusinessPathType,
15
14
  JDShopViewBusinessPathList,
16
15
  SECTION_HOME_TAB_NAME_TYPE,
17
16
  SECTION_HOME_TAB_TYPE,
18
17
  parseQueryUrlString(window?.location?.href ?? ''),
19
18
  try {
20
19
  return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
21
20
  } catch (e) {
22
21
  return {}
23
22
  }
24
23
  isWxMiniH5View && urlCookie['wxapp_type'] == '1'
25
24
  if (isJdApp) {
26
25
  isIosDevice
27
26
  ? e && e.stopPropagation()
28
27
  : androidDeviceStopNativeScrollEvent(state)
29
28
  }
30
29
  isJdApp &&
31
30
  isAndroidDevice &&
32
31
  window?.JdAndroid &&
33
32
  window?.JdAndroid.requestEvent(state)
34
33
  if (isH5AndJdShopView) {
35
34
  return (
36
35
  CHANNEL_TYPE[currentChannel] ||
37
36
  CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
38
37
  )
39
38
  }
40
39
  return null
41
40
  isH5 && ['/app/home', '/app/classify', '/member/shopcard'].includes(urlPathname)
42
41
  const getCustomObj = {
43
42
  type: 1,
44
43
  code: 'all',
45
44
  cost1: 1,
46
45
  ...customObj
47
46
  }
48
47
  try {
49
48
  window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
50
49
  } catch (e) {}
50
+ import {
51
51
  isApp,
52
52
  isIOS,
53
53
  getAppVersion,
54
54
  version,
55
55
  getUUID,
56
56
  getUrlQuery,
57
57
  assign,
58
58
  isString,
59
59
  isObject,
60
60
  serialize,
61
61
  isAndroid, versionCompare,
62
62
  CHANNEL_TYPE,
63
63
  JDShopViewBusinessPathType,
64
64
  JDShopViewBusinessPathList,
65
65
  SECTION_HOME_TAB_NAME_TYPE,
66
66
  SECTION_HOME_TAB_TYPE,
67
67
  parseQueryUrlString(window?.location?.href ?? ''),
68
68
  try {
69
69
  return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
70
70
  } catch (e) {
71
71
  return {}
72
72
  }
73
73
  isWxMiniH5View && urlCookie['wxapp_type'] == '1'
74
74
  if (isJdApp) {
75
75
  isIosDevice
76
76
  ? e && e.stopPropagation()
77
77
  : androidDeviceStopNativeScrollEvent(state)
78
78
  }
79
79
  isJdApp &&
80
80
  isAndroidDevice &&
81
81
  window?.JdAndroid &&
82
82
  window?.JdAndroid.requestEvent(state)
83
83
  if (isH5AndJdShopView) {
84
84
  return (
85
85
  CHANNEL_TYPE[currentChannel] ||
86
86
  CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
87
87
  )
88
88
  }
89
89
  return null
90
90
  isH5 && ['/app/home', '/app/classify', '/app/newProduct', '/member/shopcard'].includes(urlPathname)
91
91
  const getCustomObj = {
92
92
  type: 1,
93
93
  code: 'all',
94
94
  cost1: 1,
95
95
  ...customObj
96
96
  }
97
97
  try {
98
98
  window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
99
99
  } catch (e) {}
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  nativePageShowToast, ToastAndroidType,
3
2
  ToastIosType,
4
3
  getAppChannelType, isAndroidDevice, isH5AndJdShopView, isChartH5,
5
4
  isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
6
5
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
7
6
  sgmCustomReport, isMemberPage, isH5AndJdShopViewH5Scroll, isAppClassifyPage
8
7
  addHttps,
9
8
  clearTaroStorageKey,
10
9
  countStringify,
11
10
  dateFormat,
12
11
  dealAddress,
13
12
  dealShopContentData as originDealShopContentData,
14
13
  debounce,
15
14
  filterUrlQueryData,
16
15
  formatTabActiveMenuType,
17
16
  getQualityImage,
18
17
  getTaroStorageKeyValue,
19
18
  getWxAppCookieStr,
20
19
  isH5,
21
20
  isJdMin,
22
21
  isWxMin,
23
22
  isWxMinAndWxapp,
24
23
  lodashThrottle,
25
24
  objectToUrlEncode,
26
25
  parseQueryUrlString,
27
26
  removeTaroStorageKey,
28
27
  setLowSmallPicUrl,
29
28
  setTaroStorage,
30
29
  showFailToast,
31
30
  showNormalToast,
32
31
  showSuccessToast,
33
32
  sliceArrToChunkList,
34
33
  throttle,
35
34
  windowWidth: window.innerWidth,
36
35
  containerWidth: buildType === BUILD_TYPE.CLASSIFY ? window.innerWidth - 100 : window.innerWidth,
37
36
  screenWidth: window.innerWidth,
38
37
  platform: '',
39
38
  model: '',
40
39
  system: '',
41
40
  getSystemInfo.windowWidth = getSystemInfo.screenWidth
42
41
  getSystemInfo['containerWidth'] = buildType === BUILD_TYPE.CLASSIFY ? getSystemInfo.screenWidth - 100 : getSystemInfo.screenWidth
43
42
  const params = Object.assign(
44
43
  {},
45
44
  {
46
45
  title: '',
47
46
  duration: 1500,
48
47
  },
49
48
  options,
50
49
  )
51
50
  params.duration = params.duration / 1000
52
51
  if (isJdApp && isH5AndJdShopView) {
53
52
  const showSuccessType = isIosDevice
54
53
  ? ToastIosType.SUCCESS
55
54
  : ToastAndroidType.SUCCESS
56
55
  const duration = isAndroidDevice ? 0 : params.duration
57
56
  nativePageShowToast(options.title, showSuccessType, duration)
58
57
  console.log('执行原生toast success')
59
58
  } else {
60
59
  showSuccessToast(options)
61
60
  }
62
61
  const params = Object.assign(
63
62
  {},
64
63
  {
65
64
  title: '',
66
65
  duration: 1500,
67
66
  },
68
67
  options,
69
68
  )
70
69
  params.duration = params.duration / 1000
71
70
  console.log(`isJdApp${isJdApp}`)
72
71
  if (isJdApp && isH5AndJdShopView) {
73
72
  const showSuccessType = isIosDevice
74
73
  ? ToastIosType.FAIL
75
74
  : ToastAndroidType.FAIL
76
75
  const duration = isAndroidDevice ? 0 : params.duration
77
76
  nativePageShowToast(options.title, showSuccessType, duration)
78
77
  console.log('执行原生toast fail')
79
78
  } else {
80
79
  console.log('执行H5 toast fail')
81
80
  showFailToast(options)
82
81
  }
83
82
  const params = Object.assign(
84
83
  {},
85
84
  {
86
85
  title: '',
87
86
  duration: 1500,
88
87
  },
89
88
  options,
90
89
  )
91
90
  params.duration = params.duration / 1000
92
91
  if (isJdApp) {
93
92
  const showSuccessType = isIosDevice
94
93
  ? ToastIosType.NORMAL
95
94
  : ToastAndroidType.NORMAL
96
95
  const duration = isAndroidDevice ? 0 : params.duration
97
96
  nativePageShowToast(options.title, showSuccessType, duration)
98
97
  } else {
99
98
  showNormalToast(options)
100
99
  }
101
100
  const createLoadingEle = document.createElement('div')
102
101
  createLoadingEle.id = 'J_shopLoading'
103
102
  createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
104
103
  createLoadingEle.innerHTML = `<div class='d-loading-content'>
105
104
  <span class='d-shop-loading-icon'></span>
106
105
  <p class='d-shop-text'>${text}</p>
107
106
  </div>`
108
107
  const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
109
108
  console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
110
109
  getEle.appendChild(createLoadingEle)
111
110
  const getEle = document.getElementById('J_shopLoading')
112
111
  getEle && getEle.remove()
113
112
  num,
114
113
  widthSize = 375,
115
114
  layoutWidth = getSystemInfo.windowWidth,
116
115
  const getNum = Number(num)
117
116
  return Math.round((getNum / widthSize) * layoutWidth)
118
117
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
119
118
  if (!systemInfo.system && window) {
120
119
  systemInfo.system = window.navigator.userAgent
121
120
  systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
122
121
  }
123
122
  const isIOS = !!systemInfo?.system.match(/ios/i)
124
123
  const isAndroid = !!systemInfo?.system.match(/android/i)
125
124
  systemInfo.navBarHeight = 0
126
125
  systemInfo.statusBarHeight = 0
127
126
  systemInfo.capsulePosition = null
128
127
  systemInfo.isIOS = isIOS
129
128
  systemInfo.isAndroid = isAndroid
130
129
  return systemInfo
131
130
  return originDealShopContentData(pageData, sgmCustomReport, isvdev)
132
131
  isJdApp,
133
132
  isWxApp,
134
133
  isIosDevice,
135
134
  isAndroidDevice,
136
135
  isJdAndIosDevice,
137
136
  isJdAndAndroidDevice,
138
137
  isWxMin,
139
138
  isWxMinAndWxapp,
140
139
  isJdMin,
141
140
  isH5,
142
141
  isH5AndJdShopView,
143
142
  isChartH5,
144
143
  isH5AndJdShopViewNativeScroll,
145
144
  isH5AndJdShopViewH5Scroll,
146
145
  isH5AndJingGouMini,
147
146
  isWxMiniH5View,
148
147
  urlCookie,
149
148
  sliceArrToChunkList,
150
149
  dealAddress,
151
150
  objectToUrlEncode,
152
151
  parseQueryUrlString,
153
152
  setLowSmallPicUrl,
154
153
  setTaroStorage,
155
154
  getTaroStorageKeyValue,
156
155
  removeTaroStorageKey,
157
156
  clearTaroStorageKey,
158
157
  getQualityImage,
159
158
  countStringify,
160
159
  getWxAppCookieStr,
161
160
  getSystemInfos,
162
161
  pxTransformFromData,
163
162
  dealShopContentDataAndReport as dealShopContentData,
164
163
  dateFormat,
165
164
  throttle,
166
165
  lodashThrottle,
167
166
  debounce,
168
167
  addHttps,
169
168
  commonShowSuccessToast as showSuccessToast,
170
169
  commonShowFailToast as showFailToast,
171
170
  commonShowNormalToast as showNormalToast,
172
171
  showShopLoading,
173
172
  hideShopLoading,
174
173
  getAppChannelType,
175
174
  formatTabActiveMenuType,
176
175
  filterUrlQueryData,
177
176
  sgmCustomReport,
178
177
  isMemberPage,
179
178
  memberFormatUtils,
180
179
  getFloorDataToDataDefines,
181
180
  isAppClassifyPage
181
+ import Taro from '@tarojs/taro'
182
182
  nativePageShowToast, ToastAndroidType,
183
183
  ToastIosType,
184
184
  getAppChannelType, isAndroidDevice, isH5AndJdShopView, isChartH5,
185
185
  isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdAndHarmonyDevice, isJdApp,
186
186
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
187
187
  sgmCustomReport, isMemberPage, isH5AndJdShopViewH5Scroll, isAppClassifyPage, isPc, ipLoc_djd
188
188
  addHttps,
189
189
  clearTaroStorageKey,
190
190
  countStringify,
191
191
  dateFormat,
192
192
  dealAddress,
193
193
  dealShopContentData as originDealShopContentData,
194
194
  debounce,
195
195
  filterUrlQueryData,
196
196
  formatTabActiveMenuType,
197
197
  getQualityImage,
198
198
  getTaroStorageKeyValue,
199
199
  getWxAppCookieStr,
200
200
  isH5,
201
201
  isJdMin,
202
202
  isWxMin,
203
203
  isWxMinAndWxapp,
204
204
  lodashThrottle,
205
205
  objectToUrlEncode,
206
206
  parseQueryUrlString,
207
207
  removeTaroStorageKey,
208
208
  setLowSmallPicUrl,
209
209
  setTaroStorage,
210
210
  showFailToast,
211
211
  showNormalToast,
212
212
  showSuccessToast,
213
213
  sliceArrToChunkList,
214
214
  throttle,
215
215
  windowWidth: window.innerWidth,
216
216
  containerWidth: buildType === BUILD_TYPE.CLASSIFY ? window.innerWidth - 100 : window.innerWidth,
217
217
  screenWidth: window.innerWidth,
218
218
  platform: '',
219
219
  model: '',
220
220
  system: '',
221
221
  getSystemInfo.windowWidth = getSystemInfo.screenWidth
222
222
  getSystemInfo['containerWidth'] = buildType === BUILD_TYPE.CLASSIFY ? getSystemInfo.screenWidth - 100 : getSystemInfo.screenWidth
223
223
  const params = Object.assign(
224
224
  {},
225
225
  {
226
226
  title: '',
227
227
  duration: 1500,
228
228
  },
229
229
  options,
230
230
  )
231
231
  params.duration = params.duration / 1000
232
232
  if (isJdApp && isH5AndJdShopView) {
233
233
  const showSuccessType = isIosDevice
234
234
  ? ToastIosType.SUCCESS
235
235
  : ToastAndroidType.SUCCESS
236
236
  const duration = isAndroidDevice ? 0 : params.duration
237
237
  nativePageShowToast(options.title, showSuccessType, duration)
238
238
  console.log('执行原生toast success')
239
239
  } else {
240
240
  showSuccessToast(options)
241
241
  }
242
242
  const params = Object.assign(
243
243
  {},
244
244
  {
245
245
  title: '',
246
246
  duration: 1500,
247
247
  },
248
248
  options,
249
249
  )
250
250
  params.duration = params.duration / 1000
251
251
  console.log(`isJdApp${isJdApp}`)
252
252
  if (isJdApp && isH5AndJdShopView) {
253
253
  const showSuccessType = isIosDevice
254
254
  ? ToastIosType.FAIL
255
255
  : ToastAndroidType.FAIL
256
256
  const duration = isAndroidDevice ? 0 : params.duration
257
257
  nativePageShowToast(options.title, showSuccessType, duration)
258
258
  console.log('执行原生toast fail')
259
259
  } else {
260
260
  console.log('执行H5 toast fail')
261
261
  showFailToast(options)
262
262
  }
263
263
  const params = Object.assign(
264
264
  {},
265
265
  {
266
266
  title: '',
267
267
  duration: 1500,
268
268
  },
269
269
  options,
270
270
  )
271
271
  params.duration = params.duration / 1000
272
272
  if (isJdApp) {
273
273
  const showSuccessType = isIosDevice
274
274
  ? ToastIosType.NORMAL
275
275
  : ToastAndroidType.NORMAL
276
276
  const duration = isAndroidDevice ? 0 : params.duration
277
277
  nativePageShowToast(options.title, showSuccessType, duration)
278
278
  } else {
279
279
  showNormalToast(options)
280
280
  }
281
281
  const createLoadingEle = document.createElement('div')
282
282
  createLoadingEle.id = 'J_shopLoading'
283
283
  createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
284
284
  createLoadingEle.innerHTML = `<div class='d-loading-content'>
285
285
  <span class='d-shop-loading-icon'></span>
286
286
  <p class='d-shop-text'>${text}</p>
287
287
  </div>`
288
288
  const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
289
289
  console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
290
290
  getEle.appendChild(createLoadingEle)
291
291
  const getEle = document.getElementById('J_shopLoading')
292
292
  getEle && getEle.remove()
293
293
  num,
294
294
  widthSize = 375,
295
295
  layoutWidth = getSystemInfo.windowWidth,
296
296
  const getNum = Number(num)
297
297
  return Math.round((getNum / widthSize) * layoutWidth)
298
298
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
299
299
  if (!systemInfo.system && window) {
300
300
  systemInfo.system = window.navigator.userAgent
301
301
  systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
302
302
  }
303
303
  const isIOS = !!systemInfo?.system.match(/ios/i)
304
304
  const isAndroid = !!systemInfo?.system.match(/android/i)
305
305
  systemInfo.navBarHeight = 0
306
306
  systemInfo.statusBarHeight = 0
307
307
  systemInfo.capsulePosition = null
308
308
  systemInfo.isIOS = isIOS
309
309
  systemInfo.isAndroid = isAndroid
310
310
  return systemInfo
311
311
  return originDealShopContentData(pageData, sgmCustomReport, isvdev)
312
312
  isJdApp,
313
313
  isWxApp,
314
314
  isIosDevice,
315
315
  isAndroidDevice,
316
316
  isJdAndIosDevice,
317
317
  isJdAndAndroidDevice,
318
318
  isJdAndHarmonyDevice,
319
319
  isWxMin,
320
320
  isWxMinAndWxapp,
321
321
  isJdMin,
322
322
  isH5,
323
323
  isH5AndJdShopView,
324
324
  isChartH5,
325
325
  isH5AndJdShopViewNativeScroll,
326
326
  isH5AndJdShopViewH5Scroll,
327
327
  isH5AndJingGouMini,
328
328
  isWxMiniH5View,
329
329
  urlCookie,
330
330
  sliceArrToChunkList,
331
331
  dealAddress,
332
332
  objectToUrlEncode,
333
333
  parseQueryUrlString,
334
334
  setLowSmallPicUrl,
335
335
  setTaroStorage,
336
336
  getTaroStorageKeyValue,
337
337
  removeTaroStorageKey,
338
338
  clearTaroStorageKey,
339
339
  getQualityImage,
340
340
  countStringify,
341
341
  getWxAppCookieStr,
342
342
  getSystemInfos,
343
343
  pxTransformFromData,
344
344
  dealShopContentDataAndReport as dealShopContentData,
345
345
  dateFormat,
346
346
  throttle,
347
347
  lodashThrottle,
348
348
  debounce,
349
349
  addHttps,
350
350
  commonShowSuccessToast as showSuccessToast,
351
351
  commonShowFailToast as showFailToast,
352
352
  commonShowNormalToast as showNormalToast,
353
353
  showShopLoading,
354
354
  hideShopLoading,
355
355
  getAppChannelType,
356
356
  formatTabActiveMenuType,
357
357
  filterUrlQueryData,
358
358
  sgmCustomReport,
359
359
  isMemberPage,
360
360
  memberFormatUtils,
361
361
  getFloorDataToDataDefines,
362
362
  isAppClassifyPage,
363
363
  isPc,
364
364
  ipLoc_djd,
@@ -1 +1 @@
1
- import {
2
1
  isChartH5,
3
2
  isH5AndJdShopViewH5Scroll,
4
3
  isMemberPage,
5
4
  isChartH5,
6
5
  isH5AndJdShopViewH5Scroll,
7
6
  isH5AndJingGouMini,
8
7
  urlCookie,
9
8
  isMemberPage,
9
+ import {
10
10
  isChartH5,
11
11
  isH5AndJdShopViewH5Scroll,
12
12
  isMemberPage,
13
13
  isPc,
14
14
  ipLoc_djd,
15
15
  isJdAndHarmonyDevice,
16
16
  isChartH5,
17
17
  isH5AndJdShopViewH5Scroll,
18
18
  isH5AndJingGouMini,
19
19
  urlCookie,
20
20
  isMemberPage,
21
21
  isPc,
22
22
  ipLoc_djd,
@@ -1 +1 @@
1
- import {
2
1
  isChartH5,
3
2
  isH5AndJdShopViewH5Scroll,
4
3
  sgmCustomReport,
5
4
  isMemberPage,
6
5
  isAppClassifyPage
7
6
  isH5AndJdShopViewH5Scroll,
8
7
  isH5AndJingGouMini,
9
8
  urlCookie,
10
9
  isMemberPage,
11
10
  isAppClassifyPage
11
+ import {
12
12
  isChartH5,
13
13
  isH5AndJdShopViewH5Scroll,
14
14
  sgmCustomReport,
15
15
  isMemberPage,
16
16
  isAppClassifyPage
17
17
  isJdAndHarmonyDevice,
18
18
  isH5AndJdShopViewH5Scroll,
19
19
  isH5AndJingGouMini,
20
20
  urlCookie,
21
21
  isMemberPage,
22
22
  isAppClassifyPage
@@ -1 +1 @@
1
- var splitOnFirst = function splitOnFirst(string, separator) {
2
1
  return Object.prototype.toString.call(obj);
3
2
  return typeof obj === 'function';
4
3
  return '[object Object]' === getType(obj);
5
4
  return '[object Array]' == getType(obj);
6
5
  return '[object Undefined]' === getType(obj);
7
6
  return '[object Null]' == getType(obj);
8
7
  return typeof obj === 'string';
9
8
  return typeof obj === 'boolean';
10
9
  return '[object Number]' === getType(num);
11
10
  ua = ua || navigator.userAgent;
12
11
  if (name === 'wx') return (/micromessenger/i.test(ua)
13
12
  );
14
13
  if (name === 'qq') return (/qq\//i.test(ua)
15
14
  );
16
15
  if (name === 'weibo') return (/weibo/i.test(ua)
17
16
  );
18
17
  if (name === 'jd') return (/^jdapp/i.test(ua)
19
18
  );
20
19
  if (name === 'jdlittle') return (/^jdltapp/i.test(ua)
21
20
  );
22
21
  if (name === 'mp') return navigator.userAgent.match(/micromessenger/i) && navigator.userAgent.match(/miniprogram/i) || window.__wxjs_environment === 'miniprogram';
23
22
  if (name === 'jdb') return (/JDBmall/i.test(ua) && /shop\.m\.jd\.com\/shop\/bhome/i.test(window.location.href));
24
23
  if(name === 'jdjch') return (/jdjchshopapp/i.test(ua) || (/shop\.m\.jd\.com\/shop\/bhome/i.test(window.location.href)) && window.location.href.includes('channel')) ;
25
24
  return false;
26
25
  ua = ua || navigator.userAgent;
27
26
  return (/android/i.test(ua) && !isIOS()
28
27
  );
29
28
  ua = ua || navigator.userAgent;
30
29
  return (/ip(hone|od)|ipad/i.test(ua)
31
30
  );
32
31
  ua = ua || navigator.userAgent;
33
32
  return (/ipad/i.test(ua) || /android/i.test(ua) && !/mobi|mini|fennec/i.test(ua)
34
33
  );
35
34
  ua = ua || navigator.userAgent;
36
35
  return !!ua.match(/ip(hone|od)|android.+mobile|windows (ce|phone)|blackberry|bb10|symbian|webos|firefox.+fennec|opera m(ob|in)i|polaris|iemobile|lgtelecom|nokia|sonyericsson|dolfin|uzard|natebrowser|ktf;|skt;/i);
37
36
  ua = ua || navigator.userAgent;
38
37
  return !!ua.match(/iphone/i);
39
38
  ua = ua || navigator.userAgent;
40
39
  return !!ua.match(/ipad/i);
41
40
  ua = ua || navigator.userAgent;
42
41
  if (name === 'xview') return typeof window.XView !== 'undefined';
43
42
  if (name === 'wk') return !!ua.match(/supportjdshwk/i) || window._is_jdsh_wkwebview == 1;
44
43
  return false;
45
44
  ua = ua || navigator.userAgent;
46
45
  var re = /nettype\/([\S]*)/i;
47
46
  if (isApp('jd', ua)) re = /network\/([^;]*)/i;
48
47
  return re.test(ua) ? RegExp.$1.toLowerCase() : 'unknown';
49
48
  ua = ua || navigator.userAgent;
50
49
  if (!isApp('jd', ua)) return null;
51
50
  return ua.split(';')[4];
52
51
  ua = ua || navigator.userAgent;
53
52
  if (appName === 'jd') return ua.split(';')[2] || null;
54
53
  if (appName === 'wx') return (/micromessenger\/([\S]*)/i.test(ua) ? RegExp.$1 : null
55
54
  );
56
55
  if (appName === 'qq') return (/qq\/([\S]*)/i.test(ua) ? RegExp.$1 : null
57
56
  );
58
57
  return null;
59
58
  ua = ua || navigator.userAgent;
60
59
  var match = ua.match(/android\s([0-9\.]*)/i);
61
60
  return match ? match[1] : 'unknown';
62
61
  ua = ua || navigator.userAgent;
63
62
  var match = ua.match(/OS ((\d+_?){2,3})\s/i);
64
63
  return match ? match[1].replace(/_/g, '.') : 'unknown';
64
+ var splitOnFirst = function splitOnFirst(string, separator) {
65
65
  return Object.prototype.toString.call(obj);
66
66
  return typeof obj === 'function';
67
67
  return '[object Object]' === getType(obj);
68
68
  return '[object Array]' == getType(obj);
69
69
  return '[object Undefined]' === getType(obj);
70
70
  return '[object Null]' == getType(obj);
71
71
  return typeof obj === 'string';
72
72
  return typeof obj === 'boolean';
73
73
  return '[object Number]' === getType(num);
74
74
  ua = ua || navigator.userAgent;
75
75
  if (name === 'wx') return (/micromessenger/i.test(ua)
76
76
  );
77
77
  if (name === 'qq') return (/qq\//i.test(ua)
78
78
  );
79
79
  if (name === 'weibo') return (/weibo/i.test(ua)
80
80
  );
81
81
  if (name === 'jd') return (/^jdapp/i.test(ua)
82
82
  );
83
83
  if (name === 'jdharmony') return (/^jdapp;harmony/i.test(ua)
84
84
  );
85
85
  if (name === 'jdlittle') return (/^jdltapp/i.test(ua)
86
86
  );
87
87
  if (name === 'mp') return navigator.userAgent.match(/micromessenger/i) && navigator.userAgent.match(/miniprogram/i) || window.__wxjs_environment === 'miniprogram';
88
88
  if (name === 'jdb') return (/JDBmall/i.test(ua) && /shop\.m\.jd\.com\/shop\/bhome/i.test(window.location.href));
89
89
  if(name === 'jdjch') return (/jdjchshopapp/i.test(ua) || (/shop\.m\.jd\.com\/shop\/bhome/i.test(window.location.href)) && window.location.href.includes('channel')) ;
90
90
  return false;
91
91
  ua = ua || navigator.userAgent;
92
92
  return (/android/i.test(ua) && !isIOS()
93
93
  );
94
94
  ua = ua || navigator.userAgent;
95
95
  return (/ip(hone|od)|ipad/i.test(ua)
96
96
  );
97
97
  ua = ua || navigator.userAgent;
98
98
  return (/ipad/i.test(ua) || /android/i.test(ua) && !/mobi|mini|fennec/i.test(ua)
99
99
  );
100
100
  ua = ua || navigator.userAgent;
101
101
  return !!ua.match(/ip(hone|od)|android.+mobile|windows (ce|phone)|blackberry|bb10|symbian|webos|firefox.+fennec|opera m(ob|in)i|polaris|iemobile|lgtelecom|nokia|sonyericsson|dolfin|uzard|natebrowser|ktf;|skt;/i);
102
102
  ua = ua || navigator.userAgent;
103
103
  return !!ua.match(/iphone/i);
104
104
  ua = ua || navigator.userAgent;
105
105
  return !!ua.match(/ipad/i);
106
106
  ua = ua || navigator.userAgent;
107
107
  if (name === 'xview') return typeof window.XView !== 'undefined';
108
108
  if (name === 'wk') return !!ua.match(/supportjdshwk/i) || window._is_jdsh_wkwebview == 1;
109
109
  return false;
110
110
  ua = ua || navigator.userAgent;
111
111
  var re = /nettype\/([\S]*)/i;
112
112
  if (isApp('jd', ua)) re = /network\/([^;]*)/i;
113
113
  return re.test(ua) ? RegExp.$1.toLowerCase() : 'unknown';
114
114
  ua = ua || navigator.userAgent;
115
115
  if (!isApp('jd', ua)) return null;
116
116
  return ua.split(';')[4];
117
117
  ua = ua || navigator.userAgent;
118
118
  if (appName === 'jd') return ua.split(';')[2] || null;
119
119
  if (appName === 'wx') return (/micromessenger\/([\S]*)/i.test(ua) ? RegExp.$1 : null
120
120
  );
121
121
  if (appName === 'qq') return (/qq\/([\S]*)/i.test(ua) ? RegExp.$1 : null
122
122
  );
123
123
  return null;
124
124
  ua = ua || navigator.userAgent;
125
125
  var match = ua.match(/android\s([0-9\.]*)/i);
126
126
  return match ? match[1] : 'unknown';
127
127
  ua = ua || navigator.userAgent;
128
128
  var match = ua.match(/OS ((\d+_?){2,3})\s/i);
129
129
  return match ? match[1].replace(/_/g, '.') : 'unknown';