@aks-dev/easyui 1.0.87 → 1.0.90
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/lib/MutiPictureView/MutiPictureView.tsx +16 -5
- package/lib/MutiPictureView/index.ts +9 -7
- package/package.json +1 -1
- package/readme.md +19 -2
- package/utils/index.ts +1 -1
- package/utils/mode.ts +7 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: OBKoro1
|
|
3
3
|
* @Date: 2022-04-24 17:38:27
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-
|
|
5
|
+
* @LastEditTime: 2022-07-18 19:22:37
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/lib/MutiPictureView/MutiPictureView.tsx
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -31,7 +31,7 @@ const MutiPictureView: React.FC<MutiPictureViewProps> = (props) => {
|
|
|
31
31
|
delIconStyle,
|
|
32
32
|
spacingHorizontal = px2dp(15),
|
|
33
33
|
spacingInner = px2dp(8),
|
|
34
|
-
editable = true
|
|
34
|
+
editable = true,
|
|
35
35
|
} = props
|
|
36
36
|
const { viewModel, setViewModel } = bind
|
|
37
37
|
React.useEffect(() => {
|
|
@@ -121,7 +121,7 @@ const MutiPictureView: React.FC<MutiPictureViewProps> = (props) => {
|
|
|
121
121
|
}]} activeOpacity={0.8} onPress={() => showPhoto(index)}>
|
|
122
122
|
<Image source={source} style={{ width: '100%', height: '100%' }} resizeMode='cover' />
|
|
123
123
|
{
|
|
124
|
-
editable &&
|
|
124
|
+
editable && !props.value &&
|
|
125
125
|
<TouchableOpacity onPress={() => deletePhoto(index)} style={[styles.del_img_container, delIconStyle]}>
|
|
126
126
|
<Image source={delIcon ? delIcon : icon_del_image} resizeMode='contain' style={{ width: '100%', height: '100%' }} />
|
|
127
127
|
</TouchableOpacity>
|
|
@@ -139,15 +139,26 @@ const MutiPictureView: React.FC<MutiPictureViewProps> = (props) => {
|
|
|
139
139
|
React.useEffect(() => {
|
|
140
140
|
containerRef.current?.measure((...args) => {
|
|
141
141
|
// console.log(args)
|
|
142
|
-
if(args.length > 3){
|
|
142
|
+
if (args.length > 3) {
|
|
143
143
|
let _sideLength = (args[2] - spacingHorizontal * 2 - spacingInner * 2) / 3;
|
|
144
144
|
setSideLength(_sideLength)
|
|
145
145
|
}
|
|
146
|
-
|
|
146
|
+
|
|
147
147
|
})
|
|
148
148
|
|
|
149
149
|
}, [])
|
|
150
150
|
|
|
151
|
+
|
|
152
|
+
if (props.value && props.value?.length > 0) {
|
|
153
|
+
return (
|
|
154
|
+
<View style={[styles.container, props.style]} ref={containerRef as any}>
|
|
155
|
+
{props.value.map((item, index) => {
|
|
156
|
+
return <ItemView key={index} source={typeof item === 'string' ? { uri: item } : item} index={index} />
|
|
157
|
+
})}
|
|
158
|
+
</View >
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
|
|
151
162
|
return (
|
|
152
163
|
<View style={[styles.container, props.style]} ref={containerRef as any}>
|
|
153
164
|
{viewModel?.photos instanceof Array && viewModel.photos.map((item, index) => {
|
|
@@ -3,7 +3,7 @@ import { TextStyle } from 'react-native';
|
|
|
3
3
|
* @Author: shiguo
|
|
4
4
|
* @Date: 2022-04-24 17:38:32
|
|
5
5
|
* @LastEditors: shiguo
|
|
6
|
-
* @LastEditTime: 2022-07-
|
|
6
|
+
* @LastEditTime: 2022-07-18 19:21:19
|
|
7
7
|
* @FilePath: /@aks-dev/easyui/lib/MutiPictureView/index.ts
|
|
8
8
|
*/
|
|
9
9
|
import { StyleProp, ViewStyle, ImageStyle, ImageSourcePropType } from 'react-native'
|
|
@@ -35,12 +35,12 @@ export declare type MutiPictureViewProps = {
|
|
|
35
35
|
maxCount?: number;
|
|
36
36
|
/**default type is showImagePicker */
|
|
37
37
|
type?: 'showImagePicker' | 'openCamera';
|
|
38
|
-
style?:StyleProp<ViewStyle>;
|
|
38
|
+
style?: StyleProp<ViewStyle>;
|
|
39
39
|
addIcon?: ImageSourcePropType;
|
|
40
40
|
addIconStyle?: StyleProp<ImageStyle>;
|
|
41
|
-
addText?:string;
|
|
42
|
-
addTextStyle?:StyleProp<TextStyle>;
|
|
43
|
-
addIconContainerStyle?:StyleProp<ViewStyle>;
|
|
41
|
+
addText?: string;
|
|
42
|
+
addTextStyle?: StyleProp<TextStyle>;
|
|
43
|
+
addIconContainerStyle?: StyleProp<ViewStyle>;
|
|
44
44
|
delIcon?: ImageSourcePropType;
|
|
45
45
|
delIconStyle?: StyleProp<ImageStyle>;
|
|
46
46
|
/**外边距 */
|
|
@@ -48,10 +48,12 @@ export declare type MutiPictureViewProps = {
|
|
|
48
48
|
/**内边距 */
|
|
49
49
|
spacingInner?: number;
|
|
50
50
|
/**仅仅看看,不增减图片 */
|
|
51
|
-
editable?:boolean;
|
|
51
|
+
editable?: boolean;
|
|
52
|
+
/**这个属性会覆盖bind.viewModel.photos */
|
|
53
|
+
value?: (string | { uri: string })[];
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
|
|
55
|
-
export declare const MutiPictureView:React.FC<MutiPictureViewProps>;
|
|
57
|
+
export declare const MutiPictureView: React.FC<MutiPictureViewProps>;
|
|
56
58
|
|
|
57
59
|
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-25 17:57:29
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-
|
|
5
|
+
* @LastEditTime: 2022-07-18 16:28:37
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/README.md
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -29,7 +29,7 @@ import '@aks-dev/easyui/screen/text-fit'
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
31
|
+ Badge
|
|
32
|
-
+
|
|
32
|
+
+ Hud
|
|
33
33
|
+ Modal
|
|
34
34
|
+ EchartsView
|
|
35
35
|
+ MutiPictureView
|
|
@@ -55,6 +55,23 @@ import '@aks-dev/easyui/screen/text-fit'
|
|
|
55
55
|
|callTelephone|拨打电话|
|
|
56
56
|
|randomcolor|获取随机色|
|
|
57
57
|
|syncLoop|同步循环|
|
|
58
|
+
|encryptMobilePhoneNumber|手机号码加星|
|
|
59
|
+
|isObject|判断对象|
|
|
60
|
+
|isArray|判断数组|
|
|
61
|
+
|isNumber|判断数字|
|
|
62
|
+
|isNull|判断null|
|
|
63
|
+
|isUndefined|判断undefined|
|
|
64
|
+
|isObjectValueEqual|判断两个对象是否相同|
|
|
65
|
+
|deepEqual|深度比较两个对象|
|
|
66
|
+
|deepClone|深拷贝|
|
|
67
|
+
|isPhoneNumber|判断手机号码|
|
|
68
|
+
|toDateFriendly|转成友好时间|
|
|
69
|
+
|isChainChar|是否包含[a-z]|
|
|
70
|
+
|isHaveChartCount|包含[a-z]数量|
|
|
71
|
+
|isHaveNumberCount|包含[0-9]数量|
|
|
72
|
+
|isHaveChinese|是否包含汉字|
|
|
73
|
+
|isHaveEmojiCharact|是否包含表情|
|
|
74
|
+
|
|
58
75
|
|
|
59
76
|
### jsbridge
|
|
60
77
|
---
|
package/utils/index.ts
CHANGED
package/utils/mode.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: shiguo
|
|
3
3
|
* @Date: 2022-04-18 18:40:07
|
|
4
4
|
* @LastEditors: shiguo
|
|
5
|
-
* @LastEditTime: 2022-07-
|
|
5
|
+
* @LastEditTime: 2022-07-20 09:28:33
|
|
6
6
|
* @FilePath: /@aks-dev/easyui/utils/mode.ts
|
|
7
7
|
*/
|
|
8
8
|
import type { CallBack } from '.'
|
|
@@ -31,18 +31,19 @@ export const panHandlersCallback = (props: { GrantCallback: CallBack, MoveCallba
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
|
|
34
35
|
export const callTelephone = (phone: number | string) => {
|
|
35
36
|
|
|
36
37
|
let tel = 'tel:' + phone
|
|
37
38
|
Linking.canOpenURL(tel).then((supported) => {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} else {
|
|
39
|
+
console.log({ supported, tel })
|
|
40
|
+
if (supported) {
|
|
41
41
|
Linking.openURL(tel)
|
|
42
|
+
} else {
|
|
43
|
+
console.warn('[sg:callTelephone 不支持]', { supported, tel }.toString())
|
|
42
44
|
}
|
|
43
45
|
}).catch(error => {
|
|
44
|
-
|
|
45
|
-
console.warn('[sg:mode]', error.toString())
|
|
46
|
+
console.warn('[sg:callTelephone catch]', { error, tel }.toString())
|
|
46
47
|
})
|
|
47
48
|
|
|
48
49
|
}
|