@conecli/cone-render 0.10.1-isv2.1 → 0.10.1-isv2.2

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.
Files changed (84) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/environmentType.ts +1 -1
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/pageType.ts +1 -1
  9. package/dist/common/sgmCustomCode.ts +1 -1
  10. package/dist/components/ErrorBoundary.tsx +1 -1
  11. package/dist/components/base/CountDown/index.module.scss +49 -44
  12. package/dist/components/base/CountDown/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  14. package/dist/components/base/CustomVideo/common.ts +1 -0
  15. package/dist/components/base/CustomVideo/index.tsx +1 -1
  16. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  17. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  18. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  19. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  20. package/dist/components/base/LazyLoadImage/index.h5.module.scss +11 -3
  21. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  22. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  23. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  24. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  25. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  26. package/dist/components/base/Price/Base/index.tsx +1 -1
  27. package/dist/components/base/Price/Double/index.module.scss +8 -0
  28. package/dist/components/base/Price/Double/index.tsx +1 -1
  29. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  30. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  31. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  32. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  33. package/dist/components/floorItem.jd.tsx +1 -1
  34. package/dist/components/floorItem.tsx +1 -1
  35. package/dist/components/floorItem.weapp.tsx +1 -1
  36. package/dist/components/isv/Floor/index.tsx +1 -1
  37. package/dist/components/remoteFloorItem.tsx +1 -1
  38. package/dist/interface/common.ts +1 -1
  39. package/dist/interface/component.ts +1 -1
  40. package/dist/interface/jumpEventReport.ts +1 -1
  41. package/dist/interface/service.ts +1 -1
  42. package/dist/jumpEventReport/base.ts +1 -1
  43. package/dist/jumpEventReport/const.ts +1 -1
  44. package/dist/jumpEventReport/index.jd.ts +1 -1
  45. package/dist/jumpEventReport/index.weapp.ts +1 -1
  46. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  47. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  48. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  49. package/dist/jumpEventReport/web.base.ts +1 -1
  50. package/dist/jumpEventReport/web.jd.ts +1 -1
  51. package/dist/jumpEventReport/web.jdb.ts +1 -1
  52. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  53. package/dist/jumpEventReport/web.jxwxapp.ts +1 -1
  54. package/dist/jumpEventReport/web.pc.ts +1 -1
  55. package/dist/jumpEventReport/web.tjapp.ts +1 -1
  56. package/dist/jumpEventReport/web.tjm.ts +1 -1
  57. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  58. package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -0
  59. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  60. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  61. package/dist/open/api/device.ts +1 -1
  62. package/dist/open/api/request.ts +1 -1
  63. package/dist/open/api/shopMember.ts +1 -1
  64. package/dist/open/api/util.ts +1 -1
  65. package/dist/open/components/index.ts +1 -1
  66. package/dist/sass/app.h5.scss +5 -0
  67. package/dist/sass/base.scss +183 -137
  68. package/dist/service/fetchGateway.ts +1 -1
  69. package/dist/service/http/colorSign.ts +1 -1
  70. package/dist/service/http/h5Http.ts +1 -0
  71. package/dist/service/http/index.h5.ts +1 -0
  72. package/dist/service/requestServer.h5.ts +1 -0
  73. package/dist/service/requestServer.ts +1 -1
  74. package/dist/utils/connectNativeJsBridge.ts +1 -1
  75. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  76. package/dist/utils/h5Utils.ts +1 -1
  77. package/dist/utils/index.h5.ts +1 -1
  78. package/dist/utils/index.ts +1 -1
  79. package/dist/utils/index.weapp.ts +1 -1
  80. package/dist/utils/sgmCodeUtils.ts +1 -1
  81. package/dist/utils/taroRenderUtil.ts +1 -1
  82. package/dist/utils/utils.ts +1 -1
  83. package/package.json +35 -29
  84. package/dist/utils/memberFormatUtils.js +0 -1
@@ -1 +1 @@
1
- export const getPageType = () => {
2
1
  return process.env.BUILD_TYPE || ''
3
2
 
4
3
  M_DECORATE = 'm-decorate',
5
4
  M_RENDER_MODULE = 'm-render-module',
6
5
  M_PREVIEW = 'm-preview',
7
6
  M_ISV_PREVIEW = 'm-isv-preview',
8
7
  MARKETING_PREVIEW = 'marketing-preview',
9
8
 
10
9
  APP_VIEW = 'app-view',
11
10
  APP_MEMBER = 'app-member',
12
11
  APP_INTRODUCE = 'app-introduce',
13
12
  APP_PROMOTION = 'app-promotion',
14
13
  APP_CLASSIFY = 'app-classify',
15
14
  APP_PRODUCT = 'app-product',
16
15
 
17
16
 
18
17
  PC_VIEW = 'pc-view',
19
18
  PC_VIEW1 = 'pc-view1',
20
19
  PC_VIEW2 = 'pc-view2',
21
20
  M_VIEW = 'm-view',
22
21
  M_BSC_VIEW = 'm-bsc-view',
23
22
  SALE_VIEW = 'sale-view',
24
23
  VIP_VIEW = 'vip-view',
25
24
  M_SEARCH = 'm-search',
26
25
  M_INTRODUCE = 'm-introduce',
27
26
 
28
27
  MEMBER_SHOPCARD = 'member-shopcard',
29
28
  M_MEMBER = 'm-member',
30
29
  M_MEMBER_SAM_BIND_CARD = 'm-member-sam-bind-card',
31
30
  M_MEMBER_WATSONS_BIND_CARD = 'm-member-watsons-bind-card',
32
31
  M_SAM_CARD = 'm-sam-card',
33
32
  M_SAM_CENTER = 'm-sam-center',
34
33
  M_WATSONS_CARD = 'm-watsons-card',
35
34
 
36
35
  M_LOTTERY = 'm-lottery',
37
36
  M_COUPON = 'm-coupon',
38
37
  M_WARES = 'm-wares',
39
38
  M_FAST_SHOPPING = 'm-fast-shopping',
40
39
  M_SPECIAL_SECKILL = 'm-special-seckill',
41
40
  WEAPP_SHOP = 'weapp-shop',
42
41
  WEAPP_PROMOTION = 'weapp-promotion',
43
42
  M_VIDEOS = 'm-videos',
43
+ export const getPageType = () => {
44
44
  return process.env.BUILD_TYPE || ''
45
45
 
46
46
  M_DECORATE = 'm-decorate',
47
47
  M_RENDER_MODULE = 'm-render-module',
48
48
  M_PREVIEW = 'm-preview',
49
49
  M_ISV_PREVIEW = 'm-isv-preview',
50
50
  MARKETING_PREVIEW = 'marketing-preview',
51
51
 
52
52
  APP_VIEW = 'app-view',
53
53
  APP_MEMBER = 'app-member',
54
54
  APP_INTRODUCE = 'app-introduce',
55
55
  APP_PROMOTION = 'app-promotion',
56
56
  APP_CLASSIFY = 'app-classify',
57
57
  APP_PRODUCT = 'app-product',
58
58
  MEMBER_HOME = 'member-home',
59
59
 
60
60
 
61
61
  PC_VIEW = 'pc-view',
62
62
  PC_VIEW1 = 'pc-view1',
63
63
  PC_VIEW2 = 'pc-view2',
64
64
  M_VIEW = 'm-view',
65
65
  M_BSC_VIEW = 'm-bsc-view',
66
66
  SALE_VIEW = 'sale-view',
67
67
  VIP_VIEW = 'vip-view',
68
68
  M_SEARCH = 'm-search',
69
69
  M_INTRODUCE = 'm-introduce',
70
70
 
71
71
  MEMBER_SHOPCARD = 'member-shopcard',
72
72
  M_MEMBER = 'm-member',
73
73
  M_MEMBER_SAM_BIND_CARD = 'm-member-sam-bind-card',
74
74
  M_MEMBER_WATSONS_BIND_CARD = 'm-member-watsons-bind-card',
75
75
  M_SAM_CARD = 'm-sam-card',
76
76
  M_SAM_CENTER = 'm-sam-center',
77
77
  M_WATSONS_CARD = 'm-watsons-card',
78
78
 
79
79
  M_LOTTERY = 'm-lottery',
80
80
  M_COUPON = 'm-coupon',
81
81
  M_WARES = 'm-wares',
82
82
  M_FAST_SHOPPING = 'm-fast-shopping',
83
83
  M_SPECIAL_SECKILL = 'm-special-seckill',
84
84
  WEAPP_SHOP = 'weapp-shop',
85
85
  WEAPP_PROMOTION = 'weapp-promotion',
86
86
  M_VIDEOS = 'm-videos',
@@ -1 +1 @@
1
- export const NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG = 'noType_'
2
1
  IMAGE_LOAD = 'imageLazyLoadError',
3
2
  REMOTEMODULE_DATA = 'remoteModule_interface_dataError',
4
3
  REMOTEMODULE_JS = 'remoteModule_render_jsError',
5
4
  SYSTEMMODULE_JS = 'systemModule_render_jsError',
6
5
  FLOORLAZYLOAD_DATA = 'floorLazyLoad_render_dataError',
6
+ export const NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG = 'noType_'
7
7
  IMAGE_LOAD = 'imageLazyLoadError',
8
8
  PRICE_RENDER = 'priceRenderError',
9
9
  GRAYSCALE = 'grayscale',
10
10
  REMOTEMODULE_DATA = 'remoteModule_interface_dataError',
11
11
  REMOTEMODULE_JS = 'remoteModule_render_jsError',
12
12
  SYSTEMMODULE_JS = 'systemModule_render_jsError',
13
13
  SYSTEMPDCMODULE_DATA = 'systemPdcModule_interface_dataError',
14
14
  SYSTEMPDCMODULE_JS = 'systemPdcModule_render_jsError',
15
15
  FLOORLAZYLOAD_DATA = 'floorLazyLoad_render_dataError',
@@ -1 +1 @@
1
- import React from 'react'
2
1
  const floorLoadWay = floorData?.floorExtInfo?.floorLoadWay
3
2
  const isRemoteLoadFloor = floorLoadWay === 2
4
3
  msg: `店铺h5楼层隐藏不显示。原因:模块js执行异常,楼层过滤。`,
5
4
  floorIdx: floorData?.floorIdx,
6
5
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
7
6
  floorLoadWay,
8
7
  floorKind: floorData?.floorExtInfo?.floorKind,
9
8
  }
10
9
  code: getSgmCustomCode(isRemoteLoadFloor ? SgmCustomCode.REMOTEMODULE_JS : SgmCustomCode.SYSTEMMODULE_JS),
11
10
  msg: opt,
12
11
  })
13
12
  if(this.props.customErrorIsvFloorModule){
14
13
  return this.props.customErrorIsvFloorModule
15
14
  }
15
+ import React from 'react'
16
16
  getBundleUrl,
17
17
  formatPackResult,
18
18
  getTaroVersion
19
19
  const floorLoadWay = floorData?.floorExtInfo?.floorLoadWay
20
20
  const floorKind = floorData?.floorExtInfo?.floorKind
21
21
  const isRemoteLoadFloor = floorLoadWay === 2
22
22
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
23
23
  const modularPackResultObj = formatPackResult(modularPackResult)
24
24
  const bundleUrl = getBundleUrl(modularPackResultObj)
25
25
  const taroVersion = getTaroVersion(modularPackResultObj)
26
26
  msg: `店铺h5楼层隐藏不显示。原因:模块js执行异常,楼层过滤。`,
27
27
  floorIdx: floorData?.floorIdx,
28
28
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
29
29
  floorLoadWay,
30
30
  floorKind,
31
31
  modularPackResult: {
32
32
  bundleUrl,
33
33
  taroVersion
34
34
  },
35
35
  }
36
36
  const sgmCode = isRemoteLoadFloor ? (floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE ? SgmCustomCode.SYSTEMPDCMODULE_JS : SgmCustomCode.REMOTEMODULE_JS) : SgmCustomCode.SYSTEMMODULE_JS
37
37
  code: getSgmCustomCode(handleSgmCodeTaroVersion(sgmCode)),
38
38
  msg: opt,
39
39
  })
40
40
  if(this.props.customErrorIsvFloorModule){
41
41
  return this.props.customErrorIsvFloorModule
42
42
  }
@@ -1,47 +1,52 @@
1
1
 
2
2
  .d-count-down {
3
- position: relative;
4
- z-index: 2;
5
- padding-top: 1px;
6
- line-height: 28px;
7
- font-size: 24px;
8
- font-weight: bolder;
9
- color: #fff;
10
- text-align: center;
11
- &.d-ios-10-count-down {
12
- padding-top: 9px;
13
- }
14
- :global {
15
- .d-count-down-title {
16
- // position: relative;
17
- // top: -2px;
18
- display: inline-block;
19
- padding-right: 5px;
20
- height: 24px;
21
- line-height: 24px;
22
- font-size: 20px;
23
- }
24
- .d-count-down-time {
25
- display: inline-block;
26
- //margin: 0 2px;
27
- min-width: 24px;
28
- line-height: 28px;
29
- font-size: 20px;
30
- text-align: center;
31
- }
32
- .d-time-space-text {
33
- display: inline-block;
34
- //margin: 0 2px;
35
- font-size: 20px;
36
- }
37
- // .d-count-from-end {
38
- // margin-right: 4px;
39
- // font-size: 9px;
40
- // }
41
- }
42
- :global(.d-count-down-time) {
43
- &:global(.d-day-time) {
44
- min-width: 12px;
45
- }
46
- }
3
+ position: relative;
4
+ z-index: 2;
5
+ padding-top: 1px;
6
+ line-height: 28px;
7
+ font-size: 24px;
8
+ font-weight: bolder;
9
+ color: #fff;
10
+ text-align: center;
11
+ &.d-ios-10-count-down {
12
+ padding-top: 9px;
13
+ }
14
+ :global {
15
+ .d-count-down-title {
16
+ // position: relative;
17
+ // top: -2px;
18
+ display: inline-block;
19
+ padding-right: 5px;
20
+ height: 24px;
21
+ line-height: 24px;
22
+ font-size: 20px;
23
+ }
24
+ .d-count-down-time {
25
+ display: inline-block;
26
+ //margin: 0 2px;
27
+ min-width: 24px;
28
+ line-height: 28px;
29
+ font-size: 20px;
30
+ text-align: center;
31
+ }
32
+ .d-time-space-text {
33
+ display: inline-block;
34
+ //margin: 0 2px;
35
+ font-size: 20px;
36
+ }
37
+ .d-day-time {
38
+ min-width: 12px;
39
+ }
40
+ // .d-count-from-end {
41
+ // margin-right: 4px;
42
+ // font-size: 9px;
43
+ // }
44
+ }
45
+ &.d-en-count-down {
46
+ :global {
47
+ .d-day-space-text {
48
+ padding-right: 4px;
49
+ }
50
+ }
51
+ }
47
52
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  showDayToSecondState,
2
+ import Taro from '@tarojs/taro';
3
3
  const {
4
4
  residueTime,
5
5
  serverTime,
6
6
  startTime,
7
7
  endTime,
8
8
  className,
9
9
  info,
10
10
  endTimeEndCallBack,
11
11
  startTimeEndCallBack,
12
12
  startTitleText,
13
13
  endTitleText,
14
14
  timeNumSpaceTextState,
15
15
  showDaytimeNumSpaceTextState,
16
16
  getDaysToHours,
17
17
  onlyShowDayState,
18
18
  showDayState,
19
19
  showHourState,
20
20
  showMinuteState,
21
21
  showSecondState,
22
22
  showDayToSecondState,
23
23
  fromStartText,
24
24
  fromEndText,
25
25
  numTextColor,
26
26
  textColor,
27
27
  numTextBgColor,
28
28
  } = props;
29
29
  const [endTimeFormat, setEndTimeFormat] = useState<{
30
30
  day: string | number;
31
31
  hour: string | number;
32
32
  minute: string | number;
33
33
  second: string | number;
34
34
  }>({
35
35
  day: 0,
36
36
  hour: 0,
37
37
  minute: 0,
38
38
  second: 0,
39
39
  });
40
40
  const countDownTimer = useRef<NodeJS.Timer | null>();
41
41
  const countDownTypeText = useRef<ComponentInterFace.CountDownTimerRef>({
42
42
  type: 'end',
43
43
  text: endTitleText,
44
44
  time: null,
45
45
  });
46
46
 
47
47
  const diffTimerRef = useRef({
48
48
  stopDocumentTime: 0,
49
49
  recoverDocumentTime: 0,
50
50
  diffTime: 0,
51
51
  });
52
52
 
53
53
  useEffect(() => {
54
54
  Taro.eventCenter.on(TaroEventType.PAGE_DOCUMENT_VISIBILITY_CHANGE, (state) => {
55
55
  if (state) {
56
56
  if (diffTimerRef.current.stopDocumentTime && diffTimerRef.current.stopDocumentTime > 0) {
57
57
  diffTimerRef.current.recoverDocumentTime = Date.now();
58
58
  diffTimerRef.current.diffTime =
59
59
  diffTimerRef.current.recoverDocumentTime - diffTimerRef.current.stopDocumentTime;
60
60
  changeTimerSetInterval(true);
61
61
  }
62
62
  } else {
63
63
  diffTimerRef.current.stopDocumentTime = Date.now();
64
64
  if (countDownTimer.current) {
65
65
  clearInterval(countDownTimer.current);
66
66
  countDownTimer.current = null;
67
67
  }
68
68
  }
69
69
  });
70
70
  }, []);
71
71
  useEffect(() => {
72
72
  if (serverTime > 0 || residueTime > 0) {
73
73
  let getNowEndTime = residueTime > 0 ? residueTime : endTime - serverTime;
74
74
  if (startTime && endTime) {
75
75
  if (serverTime <= startTime) {
76
76
  getNowEndTime = startTime - serverTime;
77
77
  countDownTypeText.current = {
78
78
  type: 'start',
79
79
  text: startTitleText,
80
80
  time: null,
81
81
  };
82
82
  } else {
83
83
  getNowEndTime = endTime - serverTime;
84
84
  countDownTypeText.current = {
85
85
  type: 'end',
86
86
  text: endTitleText,
87
87
  time: null,
88
88
  };
89
89
  }
90
90
  } else {
91
91
  countDownTypeText.current = {
92
92
  type: 'end',
93
93
  text: endTitleText,
94
94
  time: null,
95
95
  };
96
96
  }
97
97
  if (getNowEndTime > 0) {
98
98
  countDownTimeFormat(getNowEndTime);
99
99
  countDownTypeText.current.time = getNowEndTime;
100
100
  countDownTypeText.current.type === 'start' &&
101
101
  (countDownTypeText.current.endTime = endTime - serverTime);
102
102
  changeTimerSetInterval();
103
103
  } else {
104
104
  countDownTypeText.current = {
105
105
  type: 'end',
106
106
  text: endTitleText,
107
107
  time: 0,
108
108
  };
109
109
  }
110
110
  }
111
111
  return () => {
112
112
  countDownTimer.current && clearInterval(countDownTimer.current);
113
113
  };
114
114
  }, [serverTime]);
115
115
 
116
116
  const changeTimerSetInterval = (recoverState = false) => {
117
117
  countDownTimer.current && clearInterval(countDownTimer.current);
118
118
  recoverState && changeTimerFunc();
119
119
  countDownTimer.current = setInterval(changeTimerFunc, 1000);
120
120
  };
121
121
  const changeTimerFunc = () => {
122
122
  if (countDownTypeText.current.time && diffTimerRef.current.diffTime > 0) {
123
123
  countDownTypeText.current.time -= diffTimerRef.current.diffTime;
124
124
  countDownTypeText.current.type === 'start' &&
125
125
  countDownTypeText.current.endTime &&
126
126
  (countDownTypeText.current.endTime -= diffTimerRef.current.diffTime);
127
127
  console.log(
128
128
  '当前id倒计时获取倒计时息屏时间计算差值',
129
129
  countDownTimer.current,
130
130
  diffTimerRef.current,
131
131
  countDownTypeText.current,
132
132
  );
133
133
  diffTimerRef.current.stopDocumentTime = 0;
134
134
  diffTimerRef.current.recoverDocumentTime = 0;
135
135
  diffTimerRef.current.diffTime = 0;
136
136
  }
137
137
  if (countDownTypeText.current.time && countDownTypeText.current.time > 1000) {
138
138
  countDownTypeText.current.time -= 1000;
139
139
  countDownTypeText.current.type === 'start' &&
140
140
  countDownTypeText.current.endTime &&
141
141
  (countDownTypeText.current.endTime -= 1000);
142
142
  countDownTimeFormat(countDownTypeText.current.time);
143
143
  } else {
144
144
  countDownTypeText.current.time = 0;
145
145
  countDownTimeFormat(countDownTypeText.current.time);
146
146
  countDownTimer.current && clearInterval(countDownTimer.current);
147
147
  if (countDownTypeText.current.type === 'start') {
148
148
  let triggerStartTimeEndCallBackState = true;
149
149
  countDownTypeText.current = Object.assign({}, countDownTypeText.current, {
150
150
  type: 'end',
151
151
  text: endTitleText,
152
152
  });
153
153
  countDownTypeText.current.time = countDownTypeText.current.endTime;
154
154
  countDownTypeText.current.time && (countDownTypeText.current.time -= 1000);
155
155
  if (countDownTypeText.current.time && countDownTypeText.current.time > 0) {
156
156
  countDownTimer.current = setInterval(() => {
157
157
  if (countDownTypeText.current.time && diffTimerRef.current.diffTime > 0) {
158
158
  countDownTypeText.current.time -= diffTimerRef.current.diffTime;
159
159
  diffTimerRef.current.stopDocumentTime = 0;
160
160
  diffTimerRef.current.recoverDocumentTime = 0;
161
161
  diffTimerRef.current.diffTime = 0;
162
162
  }
163
163
  if (triggerStartTimeEndCallBackState && startTimeEndCallBack) {
164
164
  startTimeEndCallBack({
165
165
  type: 'start',
166
166
  endState: true,
167
167
  ...info,
168
168
  });
169
169
  triggerStartTimeEndCallBackState = false;
170
170
  }
171
171
  if (countDownTypeText.current.time && countDownTypeText.current.time > 1000) {
172
172
  countDownTypeText.current.time -= 1000;
173
173
  countDownTimeFormat(countDownTypeText.current.time);
174
174
  } else {
175
175
  endTimeEndCallBack &&
176
176
  endTimeEndCallBack({
177
177
  type: 'end',
178
178
  endState: true,
179
179
  ...info,
180
180
  });
181
181
  }
182
182
  }, 1000);
183
183
  }
184
184
  } else {
185
185
  endTimeEndCallBack &&
186
186
  endTimeEndCallBack({
187
187
  type: 'end',
188
188
  endState: true,
189
189
  ...info,
190
190
  });
191
191
  }
192
192
  }
193
193
  };
194
194
  const countDownTimeFormat = (nowEndTime) => {
195
195
  let day = Math.floor(nowEndTime / 1000 / 86400);
196
196
  let hour = Math.floor((nowEndTime / 1000 / 3600) % 24);
197
197
  const minute = Math.floor((nowEndTime / 1000 / 60) % 60);
198
198
  const second = Math.floor((nowEndTime / 1000) % 60);
199
199
  if (getDaysToHours && day > 0) {
200
200
  hour = hour + day * 24;
201
201
  day = 0;
202
202
  }
203
203
  setEndTimeFormat({
204
204
  day,
205
205
  hour: `${hour}`.padStart(2, '0'),
206
206
  minute: `${minute}`.padStart(2, '0'),
207
207
  second: `${second}`.padStart(2, '0'),
208
208
  });
209
209
  };
210
210
  const numCustomStyle = numTextColor
211
211
  ? useRef({ color: numTextColor, backgroundColor: numTextBgColor })
212
212
  : useRef({});
213
213
  const textCustomStyle = textColor ? useRef({ color: textColor }) : useRef({});
214
214
  return (
215
215
  <View
216
216
  className={classNames(
217
217
  countDownStyle['d-count-down'],
218
218
  {
219
219
  [countDownStyle['d-ios-10-count-down']]: ios10State && !devToolPlatformState,
220
220
  },
221
221
  {
222
222
  [countDownStyle['d-en-count-down']]: isLanguageForEn,
223
223
  },
224
224
  className,
225
225
  )}
226
226
  >
227
227
  {countDownTypeText.current && countDownTypeText.current.text && (
228
228
  <Text className={classNames('d-count-down-title', 'font-jdzht')}>
229
229
  {countDownTypeText.current.text}
230
230
  </Text>
231
231
  )}
232
232
  <View className="display-inline-block">
233
233
  {fromStartText && <Text className="d-count-from-start">{fromStartText}</Text>}
234
234
  {onlyShowDayState && endTimeFormat.day > 0 ? (
235
235
  <>
236
236
  <Text
237
237
  className={classNames('d-count-down-time', 'd-day-time', 'font-jdzht')}
238
238
  style={numCustomStyle.current}
239
239
  >
240
240
  {endTimeFormat.day}
241
241
  </Text>
242
242
  <Text className="d-time-space-text d-day-space-text" style={textCustomStyle.current}>
243
243
  {showDaytimeNumSpaceTextState ? countDownTimeDay : ':'}
244
244
  </Text>
245
245
  </>
246
246
  ) : (
247
247
  <>
248
248
  {(showDayState || showDayToSecondState) && endTimeFormat.day > 0 && (
249
249
  <>
250
250
  <Text
251
251
  className={classNames('d-count-down-time', 'd-day-time', 'font-jdzht')}
252
252
  style={numCustomStyle.current}
253
253
  >
254
254
  {endTimeFormat.day}
255
255
  </Text>
256
256
  <Text
257
257
  className="d-time-space-text d-day-space-text"
258
258
  style={textCustomStyle.current}
259
259
  >
260
260
  {showDaytimeNumSpaceTextState ? countDownTimeDay : ':'}
261
261
  </Text>
262
262
  </>
263
263
  )}
264
264
  {showHourState && (
265
265
  <>
266
266
  <Text
267
267
  className={classNames('d-count-down-time', 'd-hour-time', 'font-jdzht')}
268
268
  style={numCustomStyle.current}
269
269
  >
270
270
  {endTimeFormat.hour}
271
271
  </Text>
272
272
  <Text className="d-time-space-text" style={textCustomStyle.current}>
273
273
  {(endTimeFormat.day > 0 && showDaytimeNumSpaceTextState) || timeNumSpaceTextState
274
274
  ? countDownTimeHour
275
275
  : ':'}
276
276
  </Text>
277
277
  </>
278
278
  )}
279
279
  {showMinuteState && (
280
280
  <>
281
281
  <Text
282
282
  className={classNames('d-count-down-time', 'd-minute-time', 'font-jdzht')}
283
283
  style={numCustomStyle.current}
284
284
  >
285
285
  {endTimeFormat.minute}
286
286
  </Text>
287
287
  <Text className="d-time-space-text" style={textCustomStyle.current}>
288
288
  {(endTimeFormat.day > 0 && showDaytimeNumSpaceTextState) || timeNumSpaceTextState
289
289
  ? countDownTimeMin
290
290
  : endTimeFormat.day > 0
291
291
  ? ''
292
292
  : ':'}
293
293
  </Text>
294
294
  </>
295
295
  )}
296
296
  {showSecondState && (endTimeFormat.day <= 0 || showDayToSecondState) && (
297
297
  <>
298
298
  <Text
299
299
  className={classNames('d-count-down-time', 'd-second-time', 'font-jdzht')}
300
300
  style={numCustomStyle.current}
301
301
  >
302
302
  {endTimeFormat.second}
303
303
  </Text>
304
304
  {(timeNumSpaceTextState ||
305
305
  (showDayToSecondState && showDaytimeNumSpaceTextState)) && (
306
306
  <Text className="d-time-space-text" style={textCustomStyle.current}>
307
307
 
308
308
  </Text>
309
309
  )}
310
310
  </>
311
311
  )}
312
312
  </>
313
313
  )}
314
314
  {fromEndText && <Text className="d-count-from-end">{fromEndText}</Text>}
315
315
  </View>
316
316
  </View>
317
317
  );
318
318
  return useMemo(() => {
319
319
  return <CountDownTimer {...props} />;
320
320
  }, []);
321
321
  residueTime: -1,
322
322
  serverTime: null,
323
323
  className: null,
324
324
  startTime: null,
325
325
  endTime: null,
326
326
  info: null,
327
327
  startTitleText: '距活动开始',
328
328
  endTitleText: '距活动结束',
329
329
  fromEndText: null,
330
330
  startTimeEndCallBack: null,
331
331
  endTimeEndCallBack: null,
332
332
  timeNumSpaceTextState: false,
333
333
  showDaytimeNumSpaceTextState: true,
334
334
  onlyShowDayState: false,
335
335
  showDayState: false,
336
336
  showDayToSecondState: false,
337
337
  getDaysToHours: false,
338
338
  showHourState: true,
339
339
  showMinuteState: true,
340
340
  showSecondState: true,
341
341
  numTextColor: null,
342
342
  textColor: null,
343
343
  numTextBgColor: null,