@conecli/cone-render 0.10.1-beta.2 → 0.10.1-beta.4

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, { useEffect, useContext, useState } from 'react'
2
1
  const { title, openAppParams, style, hasCommonHeader = true, hasDownloadTips = true, headerParams } = props
3
2
  useEffect(() => {
4
3
  hasCommonHeader && initCommonHeader()
5
4
  hasDownloadTips && initDownloadAppLayerConfigData()
6
5
  }, [])
7
6
  const initCommonHeader = () => {
8
7
  if (window?.MCommonHeaderBottom) {
9
8
  const mchb = new MCommonHeaderBottom()
10
9
  const headerArg = {
11
10
  moduleName: 'shop',
12
11
  hrederId: 'm_common_header',
13
12
  title,
14
13
  stype: 1,
15
14
  onClickJdkey: function () {
16
15
  console.log('==>m_common_header jdkey click.')
17
16
  },
18
17
  ...headerParams
19
18
  }
20
19
  mchb.header(headerArg)
21
20
  }
22
21
  }
23
22
  const initDownloadAppLayerConfigData = () => {
24
23
  const getEle = document.getElementById('m_common_tip')
25
24
  getEle &&
26
25
  window.$ &&
27
26
  window.$.downloadAppLayerConfigData &&
28
27
  window.$.downloadAppLayerConfigData({
29
28
  tipId: 'm_common_tip',
30
29
  M_sourceFrom: 'jshop',
31
30
  bottom: 74,
32
31
  onClickTipX: () => {
33
32
  Taro.eventCenter.trigger(
34
33
  TaroEventType.DOWN_LOAD_APP_CLOSE_CHANGE,
35
34
  true,
36
35
  )
37
36
  },
38
37
  downloadAppPlugIn: {
39
38
  M_sourceFrom: 'jshop',
40
39
  openAppBtnId: 'download_openapp',
41
40
  downAppURl: '//conecli.com/downloadApp/download.html?channel=jd-m',
42
41
  inteneUrl: 'openapp.jdmobile://virtual?',
43
42
  inteneUrlParams: {
44
43
  category: 'jump',
45
44
  des: 'jshopMain',
46
45
  shopId: `${global.info.queryInfo.shopId || ''}`,
47
46
  venderId: `${global.info.queryInfo.venderId || ''}`,
48
47
  sourceType: global.info.queryInfo?.sourceType || 'M-H5',
49
48
  sourceValue: global.info.queryInfo?.sourceValue || 'Mshop',
50
49
  ...openAppParams,
51
50
  },
52
51
  },
53
52
  })
54
53
  }
55
54
  return !isWxMiniH5View && !isJdApp ? (
56
55
  <View
57
56
  className={mobileCommonHeaderStyle['d-mobile-header-layout']}
58
57
  style={style}
59
58
  >
60
59
  <View
61
60
  id="m_common_tip"
62
61
  className={mobileCommonHeaderStyle['d-mobile-common-tip']}
63
62
  />
64
63
  {hasCommonHeader && (
65
64
  <View
66
65
  id="m_common_header"
67
66
  className={mobileCommonHeaderStyle['d-mobile-common-header']}
68
67
  />
69
68
  )}
70
69
  </View>
71
70
  ) : null
72
71
  title: '店铺',
73
72
  openAppParams: {},
73
+ import React, {useEffect, useRef} from 'react'
74
74
  const { title, openAppParams, style, hasCommonHeader = true, hasDownloadTips = true, headerParams } = props
75
75
  const headerRef:any = useRef(null)
76
76
  useEffect(() => {
77
77
  hasCommonHeader && initCommonHeader()
78
78
  hasDownloadTips && initDownloadAppLayerConfigData()
79
79
  }, [])
80
80
  const scrollEventFunc = () => {
81
81
  const stickyTop = headerRef.current?.getBoundingClientRect()?.top || 0;
82
82
  const rootScrollEleNode = document.querySelector('#J_shopHomeRoot')
83
83
  if (rootScrollEleNode && rootScrollEleNode.scrollTop > stickyTop) {
84
84
  headerRef.current.classList.add('d-mobile-header-sticky');
85
85
  } else {
86
86
  headerRef.current.classList.remove('d-mobile-header-sticky');
87
87
  }
88
88
  }
89
89
  useEffect(() => {
90
90
  if(!headerRef.current) return
91
91
  const rootScrollEleNode = document.querySelector('#J_shopHomeRoot')
92
92
  rootScrollEleNode && rootScrollEleNode.addEventListener('scroll', scrollEventFunc);
93
93
  return () => {
94
94
  rootScrollEleNode && rootScrollEleNode.removeEventListener('scroll', scrollEventFunc)
95
95
  }
96
96
  },[])
97
97
  const initCommonHeader = () => {
98
98
  if (window?.MCommonHeaderBottom) {
99
99
  const mchb = new MCommonHeaderBottom()
100
100
  const headerArg = {
101
101
  moduleName: 'shop',
102
102
  hrederId: 'm_common_header',
103
103
  title,
104
104
  stype: 1,
105
105
  onClickJdkey: function () {
106
106
  console.log('==>m_common_header jdkey click.')
107
107
  },
108
108
  ...headerParams
109
109
  }
110
110
  mchb.header(headerArg)
111
111
  }
112
112
  }
113
113
  const initDownloadAppLayerConfigData = () => {
114
114
  const getEle = document.getElementById('m_common_tip')
115
115
  getEle &&
116
116
  window.$ &&
117
117
  window.$.downloadAppLayerConfigData &&
118
118
  window.$.downloadAppLayerConfigData({
119
119
  tipId: 'm_common_tip',
120
120
  M_sourceFrom: 'jshop',
121
121
  bottom: 74,
122
122
  onClickTipX: () => {
123
123
  Taro.eventCenter.trigger(
124
124
  TaroEventType.DOWN_LOAD_APP_CLOSE_CHANGE,
125
125
  true,
126
126
  )
127
127
  },
128
128
  downloadAppPlugIn: {
129
129
  M_sourceFrom: 'jshop',
130
130
  openAppBtnId: 'download_openapp',
131
131
  downAppURl: '//conecli.com/downloadApp/download.html?channel=jd-m',
132
132
  inteneUrl: 'openapp.jdmobile://virtual?',
133
133
  inteneUrlParams: {
134
134
  category: 'jump',
135
135
  des: 'jshopMain',
136
136
  shopId: `${global.info.queryInfo.shopId || ''}`,
137
137
  venderId: `${global.info.queryInfo.venderId || ''}`,
138
138
  sourceType: global.info.queryInfo?.sourceType || 'M-H5',
139
139
  sourceValue: global.info.queryInfo?.sourceValue || 'Mshop',
140
140
  ...openAppParams,
141
141
  },
142
142
  },
143
143
  })
144
144
  }
145
145
  return !isWxMiniH5View && !isJdApp ? (
146
146
  <View
147
147
  className={mobileCommonHeaderStyle['d-mobile-header-layout']}
148
148
  style={style}
149
149
  ref={headerRef}
150
150
  >
151
151
  <View
152
152
  id="m_common_tip"
153
153
  className={mobileCommonHeaderStyle['d-mobile-common-tip']}
154
154
  />
155
155
  {hasCommonHeader && (
156
156
  <View
157
157
  id="m_common_header"
158
158
  className={mobileCommonHeaderStyle['d-mobile-common-header']}
159
159
  />
160
160
  )}
161
161
  </View>
162
162
  ) : null
163
163
  title: '店铺',
164
164
  openAppParams: {},
@@ -1 +1 @@
1
- import { View, Text } from '@tarojs/components'
1
+ import { View, Text } from '@tarojs/components'
2
2
  const { placeHolderPreContainerId = '-1', containerId } = props
3
3
  return (
4
4
  <View
5
5
  className={classNames(placeHolderStyle['d-place-holder'], {
6
6
  [placeHolderStyle['d-place-holder-active']]:
7
7
  placeHolderPreContainerId === containerId ||
8
8
  placeHolderPreContainerId === EMPTY_LIST_PREFLOOR_ID,
9
9
  })}
10
10
  >
11
11
  <View
12
12
  className={classNames(
13
13
  placeHolderStyle['d-place-holder-border'],
14
14
  'flexible-center-box',
15
15
  )}
16
16
  >
17
17
  <Text className={placeHolderStyle['d-place-holder-text']}>
18
18
  松开鼠标模块会放到这里
19
19
  </Text>
20
20
  </View>
21
21
  </View>
22
22
  )
@@ -1 +1 @@
1
- import React from 'react'
2
1
  return FloorContentItem ? (
3
2
  <FloorContentItem {...props} dataDefines={dataDefines} />
4
3
  ) : isDevMode ? (
5
4
  renderDecorateDefaultModule()
6
5
  ) : null
6
+ import React from 'react'
7
7
  const {
8
8
  floorData,
9
9
  renderSourceType = BUSINESS_TYPE.ONLINE,
10
10
  builtInComponents = {},
11
11
  updateContainerFloorListDataFn,
12
12
  } = props
13
13
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
14
14
  const floorModuleType = floorData?.floorExtInfo?.moduleFlag
15
15
  const FloorContentItem =
16
16
  (floorModuleType && builtInComponents[floorModuleType]) || null
17
17
  const dataDefines = getFloorDataToDataDefines(floorData)
18
18
 
19
19
  const renderDecorateDefaultModule = () => {
20
20
  return (
21
21
  <View
22
22
  style={{
23
23
  lineHeight: '120px',
24
24
  textAlign: 'center',
25
25
  }}
26
26
  >
27
27
  当前模块是{floorData.moduleName}
28
28
  </View>
29
29
  )
30
30
  }
31
31
  return FloorContentItem ? (
32
32
  <FloorContentItem {...props} dataDefines={dataDefines} />
33
33
  ) : isDevMode ? (
34
34
  renderDecorateDefaultModule()
35
35
  ) : null
36
36
  switch (moduleId) {
37
37
  case 83158:
38
38
  return 'freeLayout'
39
39
  case 99654:
40
40
  return 'activeText'
41
41
  case 100382:
42
42
  return 'superGoods'
43
43
  }
44
44
  floorList.map((item) => {
45
45
  if (!item.floorExtInfo) {
46
46
  return null
47
47
  }
48
48
  const moduleFlag = item.floorExtInfo.moduleFlag
49
49
  if (!moduleFlag) {
50
50
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
51
51
  if (newModuleFlag) {
52
52
  item.floorExtInfo.moduleFlag = newModuleFlag
53
53
  }
54
54
  }
55
55
  })
@@ -1 +1 @@
1
- import React from 'react'
2
1
  const { floorData, renderSourceType, builtInComponents = {} } = props
3
2
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
4
3
  const floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
5
4
  const FloorContentItem =
6
5
  (floorModuleType && builtInComponents[floorModuleType]) || null
7
6
  const dataDefines = getFloorDataToDataDefines(floorData)
8
7
 
9
8
  const renderDecorateDefaultModule = () => {
10
9
  return (
11
10
  <View
12
11
  style={{
13
12
  lineHeight: '120px',
14
13
  textAlign: 'center',
15
14
  }}
16
15
  >
17
16
  当前模块是{floorData.moduleName}
18
17
  </View>
19
18
  )
20
19
  }
21
20
  if (floorModuleType && (RemoteLoadFloorList.includes(floorModuleType) || floorData?.floorExtInfo?.floorLoadWay === 2)) {
22
21
  return (
23
22
  <RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
24
23
  )
25
24
  } else {
26
25
  return FloorContentItem ? (
27
26
  <ErrorBoundary {...props}>
28
27
  <FloorContentItem {...props} dataDefines={dataDefines} />
29
28
  </ErrorBoundary>
30
29
  ) : isDevMode ? (
31
30
  renderDecorateDefaultModule()
32
31
  ) : null
33
32
  }
34
33
  renderSourceType: BUSINESS_TYPE.ONLINE,
35
34
  switch (moduleId) {
36
35
  case 83158:
37
36
  return 'freeLayout'
38
37
  case 99654:
39
38
  return 'activeText'
40
39
  case 100382:
41
40
  return 'superGoods'
42
41
  }
43
42
  floorList.map((item) => {
44
43
  if (!item.floorExtInfo) {
45
44
  return null
46
45
  }
47
46
  const moduleFlag = item.floorExtInfo.moduleFlag
48
47
  if (!moduleFlag) {
49
48
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
50
49
  if (newModuleFlag) {
51
50
  item.floorExtInfo.moduleFlag = newModuleFlag
52
51
  }
53
52
  }
54
53
  })
54
+ import React from 'react'
55
55
  const {
56
56
  floorData,
57
57
  renderSourceType = BUSINESS_TYPE.ONLINE,
58
58
  builtInComponents = {},
59
59
  } = props
60
60
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
61
61
  const floorModuleType: any = floorData?.floorExtInfo?.moduleFlag
62
62
  const FloorContentItem =
63
63
  (floorModuleType && builtInComponents[floorModuleType]) || null
64
64
  const dataDefines = getFloorDataToDataDefines(floorData)
65
65
 
66
66
  const renderDecorateDefaultModule = () => {
67
67
  return (
68
68
  <View
69
69
  style={{
70
70
  lineHeight: '120px',
71
71
  textAlign: 'center',
72
72
  }}
73
73
  >
74
74
  当前模块是{floorData.moduleName}
75
75
  </View>
76
76
  )
77
77
  }
78
78
  if (
79
79
  floorModuleType &&
80
80
  (RemoteLoadFloorList.includes(floorModuleType) ||
81
81
  floorData?.floorExtInfo?.floorLoadWay === 2)
82
82
  ) {
83
83
  return (
84
84
  <RemoteFloorItem {...props} dataDefines={dataDefines}></RemoteFloorItem>
85
85
  )
86
86
  } else {
87
87
  return FloorContentItem ? (
88
88
  <ErrorBoundary {...props}>
89
89
  <FloorContentItem {...props} dataDefines={dataDefines} />
90
90
  </ErrorBoundary>
91
91
  ) : isDevMode ? (
92
92
  renderDecorateDefaultModule()
93
93
  ) : null
94
94
  }
95
95
  switch (moduleId) {
96
96
  case 83158:
97
97
  return 'freeLayout'
98
98
  case 99654:
99
99
  return 'activeText'
100
100
  case 100382:
101
101
  return 'superGoods'
102
102
  }
103
103
  floorList.map((item) => {
104
104
  if (!item.floorExtInfo) {
105
105
  return null
106
106
  }
107
107
  const moduleFlag = item.floorExtInfo.moduleFlag
108
108
  if (!moduleFlag) {
109
109
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
110
110
  if (newModuleFlag) {
111
111
  item.floorExtInfo.moduleFlag = newModuleFlag
112
112
  }
113
113
  }
114
114
  })
@@ -1 +1 @@
1
- import React from 'react'
2
1
  return FloorContentItem ? (
3
2
  <ErrorBoundary {...props}>
4
3
  <FloorContentItem {...props} dataDefines={dataDefines} />
5
4
  </ErrorBoundary>
6
5
  ) : isDevMode ? (
7
6
  renderDecorateDefaultModule()
8
7
  ) : null
8
+ import React from 'react'
9
9
  const {
10
10
  floorData,
11
11
  renderSourceType = BUSINESS_TYPE.ONLINE,
12
12
  builtInComponents = {},
13
13
  updateContainerFloorListDataFn,
14
14
  } = props
15
15
  const isDevMode = renderSourceType === BUSINESS_TYPE.DECORATE
16
16
  const floorModuleType = floorData?.floorExtInfo?.moduleFlag
17
17
  const FloorContentItem =
18
18
  (floorModuleType && builtInComponents[floorModuleType]) || null
19
19
  const dataDefines = getFloorDataToDataDefines(floorData)
20
20
 
21
21
  const renderDecorateDefaultModule = () => {
22
22
  return (
23
23
  <View
24
24
  style={{
25
25
  lineHeight: '120px',
26
26
  textAlign: 'center',
27
27
  }}
28
28
  >
29
29
  当前模块是{floorData.moduleName}
30
30
  </View>
31
31
  )
32
32
  }
33
33
  return FloorContentItem ? (
34
34
  <ErrorBoundary {...props}>
35
35
  <FloorContentItem {...props} dataDefines={dataDefines} />
36
36
  </ErrorBoundary>
37
37
  ) : isDevMode ? (
38
38
  renderDecorateDefaultModule()
39
39
  ) : null
40
40
  switch (moduleId) {
41
41
  case 83158:
42
42
  return 'freeLayout'
43
43
  case 99654:
44
44
  return 'activeText'
45
45
  case 100382:
46
46
  return 'superGoods'
47
47
  }
48
48
  floorList.map((item) => {
49
49
  if (!item.floorExtInfo) {
50
50
  return null
51
51
  }
52
52
  const moduleFlag = item.floorExtInfo.moduleFlag
53
53
  if (!moduleFlag) {
54
54
  const newModuleFlag = moduleId2ModuleFlag(item.moduleId)
55
55
  if (newModuleFlag) {
56
56
  item.floorExtInfo.moduleFlag = newModuleFlag
57
57
  }
58
58
  }
59
59
  })
@@ -1 +1 @@
1
- import React from 'react'
2
1
  subMessage?: string
3
2
  viewMaxHeight?: string
4
3
  floorLoadWay?: number
5
4
  floorKind?: number
6
5
  shopId?: string
7
6
  moduleDesignerType?: string
8
7
  showCommonFloorHead?: boolean
9
8
  borderRadius: number
10
9
  borderTopLeftRadius?: number
11
10
  borderTopRightRadius?: number
12
11
  borderBottomLeftRadius?: number
13
12
  borderBottomRightRadius?: number
14
13
  marginTop?: number
15
14
  marginBottom?: number
16
15
  marginLeft?: number
17
16
  marginRight?: number
18
17
  paddingTop?: number
19
18
  paddingBottom?: number
20
19
  paddingLeft?: number
21
20
  paddingRight?: number
22
21
  containerId: string
23
22
  background?: string
24
23
  containerPosition?: string
25
24
  key?: string
26
25
  floors: floorItemData[]
27
26
  includeUids: string[]
28
27
  typeCn: string
29
28
  typeCode?: string
30
29
  addLuxuryStyle?: boolean
31
30
  addLuxuryBackupStyle?: boolean
32
31
  renderExtendComponent?: Function
33
32
  floorExtendData?: any
34
33
  }
35
34
  isRealTimeRender: boolean
36
35
  forceRenderTime: number
37
36
  customErrorIsvFloorModule?: React.ReactElement | undefined
38
37
  containerIndex?: number
39
38
  containerData?: any
40
39
  shopTotalInfo?: any
41
40
  selectContainerFn?: Function
42
41
  selectContainerId?: string
43
42
  placeHolderPreContainerId?: string
44
43
  children?: any
45
44
  style?: {
46
45
  [key: string]: any
47
46
  };
48
47
  layoutLeftRightMargin?: number
49
48
  }
50
49
  showDayToSecondState?: boolean
51
50
  onFormSubmit?: Function
52
51
  onFormReset?: Function
53
52
  isFormDialog?: boolean
54
53
  forbiddenBgScrollState?: boolean
55
54
  evenList: any[]
56
55
  oddList: any[]
56
+ import React from 'react'
57
57
  subMessage?: string
58
58
  viewMaxHeight?: string
59
59
  floorLoadWay?: number
60
60
  floorKind?: number
61
61
  shopId?: string
62
62
  moduleDesignerType?: string
63
63
  showCommonFloorHead?: boolean
64
64
  borderRadius: number
65
65
  borderTopLeftRadius?: number
66
66
  borderTopRightRadius?: number
67
67
  borderBottomLeftRadius?: number
68
68
  borderBottomRightRadius?: number
69
69
  marginTop?: number
70
70
  marginBottom?: number
71
71
  marginLeft?: number
72
72
  marginRight?: number
73
73
  paddingTop?: number
74
74
  paddingBottom?: number
75
75
  paddingLeft?: number
76
76
  paddingRight?: number
77
77
  containerId: string
78
78
  background?: string
79
79
  containerPosition?: string
80
80
  key?: string
81
81
  floors: floorItemData[]
82
82
  includeUids: string[]
83
83
  typeCn: string
84
84
  typeCode?: string
85
85
  addLuxuryStyle?: boolean
86
86
  addLuxuryBackupStyle?: boolean
87
87
  renderExtendComponent?: Function
88
88
  floorExtendData?: any
89
89
  }
90
90
  isRealTimeRender: boolean
91
91
  forceRenderTime: number
92
92
  customErrorIsvFloorModule?: React.ReactElement | undefined
93
93
  containerIndex?: number
94
94
  containerData?: any
95
95
  shopTotalInfo?: any
96
96
  selectContainerFn?: Function
97
97
  selectContainerId?: string
98
98
  placeHolderPreContainerId?: string
99
99
  children?: any
100
100
  style?: {
101
101
  [key: string]: any
102
102
  };
103
103
  layoutLeftRightMargin?: number
104
104
  }
105
105
  showDayToSecondState?: boolean
106
106
  onFormSubmit?: Function
107
107
  onFormReset?: Function
108
108
  isFormDialog?: boolean
109
109
  forbiddenBgScrollState?: boolean
110
110
  evenList: any[]
111
111
  oddList: any[]