Commit 0093a090 authored by huanglu's avatar huanglu

feat: ios

parent f762147a
...@@ -403,6 +403,7 @@ ...@@ -403,6 +403,7 @@
13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */, 13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
F3C413C12DF8BDDF14DB7E6F /* [CP] Copy Pods Resources */,
); );
buildRules = ( buildRules = (
); );
...@@ -658,6 +659,24 @@ ...@@ -658,6 +659,24 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
F3C413C12DF8BDDF14DB7E6F /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-GeekTeacherWork/Pods-GeekTeacherWork-resources.sh",
"${PODS_ROOT}/SVProgressHUD/SVProgressHUD/SVProgressHUD.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SVProgressHUD.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-GeekTeacherWork/Pods-GeekTeacherWork-resources.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = { FD10A7F022414F080027D42C /* Start Packager */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
......
...@@ -53,17 +53,17 @@ RCT_EXPORT_METHOD(showWorkResult:(NSString *)imageUrl ...@@ -53,17 +53,17 @@ RCT_EXPORT_METHOD(showWorkResult:(NSString *)imageUrl
- (void) showPicker { - (void) showPicker {
// self.picker = [[GeekCameraVC alloc] init]; self.picker = [[GeekCameraVC alloc] init];
// self.picker.modalPresentationStyle = UIModalPresentationFullScreen; self.picker.modalPresentationStyle = UIModalPresentationFullScreen;
UIImagePickerController *picker = [[UIImagePickerController alloc] init]; // UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; // picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self; // picker.delegate = self;
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:picker animated:YES completion:nil]; [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:self.picker animated:YES completion:nil];
// self.picker.imageBlock = ^(UIImage * _Nonnull image) { self.picker.imageBlock = ^(UIImage * _Nonnull image) {
// NSString *imgPath = [GeekUtil saveImageTosandBox:image]; NSString *imgPath = [GeekUtil saveImageTosandBox:image];
// [GeekUtil postImage:imgPath]; [GeekUtil postImage:imgPath];
// [SVProgressHUD showWithStatus:@"正在上传图片"]; [SVProgressHUD showWithStatus:@"正在上传图片"];
// }; };
} }
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info { - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<UIImagePickerControllerInfoKey,id> *)info {
......
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSCameraUsageDescription</key>
<string>使用相机权限</string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CodePushServerURL</key>
<string>http://119.27.181.101:3000</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>GeekTeacherWork</string> <string>GeekTeacherWork</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
......
...@@ -34,6 +34,11 @@ target 'GeekTeacherWork' do ...@@ -34,6 +34,11 @@ target 'GeekTeacherWork' do
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod "YYModel"
pod "Masonry"
pod "SVProgressHUD"
pod "LCActionSheet"
target 'GeekTeacherWorkTests' do target 'GeekTeacherWorkTests' do
inherit! :search_paths inherit! :search_paths
# Pods for testing # Pods for testing
......
...@@ -27,6 +27,8 @@ PODS: ...@@ -27,6 +27,8 @@ PODS:
- glog (0.3.5) - glog (0.3.5)
- JWT (3.0.0-beta.12): - JWT (3.0.0-beta.12):
- Base64 (~> 1.1.2) - Base64 (~> 1.1.2)
- LCActionSheet (3.5.4):
- Masonry (~> 1.1.0)
- libwebp (1.1.0): - libwebp (1.1.0):
- libwebp/demux (= 1.1.0) - libwebp/demux (= 1.1.0)
- libwebp/mux (= 1.1.0) - libwebp/mux (= 1.1.0)
...@@ -36,6 +38,7 @@ PODS: ...@@ -36,6 +38,7 @@ PODS:
- libwebp/mux (1.1.0): - libwebp/mux (1.1.0):
- libwebp/demux - libwebp/demux
- libwebp/webp (1.1.0) - libwebp/webp (1.1.0)
- Masonry (1.1.0)
- RCTRequired (0.61.5) - RCTRequired (0.61.5)
- RCTTypeSafety (0.61.5): - RCTTypeSafety (0.61.5):
- FBLazyVector (= 0.61.5) - FBLazyVector (= 0.61.5)
...@@ -265,7 +268,9 @@ PODS: ...@@ -265,7 +268,9 @@ PODS:
- libwebp (~> 1.0) - libwebp (~> 1.0)
- SDWebImage/Core (~> 5.7) - SDWebImage/Core (~> 5.7)
- SSZipArchive (2.2.3) - SSZipArchive (2.2.3)
- SVProgressHUD (2.2.5)
- Yoga (1.14.0) - Yoga (1.14.0)
- YYModel (1.0.4)
DEPENDENCIES: DEPENDENCIES:
- CodePush (from `../node_modules/react-native-code-push`) - CodePush (from `../node_modules/react-native-code-push`)
...@@ -274,6 +279,8 @@ DEPENDENCIES: ...@@ -274,6 +279,8 @@ DEPENDENCIES:
- FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`) - FBReactNativeSpec (from `../node_modules/react-native/Libraries/FBReactNativeSpec`)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`) - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- LCActionSheet
- Masonry
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
- React (from `../node_modules/react-native/`) - React (from `../node_modules/react-native/`)
...@@ -307,17 +314,23 @@ DEPENDENCIES: ...@@ -307,17 +314,23 @@ DEPENDENCIES:
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- RNReanimated (from `../node_modules/react-native-reanimated`) - RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`) - RNScreens (from `../node_modules/react-native-screens`)
- SVProgressHUD
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
- YYModel
SPEC REPOS: SPEC REPOS:
trunk: trunk:
- Base64 - Base64
- boost-for-react-native - boost-for-react-native
- JWT - JWT
- LCActionSheet
- libwebp - libwebp
- Masonry
- SDWebImage - SDWebImage
- SDWebImageWebPCoder - SDWebImageWebPCoder
- SSZipArchive - SSZipArchive
- SVProgressHUD
- YYModel
EXTERNAL SOURCES: EXTERNAL SOURCES:
CodePush: CodePush:
...@@ -405,7 +418,9 @@ SPEC CHECKSUMS: ...@@ -405,7 +418,9 @@ SPEC CHECKSUMS:
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28 glog: 1f3da668190260b06b429bb211bfbee5cd790c28
JWT: 9b5c05abbcc1a0e69c3c91e1655b3387fc7e581d JWT: 9b5c05abbcc1a0e69c3c91e1655b3387fc7e581d
LCActionSheet: a015dee43c54c8f6631e86facd9e2ad59dc1b5ab
libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3 libwebp: 946cb3063cea9236285f7e9a8505d806d30e07f3
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1 RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1
RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320 RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320
React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78 React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78
...@@ -439,8 +454,10 @@ SPEC CHECKSUMS: ...@@ -439,8 +454,10 @@ SPEC CHECKSUMS:
SDWebImage: 62ae4a18473520c67b79e9724c31a63599cc9423 SDWebImage: 62ae4a18473520c67b79e9724c31a63599cc9423
SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21 SDWebImageWebPCoder: d0dac55073088d24b2ac1b191a71a8f8d0adac21
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9 SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
SVProgressHUD: 1428aafac632c1f86f62aa4243ec12008d7a51d6
Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
YYModel: 2a7fdd96aaa4b86a824e26d0c517de8928c04b30
PODFILE CHECKSUM: 7c6653c14e1b7c83f5335ef9d27a049ac0bdd625 PODFILE CHECKSUM: 8b8a582a803563a2f2d3eaff4db0254084a15277
COCOAPODS: 1.9.1 COCOAPODS: 1.9.1
...@@ -16,14 +16,10 @@ calendarManagerEmitter.addListener('GeekWorkPicker', (res) => { ...@@ -16,14 +16,10 @@ calendarManagerEmitter.addListener('GeekWorkPicker', (res) => {
noop.cb && noop.cb(res) noop.cb && noop.cb(res)
}) })
const uploadedHomeWork = (img: string, studentId: number) => { const uploadedHomeWork = async (img: string, studentId: number) => {
console.log('uploadedHomeWork', img) console.log('uploadedHomeWork', img)
return addOnlineHomeworkImageInterface(img, '123').then(rs => { const data = await addOnlineHomeworkImageInterface(img, '123')
console.log('=====re', rs) console.log('uploadedHomeWork: ', data)
return rs
}).catch(er => {
console.log('=====: err: ', er)
})
}; };
const showWorkPicker = async (studentId: number) => { const showWorkPicker = async (studentId: number) => {
...@@ -34,7 +30,7 @@ const showWorkPicker = async (studentId: number) => { ...@@ -34,7 +30,7 @@ const showWorkPicker = async (studentId: number) => {
// TODO: 上传图片地址 // TODO: 上传图片地址
const path = arg.image const path = arg.image
const res = await uploadedHomeWork(path, studentId); const res = await uploadedHomeWork(path, studentId);
GeekWorkPicker.showWorkResult(path, res); GeekWorkPicker.showWorkResult(path, []);
} }
// 处理数据 // 处理数据
if (arg.type === 'uploadWork') { if (arg.type === 'uploadWork') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment