@zamlia/mini-ui 0.0.11 → 0.0.12
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.
- package/es/components/industry/CitySelectButton/index.d.ts.map +1 -1
- package/lib/components/industry/CitySelectButton/index.d.ts.map +1 -1
- package/lib/styles/index.css +1 -0
- package/lib/styles/index.css.map +1 -0
- package/package.json +9 -7
- package/es/styles/_base.scss +0 -4
- package/es/styles/index.scss +0 -19
- package/es/styles/mixins.scss +0 -15
- package/es/styles/variables.scss +0 -2
- package/lib/styles/_base.scss +0 -4
- package/lib/styles/index.scss +0 -19
- package/lib/styles/mixins.scss +0 -15
- package/lib/styles/variables.scss +0 -2
- package/src/components/common/BottomPopup/index.scss +0 -34
- package/src/components/common/BottomPopup/index.tsx +0 -129
- package/src/components/common/Card/index.scss +0 -160
- package/src/components/common/Card/index.tsx +0 -72
- package/src/components/common/CardItem/index.tsx +0 -153
- package/src/components/common/DataSelect/index.tsx +0 -86
- package/src/components/common/Modal/index.scss +0 -49
- package/src/components/common/Modal/index.tsx +0 -105
- package/src/components/common/NavBar/index.scss +0 -26
- package/src/components/common/NavBar/index.tsx +0 -81
- package/src/components/common/Page/index.scss +0 -19
- package/src/components/common/Page/index.tsx +0 -56
- package/src/components/common/PullToPushRefresh/index.scss +0 -38
- package/src/components/common/PullToPushRefresh/index.tsx +0 -338
- package/src/components/common/Radio/index.scss +0 -15
- package/src/components/common/Radio/index.tsx +0 -56
- package/src/components/common/TabPane/index.tsx +0 -26
- package/src/components/common/Tabs/index.scss +0 -60
- package/src/components/common/Tabs/index.tsx +0 -107
- package/src/components/common/UploadFile/index.scss +0 -59
- package/src/components/common/UploadFile/index.tsx +0 -321
- package/src/components/common/UploadFile/upload.ts +0 -63
- package/src/components/common/UploadFile/utils.ts +0 -81
- package/src/components/common/VideoView/index.tsx +0 -50
- package/src/components/common/index.ts +0 -23
- package/src/components/industry/CitySelectButton/index.tsx +0 -76
- package/src/components/industry/CitySelectModal/index.scss +0 -122
- package/src/components/industry/CitySelectModal/index.tsx +0 -121
- package/src/components/industry/PaymentMethodSelect/index.scss +0 -146
- package/src/components/industry/PaymentMethodSelect/index.tsx +0 -316
- package/src/components/industry/index.ts +0 -5
- package/src/config/classPrefix.ts +0 -44
- package/src/index.ts +0 -9
- package/src/styles/_base.scss +0 -4
- package/src/styles/index.scss +0 -19
- package/src/styles/mixins.scss +0 -15
- package/src/styles/variables.scss +0 -2
- package/src/utils/city.ts +0 -4072
- package/src/utils/index.ts +0 -155
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { ITouchEvent, View } from '@tarojs/components';
|
|
3
|
-
import classNames from 'classnames'
|
|
4
|
-
/** 和Card共用样式 */
|
|
5
|
-
import '../Card/index.scss';
|
|
6
|
-
|
|
7
|
-
export type CardItemProps = {
|
|
8
|
-
/** label */
|
|
9
|
-
label: string | React.ReactElement
|
|
10
|
-
/** 值 */
|
|
11
|
-
value: string | number | React.ReactElement | null
|
|
12
|
-
/**
|
|
13
|
-
* label分割方式
|
|
14
|
-
* @default :
|
|
15
|
-
*/
|
|
16
|
-
labelDivider?: string
|
|
17
|
-
/**
|
|
18
|
-
* 是隐藏分割符
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
disabledLabelDivider?: boolean
|
|
22
|
-
/**
|
|
23
|
-
* 右边区域
|
|
24
|
-
* x轴排列方向 justify = 'start' 才显示
|
|
25
|
-
*/
|
|
26
|
-
extra?: React.ReactElement | string | number | null
|
|
27
|
-
/**
|
|
28
|
-
* x轴排列方向
|
|
29
|
-
* @default start
|
|
30
|
-
*/
|
|
31
|
-
justify?: 'start' | 'between'
|
|
32
|
-
/**
|
|
33
|
-
* y轴排列方向
|
|
34
|
-
* @default center
|
|
35
|
-
*/
|
|
36
|
-
align?: 'center' | 'start' | 'end'
|
|
37
|
-
/**
|
|
38
|
-
* 排列方式
|
|
39
|
-
* @default inline
|
|
40
|
-
*/
|
|
41
|
-
layout?: 'inline' | 'vertical'
|
|
42
|
-
/**
|
|
43
|
-
* value DOM是否脱离文档流
|
|
44
|
-
* 仅在layout == 'inline' 支持
|
|
45
|
-
* 不会影响上下item的间距
|
|
46
|
-
* @default false
|
|
47
|
-
*/
|
|
48
|
-
valueAbsolute?: boolean
|
|
49
|
-
/** 自定义字体样式 */
|
|
50
|
-
labelStyle?: CSSProperties
|
|
51
|
-
valueStyle?: CSSProperties
|
|
52
|
-
className?: string
|
|
53
|
-
/** 点击事件 */
|
|
54
|
-
onClick?: (e: ITouchEvent) => void
|
|
55
|
-
/**
|
|
56
|
-
* 是否隐藏该组件
|
|
57
|
-
* @default false
|
|
58
|
-
*/
|
|
59
|
-
hide?: boolean
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const CardItem: React.FC<CardItemProps> = (props) => {
|
|
63
|
-
const {
|
|
64
|
-
label,
|
|
65
|
-
value,
|
|
66
|
-
labelDivider = ':',
|
|
67
|
-
extra,
|
|
68
|
-
justify = 'start',
|
|
69
|
-
align = 'center',
|
|
70
|
-
layout = 'inline',
|
|
71
|
-
valueAbsolute = false,
|
|
72
|
-
className,
|
|
73
|
-
disabledLabelDivider = false,
|
|
74
|
-
labelStyle = {},
|
|
75
|
-
valueStyle = {},
|
|
76
|
-
hide,
|
|
77
|
-
onClick
|
|
78
|
-
} = props
|
|
79
|
-
|
|
80
|
-
const isRow = layout === 'inline';
|
|
81
|
-
|
|
82
|
-
const labelRender = () => {
|
|
83
|
-
let _render = value;
|
|
84
|
-
// if (typeof label === 'string') {
|
|
85
|
-
_render = (
|
|
86
|
-
<View className='bd_card-item__l-text' style={labelStyle}>{label}{disabledLabelDivider ? '' : labelDivider}</View>
|
|
87
|
-
)
|
|
88
|
-
// }
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<View className={classNames(
|
|
92
|
-
'bd_card-item__l',
|
|
93
|
-
{ 'bd_card-item__l-col': !isRow }
|
|
94
|
-
)}
|
|
95
|
-
>
|
|
96
|
-
{_render}
|
|
97
|
-
</View>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const valueRender = () => {
|
|
102
|
-
let _render = value;
|
|
103
|
-
if (['string', 'number']?.includes(typeof value)) {
|
|
104
|
-
_render = (
|
|
105
|
-
<View className='bd_card-item__v-text' style={valueStyle}>{value}</View>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return (
|
|
110
|
-
<View
|
|
111
|
-
className={classNames('bd_card-item__v', {
|
|
112
|
-
'bd_card-item__v-absolute': isRow && valueAbsolute
|
|
113
|
-
})}
|
|
114
|
-
style={valueStyle}
|
|
115
|
-
>
|
|
116
|
-
{_render}
|
|
117
|
-
</View>
|
|
118
|
-
)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const extraRender = () => {
|
|
122
|
-
if (!(!!extra && justify === 'start')) return null;
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<View className='bd_card-item__extra'>
|
|
126
|
-
{extra}
|
|
127
|
-
</View>
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return (
|
|
132
|
-
hide ? null : (
|
|
133
|
-
<View
|
|
134
|
-
className={classNames(
|
|
135
|
-
'bd_card-item',
|
|
136
|
-
`bd_card-item--align-${align}`,
|
|
137
|
-
{
|
|
138
|
-
'bd_card-item--row': isRow,
|
|
139
|
-
'bd_card-item--col': !isRow,
|
|
140
|
-
'bd_card-item--row-start': isRow && justify === 'start',
|
|
141
|
-
'bd_card-item--row-between': isRow && justify === 'between'
|
|
142
|
-
}, className)}
|
|
143
|
-
onClick={onClick}
|
|
144
|
-
>
|
|
145
|
-
{labelRender()}
|
|
146
|
-
{valueRender()}
|
|
147
|
-
{extraRender()}
|
|
148
|
-
</View>
|
|
149
|
-
)
|
|
150
|
-
);
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export default CardItem;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { View, Picker } from '@tarojs/components';
|
|
3
|
-
import { Utils } from '@utils';
|
|
4
|
-
|
|
5
|
-
export type DataSelectProps = {
|
|
6
|
-
dataSource: any[]
|
|
7
|
-
rangeKey: string
|
|
8
|
-
remoteValue?: any
|
|
9
|
-
onChange: (currentItem: any) => void
|
|
10
|
-
childRender?: (currentItem: any) => React.ReactElement
|
|
11
|
-
defaultSeletItem?: any
|
|
12
|
-
defaultValue?: string
|
|
13
|
-
isSelectFirstItem?: boolean
|
|
14
|
-
classNmaes?: string
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const DataSelect: React.FC<DataSelectProps> = (
|
|
18
|
-
{
|
|
19
|
-
dataSource,
|
|
20
|
-
rangeKey,
|
|
21
|
-
remoteValue,
|
|
22
|
-
onChange,
|
|
23
|
-
childRender,
|
|
24
|
-
defaultSeletItem = {},
|
|
25
|
-
defaultValue,
|
|
26
|
-
isSelectFirstItem = false,
|
|
27
|
-
classNmaes = 'DataSelect'
|
|
28
|
-
},
|
|
29
|
-
) => {
|
|
30
|
-
const [selectItem, setSelectItem] = useState<any>(defaultSeletItem as any)
|
|
31
|
-
const [selectIndex, setSelectIndex] = useState<number>(0)
|
|
32
|
-
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
if (!Utils.isEmpty(defaultSeletItem)) {
|
|
35
|
-
setSelectItem(defaultSeletItem)
|
|
36
|
-
}
|
|
37
|
-
}, [defaultSeletItem])
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (isSelectFirstItem && dataSource?.length > 0) setSelectItem(dataSource[0])
|
|
41
|
-
}, [])
|
|
42
|
-
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
remoteValue && setSelectItem(remoteValue)
|
|
45
|
-
}, [remoteValue])
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<View className={classNmaes}>
|
|
49
|
-
<Picker
|
|
50
|
-
mode='selector'
|
|
51
|
-
disabled={dataSource?.length === 0}
|
|
52
|
-
range={dataSource}
|
|
53
|
-
rangeKey={rangeKey}
|
|
54
|
-
value={selectIndex}
|
|
55
|
-
onChange={(e) => {
|
|
56
|
-
onChange(dataSource[e?.detail.value as any])
|
|
57
|
-
setSelectItem(dataSource[e?.detail.value as any])
|
|
58
|
-
setSelectIndex(e?.detail.value as number)
|
|
59
|
-
}}>
|
|
60
|
-
<View className='select-box'>
|
|
61
|
-
{
|
|
62
|
-
!childRender ? (
|
|
63
|
-
<>
|
|
64
|
-
<View className='text' style={{ fontWeight: "bold" }}>
|
|
65
|
-
{
|
|
66
|
-
!dataSource?.length ? '没有数据' : (
|
|
67
|
-
Utils.substr(selectItem[rangeKey], 20) ||
|
|
68
|
-
defaultValue ||
|
|
69
|
-
'选择内容'
|
|
70
|
-
)
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
</View>
|
|
74
|
-
<View className="icon" />
|
|
75
|
-
</>
|
|
76
|
-
) : (
|
|
77
|
-
childRender(selectItem)
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
</View>
|
|
81
|
-
</Picker>
|
|
82
|
-
</View>
|
|
83
|
-
);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export default DataSelect;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// 样式基础文件(变量和 mixin)已通过 Taro 配置自动注入,无需手动导入
|
|
2
|
-
.we-modal {
|
|
3
|
-
|
|
4
|
-
.nut-dialog {
|
|
5
|
-
position: relative;
|
|
6
|
-
min-width: 80vw;
|
|
7
|
-
|
|
8
|
-
&__content {
|
|
9
|
-
padding-inline: 24px;
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
&__footer {}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&__close {
|
|
17
|
-
position: fixed !important;
|
|
18
|
-
top: 36px;
|
|
19
|
-
right: 50px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&__btn {
|
|
23
|
-
width: 48%;
|
|
24
|
-
min-width: 230px;
|
|
25
|
-
height: 78px;
|
|
26
|
-
border-radius: 20px;
|
|
27
|
-
font-size: 24px;
|
|
28
|
-
line-height: 78px;
|
|
29
|
-
text-align: center;
|
|
30
|
-
border: 1px solid $primary-color;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&__btn-cancel {
|
|
34
|
-
margin-right: 20px;
|
|
35
|
-
background: #F0F0F0;
|
|
36
|
-
color: #666666;
|
|
37
|
-
border-color: transparent;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&__btn-confirm {
|
|
41
|
-
background: $primary-color;
|
|
42
|
-
color: #ffffff;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&__btn-confirm-large {
|
|
46
|
-
min-width: 330px;
|
|
47
|
-
border-radius: 40px;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { View } from '@tarojs/components';
|
|
3
|
-
import { Dialog, DialogProps } from '@nutui/nutui-react-taro';
|
|
4
|
-
import classNames from 'classnames';
|
|
5
|
-
import './index.scss';
|
|
6
|
-
import { Close } from '@nutui/icons-react-taro';
|
|
7
|
-
|
|
8
|
-
export type ModalProps = {
|
|
9
|
-
/** 底部 */
|
|
10
|
-
content?: React.ReactElement | string
|
|
11
|
-
/**
|
|
12
|
-
* 是否显示右上角关闭按钮
|
|
13
|
-
* @default true
|
|
14
|
-
*/
|
|
15
|
-
showCloseIcon?: boolean
|
|
16
|
-
/**
|
|
17
|
-
* 是否显示取消按钮
|
|
18
|
-
* @default true
|
|
19
|
-
*/
|
|
20
|
-
showCancel?: boolean
|
|
21
|
-
/**
|
|
22
|
-
* 是否显示确认按钮
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
showConfirm?: boolean
|
|
26
|
-
/**
|
|
27
|
-
*自定义确定按钮文字
|
|
28
|
-
*/
|
|
29
|
-
confirmText?: React.ReactElement | string
|
|
30
|
-
className?: string
|
|
31
|
-
onCancel?: () => void
|
|
32
|
-
onConfirm?: () => void
|
|
33
|
-
} & Omit<DialogProps, 'content' | 'onCancel' | 'onConfirm' | 'confirmText'>;
|
|
34
|
-
|
|
35
|
-
const Modal: React.FC<PropsWithChildren<ModalProps>> = (props) => {
|
|
36
|
-
const {
|
|
37
|
-
className,
|
|
38
|
-
content,
|
|
39
|
-
children,
|
|
40
|
-
showCloseIcon = true,
|
|
41
|
-
showCancel = true,
|
|
42
|
-
showConfirm = true,
|
|
43
|
-
confirmText = "确定",
|
|
44
|
-
onCancel,
|
|
45
|
-
onConfirm,
|
|
46
|
-
...restProps
|
|
47
|
-
} = props
|
|
48
|
-
|
|
49
|
-
const confirmBtnRender = () => {
|
|
50
|
-
if (!showConfirm) {
|
|
51
|
-
return null
|
|
52
|
-
}
|
|
53
|
-
if (typeof confirmText === 'string') {
|
|
54
|
-
return (
|
|
55
|
-
<View className={classNames('we-modal__btn we-modal__btn-confirm', {
|
|
56
|
-
'we-modal__btn-confirm-large': !showCancel
|
|
57
|
-
})} onClick={onConfirm}>
|
|
58
|
-
{confirmText}
|
|
59
|
-
</View>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
return confirmText
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const cancelBtnRender = () => {
|
|
66
|
-
if (!showCancel) {
|
|
67
|
-
return null
|
|
68
|
-
}
|
|
69
|
-
return (
|
|
70
|
-
<View className='we-modal__btn we-modal__btn-cancel' onClick={onCancel}>
|
|
71
|
-
取消
|
|
72
|
-
</View>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<View className={!!className ? `${className} we-modal` : 'we-modal'}>
|
|
78
|
-
<Dialog
|
|
79
|
-
{...restProps}
|
|
80
|
-
lockScroll={true}
|
|
81
|
-
onConfirm={onConfirm}
|
|
82
|
-
onCancel={onCancel}
|
|
83
|
-
footer={(
|
|
84
|
-
<>
|
|
85
|
-
{cancelBtnRender()}
|
|
86
|
-
{confirmBtnRender()}
|
|
87
|
-
</>
|
|
88
|
-
)}
|
|
89
|
-
>
|
|
90
|
-
{children || content}
|
|
91
|
-
{
|
|
92
|
-
showCloseIcon && (
|
|
93
|
-
<Close
|
|
94
|
-
size='22'
|
|
95
|
-
className='we-modal__close'
|
|
96
|
-
onClick={onCancel}
|
|
97
|
-
/>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
</Dialog>
|
|
101
|
-
</View>
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export default Modal;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.transparent-nav {
|
|
2
|
-
width: 100vw;
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
top: 0;
|
|
7
|
-
left: 0;
|
|
8
|
-
z-index: 1000;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.transparent-nav--center {
|
|
12
|
-
font-weight: 600;
|
|
13
|
-
font-size: 36px;
|
|
14
|
-
color: #1D1B1B;
|
|
15
|
-
line-height: 50px;
|
|
16
|
-
display: flex;
|
|
17
|
-
justify-content: center;
|
|
18
|
-
align-items: center;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.transparent-nav--fixed {
|
|
22
|
-
position: fixed;
|
|
23
|
-
top: 0;
|
|
24
|
-
left: 0;
|
|
25
|
-
z-index: 1000;
|
|
26
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { Text, ITouchEvent } from '@tarojs/components';
|
|
2
|
-
import { NavBar as NutNavBar } from '@nutui/nutui-react-taro';
|
|
3
|
-
import { ArrowLeft, Share } from '@nutui/icons-react-taro';
|
|
4
|
-
import Taro from '@tarojs/taro';
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import './index.scss';
|
|
7
|
-
|
|
8
|
-
export type NavBarProps = {
|
|
9
|
-
title?: string | React.ReactElement
|
|
10
|
-
/**
|
|
11
|
-
* 标题剧中
|
|
12
|
-
* @default false
|
|
13
|
-
*/
|
|
14
|
-
titleCenter?: boolean
|
|
15
|
-
/**
|
|
16
|
-
* 是否是头像
|
|
17
|
-
* @default false
|
|
18
|
-
* @description 如果该值是true titleCenter则为true
|
|
19
|
-
*/
|
|
20
|
-
isHeader?: boolean
|
|
21
|
-
/**
|
|
22
|
-
* 背景颜色
|
|
23
|
-
* @default transparent
|
|
24
|
-
* @description 只有isHeader才生效
|
|
25
|
-
*/
|
|
26
|
-
backageColor?: string
|
|
27
|
-
/**
|
|
28
|
-
* 是否穿透
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
fixed?: boolean
|
|
32
|
-
/**
|
|
33
|
-
* 返回按钮
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
back?: boolean
|
|
37
|
-
/**
|
|
38
|
-
* 返回事件
|
|
39
|
-
*/
|
|
40
|
-
onBack?: () => void
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const NavBar: React.FC<NavBarProps> = (props) => {
|
|
44
|
-
const {
|
|
45
|
-
title,
|
|
46
|
-
onBack
|
|
47
|
-
} = props;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* 返回
|
|
51
|
-
*/
|
|
52
|
-
const handleBack = (e: ITouchEvent) => {
|
|
53
|
-
e?.stopPropagation()
|
|
54
|
-
if (onBack) {
|
|
55
|
-
onBack();
|
|
56
|
-
} else {
|
|
57
|
-
Taro.navigateBack({ delta: 1 })
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<NutNavBar
|
|
63
|
-
back={
|
|
64
|
-
<>
|
|
65
|
-
<ArrowLeft size={14} />
|
|
66
|
-
返回
|
|
67
|
-
</>
|
|
68
|
-
}
|
|
69
|
-
right={
|
|
70
|
-
<span className="flex-center">
|
|
71
|
-
<Share size={14} />
|
|
72
|
-
</span>
|
|
73
|
-
}
|
|
74
|
-
onBackClick={handleBack}
|
|
75
|
-
>
|
|
76
|
-
<Text>{title}</Text>
|
|
77
|
-
</NutNavBar>
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export default NavBar
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
.we-page {
|
|
2
|
-
width: 100%;
|
|
3
|
-
|
|
4
|
-
&__loading {
|
|
5
|
-
padding: 50px 0;
|
|
6
|
-
text-align: center;
|
|
7
|
-
display: flex;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&__empty {
|
|
12
|
-
width: 100%;
|
|
13
|
-
text-align: center;
|
|
14
|
-
height: 100px;
|
|
15
|
-
line-height: 100px;
|
|
16
|
-
font-size: 28px;
|
|
17
|
-
color: #666666;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { View } from '@tarojs/components';
|
|
3
|
-
import { Utils } from '@utils';
|
|
4
|
-
import './index.scss';
|
|
5
|
-
|
|
6
|
-
export type PageProps = {
|
|
7
|
-
error: boolean
|
|
8
|
-
loading: boolean
|
|
9
|
-
loadingColor?: string
|
|
10
|
-
loadingText?: string
|
|
11
|
-
errorText?: string
|
|
12
|
-
emptyDataText?: string
|
|
13
|
-
emptyDataRender?: React.ReactElement
|
|
14
|
-
dataSource: Array<any> | any
|
|
15
|
-
onRequest?: () => void
|
|
16
|
-
renderLoading?: any
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const Page: React.FC<PropsWithChildren<PageProps>> = (props) => {
|
|
20
|
-
const {
|
|
21
|
-
error = true,
|
|
22
|
-
loading = false,
|
|
23
|
-
// loadingColor = '#666666',
|
|
24
|
-
// loadingText = '加载中...',
|
|
25
|
-
errorText = '加载失败,请点击重试',
|
|
26
|
-
emptyDataText = '没有数据',
|
|
27
|
-
dataSource = [],
|
|
28
|
-
renderLoading,
|
|
29
|
-
emptyDataRender,
|
|
30
|
-
onRequest = () => { console.error('Page组件props没有传入onRequest') },
|
|
31
|
-
children
|
|
32
|
-
} = props;
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<View className='we-page'>
|
|
36
|
-
{
|
|
37
|
-
!loading && !error && !Utils.isEmpty(dataSource) && children
|
|
38
|
-
}
|
|
39
|
-
{loading ?
|
|
40
|
-
(
|
|
41
|
-
renderLoading || (
|
|
42
|
-
<View className='we-page__loading'>
|
|
43
|
-
{/* <Loading color={loadingColor} content={loadingText} /> */}
|
|
44
|
-
</View>
|
|
45
|
-
)
|
|
46
|
-
) : (
|
|
47
|
-
error ?
|
|
48
|
-
<View className='we-page__empty' onClick={onRequest}>{errorText}</View> :
|
|
49
|
-
Utils.isEmpty(dataSource) && <View className='we-page__empty-content'>{emptyDataRender ? emptyDataRender : emptyDataText}</View>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
</View>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export default Page
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
.we-list {
|
|
2
|
-
.scroll {
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
&__bottom {
|
|
7
|
-
margin: 0 auto;
|
|
8
|
-
text-align: center;
|
|
9
|
-
height: 200px;
|
|
10
|
-
line-height: 200px;
|
|
11
|
-
font-size: 24px;
|
|
12
|
-
color: #999999;
|
|
13
|
-
|
|
14
|
-
&-text {}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&__text {
|
|
18
|
-
font-size: 24px;
|
|
19
|
-
color: #999999;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&__ptpr {
|
|
23
|
-
display: flex;
|
|
24
|
-
align-items: center;
|
|
25
|
-
justify-content: center;
|
|
26
|
-
height: 200px;
|
|
27
|
-
|
|
28
|
-
.nut-loading-icon {
|
|
29
|
-
width: 20px !important;
|
|
30
|
-
height: 20px !important;
|
|
31
|
-
font-size: 16px !important;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.nut-loading-text {
|
|
35
|
-
font-size: 12px !important;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|