@conecli/cone-render 0.8.15-alpha.12 → 0.8.15-alpha.14

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 React from 'react'
1
+ import React from 'react'
@@ -1 +1 @@
1
- import React, { useCallback, useEffect, useRef, useState } from 'react'
2
1
  const [componentShowState, setComponentShowState] = useState(false)
3
2
  const componentLazyRef = useRef<HTMLElement | null>(null)
4
3
  const componentShowStateRef = useRef(false)
5
4
  useEffect(() => {
6
5
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
7
6
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
8
7
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
9
8
  !componentShowStateRef.current && dealPageScrollInfo(res)
10
9
  })
11
10
 
12
11
 
13
12
  <View
14
13
  ref={componentLazyRef}
15
14
  className={classNames(
16
15
  imageStyle['d-app-lazy-image'],
17
16
  {
18
17
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
19
18
  },
20
19
  {
21
20
  [imageStyle['d-hide-image-error']]: imageErrState,
22
21
  },
23
22
  {
24
23
  [imageStyle['d-load-completed']]: loadSuccess,
25
24
  },
26
25
  {
27
26
  'd-imag-rendering-crisp-edges':
28
27
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
29
28
  imagRenderingSet,
30
29
  },
31
30
  'J_html5ImageBg',
32
31
  className,
33
32
  )}
34
33
  style={{
35
34
  ...style,
36
35
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
37
36
  }}
38
37
  >
39
38
  {(componentShowState || lazyLoad === false) && <img
40
39
  src={getQualityImage(
41
40
  imgSrc,
42
41
  taroJdBaseInfo.info.pageInfo.isVipShop
43
42
  ? NetWorkTypeQuality['perfect']
44
43
  : NetWorkTypeQuality[getNetWorkType],
45
44
  )}
46
45
  onLoad={imageLoad.bind(this, imgSrc)}
47
46
  onError={imageError}
48
47
  />}
49
48
  </View>
50
49
  ) : (
51
50
  <Image
52
51
  style={{
53
52
  ...style,
54
53
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
55
54
  }}
56
55
  className={classNames(
57
56
  imageStyle['d-lazy-image'],
58
57
  {
59
58
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
60
59
  },
61
60
  {
62
61
  [imageStyle['d-hide-image-error']]: imageErrState,
63
62
  },
64
63
  {
65
64
  [imageStyle['d-load-completed']]: loadSuccess,
66
65
  },
67
66
  {
68
67
  'd-imag-rendering-crisp-edges': imagRenderingSet,
69
68
  },
70
69
  className,
71
70
  )}
72
71
  src={getQualityImage(
73
72
  imgSrc,
74
73
  NetWorkTypeQuality[getNetWorkType],
75
74
  )}
76
75
  lazyLoad={lazyLoad}
77
76
  onError={imageError}
78
77
  onLoad={imageLoad.bind(this, imgSrc)}
79
78
  {...otherOption}
80
79
  />
81
80
  )
81
+ import React, { useCallback, useEffect, useRef, useState } from 'react'
82
82
  const [componentShowState, setComponentShowState] = useState(false)
83
83
  const componentLazyRef = useRef<HTMLElement | null>(null)
84
84
  const componentShowStateRef = useRef(false)
85
85
  useEffect(() => {
86
86
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
87
87
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
88
88
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
89
89
  !componentShowStateRef.current && dealPageScrollInfo(res)
90
90
  })
91
91
 
92
92
 
93
93
  <View
94
94
  ref={componentLazyRef}
95
95
  className={classNames(
96
96
  imageStyle['d-app-lazy-image'],
97
97
  {
98
98
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
99
99
  },
100
100
  {
101
101
  [imageStyle['d-hide-image-error']]: imageErrState,
102
102
  },
103
103
  {
104
104
  [imageStyle['d-load-completed']]: loadSuccess,
105
105
  },
106
106
  {
107
107
  'd-imag-rendering-crisp-edges':
108
108
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
109
109
  imagRenderingSet,
110
110
  },
111
111
  'J_html5ImageBg',
112
112
  className,
113
113
  )}
114
114
  style={{
115
115
  ...style,
116
116
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
117
117
  >
118
118
  {(componentShowState || lazyLoad === false) && <img
119
119
  src={getQualityImage(
120
120
  imgSrc,
121
121
  taroJdBaseInfo.info.pageInfo.isVipShop
122
122
  ? NetWorkTypeQuality['perfect']
123
123
  : NetWorkTypeQuality[getNetWorkType],
124
124
  )}
125
125
  onLoad={imageLoad.bind(this, imgSrc)}
126
126
  onError={imageError}
127
127
  />}
128
128
  </View>
129
129
  ) : (
130
130
  <Image
131
131
  style={{
132
132
  ...style,
133
133
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
134
134
  }}
135
135
  className={classNames(
136
136
  imageStyle['d-lazy-image'],
137
137
  {
138
138
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
139
139
  },
140
140
  {
141
141
  [imageStyle['d-hide-image-error']]: imageErrState,
142
142
  },
143
143
  {
144
144
  [imageStyle['d-load-completed']]: loadSuccess,
145
145
  },
146
146
  {
147
147
  'd-imag-rendering-crisp-edges': imagRenderingSet,
148
148
  },
149
149
  className,
150
150
  )}
151
151
  src={getQualityImage(
152
152
  imgSrc,
153
153
  NetWorkTypeQuality[getNetWorkType],
154
154
  )}
155
155
  lazyLoad={lazyLoad}
156
156
  onError={imageError}
157
157
  onLoad={imageLoad.bind(this, imgSrc)}
158
158
  {...otherOption}
159
159
  />
160
160
  )
@@ -1 +1 @@
1
- import React, { Suspense, lazy } from 'react'
1
+ import React, { Suspense, lazy } from 'react'
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  nativePageShowToast, ToastAndroidType,
3
2
  ToastIosType
4
3
  getAppChannelType, isAndroidDevice, isH5AndJdShopView,
5
4
  isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
6
5
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie
7
6
  addHttps, clearTaroStorageKey, countStringify, dateFormat, dealAddress, dealShopContentData as originDealShopContentData, debounce, filterUrlQueryData, formatTabActiveMenuType, getQualityImage, getTaroStorageKeyValue,
8
7
  getWxAppCookieStr, isH5, isJdMin, isWxMin,
9
8
  isWxMinAndWxapp, lodashThrottle, objectToUrlEncode, parseQueryUrlString, removeTaroStorageKey, setLowSmallPicUrl,
10
9
  setTaroStorage, showFailToast,
11
10
  showNormalToast, showSuccessToast, sliceArrToChunkList, throttle
12
11
  <span class="d-shop-loading-icon"></span>
13
12
  <p class="d-shop-text">${text}</p>
14
13
  </div>`
15
14
  return originDealShopContentData(pageData, DraJSAgentReport)
16
15
  isJdApp,
17
16
  isWxApp,
18
17
  isIosDevice,
19
18
  isAndroidDevice,
20
19
  isJdAndIosDevice,
21
20
  isJdAndAndroidDevice,
22
21
  isWxMin,
23
22
  isWxMinAndWxapp,
24
23
  isJdMin,
25
24
  isH5,
26
25
  isH5AndJdShopView,
27
26
  isH5AndJdShopViewNativeScroll,
28
27
  isH5AndJingGouMini,
29
28
  isWxMiniH5View,
30
29
  urlCookie,
31
30
  sliceArrToChunkList,
32
31
  dealAddress,
33
32
  objectToUrlEncode,
34
33
  parseQueryUrlString,
35
34
  setLowSmallPicUrl,
36
35
  setTaroStorage,
37
36
  getTaroStorageKeyValue,
38
37
  removeTaroStorageKey,
39
38
  clearTaroStorageKey,
40
39
  getQualityImage,
41
40
  countStringify,
42
41
  getWxAppCookieStr,
43
42
  getSystemInfos,
44
43
  pxTransformFromData,
45
44
  dateFormat,
46
45
  throttle,
47
46
  lodashThrottle,
48
47
  debounce,
49
48
  addHttps,
50
49
  commonShowSuccessToast as showSuccessToast,
51
50
  commonShowFailToast as showFailToast,
52
51
  commonShowNormalToast as showNormalToast,
53
52
  showShopLoading,
54
53
  hideShopLoading,
55
54
  getAppChannelType,
56
55
  formatTabActiveMenuType,
57
56
  filterUrlQueryData,
57
+ import Taro from '@tarojs/taro'
58
58
  nativePageShowToast, ToastAndroidType,
59
59
  ToastIosType
60
60
  getAppChannelType, isAndroidDevice, isH5AndJdShopView,
61
61
  isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
62
62
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie
63
63
  addHttps, clearTaroStorageKey, countStringify, dateFormat, dealAddress, dealShopContentData as originDealShopContentData, debounce, filterUrlQueryData, formatTabActiveMenuType, getQualityImage, getTaroStorageKeyValue,
64
64
  getWxAppCookieStr, isH5, isJdMin, isWxMin,
65
65
  isWxMinAndWxapp, lodashThrottle, objectToUrlEncode, parseQueryUrlString, removeTaroStorageKey, setLowSmallPicUrl,
66
66
  setTaroStorage, showFailToast,
67
67
  showNormalToast, showSuccessToast, sliceArrToChunkList, throttle
68
68
  <span class="d-shop-loading-icon"></span>
69
69
  <p class="d-shop-text">${text}</p>
70
70
  </div>`
71
71
  return originDealShopContentData(pageData, DraJSAgentReport)
72
72
  isJdApp,
73
73
  isWxApp,
74
74
  isIosDevice,
75
75
  isAndroidDevice,
76
76
  isJdAndIosDevice,
77
77
  isJdAndAndroidDevice,
78
78
  isWxMin,
79
79
  isWxMinAndWxapp,
80
80
  isJdMin,
81
81
  isH5,
82
82
  isH5AndJdShopView,
83
83
  isH5AndJdShopViewNativeScroll,
84
84
  isH5AndJingGouMini,
85
85
  isWxMiniH5View,
86
86
  urlCookie,
87
87
  sliceArrToChunkList,
88
88
  dealAddress,
89
89
  objectToUrlEncode,
90
90
  parseQueryUrlString,
91
91
  setLowSmallPicUrl,
92
92
  setTaroStorage,
93
93
  getTaroStorageKeyValue,
94
94
  removeTaroStorageKey,
95
95
  clearTaroStorageKey,
96
96
  getQualityImage,
97
97
  countStringify,
98
98
  getWxAppCookieStr,
99
99
  getSystemInfos,
100
100
  pxTransformFromData,
101
101
  dateFormat,
102
102
  throttle,
103
103
  lodashThrottle,
104
104
  debounce,
105
105
  addHttps,
106
106
  commonShowSuccessToast as showSuccessToast,
107
107
  commonShowFailToast as showFailToast,
108
108
  commonShowNormalToast as showNormalToast,
109
109
  showShopLoading,
110
110
  hideShopLoading,
111
111
  getAppChannelType,
112
112
  formatTabActiveMenuType,
113
113
  filterUrlQueryData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.15-alpha.12",
3
+ "version": "0.8.15-alpha.14",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"