@zamlia/mini-ui 0.0.1
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/common/BottomPopup/index.d.ts +78 -0
- package/es/components/common/BottomPopup/index.d.ts.map +1 -0
- package/es/components/common/Card/index.d.ts +33 -0
- package/es/components/common/Card/index.d.ts.map +1 -0
- package/es/components/common/CardItem/index.d.ts +60 -0
- package/es/components/common/CardItem/index.d.ts.map +1 -0
- package/es/components/common/DataSelect/index.d.ts +15 -0
- package/es/components/common/DataSelect/index.d.ts.map +1 -0
- package/es/components/common/Modal/index.d.ts +31 -0
- package/es/components/common/Modal/index.d.ts.map +1 -0
- package/es/components/common/NavBar/index.d.ts +38 -0
- package/es/components/common/NavBar/index.d.ts.map +1 -0
- package/es/components/common/Page/index.d.ts +16 -0
- package/es/components/common/Page/index.d.ts.map +1 -0
- package/es/components/common/PullToPushRefresh/index.d.ts +94 -0
- package/es/components/common/PullToPushRefresh/index.d.ts.map +1 -0
- package/es/components/common/Radio/index.d.ts +26 -0
- package/es/components/common/Radio/index.d.ts.map +1 -0
- package/es/components/common/TabPane/index.d.ts +9 -0
- package/es/components/common/TabPane/index.d.ts.map +1 -0
- package/es/components/common/Tabs/index.d.ts +27 -0
- package/es/components/common/Tabs/index.d.ts.map +1 -0
- package/es/components/common/UploadFile/index.d.ts +50 -0
- package/es/components/common/UploadFile/index.d.ts.map +1 -0
- package/es/components/common/UploadFile/upload.d.ts +11 -0
- package/es/components/common/UploadFile/upload.d.ts.map +1 -0
- package/es/components/common/UploadFile/utils.d.ts +20 -0
- package/es/components/common/UploadFile/utils.d.ts.map +1 -0
- package/es/components/common/VideoView/index.d.ts +14 -0
- package/es/components/common/VideoView/index.d.ts.map +1 -0
- package/es/components/common/index.d.ts +23 -0
- package/es/components/common/index.d.ts.map +1 -0
- package/es/components/industry/CitySelectButton/index.d.ts +17 -0
- package/es/components/industry/CitySelectButton/index.d.ts.map +1 -0
- package/es/components/industry/CitySelectModal/index.d.ts +13 -0
- package/es/components/industry/CitySelectModal/index.d.ts.map +1 -0
- package/es/components/industry/PaymentMethodSelect/index.d.ts +59 -0
- package/es/components/industry/PaymentMethodSelect/index.d.ts.map +1 -0
- package/es/components/industry/index.d.ts +5 -0
- package/es/components/industry/index.d.ts.map +1 -0
- package/es/config/classPrefix.d.ts +36 -0
- package/es/config/classPrefix.d.ts.map +1 -0
- package/es/index.d.ts +4 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +5334 -0
- package/es/index.js.map +1 -0
- package/es/styles/_base.scss +4 -0
- package/es/styles/index.scss +19 -0
- package/es/styles/mixins.scss +15 -0
- package/es/styles/variables.scss +2 -0
- package/es/utils/city.d.ts +4005 -0
- package/es/utils/city.d.ts.map +1 -0
- package/es/utils/index.d.ts +50 -0
- package/es/utils/index.d.ts.map +1 -0
- package/lib/components/common/BottomPopup/index.d.ts +78 -0
- package/lib/components/common/BottomPopup/index.d.ts.map +1 -0
- package/lib/components/common/Card/index.d.ts +33 -0
- package/lib/components/common/Card/index.d.ts.map +1 -0
- package/lib/components/common/CardItem/index.d.ts +60 -0
- package/lib/components/common/CardItem/index.d.ts.map +1 -0
- package/lib/components/common/DataSelect/index.d.ts +15 -0
- package/lib/components/common/DataSelect/index.d.ts.map +1 -0
- package/lib/components/common/Modal/index.d.ts +31 -0
- package/lib/components/common/Modal/index.d.ts.map +1 -0
- package/lib/components/common/NavBar/index.d.ts +38 -0
- package/lib/components/common/NavBar/index.d.ts.map +1 -0
- package/lib/components/common/Page/index.d.ts +16 -0
- package/lib/components/common/Page/index.d.ts.map +1 -0
- package/lib/components/common/PullToPushRefresh/index.d.ts +94 -0
- package/lib/components/common/PullToPushRefresh/index.d.ts.map +1 -0
- package/lib/components/common/Radio/index.d.ts +26 -0
- package/lib/components/common/Radio/index.d.ts.map +1 -0
- package/lib/components/common/TabPane/index.d.ts +9 -0
- package/lib/components/common/TabPane/index.d.ts.map +1 -0
- package/lib/components/common/Tabs/index.d.ts +27 -0
- package/lib/components/common/Tabs/index.d.ts.map +1 -0
- package/lib/components/common/UploadFile/index.d.ts +50 -0
- package/lib/components/common/UploadFile/index.d.ts.map +1 -0
- package/lib/components/common/UploadFile/upload.d.ts +11 -0
- package/lib/components/common/UploadFile/upload.d.ts.map +1 -0
- package/lib/components/common/UploadFile/utils.d.ts +20 -0
- package/lib/components/common/UploadFile/utils.d.ts.map +1 -0
- package/lib/components/common/VideoView/index.d.ts +14 -0
- package/lib/components/common/VideoView/index.d.ts.map +1 -0
- package/lib/components/common/index.d.ts +23 -0
- package/lib/components/common/index.d.ts.map +1 -0
- package/lib/components/industry/CitySelectButton/index.d.ts +17 -0
- package/lib/components/industry/CitySelectButton/index.d.ts.map +1 -0
- package/lib/components/industry/CitySelectModal/index.d.ts +13 -0
- package/lib/components/industry/CitySelectModal/index.d.ts.map +1 -0
- package/lib/components/industry/PaymentMethodSelect/index.d.ts +59 -0
- package/lib/components/industry/PaymentMethodSelect/index.d.ts.map +1 -0
- package/lib/components/industry/index.d.ts +5 -0
- package/lib/components/industry/index.d.ts.map +1 -0
- package/lib/config/classPrefix.d.ts +36 -0
- package/lib/config/classPrefix.d.ts.map +1 -0
- package/lib/index.d.ts +585 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +5349 -0
- package/lib/index.js.map +1 -0
- package/lib/styles/_base.scss +4 -0
- package/lib/styles/index.scss +19 -0
- package/lib/styles/mixins.scss +15 -0
- package/lib/styles/variables.scss +2 -0
- package/lib/utils/city.d.ts +4005 -0
- package/lib/utils/city.d.ts.map +1 -0
- package/lib/utils/index.d.ts +50 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/package.json +81 -0
- package/src/components/common/BottomPopup/index.scss +34 -0
- package/src/components/common/BottomPopup/index.tsx +129 -0
- package/src/components/common/Card/index.scss +160 -0
- package/src/components/common/Card/index.tsx +72 -0
- package/src/components/common/CardItem/index.tsx +153 -0
- package/src/components/common/DataSelect/index.tsx +86 -0
- package/src/components/common/Modal/index.scss +49 -0
- package/src/components/common/Modal/index.tsx +105 -0
- package/src/components/common/NavBar/index.scss +26 -0
- package/src/components/common/NavBar/index.tsx +81 -0
- package/src/components/common/Page/index.scss +19 -0
- package/src/components/common/Page/index.tsx +56 -0
- package/src/components/common/PullToPushRefresh/index.scss +38 -0
- package/src/components/common/PullToPushRefresh/index.tsx +338 -0
- package/src/components/common/Radio/index.scss +15 -0
- package/src/components/common/Radio/index.tsx +56 -0
- package/src/components/common/TabPane/index.tsx +26 -0
- package/src/components/common/Tabs/index.scss +60 -0
- package/src/components/common/Tabs/index.tsx +107 -0
- package/src/components/common/UploadFile/index.scss +59 -0
- package/src/components/common/UploadFile/index.tsx +321 -0
- package/src/components/common/UploadFile/upload.ts +63 -0
- package/src/components/common/UploadFile/utils.ts +81 -0
- package/src/components/common/VideoView/index.tsx +50 -0
- package/src/components/common/index.ts +23 -0
- package/src/components/industry/CitySelectButton/index.tsx +76 -0
- package/src/components/industry/CitySelectModal/index.scss +122 -0
- package/src/components/industry/CitySelectModal/index.tsx +121 -0
- package/src/components/industry/PaymentMethodSelect/index.scss +146 -0
- package/src/components/industry/PaymentMethodSelect/index.tsx +316 -0
- package/src/components/industry/index.ts +5 -0
- package/src/config/classPrefix.ts +44 -0
- package/src/index.ts +9 -0
- package/src/styles/_base.scss +4 -0
- package/src/styles/index.scss +19 -0
- package/src/styles/mixins.scss +15 -0
- package/src/styles/variables.scss +2 -0
- package/src/utils/city.ts +4072 -0
- package/src/utils/index.ts +155 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"city.d.ts","sourceRoot":"","sources":["../../src/utils/city.ts"],"names":[],"mappings":"AAuBA,eAAO,IAAI,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
+
* @param value 要检查的值
|
|
8
|
+
* @returns 如果值为空返回 true,否则返回 false
|
|
9
|
+
*/
|
|
10
|
+
isEmpty(value: any): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 深拷贝对象
|
|
13
|
+
* @param obj 要拷贝的对象
|
|
14
|
+
* @returns 深拷贝后的新对象
|
|
15
|
+
*/
|
|
16
|
+
cloneDeep<T>(obj: T): T;
|
|
17
|
+
/**
|
|
18
|
+
* 判断 URL 是否是图片
|
|
19
|
+
* @param url 要检查的 URL
|
|
20
|
+
* @returns 如果是图片返回 true,否则返回 false
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* isImg('https://example.com/image.jpg') // => true
|
|
24
|
+
* isImg('https://example.com/image.png') // => true
|
|
25
|
+
* isImg('https://example.com/video.mp4') // => false
|
|
26
|
+
*/
|
|
27
|
+
isImg(url: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 判断 URL 是否是视频
|
|
30
|
+
* @param url 要检查的 URL
|
|
31
|
+
* @returns 如果是视频返回 true,否则返回 false
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* isVideo('https://example.com/video.mp4') // => true
|
|
35
|
+
* isVideo('https://example.com/video.mov') // => true
|
|
36
|
+
* isVideo('https://example.com/image.jpg') // => false
|
|
37
|
+
*/
|
|
38
|
+
isVideo(url: string): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 将字符串多余长度转化为...
|
|
41
|
+
* @param str 字符串
|
|
42
|
+
* @param len 字符串长度
|
|
43
|
+
*/
|
|
44
|
+
substr(str: string, len: number): string;
|
|
45
|
+
/**
|
|
46
|
+
* 等待
|
|
47
|
+
*/
|
|
48
|
+
delay: (delayTime?: number) => Promise<void>;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,KAAK;IAEhB;;;;OAIG;mBACY,GAAG,GAAG,OAAO;IAoB5B;;;;OAIG;cACO,CAAC,OAAO,CAAC,GAAG,CAAC;IA0BvB;;;;;;;;;OASG;eACQ,MAAM,GAAG,OAAO;IAmB3B;;;;;;;;;OASG;iBACU,MAAM,GAAG,OAAO;IAkB7B;;;;OAIG;gBACS,MAAM,OAAO,MAAM,GAAG,MAAM;IAuBxC;;OAEG;mCACuB,OAAO,CAAC,IAAI,CAAC;CAKxC,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zamlia/mini-ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "基于 Taro 和 nut-ui 的小程序通用组件库",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "gitee",
|
|
7
|
+
"url": "https://gitee.com/liucaptain/ly-utils"
|
|
8
|
+
},
|
|
9
|
+
"bugs": "https://gitee.com/liucaptain/ly-utils/issues",
|
|
10
|
+
"homepage": "https://gitee.com/liucaptain/ly-utils.git#readme",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"module": "es/index.js",
|
|
16
|
+
"types": "lib/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./lib/index.d.ts",
|
|
20
|
+
"import": "./es/index.js",
|
|
21
|
+
"require": "./lib/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./style": "./lib/styles/index.css",
|
|
24
|
+
"./style.scss": "./src/styles/index.scss"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"lib",
|
|
28
|
+
"es",
|
|
29
|
+
"src"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "npm run generate:styles && rollup -c && npm run build:styles",
|
|
33
|
+
"build:lib": "rollup -c --environment BUILD:cjs",
|
|
34
|
+
"build:es": "rollup -c --environment BUILD:esm",
|
|
35
|
+
"build:dts": "rollup -c --environment BUILD:dts",
|
|
36
|
+
"build:styles": "node scripts/copy-styles.js",
|
|
37
|
+
"generate:styles": "node scripts/generate-styles.js",
|
|
38
|
+
"dev": "npm run generate:styles && rollup -c --watch",
|
|
39
|
+
"dev:lib": "rollup -c --watch --environment BUILD:cjs",
|
|
40
|
+
"dev:es": "rollup -c --watch --environment BUILD:esm",
|
|
41
|
+
"clean": "rm -rf lib es",
|
|
42
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
43
|
+
"prepublishOnly": "npm run build"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"taro",
|
|
47
|
+
"react",
|
|
48
|
+
"miniprogram",
|
|
49
|
+
"components",
|
|
50
|
+
"nut-ui",
|
|
51
|
+
"weapp"
|
|
52
|
+
],
|
|
53
|
+
"author": "liucaptain <13610333362@qq.com>",
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@tarojs/components": "^3.6.17",
|
|
57
|
+
"@tarojs/runtime": "^3.6.17",
|
|
58
|
+
"@tarojs/taro": "^3.6.17",
|
|
59
|
+
"react": "^18.0.0",
|
|
60
|
+
"react-dom": "^18.0.0"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@nutui/icons-react-taro": "^3.0.2-cpp.3",
|
|
64
|
+
"@nutui/nutui-react-taro": "^3.0.19-cpp.24",
|
|
65
|
+
"@tarojs/plugin-framework-react": "^3.6.17",
|
|
66
|
+
"@tarojs/plugin-platform-weapp": "^3.6.17",
|
|
67
|
+
"@tarojs/webpack5-runner": "^3.6.17",
|
|
68
|
+
"classnames": "^2.3.2"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@rollup/plugin-alias": "^5.0.0",
|
|
72
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
73
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
74
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
75
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
76
|
+
"rollup": "^4.0.0",
|
|
77
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
78
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
79
|
+
"rollup-plugin-typescript2": "^0.36.0"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.we-popup {
|
|
2
|
+
color: red;
|
|
3
|
+
.nut-overlay {
|
|
4
|
+
z-index: 100 !important;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.nut-popup {
|
|
8
|
+
position: fixed;
|
|
9
|
+
|
|
10
|
+
&-title {}
|
|
11
|
+
|
|
12
|
+
&__close-icon--top-right {
|
|
13
|
+
width: 12px;
|
|
14
|
+
height: 12px;
|
|
15
|
+
|
|
16
|
+
text {
|
|
17
|
+
font-size: 10px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__title {
|
|
23
|
+
font-size: 32px;
|
|
24
|
+
color: #000000;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__footer {}
|
|
28
|
+
|
|
29
|
+
&__footer-fixed {
|
|
30
|
+
position: fixed;
|
|
31
|
+
bottom: 0;
|
|
32
|
+
left: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import React, { CSSProperties, PropsWithChildren, useEffect, useState, useImperativeHandle } from 'react';
|
|
2
|
+
import { Popup, PopupProps } from '@nutui/nutui-react-taro';
|
|
3
|
+
import { View, Text } from '@tarojs/components';
|
|
4
|
+
import { Close } from '@nutui/icons-react-taro';
|
|
5
|
+
import './index.scss';
|
|
6
|
+
|
|
7
|
+
export type BottomPopupProps = {
|
|
8
|
+
/**
|
|
9
|
+
* 标题
|
|
10
|
+
*/
|
|
11
|
+
title?: string | React.ReactElement
|
|
12
|
+
/**
|
|
13
|
+
* 弹窗是否开启
|
|
14
|
+
* @default false
|
|
15
|
+
*/
|
|
16
|
+
visible?: boolean
|
|
17
|
+
/**
|
|
18
|
+
* 弹窗高度
|
|
19
|
+
*/
|
|
20
|
+
height?: number
|
|
21
|
+
/**
|
|
22
|
+
* 是否展示关闭按钮
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
showClose?: boolean
|
|
26
|
+
/**
|
|
27
|
+
* 点击遮罩是否关闭
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
maskClose?: boolean
|
|
31
|
+
/**
|
|
32
|
+
* 自定义头部导航样式
|
|
33
|
+
*/
|
|
34
|
+
customHeaderStyles?: CSSProperties
|
|
35
|
+
/**
|
|
36
|
+
* 底部固定区域
|
|
37
|
+
*/
|
|
38
|
+
bottomFixedCard?: React.ReactElement
|
|
39
|
+
} & Partial<Omit<PopupProps, 'round' | 'transition' | 'position' | 'title'>>;
|
|
40
|
+
|
|
41
|
+
export type BottomPopupRef = {
|
|
42
|
+
/** 打开弹窗 */
|
|
43
|
+
open: () => void
|
|
44
|
+
/** 关闭弹窗 */
|
|
45
|
+
close: () => void
|
|
46
|
+
} | undefined;
|
|
47
|
+
|
|
48
|
+
const BottomPopup: React.FC<PropsWithChildren<BottomPopupProps>> = (props, ref) => {
|
|
49
|
+
const {
|
|
50
|
+
visible: propsVisible = false,
|
|
51
|
+
title,
|
|
52
|
+
height,
|
|
53
|
+
showClose = false,
|
|
54
|
+
maskClose = false,
|
|
55
|
+
customHeaderStyles = {},
|
|
56
|
+
bottomFixedCard,
|
|
57
|
+
children,
|
|
58
|
+
...restProps
|
|
59
|
+
} = props;
|
|
60
|
+
const [visible, setVisible] = useState<boolean>(false);
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
setVisible(propsVisible)
|
|
64
|
+
}, [propsVisible])
|
|
65
|
+
|
|
66
|
+
/** 打开 */
|
|
67
|
+
const handleOpen = () => {
|
|
68
|
+
setVisible(true)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** 关闭 */
|
|
72
|
+
const handleClose = () => {
|
|
73
|
+
setVisible(false);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// 暴露方法给外部
|
|
77
|
+
useImperativeHandle(ref, () => ({
|
|
78
|
+
open: handleOpen,
|
|
79
|
+
close: handleClose,
|
|
80
|
+
}), [])
|
|
81
|
+
|
|
82
|
+
const titleRender = () => {
|
|
83
|
+
if (!title) return
|
|
84
|
+
|
|
85
|
+
if (typeof title === 'string') {
|
|
86
|
+
return (
|
|
87
|
+
<Text className='bd-popup__title'>{title}</Text>
|
|
88
|
+
)
|
|
89
|
+
} else {
|
|
90
|
+
return title
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const footerRender = () => {
|
|
95
|
+
if (!bottomFixedCard) return
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<View className='bd-popup__footer-fixed'>
|
|
99
|
+
{bottomFixedCard}
|
|
100
|
+
</View>
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<View className='we-popup'>
|
|
106
|
+
{
|
|
107
|
+
visible && (
|
|
108
|
+
<Popup
|
|
109
|
+
round
|
|
110
|
+
visible={visible}
|
|
111
|
+
transition="slide-top"
|
|
112
|
+
style={{ minHeight: '30%' }}
|
|
113
|
+
position="bottom"
|
|
114
|
+
title={titleRender()}
|
|
115
|
+
onClose={handleClose}
|
|
116
|
+
closeIcon={<Close size={14} />}
|
|
117
|
+
closeable={showClose}
|
|
118
|
+
{...restProps}
|
|
119
|
+
>
|
|
120
|
+
{children}
|
|
121
|
+
{footerRender()}
|
|
122
|
+
</Popup>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
</View>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export default React.forwardRef<BottomPopupRef, PropsWithChildren<BottomPopupProps>>(BottomPopup as any);
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
$card-item-inline-padding: 8px;
|
|
2
|
+
|
|
3
|
+
.we-card {
|
|
4
|
+
width: 690px;
|
|
5
|
+
margin: 0 auto;
|
|
6
|
+
padding: 25px 30px 30px;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
border-radius: 20px;
|
|
9
|
+
background: #ffffff;
|
|
10
|
+
font-size: 26px;
|
|
11
|
+
color: #333333;
|
|
12
|
+
|
|
13
|
+
&__header {
|
|
14
|
+
margin-bottom: 40px;
|
|
15
|
+
padding-bottom: 20px;
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
|
|
20
|
+
&-title {
|
|
21
|
+
font-size: 30px;
|
|
22
|
+
font-weight: bold;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__header-border {
|
|
27
|
+
border-bottom: 1px solid #F0F0F0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__body {}
|
|
31
|
+
|
|
32
|
+
&__footer-btns {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
flex-direction: row-reverse;
|
|
36
|
+
|
|
37
|
+
&--hidden {
|
|
38
|
+
position: relative;
|
|
39
|
+
width: 80px;
|
|
40
|
+
height: 51px;
|
|
41
|
+
text-align: center;
|
|
42
|
+
line-height: 42px;
|
|
43
|
+
letter-spacing: 4px;
|
|
44
|
+
font-weight: bold;
|
|
45
|
+
|
|
46
|
+
&__list {
|
|
47
|
+
margin-top: 8px;
|
|
48
|
+
margin-left: -32px;
|
|
49
|
+
position: absolute;
|
|
50
|
+
width: max-content;
|
|
51
|
+
background: #ffffff;
|
|
52
|
+
border-radius: 20px;
|
|
53
|
+
box-shadow: 0 2px 12px rgba(50, 50, 51, .122);
|
|
54
|
+
z-index: 10001;
|
|
55
|
+
|
|
56
|
+
&-item {
|
|
57
|
+
padding: 12px;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
border-bottom: 1px solid #eeeeee;
|
|
60
|
+
|
|
61
|
+
/** 只要是card footer中的按钮必须加上这个类型 */
|
|
62
|
+
.bd-card-footer-btn {
|
|
63
|
+
margin-inline: 0 !important;
|
|
64
|
+
border: none !important;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-item:nth-last-child(1) {
|
|
69
|
+
border-bottom: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&__list::after {
|
|
74
|
+
content: '';
|
|
75
|
+
position: absolute;
|
|
76
|
+
top: -15px;
|
|
77
|
+
left: 0;
|
|
78
|
+
right: 0;
|
|
79
|
+
margin: auto;
|
|
80
|
+
width: 0;
|
|
81
|
+
height: 0;
|
|
82
|
+
border-left: 15px solid transparent;
|
|
83
|
+
border-right: 15px solid transparent;
|
|
84
|
+
border-bottom: 15px solid #ffffff;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.we-card-item {
|
|
91
|
+
position: relative;
|
|
92
|
+
margin-bottom: 30px;
|
|
93
|
+
padding-inline: $card-item-inline-padding;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
font-size: 28px;
|
|
96
|
+
color: #333333;
|
|
97
|
+
|
|
98
|
+
&__l {
|
|
99
|
+
margin-right: 31px;
|
|
100
|
+
color: #999999;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&__l-col {
|
|
104
|
+
margin-bottom: 12px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&__l-text {}
|
|
108
|
+
|
|
109
|
+
&__v {}
|
|
110
|
+
|
|
111
|
+
&__v-text {}
|
|
112
|
+
|
|
113
|
+
&__v-absolute {
|
|
114
|
+
width: max-content;
|
|
115
|
+
height: max-content;
|
|
116
|
+
position: absolute;
|
|
117
|
+
right: $card-item-inline-padding;
|
|
118
|
+
top: 0;
|
|
119
|
+
bottom: 0;
|
|
120
|
+
margin: auto;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&__extra {
|
|
124
|
+
flex-grow: 1;
|
|
125
|
+
display: flex;
|
|
126
|
+
justify-content: flex-end;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.we-card-item:nth-last-child(1) {
|
|
131
|
+
margin-bottom: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.we-card-item--align-start {
|
|
135
|
+
align-items: flex-start!important;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.we-card-item--align-center {
|
|
139
|
+
align-items: center!important;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.we-card-item--align-end {
|
|
143
|
+
align-items: flex-end!important;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.we-card-item--row {
|
|
147
|
+
display: flex;
|
|
148
|
+
justify-content: space-between;
|
|
149
|
+
align-items: center;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.we-card-item--row-start {
|
|
153
|
+
justify-content: flex-start!important;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.we-card-item--row-between {
|
|
157
|
+
justify-content: space-between!important;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.we-card-item-col {}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { View } from '@tarojs/components';
|
|
3
|
+
import CardItem, { CardItemProps } from '../CardItem';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import './index.scss';
|
|
6
|
+
|
|
7
|
+
export type CardProps = {
|
|
8
|
+
/**
|
|
9
|
+
* 是否显示Header
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
showHeader?: boolean
|
|
13
|
+
/**
|
|
14
|
+
* 是否显示Header Border
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
showHeaderBorder?: boolean
|
|
18
|
+
/** 标题 */
|
|
19
|
+
title?: string | React.ReactElement
|
|
20
|
+
/** header右边区域 */
|
|
21
|
+
extra?: React.ReactElement
|
|
22
|
+
/**
|
|
23
|
+
* 底部模块
|
|
24
|
+
* @type {React.ReactElement | React.ReactElement[]}
|
|
25
|
+
* 如果是类型是数组 则是一个按钮集群,
|
|
26
|
+
* 超出部分可以一点点点显示剩下的按钮
|
|
27
|
+
*/
|
|
28
|
+
footer?: React.ReactElement | React.ReactElement[]
|
|
29
|
+
className?: string
|
|
30
|
+
onClick?: (e: React.MouseEvent) => void
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
interface CardComponent extends React.FC<PropsWithChildren<CardProps>> {
|
|
34
|
+
Item: React.FC<CardItemProps>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const Card: CardComponent = (props) => {
|
|
38
|
+
const {
|
|
39
|
+
showHeader = true,
|
|
40
|
+
showHeaderBorder = true,
|
|
41
|
+
title,
|
|
42
|
+
extra,
|
|
43
|
+
footer,
|
|
44
|
+
className,
|
|
45
|
+
onClick,
|
|
46
|
+
children
|
|
47
|
+
} = props
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<View className={classNames('we-card', className)} onClick={(e: any) => onClick?.(e)}>
|
|
51
|
+
{
|
|
52
|
+
!showHeader ? null : (
|
|
53
|
+
<View className={classNames(
|
|
54
|
+
'we-card__header',
|
|
55
|
+
{ 'we-card__header-border': showHeaderBorder }
|
|
56
|
+
)}>
|
|
57
|
+
<View className='we-card__header-title'>{title}</View>
|
|
58
|
+
{!!extra && extra}
|
|
59
|
+
</View>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
<View className='we-card__body'>
|
|
63
|
+
{children}
|
|
64
|
+
</View>
|
|
65
|
+
{!!footer && footer}
|
|
66
|
+
</View>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
Card.Item = CardItem
|
|
71
|
+
|
|
72
|
+
export default Card;
|
|
@@ -0,0 +1,153 @@
|
|
|
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;
|