@aks-dev/easyui 1.2.0 → 1.2.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.
|
@@ -9,6 +9,7 @@ import * as React from "react";
|
|
|
9
9
|
import { Image, View, StyleSheet, Keyboard, TouchableOpacity, Text, } from "react-native";
|
|
10
10
|
import { px2dp } from "../../screen/px2dp";
|
|
11
11
|
import { px2sp } from "../../screen/px2sp";
|
|
12
|
+
import SYImagePicker from "@aks-dev/react-native-syan-image-picker";
|
|
12
13
|
let icon_add_image = require("./assets/icon_add_image.png");
|
|
13
14
|
let icon_del_image = require("./assets/icon_del_image.png");
|
|
14
15
|
const MutiPictureView = (props) => {
|
|
@@ -22,46 +23,41 @@ const MutiPictureView = (props) => {
|
|
|
22
23
|
if (!images) {
|
|
23
24
|
throw new Error("viewModel没有定义photos字段");
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// console.log("打开相机失败");
|
|
61
|
-
// }
|
|
62
|
-
// },
|
|
63
|
-
// );
|
|
64
|
-
// }
|
|
26
|
+
if (type == "showImagePicker") {
|
|
27
|
+
SYImagePicker.showImagePicker({
|
|
28
|
+
imageCount: maxCount - (viewModel.photos?.length || 0),
|
|
29
|
+
isCrop: false,
|
|
30
|
+
isRecordSelected: false,
|
|
31
|
+
quality: 20,
|
|
32
|
+
}, (err, photos) => {
|
|
33
|
+
if (!err) {
|
|
34
|
+
let imgs = photos.map((it) => {
|
|
35
|
+
return { uri: it.uri };
|
|
36
|
+
});
|
|
37
|
+
images = images.concat(imgs);
|
|
38
|
+
setViewModel({ photos: images });
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (type == "openCamera") {
|
|
43
|
+
SYImagePicker.openCamera({
|
|
44
|
+
imageCount: maxCount - (viewModel.photos?.length || 0),
|
|
45
|
+
isCrop: false,
|
|
46
|
+
isRecordSelected: false,
|
|
47
|
+
quality: 20,
|
|
48
|
+
}, (err, photos) => {
|
|
49
|
+
if (!err) {
|
|
50
|
+
let imgs = photos.map((it) => {
|
|
51
|
+
return { uri: it.uri };
|
|
52
|
+
});
|
|
53
|
+
images = images.concat(imgs);
|
|
54
|
+
setViewModel({ photos: images });
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
console.log("打开相机失败");
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
65
61
|
};
|
|
66
62
|
const deletePhoto = (index) => {
|
|
67
63
|
Keyboard.dismiss();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aks-dev/easyui",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "工具箱",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
"react-native": "*",
|
|
52
52
|
"react-native-permissions": "*",
|
|
53
53
|
"react-native-vision-camera": "*",
|
|
54
|
-
"react-native-webview": "*"
|
|
54
|
+
"react-native-webview": "*",
|
|
55
|
+
"@aks-dev/react-native-syan-image-picker": "*"
|
|
55
56
|
},
|
|
56
57
|
"dependencies": {
|
|
57
58
|
"echarts": "^6.0.0",
|
|
@@ -66,7 +67,8 @@
|
|
|
66
67
|
"react-native": "^0.84.1",
|
|
67
68
|
"react-native-permissions": "^5.5.1",
|
|
68
69
|
"react-native-vision-camera": "^4.7.3",
|
|
69
|
-
"react-native-webview": "^13.16.1"
|
|
70
|
+
"react-native-webview": "^13.16.1",
|
|
71
|
+
"@aks-dev/react-native-syan-image-picker": "^1.0.1"
|
|
70
72
|
},
|
|
71
73
|
"resolutions": {
|
|
72
74
|
"@types/react": "*"
|