@aks-dev/easyui 1.0.88 → 1.0.89

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.
@@ -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-08 17:02:04
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-14 15:14:53
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "移动端App开发工具包",
5
5
  "main": "./src/index.ts",
6
6
  "typings": "./src/index.d.ts",