├── README.md └── app └── letschat ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── android ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ ├── react.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── letschat │ │ │ └── MainActivity.java │ │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── compoments ├── chat.js ├── chats.item.js ├── chats.js ├── concats.js ├── discover.js ├── letschat.js ├── me.js └── widgets │ └── item.js ├── index.android.js ├── index.ios-letschat.js ├── index.ios.bak.js ├── index.ios.js ├── ios ├── letschat.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── letschat.xcscheme ├── letschat │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Icon.png │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── letschat-60@2x.png │ │ │ └── letschat-60@3x.png │ │ ├── Brand Assets.launchimage │ │ │ ├── Contents.json │ │ │ └── brand.png │ │ ├── Contents.json │ │ ├── album.imageset │ │ │ ├── Contents.json │ │ │ ├── album.png │ │ │ ├── album@2x.png │ │ │ └── album@3x.png │ │ ├── chat.imageset │ │ │ ├── Contents.json │ │ │ ├── chat.png │ │ │ ├── chat@2x.png │ │ │ └── chat@3x.png │ │ ├── concats.imageset │ │ │ ├── Contents.json │ │ │ ├── concats.png │ │ │ ├── concats@2x.png │ │ │ └── concats@3x.png │ │ ├── discover.imageset │ │ │ ├── Contents.json │ │ │ ├── discover.png │ │ │ └── discover@2x.png │ │ ├── face.imageset │ │ │ ├── Contents.json │ │ │ ├── face.png │ │ │ ├── face@2x.png │ │ │ └── face@3x.png │ │ ├── favorite.imageset │ │ │ ├── Contents.json │ │ │ ├── favorite.png │ │ │ ├── favorite@2x.png │ │ │ └── favorite@3x.png │ │ ├── launch.imageset │ │ │ ├── Contents.json │ │ │ └── launch.png │ │ ├── me.imageset │ │ │ ├── Contents.json │ │ │ ├── me.png │ │ │ ├── me@2x.png │ │ │ └── me@3x.png │ │ ├── settings.imageset │ │ │ ├── Contents.json │ │ │ ├── settings.png │ │ │ ├── settings@2x.png │ │ │ └── settings@3x.png │ │ └── wallet.imageset │ │ │ ├── Contents.json │ │ │ ├── wallet.png │ │ │ ├── wallet@2x.png │ │ │ └── wallet@3x.png │ ├── Info.plist │ └── main.m └── letschatTests │ ├── Info.plist │ └── letschatTests.m ├── main.jsbundle ├── package.json ├── server ├── app.js ├── bin │ └── www ├── database │ ├── message.json │ └── user.json ├── package.json ├── public │ ├── favicon.ico │ └── stylesheets │ │ └── style.css ├── routes │ ├── routes.js │ ├── services │ │ ├── message.js │ │ ├── test.js │ │ └── user.js │ └── util.js ├── service.md └── views │ └── 404 │ └── error.ejs └── views ├── about.js ├── about └── webview.js ├── concats.js ├── discover.js ├── home.js ├── home ├── address.js └── itemblock.js ├── login.js ├── manager.js ├── manager ├── addUser.js ├── deleteUser.js ├── modifyPassword.js └── postMessage.js ├── me.js ├── message-bak.js ├── message.js ├── message ├── detail.js └── item.js ├── service.js └── util.js /README.md: -------------------------------------------------------------------------------- 1 | # letschat 2 | 基于Java和React Native搭建的实时聊天工具,功能完全模仿微信 3 | 4 | 项目刚开始,变化较大,请先不要Fork 5 | 6 | 功能稳定下来之后我们会添加文档 7 | -------------------------------------------------------------------------------- /app/letschat/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ugh 11 | .*/node_modules/babel.* 12 | .*/node_modules/babylon.* 13 | .*/node_modules/invariant.* 14 | 15 | # Ignore react and fbjs where there are overlaps, but don't ignore 16 | # anything that react-native relies on 17 | .*/node_modules/fbjs/lib/Map.js 18 | .*/node_modules/fbjs/lib/Promise.js 19 | .*/node_modules/fbjs/lib/fetch.js 20 | .*/node_modules/fbjs/lib/ExecutionEnvironment.js 21 | .*/node_modules/fbjs/lib/isEmpty.js 22 | .*/node_modules/fbjs/lib/crc32.js 23 | .*/node_modules/fbjs/lib/ErrorUtils.js 24 | 25 | # Flow has a built-in definition for the 'react' module which we prefer to use 26 | # over the currently-untyped source 27 | .*/node_modules/react/react.js 28 | .*/node_modules/react/lib/React.js 29 | .*/node_modules/react/lib/ReactDOM.js 30 | 31 | # Ignore commoner tests 32 | .*/node_modules/commoner/test/.* 33 | 34 | # See https://github.com/facebook/flow/issues/442 35 | .*/react-tools/node_modules/commoner/lib/reader.js 36 | 37 | # Ignore jest 38 | .*/node_modules/jest-cli/.* 39 | 40 | # Ignore Website 41 | .*/website/.* 42 | 43 | [include] 44 | 45 | [libs] 46 | node_modules/react-native/Libraries/react-native/react-native-interface.js 47 | 48 | [options] 49 | module.system=haste 50 | 51 | munge_underscores=true 52 | 53 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 54 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub' 55 | 56 | suppress_type=$FlowIssue 57 | suppress_type=$FlowFixMe 58 | suppress_type=$FixMe 59 | 60 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 61 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 62 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 63 | 64 | [version] 65 | 0.20.1 66 | -------------------------------------------------------------------------------- /app/letschat/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | -------------------------------------------------------------------------------- /app/letschat/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /app/letschat/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets. 7 | * These basically call `react-native bundle` with the correct arguments during the Android build 8 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 9 | * bundle directly from the development server. Below you can see all the possible configurations 10 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 11 | * `apply from: "react.gradle"` line. 12 | * 13 | * project.ext.react = [ 14 | * // the name of the generated asset file containing your JS bundle 15 | * bundleAssetName: "index.android.bundle", 16 | * 17 | * // the entry file for bundle generation 18 | * entryFile: "index.android.js", 19 | * 20 | * // whether to bundle JS and assets in debug mode 21 | * bundleInDebug: false, 22 | * 23 | * // whether to bundle JS and assets in release mode 24 | * bundleInRelease: true, 25 | * 26 | * // the root of your project, i.e. where "package.json" lives 27 | * root: "../../", 28 | * 29 | * // where to put the JS bundle asset in debug mode 30 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 31 | * 32 | * // where to put the JS bundle asset in release mode 33 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 34 | * 35 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 36 | * // require('./image.png')), in debug mode 37 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 38 | * 39 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 40 | * // require('./image.png')), in release mode 41 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 42 | * 43 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 44 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 45 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 46 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 47 | * // for example, you might want to remove it from here. 48 | * inputExcludes: ["android/**", "ios/**"] 49 | * ] 50 | */ 51 | 52 | apply from: "react.gradle" 53 | 54 | /** 55 | * Set this to true to create three separate APKs instead of one: 56 | * - A universal APK that works on all devices 57 | * - An APK that only works on ARM devices 58 | * - An APK that only works on x86 devices 59 | * The advantage is the size of the APK is reduced by about 4MB. 60 | * Upload all the APKs to the Play Store and people will download 61 | * the correct one based on the CPU architecture of their device. 62 | */ 63 | def enableSeparateBuildPerCPUArchitecture = false 64 | 65 | /** 66 | * Run Proguard to shrink the Java bytecode in release builds. 67 | */ 68 | def enableProguardInReleaseBuilds = false 69 | 70 | android { 71 | compileSdkVersion 23 72 | buildToolsVersion "23.0.1" 73 | 74 | defaultConfig { 75 | applicationId "com.letschat" 76 | minSdkVersion 16 77 | targetSdkVersion 22 78 | versionCode 1 79 | versionName "1.0" 80 | ndk { 81 | abiFilters "armeabi-v7a", "x86" 82 | } 83 | } 84 | splits { 85 | abi { 86 | enable enableSeparateBuildPerCPUArchitecture 87 | universalApk true 88 | reset() 89 | include "armeabi-v7a", "x86" 90 | } 91 | } 92 | buildTypes { 93 | release { 94 | minifyEnabled enableProguardInReleaseBuilds 95 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 96 | } 97 | } 98 | // applicationVariants are e.g. debug, release 99 | applicationVariants.all { variant -> 100 | variant.outputs.each { output -> 101 | // For each separate APK per architecture, set a unique version code as described here: 102 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 103 | def versionCodes = ["armeabi-v7a":1, "x86":2] 104 | def abi = output.getFilter(OutputFile.ABI) 105 | if (abi != null) { // null for the universal-debug, universal-release variants 106 | output.versionCodeOverride = 107 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 108 | } 109 | } 110 | } 111 | } 112 | 113 | dependencies { 114 | compile fileTree(dir: "libs", include: ["*.jar"]) 115 | compile "com.android.support:appcompat-v7:23.0.1" 116 | compile "com.facebook.react:react-native:0.18.+" 117 | } 118 | -------------------------------------------------------------------------------- /app/letschat/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | 30 | # Do not strip any method/class that is annotated with @DoNotStrip 31 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 32 | -keepclassmembers class * { 33 | @com.facebook.proguard.annotations.DoNotStrip *; 34 | } 35 | 36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 37 | void set*(***); 38 | *** get*(); 39 | } 40 | 41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 43 | -keepclassmembers,includedescriptorclasses class * { native ; } 44 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 45 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; } 46 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; } 47 | 48 | -dontwarn com.facebook.react.** 49 | 50 | # okhttp 51 | 52 | -keepattributes Signature 53 | -keepattributes *Annotation* 54 | -keep class com.squareup.okhttp.** { *; } 55 | -keep interface com.squareup.okhttp.** { *; } 56 | -dontwarn com.squareup.okhttp.** 57 | 58 | # okio 59 | 60 | -keep class sun.misc.Unsafe { *; } 61 | -dontwarn java.nio.file.* 62 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 63 | -dontwarn okio.** 64 | 65 | # stetho 66 | 67 | -dontwarn com.facebook.stetho.** 68 | -------------------------------------------------------------------------------- /app/letschat/android/app/react.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.taskdefs.condition.Os 2 | 3 | def config = project.hasProperty("react") ? project.react : []; 4 | 5 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" 6 | def entryFile = config.entryFile ?: "index.android.js" 7 | 8 | // because elvis operator 9 | def elvisFile(thing) { 10 | return thing ? file(thing) : null; 11 | } 12 | 13 | def reactRoot = elvisFile(config.root) ?: file("../../") 14 | def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?: 15 | file("$buildDir/intermediates/assets/debug") 16 | def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?: 17 | file("$buildDir/intermediates/assets/release") 18 | def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?: 19 | file("$buildDir/intermediates/res/merged/debug") 20 | def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?: 21 | file("$buildDir/intermediates/res/merged/release") 22 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] 23 | 24 | def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName") 25 | def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName") 26 | 27 | task bundleDebugJsAndAssets(type: Exec) { 28 | // create dirs if they are not there (e.g. the "clean" task just ran) 29 | doFirst { 30 | jsBundleDirDebug.mkdirs() 31 | resourcesDirDebug.mkdirs() 32 | } 33 | 34 | // set up inputs and outputs so gradle can cache the result 35 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 36 | outputs.dir jsBundleDirDebug 37 | outputs.dir resourcesDirDebug 38 | 39 | // set up the call to the react-native cli 40 | workingDir reactRoot 41 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 42 | commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 43 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 44 | } else { 45 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 46 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 47 | } 48 | 49 | enabled config.bundleInDebug ?: false 50 | } 51 | 52 | task bundleReleaseJsAndAssets(type: Exec) { 53 | // create dirs if they are not there (e.g. the "clean" task just ran) 54 | doFirst { 55 | jsBundleDirRelease.mkdirs() 56 | resourcesDirRelease.mkdirs() 57 | } 58 | 59 | // set up inputs and outputs so gradle can cache the result 60 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 61 | outputs.dir jsBundleDirRelease 62 | outputs.dir resourcesDirRelease 63 | 64 | // set up the call to the react-native cli 65 | workingDir reactRoot 66 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 67 | commandLine "cmd","/c", "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 68 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 69 | } else { 70 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 71 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 72 | } 73 | 74 | enabled config.bundleInRelease ?: true 75 | } 76 | 77 | void runBefore(String dependentTaskName, Task task) { 78 | Task dependentTask = tasks.findByPath(dependentTaskName); 79 | if (dependentTask != null) { 80 | dependentTask.dependsOn task 81 | } 82 | } 83 | 84 | gradle.projectsEvaluated { 85 | 86 | // hook bundleDebugJsAndAssets into the android build process 87 | 88 | bundleDebugJsAndAssets.dependsOn mergeDebugResources 89 | bundleDebugJsAndAssets.dependsOn mergeDebugAssets 90 | 91 | runBefore('processArmeabi-v7aDebugResources', bundleDebugJsAndAssets) 92 | runBefore('processX86DebugResources', bundleDebugJsAndAssets) 93 | runBefore('processUniversalDebugResources', bundleDebugJsAndAssets) 94 | runBefore('processDebugResources', bundleDebugJsAndAssets) 95 | 96 | // hook bundleReleaseJsAndAssets into the android build process 97 | 98 | bundleReleaseJsAndAssets.dependsOn mergeReleaseResources 99 | bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets 100 | 101 | runBefore('processArmeabi-v7aReleaseResources', bundleReleaseJsAndAssets) 102 | runBefore('processX86ReleaseResources', bundleReleaseJsAndAssets) 103 | runBefore('processUniversalReleaseResources', bundleReleaseJsAndAssets) 104 | runBefore('processReleaseResources', bundleReleaseJsAndAssets) 105 | 106 | } 107 | -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/java/com/letschat/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.letschat; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.shell.MainReactPackage; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | public class MainActivity extends ReactActivity { 11 | 12 | /** 13 | * Returns the name of the main component registered from JavaScript. 14 | * This is used to schedule rendering of the component. 15 | */ 16 | @Override 17 | protected String getMainComponentName() { 18 | return "letschat"; 19 | } 20 | 21 | /** 22 | * Returns whether dev mode should be enabled. 23 | * This enables e.g. the dev menu. 24 | */ 25 | @Override 26 | protected boolean getUseDeveloperSupport() { 27 | return BuildConfig.DEBUG; 28 | } 29 | 30 | /** 31 | * A list of packages used by the app. If the app uses additional views 32 | * or modules besides the default ones, add more packages here. 33 | */ 34 | @Override 35 | protected List getPackages() { 36 | return Arrays.asList( 37 | new MainReactPackage()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | letschat 3 | 4 | -------------------------------------------------------------------------------- /app/letschat/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/letschat/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/letschat/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /app/letschat/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/letschat/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /app/letschat/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /app/letschat/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/letschat/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'letschat' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /app/letschat/compoments/chat.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | // var ChatSection = require('./chat.section'); 4 | // var ChatMessage = require('./chat.message'); 5 | 6 | var { 7 | AppRegistry, 8 | StyleSheet, 9 | NavigatorIOS, 10 | PixelRatio, 11 | View, 12 | Text 13 | } = React; 14 | 15 | var ChatsItem = React.createClass({ 16 | render: function(){ 17 | return ( 18 | 19 | this.props.name 20 | 21 | ); 22 | } 23 | }); 24 | 25 | var styles = StyleSheet.create({ 26 | flex: { 27 | flex:1 28 | }, 29 | list_item:{ 30 | padding: 10, 31 | backgroundColor: '#EEE', 32 | marginBottom: 1 / PixelRatio.get() 33 | } 34 | }); 35 | 36 | module.exports = Chat; -------------------------------------------------------------------------------- /app/letschat/compoments/chats.item.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | 4 | var { 5 | AppRegistry, 6 | StyleSheet, 7 | NavigatorIOS, 8 | PixelRatio, 9 | View, 10 | Text 11 | } = React; 12 | 13 | var ChatsItem = React.createClass({ 14 | render: function(){ 15 | return ( 16 | 17 | ad 18 | 19 | ); 20 | } 21 | }); 22 | 23 | var styles = StyleSheet.create({ 24 | flex: { 25 | flex:1 26 | }, 27 | list_item:{ 28 | padding: 10, 29 | backgroundColor: '#EEE', 30 | marginBottom: 1 / PixelRatio.get() 31 | } 32 | }); 33 | 34 | module.exports = ChatsItem; -------------------------------------------------------------------------------- /app/letschat/compoments/chats.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | var Chat = require('./chats.item'); 4 | 5 | var { 6 | AppRegistry, 7 | StyleSheet, 8 | NavigatorIOS, 9 | PixelRatio, 10 | View, 11 | ScrollView, 12 | Text 13 | } = React; 14 | 15 | var Chats = React.createClass({ 16 | render: function(){ 17 | return ( 18 | 24 | 25 | ); 26 | } 27 | }); 28 | 29 | var List = React.createClass({ 30 | render: function(){ 31 | return ( 32 | 34 | ad 35 | 306 36 | 大数据前沿技术交流群 37 | 38 | ); 39 | }, 40 | goTo: function(name){ 41 | this.props.navigator.push({ 42 | component: Chat, 43 | title: name, 44 | rightButtonTitle: '资料', 45 | onRightButtonPress: function(){ 46 | React.AlertIOS.alert('开发中'); 47 | } 48 | }) 49 | } 50 | }); 51 | 52 | var styles = StyleSheet.create({ 53 | flex: { 54 | flex:1 55 | }, 56 | list_item:{ 57 | padding: 10, 58 | backgroundColor: '#EEE', 59 | marginBottom: 1 / PixelRatio.get() 60 | } 61 | }); 62 | 63 | module.exports = Chats; -------------------------------------------------------------------------------- /app/letschat/compoments/concats.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | //var ConcatsItem = require('./chats.item'); 4 | 5 | var { 6 | AppRegistry, 7 | StyleSheet, 8 | NavigatorIOS, 9 | PixelRatio, 10 | View, 11 | ScrollView, 12 | Text 13 | } = React; 14 | 15 | var Concats = React.createClass({ 16 | render: function(){ 17 | return ( 18 | 24 | 25 | ); 26 | } 27 | }); 28 | 29 | var List = React.createClass({ 30 | render: function(){ 31 | return ( 32 | 34 | 新的朋友 36 | 群聊 38 | 标签 40 | 公众号 42 | 43 | ); 44 | }, 45 | goTo: function(name){ 46 | // this.props.navigator.push({ 47 | // component: ConcatsItem, 48 | // title: name, 49 | // rightButtonTitle: '资料', 50 | // onRightButtonPress: function(){ 51 | // React.AlertIOS.alert('开发中'); 52 | // } 53 | // }) 54 | } 55 | }); 56 | 57 | var styles = StyleSheet.create({ 58 | flex: { 59 | flex:1 60 | }, 61 | list_item:{ 62 | padding: 10, 63 | backgroundColor: '#EEE', 64 | marginBottom: 1 / PixelRatio.get() 65 | } 66 | }); 67 | 68 | module.exports = Concats; -------------------------------------------------------------------------------- /app/letschat/compoments/discover.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | //var DiscoverItem = require('./chats.item'); 4 | 5 | var { 6 | AppRegistry, 7 | StyleSheet, 8 | NavigatorIOS, 9 | PixelRatio, 10 | View, 11 | ScrollView, 12 | Text 13 | } = React; 14 | 15 | var Discover = React.createClass({ 16 | render: function(){ 17 | return ( 18 | 24 | 25 | ); 26 | } 27 | }); 28 | 29 | var List = React.createClass({ 30 | render: function(){ 31 | return ( 32 | 34 | 朋友圈 36 | 扫一扫 38 | 摇一摇 40 | 购物 42 | 游戏 44 | 45 | ); 46 | }, 47 | goTo: function(name){ 48 | // this.props.navigator.push({ 49 | // component: ConcatsItem, 50 | // title: name, 51 | // rightButtonTitle: '资料', 52 | // onRightButtonPress: function(){ 53 | // React.AlertIOS.alert('开发中'); 54 | // } 55 | // }) 56 | } 57 | }); 58 | 59 | var styles = StyleSheet.create({ 60 | flex: { 61 | flex:1 62 | }, 63 | list_item:{ 64 | padding: 10, 65 | backgroundColor: '#EEE', 66 | marginBottom: 1 / PixelRatio.get() 67 | } 68 | }); 69 | 70 | module.exports = Discover; -------------------------------------------------------------------------------- /app/letschat/compoments/letschat.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | var _ = require('lodash'); 4 | 5 | var Chats = require('./chats'); 6 | var Concats = require('./concats'); 7 | var Discover = require('./discover'); 8 | var Me = require('./me'); 9 | 10 | var { 11 | AppRegistry, 12 | StyleSheet, 13 | NavigatorIOS, 14 | TabBarIOS, 15 | PixelRatio, 16 | View 17 | } = React; 18 | 19 | var Letschat = React.createClass({ 20 | // 21 | getInitialState() { 22 | 23 | return { 24 | selectedTab: 'chat', 25 | tabs: { 26 | chat: { 27 | title: '聊天', icon: require('image!chat'), getTarget: function(){ 28 | return (); 29 | } 30 | }, 31 | concats: { 32 | title: '联系人', icon: require('image!concats'), getTarget: function(){ 33 | return (); 34 | } 35 | }, 36 | discover: { 37 | title: '发现', icon: require('image!discover'), getTarget: function(){ 38 | return (); 39 | } 40 | }, 41 | me: { 42 | title: '我', icon: require('image!me'), getTarget: function(){ 43 | return (); 44 | } 45 | } 46 | } 47 | }; 48 | }, 49 | 50 | // 51 | select: function(name){ 52 | this.setState({ 53 | selectedTab: name 54 | }); 55 | }, 56 | 57 | // 58 | getTabBarItems: function(){ 59 | var items = []; 60 | var self = this; 61 | 62 | _.each(this.state.tabs, function(tab, tabName){ 63 | 64 | tab = _.assign({ 65 | title: tabName, 66 | getTarget: function(){ return (); } 67 | }, tab); 68 | 69 | items.push( 70 | 76 | {tab.getTarget()} 77 | 78 | ); 79 | }); 80 | 81 | return items; 82 | }, 83 | 84 | // 85 | render: function(){ 86 | 87 | return ( 88 | 89 | {this.getTabBarItems()} 90 | 91 | ); 92 | } 93 | }); 94 | 95 | var styles = StyleSheet.create({ 96 | flex: { 97 | flex:1 98 | }, 99 | list_item:{ 100 | padding: 10, 101 | backgroundColor: '#EEE', 102 | marginBottom: 1 / PixelRatio.get() 103 | } 104 | }); 105 | 106 | module.exports = Letschat; -------------------------------------------------------------------------------- /app/letschat/compoments/me.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | var ListItem = require('./widgets/item'); 4 | 5 | var { 6 | AppRegistry, 7 | StyleSheet, 8 | NavigatorIOS, 9 | PixelRatio, 10 | View, 11 | ScrollView, 12 | Text 13 | } = React; 14 | 15 | var Me = React.createClass({ 16 | render: function(){ 17 | return ( 18 | 24 | 25 | ); 26 | } 27 | }); 28 | 29 | var List = React.createClass({ 30 | render: function(){ 31 | return ( 32 | 34 | 36 | 38 | 40 | 42 | 44 | 45 | ); 46 | }, 47 | goTo: function(name){ 48 | // this.props.navigator.push({ 49 | // component: ConcatsItem, 50 | // title: name, 51 | // rightButtonTitle: '资料', 52 | // onRightButtonPress: function(){ 53 | // React.AlertIOS.alert('开发中'); 54 | // } 55 | // }) 56 | } 57 | }); 58 | 59 | var styles = StyleSheet.create({ 60 | flex: { 61 | flex:1 62 | }, 63 | list_item:{ 64 | padding: 10, 65 | backgroundColor: '#EEE', 66 | marginBottom: 1 / PixelRatio.get() 67 | } 68 | }); 69 | 70 | module.exports = Me; -------------------------------------------------------------------------------- /app/letschat/compoments/widgets/item.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | 4 | var { 5 | AppRegistry, 6 | StyleSheet, 7 | View, 8 | Text, 9 | Image 10 | } = React; 11 | 12 | var styles = StyleSheet.create({ 13 | row: { 14 | paddingTop: 5, 15 | paddingLeft: 10, 16 | flexDirection: 'row' 17 | }, 18 | image:{ 19 | width: 30 20 | }, 21 | text:{ 22 | flex: 1, 23 | marginTop: 7, 24 | marginLeft: 10 25 | } 26 | }); 27 | 28 | module.exports = React.createClass({ 29 | render: function(){ 30 | return ( 31 | 32 | 35 | {this.props.text} 37 | 38 | ); 39 | } 40 | }); -------------------------------------------------------------------------------- /app/letschat/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | import React, { 7 | AppRegistry, 8 | Component, 9 | StyleSheet, 10 | Text, 11 | View 12 | } from 'react-native'; 13 | 14 | class letschat extends Component { 15 | render() { 16 | return ( 17 | 18 | 19 | Welcome to React Native! 20 | 21 | 22 | To get started, edit index.android.js 23 | 24 | 25 | Shake or press menu button for dev menu 26 | 27 | 28 | ); 29 | } 30 | } 31 | 32 | const styles = StyleSheet.create({ 33 | container: { 34 | flex: 1, 35 | justifyContent: 'center', 36 | alignItems: 'center', 37 | backgroundColor: '#F5FCFF', 38 | }, 39 | welcome: { 40 | fontSize: 20, 41 | textAlign: 'center', 42 | margin: 10, 43 | }, 44 | instructions: { 45 | textAlign: 'center', 46 | color: '#333333', 47 | marginBottom: 5, 48 | }, 49 | }); 50 | 51 | AppRegistry.registerComponent('letschat', () => letschat); 52 | -------------------------------------------------------------------------------- /app/letschat/index.ios-letschat.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | var AdSupportIOS = require('AdSupportIOS'); 4 | var Home = require('./views/home'); 5 | var About = require('./views/about'); 6 | var Manager = require('./views/manager'); 7 | var Util = require('./views/util'); 8 | var Service = require('./views/service'); 9 | 10 | var Message = require('./views/message'); 11 | var Concats = require('./views/concats'); 12 | var Discover = require('./views/discover'); 13 | var Me = require('./views/me'); 14 | 15 | var { 16 | StyleSheet, 17 | View, 18 | TabBarIOS, 19 | Text, 20 | NavigatorIOS, 21 | AppRegistry, 22 | Image, 23 | TextInput, 24 | StatusBarIOS, 25 | ScrollView, 26 | TouchableHighlight, 27 | ActivityIndicatorIOS, 28 | AlertIOS, 29 | AsyncStorage, 30 | } = React; 31 | 32 | 33 | StatusBarIOS.setStyle('light-content'); 34 | var Address = React.createClass({ 35 | statics: { 36 | title: '主页', 37 | description: '选项卡' 38 | }, 39 | 40 | getInitialState: function(){ 41 | return { 42 | selectedTab: 'home', 43 | showIndex: { 44 | height:0, 45 | opacity:0 46 | }, 47 | showLogin:{ 48 | flex:1, 49 | opacity:1 50 | }, 51 | isLoadingShow: false 52 | }; 53 | }, 54 | 55 | componentDidMount: function(){ 56 | var that = this; 57 | 58 | // TEST 59 | that.setState({ 60 | showLogin: { 61 | height:0, 62 | width:0, 63 | flex:0, 64 | }, 65 | showIndex:{ 66 | flex:1, 67 | opacity:1 68 | }, 69 | isLoadingShow: false 70 | }); 71 | return; 72 | 73 | AsyncStorage.getItem('token', function(err, token){ 74 | if(!err && token){ 75 | var path = Service.host + Service.loginByToken; 76 | Util.post(path, { 77 | token: token 78 | },function(data){ 79 | if(data.status){ 80 | that.setState({ 81 | showLogin: { 82 | height:0, 83 | width:0, 84 | flex:0, 85 | }, 86 | showIndex:{ 87 | flex:1, 88 | opacity:1 89 | }, 90 | isLoadingShow: false 91 | }); 92 | } 93 | }); 94 | }else{ 95 | that.setState({ 96 | showIndex: { 97 | height:0, 98 | opacity:0 99 | }, 100 | showLogin:{ 101 | flex:1, 102 | opacity:1 103 | }, 104 | isLoadingShow: false 105 | }); 106 | } 107 | }); 108 | 109 | var path = Service.host + Service.getMessage; 110 | var that = this; 111 | Util.post(path, { 112 | key: Util.key 113 | }, function(data){ 114 | that.setState({ 115 | data: data 116 | }); 117 | }); 118 | }, 119 | 120 | _selectTab: function(tabName){ 121 | this.setState({ 122 | selectedTab: tabName 123 | }); 124 | }, 125 | 126 | _addNavigator: function(component, title){ 127 | var data = null; 128 | if(title === '公告'){ 129 | data = this.state.data; 130 | } 131 | return ; 145 | }, 146 | 147 | _getEmail: function(val){ 148 | var email = val; 149 | this.setState({ 150 | email: email 151 | }); 152 | }, 153 | 154 | _getPassword: function(val){ 155 | var password = val; 156 | this.setState({ 157 | password: password 158 | }); 159 | }, 160 | 161 | _login: function(){ 162 | var email = this.state.email; 163 | var password = this.state.password; 164 | var path = Service.host + Service.login; 165 | var that = this; 166 | 167 | //隐藏登录页 & 加载loading 168 | that.setState({ 169 | showLogin: { 170 | height:0, 171 | width:0, 172 | flex:0, 173 | }, 174 | isLoadingShow: true 175 | }); 176 | AdSupportIOS.getAdvertisingTrackingEnabled(function(){ 177 | AdSupportIOS.getAdvertisingId(function(deviceId){ 178 | Util.post(path, { 179 | email: email, 180 | password: password, 181 | deviceId: deviceId, 182 | }, function(data){ 183 | if(data.status){ 184 | var user = data.data; 185 | //加入数据到本地 186 | AsyncStorage.multiSet([ 187 | ['username', user.username], 188 | ['token', user.token], 189 | ['userid', user.userid], 190 | ['email', user.email], 191 | ['tel', user.tel], 192 | ['partment', user.partment], 193 | ['tag', user.tag], 194 | ], function(err){ 195 | if(!err){ 196 | that.setState({ 197 | showLogin: { 198 | height:0, 199 | width:0, 200 | flex:0, 201 | }, 202 | showIndex:{ 203 | flex:1, 204 | opacity:1 205 | }, 206 | isLoadingShow: false 207 | }); 208 | } 209 | }); 210 | 211 | }else{ 212 | AlertIOS.alert('登录', '用户名或者密码错误'); 213 | that.setState({ 214 | showLogin: { 215 | flex:1, 216 | opacity:1 217 | }, 218 | showIndex:{ 219 | height:0, 220 | width:0, 221 | flex:0, 222 | }, 223 | isLoadingShow: false 224 | }); 225 | } 226 | }); 227 | }, function(){ 228 | AlertIOS.alert('设置','无法获取设备唯一标识'); 229 | }); 230 | }, function(){ 231 | AlertIOS.alert('设置','无法获取设备唯一标识,请关闭设置->隐私->广告->限制广告跟踪'); 232 | }); 233 | }, 234 | 235 | render: function(){ 236 | return( 237 | 238 | {this.state.isLoadingShow ? 239 | 240 | 241 | :null 242 | } 243 | {!this.state.isLoadingShow ? 244 | 245 | 246 | 247 | 253 | {this._addNavigator(Message, '微信')} 254 | 255 | 256 | 262 | {this._addNavigator(Concats, '通讯录')} 263 | 264 | 265 | 271 | {this._addNavigator(Discover, '发现')} 272 | 273 | 274 | 280 | {this._addNavigator(Me, '我')} 281 | 282 | 283 | : null 284 | } 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 邮箱 293 | 294 | 295 | 密码 296 | 297 | 298 | 299 | 300 | 登录 301 | 302 | 303 | 304 | 305 | 306 | 307 | ); 308 | } 309 | 310 | }); 311 | 312 | var styles = StyleSheet.create({ 313 | container:{ 314 | marginTop:50, 315 | alignItems:'center', 316 | }, 317 | logo:{ 318 | width:100, 319 | height:100, 320 | resizeMode: Image.resizeMode.contain 321 | }, 322 | inputRow:{ 323 | flexDirection:'row', 324 | alignItems:'center', 325 | justifyContent: 'center', 326 | marginBottom:10, 327 | }, 328 | input:{ 329 | marginLeft:10, 330 | width:220, 331 | borderWidth:Util.pixel, 332 | height:35, 333 | paddingLeft:8, 334 | borderRadius:5, 335 | borderColor:'#ccc' 336 | }, 337 | btn:{ 338 | marginTop:10, 339 | width:80, 340 | height:35, 341 | backgroundColor:'#3BC1FF', 342 | justifyContent:'center', 343 | alignItems:'center', 344 | borderRadius: 4, 345 | } 346 | }); 347 | 348 | AppRegistry.registerComponent('letschat', () => Address); 349 | -------------------------------------------------------------------------------- /app/letschat/index.ios.bak.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | import React, { 7 | AppRegistry, 8 | Component, 9 | StyleSheet, 10 | Text, 11 | View 12 | } from 'react-native'; 13 | 14 | class letschat extends Component { 15 | render() { 16 | return ( 17 | 18 | 19 | Let's Chat! 20 | 21 | 22 | To get started, edit index.ios.js 23 | 24 | 25 | Press Cmd+R to reload,{'\n'} 26 | Cmd+D or shake for dev menu 27 | 28 | 29 | ); 30 | } 31 | } 32 | 33 | const styles = StyleSheet.create({ 34 | container: { 35 | flex: 1, 36 | justifyContent: 'center', 37 | alignItems: 'center', 38 | backgroundColor: '#F5FCFF', 39 | }, 40 | welcome: { 41 | fontSize: 20, 42 | textAlign: 'center', 43 | margin: 10, 44 | }, 45 | instructions: { 46 | textAlign: 'center', 47 | color: '#333333', 48 | marginBottom: 5, 49 | }, 50 | }); 51 | 52 | AppRegistry.registerComponent('letschat', () => letschat); 53 | -------------------------------------------------------------------------------- /app/letschat/index.ios.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var React = require('react-native'); 3 | var Letschat = require('./compoments/letschat'); 4 | 5 | var { 6 | AppRegistry 7 | } = React; 8 | 9 | AppRegistry.registerComponent('letschat', () => Letschat); -------------------------------------------------------------------------------- /app/letschat/ios/letschat.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* letschatTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* letschatTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 22 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 24 | 878DED071C512C3A00AB3168 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 878DECFD1C512AEE00AB3168 /* libRCTAdSupport.a */; }; 25 | 87DD0FB41C549EF9009E2714 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 87DD0FB31C549EF9009E2714 /* Images.xcassets */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 32 | proxyType = 2; 33 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 34 | remoteInfo = RCTActionSheet; 35 | }; 36 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 39 | proxyType = 2; 40 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 41 | remoteInfo = RCTGeolocation; 42 | }; 43 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 44 | isa = PBXContainerItemProxy; 45 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 46 | proxyType = 2; 47 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 48 | remoteInfo = RCTImage; 49 | }; 50 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 51 | isa = PBXContainerItemProxy; 52 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 53 | proxyType = 2; 54 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 55 | remoteInfo = RCTNetwork; 56 | }; 57 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 58 | isa = PBXContainerItemProxy; 59 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 60 | proxyType = 2; 61 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 62 | remoteInfo = RCTVibration; 63 | }; 64 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 65 | isa = PBXContainerItemProxy; 66 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 67 | proxyType = 1; 68 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 69 | remoteInfo = letschat; 70 | }; 71 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 72 | isa = PBXContainerItemProxy; 73 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 74 | proxyType = 2; 75 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 76 | remoteInfo = RCTSettings; 77 | }; 78 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 79 | isa = PBXContainerItemProxy; 80 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 81 | proxyType = 2; 82 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 83 | remoteInfo = RCTWebSocket; 84 | }; 85 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 86 | isa = PBXContainerItemProxy; 87 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 88 | proxyType = 2; 89 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 90 | remoteInfo = React; 91 | }; 92 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 93 | isa = PBXContainerItemProxy; 94 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 95 | proxyType = 2; 96 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 97 | remoteInfo = RCTLinking; 98 | }; 99 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 100 | isa = PBXContainerItemProxy; 101 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 102 | proxyType = 2; 103 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 104 | remoteInfo = RCTText; 105 | }; 106 | 878DECFC1C512AEE00AB3168 /* PBXContainerItemProxy */ = { 107 | isa = PBXContainerItemProxy; 108 | containerPortal = 878DECF71C512AEE00AB3168 /* RCTAdSupport.xcodeproj */; 109 | proxyType = 2; 110 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 111 | remoteInfo = RCTAdSupport; 112 | }; 113 | /* End PBXContainerItemProxy section */ 114 | 115 | /* Begin PBXFileReference section */ 116 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 117 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 118 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 119 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 120 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 121 | 00E356EE1AD99517003FC87E /* letschatTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = letschatTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 122 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 123 | 00E356F21AD99517003FC87E /* letschatTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = letschatTests.m; sourceTree = ""; }; 124 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 125 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 126 | 13B07F961A680F5B00A75B9A /* letschat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = letschat.app; sourceTree = BUILT_PRODUCTS_DIR; }; 127 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = letschat/AppDelegate.h; sourceTree = ""; }; 128 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = letschat/AppDelegate.m; sourceTree = ""; }; 129 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 130 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = letschat/Info.plist; sourceTree = ""; }; 131 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = letschat/main.m; sourceTree = ""; }; 132 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 133 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 134 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 135 | 878DECF71C512AEE00AB3168 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = "../node_modules/react-native/Libraries/AdSupport/RCTAdSupport.xcodeproj"; sourceTree = ""; }; 136 | 87DD0FB31C549EF9009E2714 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = letschat/Images.xcassets; sourceTree = ""; }; 137 | /* End PBXFileReference section */ 138 | 139 | /* Begin PBXFrameworksBuildPhase section */ 140 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 141 | isa = PBXFrameworksBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | ); 145 | runOnlyForDeploymentPostprocessing = 0; 146 | }; 147 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 148 | isa = PBXFrameworksBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | 878DED071C512C3A00AB3168 /* libRCTAdSupport.a in Frameworks */, 152 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 153 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 154 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 155 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 156 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 157 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 158 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 159 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 160 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 161 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | }; 165 | /* End PBXFrameworksBuildPhase section */ 166 | 167 | /* Begin PBXGroup section */ 168 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 172 | ); 173 | name = Products; 174 | sourceTree = ""; 175 | }; 176 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 180 | ); 181 | name = Products; 182 | sourceTree = ""; 183 | }; 184 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 188 | ); 189 | name = Products; 190 | sourceTree = ""; 191 | }; 192 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 196 | ); 197 | name = Products; 198 | sourceTree = ""; 199 | }; 200 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 204 | ); 205 | name = Products; 206 | sourceTree = ""; 207 | }; 208 | 00E356EF1AD99517003FC87E /* letschatTests */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 00E356F21AD99517003FC87E /* letschatTests.m */, 212 | 00E356F01AD99517003FC87E /* Supporting Files */, 213 | ); 214 | path = letschatTests; 215 | sourceTree = ""; 216 | }; 217 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | 00E356F11AD99517003FC87E /* Info.plist */, 221 | ); 222 | name = "Supporting Files"; 223 | sourceTree = ""; 224 | }; 225 | 139105B71AF99BAD00B5F7CC /* Products */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 229 | ); 230 | name = Products; 231 | sourceTree = ""; 232 | }; 233 | 139FDEE71B06529A00C62182 /* Products */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 237 | ); 238 | name = Products; 239 | sourceTree = ""; 240 | }; 241 | 13B07FAE1A68108700A75B9A /* letschat */ = { 242 | isa = PBXGroup; 243 | children = ( 244 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 245 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 246 | 13B07FB61A68108700A75B9A /* Info.plist */, 247 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 248 | 13B07FB71A68108700A75B9A /* main.m */, 249 | 87DD0FB31C549EF9009E2714 /* Images.xcassets */, 250 | ); 251 | name = letschat; 252 | sourceTree = ""; 253 | }; 254 | 146834001AC3E56700842450 /* Products */ = { 255 | isa = PBXGroup; 256 | children = ( 257 | 146834041AC3E56700842450 /* libReact.a */, 258 | ); 259 | name = Products; 260 | sourceTree = ""; 261 | }; 262 | 78C398B11ACF4ADC00677621 /* Products */ = { 263 | isa = PBXGroup; 264 | children = ( 265 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 266 | ); 267 | name = Products; 268 | sourceTree = ""; 269 | }; 270 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 271 | isa = PBXGroup; 272 | children = ( 273 | 878DECF71C512AEE00AB3168 /* RCTAdSupport.xcodeproj */, 274 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 275 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 276 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 277 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 278 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 279 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 280 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 281 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 282 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 283 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 284 | ); 285 | name = Libraries; 286 | sourceTree = ""; 287 | }; 288 | 832341B11AAA6A8300B99B32 /* Products */ = { 289 | isa = PBXGroup; 290 | children = ( 291 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 292 | ); 293 | name = Products; 294 | sourceTree = ""; 295 | }; 296 | 83CBB9F61A601CBA00E9B192 = { 297 | isa = PBXGroup; 298 | children = ( 299 | 13B07FAE1A68108700A75B9A /* letschat */, 300 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 301 | 00E356EF1AD99517003FC87E /* letschatTests */, 302 | 83CBBA001A601CBA00E9B192 /* Products */, 303 | ); 304 | indentWidth = 2; 305 | sourceTree = ""; 306 | tabWidth = 2; 307 | }; 308 | 83CBBA001A601CBA00E9B192 /* Products */ = { 309 | isa = PBXGroup; 310 | children = ( 311 | 13B07F961A680F5B00A75B9A /* letschat.app */, 312 | 00E356EE1AD99517003FC87E /* letschatTests.xctest */, 313 | ); 314 | name = Products; 315 | sourceTree = ""; 316 | }; 317 | 878DECF81C512AEE00AB3168 /* Products */ = { 318 | isa = PBXGroup; 319 | children = ( 320 | 878DECFD1C512AEE00AB3168 /* libRCTAdSupport.a */, 321 | ); 322 | name = Products; 323 | sourceTree = ""; 324 | }; 325 | /* End PBXGroup section */ 326 | 327 | /* Begin PBXNativeTarget section */ 328 | 00E356ED1AD99517003FC87E /* letschatTests */ = { 329 | isa = PBXNativeTarget; 330 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "letschatTests" */; 331 | buildPhases = ( 332 | 00E356EA1AD99517003FC87E /* Sources */, 333 | 00E356EB1AD99517003FC87E /* Frameworks */, 334 | 00E356EC1AD99517003FC87E /* Resources */, 335 | ); 336 | buildRules = ( 337 | ); 338 | dependencies = ( 339 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 340 | ); 341 | name = letschatTests; 342 | productName = letschatTests; 343 | productReference = 00E356EE1AD99517003FC87E /* letschatTests.xctest */; 344 | productType = "com.apple.product-type.bundle.unit-test"; 345 | }; 346 | 13B07F861A680F5B00A75B9A /* letschat */ = { 347 | isa = PBXNativeTarget; 348 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "letschat" */; 349 | buildPhases = ( 350 | 13B07F871A680F5B00A75B9A /* Sources */, 351 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 352 | 13B07F8E1A680F5B00A75B9A /* Resources */, 353 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 354 | ); 355 | buildRules = ( 356 | ); 357 | dependencies = ( 358 | ); 359 | name = letschat; 360 | productName = "Hello World"; 361 | productReference = 13B07F961A680F5B00A75B9A /* letschat.app */; 362 | productType = "com.apple.product-type.application"; 363 | }; 364 | /* End PBXNativeTarget section */ 365 | 366 | /* Begin PBXProject section */ 367 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 368 | isa = PBXProject; 369 | attributes = { 370 | LastUpgradeCheck = 0720; 371 | ORGANIZATIONNAME = Facebook; 372 | TargetAttributes = { 373 | 00E356ED1AD99517003FC87E = { 374 | CreatedOnToolsVersion = 6.2; 375 | TestTargetID = 13B07F861A680F5B00A75B9A; 376 | }; 377 | 13B07F861A680F5B00A75B9A = { 378 | DevelopmentTeam = VH8DPFD84U; 379 | SystemCapabilities = { 380 | com.apple.Maps.iOS = { 381 | enabled = 0; 382 | }; 383 | }; 384 | }; 385 | }; 386 | }; 387 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "letschat" */; 388 | compatibilityVersion = "Xcode 3.2"; 389 | developmentRegion = English; 390 | hasScannedForEncodings = 0; 391 | knownRegions = ( 392 | en, 393 | Base, 394 | ); 395 | mainGroup = 83CBB9F61A601CBA00E9B192; 396 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 397 | projectDirPath = ""; 398 | projectReferences = ( 399 | { 400 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 401 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 402 | }, 403 | { 404 | ProductGroup = 878DECF81C512AEE00AB3168 /* Products */; 405 | ProjectRef = 878DECF71C512AEE00AB3168 /* RCTAdSupport.xcodeproj */; 406 | }, 407 | { 408 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 409 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 410 | }, 411 | { 412 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 413 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 414 | }, 415 | { 416 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 417 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 418 | }, 419 | { 420 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 421 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 422 | }, 423 | { 424 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 425 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 426 | }, 427 | { 428 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 429 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 430 | }, 431 | { 432 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 433 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 434 | }, 435 | { 436 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 437 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 438 | }, 439 | { 440 | ProductGroup = 146834001AC3E56700842450 /* Products */; 441 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 442 | }, 443 | ); 444 | projectRoot = ""; 445 | targets = ( 446 | 13B07F861A680F5B00A75B9A /* letschat */, 447 | 00E356ED1AD99517003FC87E /* letschatTests */, 448 | ); 449 | }; 450 | /* End PBXProject section */ 451 | 452 | /* Begin PBXReferenceProxy section */ 453 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 454 | isa = PBXReferenceProxy; 455 | fileType = archive.ar; 456 | path = libRCTActionSheet.a; 457 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 458 | sourceTree = BUILT_PRODUCTS_DIR; 459 | }; 460 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 461 | isa = PBXReferenceProxy; 462 | fileType = archive.ar; 463 | path = libRCTGeolocation.a; 464 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 465 | sourceTree = BUILT_PRODUCTS_DIR; 466 | }; 467 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 468 | isa = PBXReferenceProxy; 469 | fileType = archive.ar; 470 | path = libRCTImage.a; 471 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 472 | sourceTree = BUILT_PRODUCTS_DIR; 473 | }; 474 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 475 | isa = PBXReferenceProxy; 476 | fileType = archive.ar; 477 | path = libRCTNetwork.a; 478 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 479 | sourceTree = BUILT_PRODUCTS_DIR; 480 | }; 481 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 482 | isa = PBXReferenceProxy; 483 | fileType = archive.ar; 484 | path = libRCTVibration.a; 485 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 486 | sourceTree = BUILT_PRODUCTS_DIR; 487 | }; 488 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 489 | isa = PBXReferenceProxy; 490 | fileType = archive.ar; 491 | path = libRCTSettings.a; 492 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 493 | sourceTree = BUILT_PRODUCTS_DIR; 494 | }; 495 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 496 | isa = PBXReferenceProxy; 497 | fileType = archive.ar; 498 | path = libRCTWebSocket.a; 499 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 500 | sourceTree = BUILT_PRODUCTS_DIR; 501 | }; 502 | 146834041AC3E56700842450 /* libReact.a */ = { 503 | isa = PBXReferenceProxy; 504 | fileType = archive.ar; 505 | path = libReact.a; 506 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 507 | sourceTree = BUILT_PRODUCTS_DIR; 508 | }; 509 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 510 | isa = PBXReferenceProxy; 511 | fileType = archive.ar; 512 | path = libRCTLinking.a; 513 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 514 | sourceTree = BUILT_PRODUCTS_DIR; 515 | }; 516 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 517 | isa = PBXReferenceProxy; 518 | fileType = archive.ar; 519 | path = libRCTText.a; 520 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 521 | sourceTree = BUILT_PRODUCTS_DIR; 522 | }; 523 | 878DECFD1C512AEE00AB3168 /* libRCTAdSupport.a */ = { 524 | isa = PBXReferenceProxy; 525 | fileType = archive.ar; 526 | path = libRCTAdSupport.a; 527 | remoteRef = 878DECFC1C512AEE00AB3168 /* PBXContainerItemProxy */; 528 | sourceTree = BUILT_PRODUCTS_DIR; 529 | }; 530 | /* End PBXReferenceProxy section */ 531 | 532 | /* Begin PBXResourcesBuildPhase section */ 533 | 00E356EC1AD99517003FC87E /* Resources */ = { 534 | isa = PBXResourcesBuildPhase; 535 | buildActionMask = 2147483647; 536 | files = ( 537 | ); 538 | runOnlyForDeploymentPostprocessing = 0; 539 | }; 540 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 541 | isa = PBXResourcesBuildPhase; 542 | buildActionMask = 2147483647; 543 | files = ( 544 | 87DD0FB41C549EF9009E2714 /* Images.xcassets in Resources */, 545 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 546 | ); 547 | runOnlyForDeploymentPostprocessing = 0; 548 | }; 549 | /* End PBXResourcesBuildPhase section */ 550 | 551 | /* Begin PBXShellScriptBuildPhase section */ 552 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 553 | isa = PBXShellScriptBuildPhase; 554 | buildActionMask = 2147483647; 555 | files = ( 556 | ); 557 | inputPaths = ( 558 | ); 559 | name = "Bundle React Native code and images"; 560 | outputPaths = ( 561 | ); 562 | runOnlyForDeploymentPostprocessing = 0; 563 | shellPath = /bin/sh; 564 | shellScript = "../node_modules/react-native/packager/react-native-xcode.sh"; 565 | }; 566 | /* End PBXShellScriptBuildPhase section */ 567 | 568 | /* Begin PBXSourcesBuildPhase section */ 569 | 00E356EA1AD99517003FC87E /* Sources */ = { 570 | isa = PBXSourcesBuildPhase; 571 | buildActionMask = 2147483647; 572 | files = ( 573 | 00E356F31AD99517003FC87E /* letschatTests.m in Sources */, 574 | ); 575 | runOnlyForDeploymentPostprocessing = 0; 576 | }; 577 | 13B07F871A680F5B00A75B9A /* Sources */ = { 578 | isa = PBXSourcesBuildPhase; 579 | buildActionMask = 2147483647; 580 | files = ( 581 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 582 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 583 | ); 584 | runOnlyForDeploymentPostprocessing = 0; 585 | }; 586 | /* End PBXSourcesBuildPhase section */ 587 | 588 | /* Begin PBXTargetDependency section */ 589 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 590 | isa = PBXTargetDependency; 591 | target = 13B07F861A680F5B00A75B9A /* letschat */; 592 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 593 | }; 594 | /* End PBXTargetDependency section */ 595 | 596 | /* Begin PBXVariantGroup section */ 597 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 598 | isa = PBXVariantGroup; 599 | children = ( 600 | 13B07FB21A68108700A75B9A /* Base */, 601 | ); 602 | name = LaunchScreen.xib; 603 | path = letschat; 604 | sourceTree = ""; 605 | }; 606 | /* End PBXVariantGroup section */ 607 | 608 | /* Begin XCBuildConfiguration section */ 609 | 00E356F61AD99517003FC87E /* Debug */ = { 610 | isa = XCBuildConfiguration; 611 | buildSettings = { 612 | BUNDLE_LOADER = "$(TEST_HOST)"; 613 | FRAMEWORK_SEARCH_PATHS = ( 614 | "$(SDKROOT)/Developer/Library/Frameworks", 615 | "$(inherited)", 616 | ); 617 | GCC_PREPROCESSOR_DEFINITIONS = ( 618 | "DEBUG=1", 619 | "$(inherited)", 620 | ); 621 | INFOPLIST_FILE = letschatTests/Info.plist; 622 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 623 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 624 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 625 | PRODUCT_NAME = "$(TARGET_NAME)"; 626 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/letschat.app/letschat"; 627 | }; 628 | name = Debug; 629 | }; 630 | 00E356F71AD99517003FC87E /* Release */ = { 631 | isa = XCBuildConfiguration; 632 | buildSettings = { 633 | BUNDLE_LOADER = "$(TEST_HOST)"; 634 | COPY_PHASE_STRIP = NO; 635 | FRAMEWORK_SEARCH_PATHS = ( 636 | "$(SDKROOT)/Developer/Library/Frameworks", 637 | "$(inherited)", 638 | ); 639 | INFOPLIST_FILE = letschatTests/Info.plist; 640 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 641 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 642 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 643 | PRODUCT_NAME = "$(TARGET_NAME)"; 644 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/letschat.app/letschat"; 645 | }; 646 | name = Release; 647 | }; 648 | 13B07F941A680F5B00A75B9A /* Debug */ = { 649 | isa = XCBuildConfiguration; 650 | buildSettings = { 651 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 652 | CODE_SIGN_IDENTITY = "iPhone Developer"; 653 | DEAD_CODE_STRIPPING = NO; 654 | HEADER_SEARCH_PATHS = ( 655 | "$(inherited)", 656 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 657 | "$(SRCROOT)/../node_modules/react-native/React/**", 658 | ); 659 | INFOPLIST_FILE = letschat/Info.plist; 660 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 661 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 662 | OTHER_LDFLAGS = "-ObjC"; 663 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 664 | PRODUCT_NAME = letschat; 665 | }; 666 | name = Debug; 667 | }; 668 | 13B07F951A680F5B00A75B9A /* Release */ = { 669 | isa = XCBuildConfiguration; 670 | buildSettings = { 671 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 672 | CODE_SIGN_IDENTITY = "iPhone Developer"; 673 | HEADER_SEARCH_PATHS = ( 674 | "$(inherited)", 675 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 676 | "$(SRCROOT)/../node_modules/react-native/React/**", 677 | ); 678 | INFOPLIST_FILE = letschat/Info.plist; 679 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 680 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 681 | OTHER_LDFLAGS = "-ObjC"; 682 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 683 | PRODUCT_NAME = letschat; 684 | }; 685 | name = Release; 686 | }; 687 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 688 | isa = XCBuildConfiguration; 689 | buildSettings = { 690 | ALWAYS_SEARCH_USER_PATHS = NO; 691 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 692 | CLANG_CXX_LIBRARY = "libc++"; 693 | CLANG_ENABLE_MODULES = YES; 694 | CLANG_ENABLE_OBJC_ARC = YES; 695 | CLANG_WARN_BOOL_CONVERSION = YES; 696 | CLANG_WARN_CONSTANT_CONVERSION = YES; 697 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 698 | CLANG_WARN_EMPTY_BODY = YES; 699 | CLANG_WARN_ENUM_CONVERSION = YES; 700 | CLANG_WARN_INT_CONVERSION = YES; 701 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 702 | CLANG_WARN_UNREACHABLE_CODE = YES; 703 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 704 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 705 | COPY_PHASE_STRIP = NO; 706 | ENABLE_STRICT_OBJC_MSGSEND = YES; 707 | ENABLE_TESTABILITY = YES; 708 | GCC_C_LANGUAGE_STANDARD = gnu99; 709 | GCC_DYNAMIC_NO_PIC = NO; 710 | GCC_OPTIMIZATION_LEVEL = 0; 711 | GCC_PREPROCESSOR_DEFINITIONS = ( 712 | "DEBUG=1", 713 | "$(inherited)", 714 | ); 715 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 716 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 717 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 718 | GCC_WARN_UNDECLARED_SELECTOR = YES; 719 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 720 | GCC_WARN_UNUSED_FUNCTION = YES; 721 | GCC_WARN_UNUSED_VARIABLE = YES; 722 | HEADER_SEARCH_PATHS = ( 723 | "$(inherited)", 724 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 725 | "$(SRCROOT)/../node_modules/react-native/React/**", 726 | ); 727 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 728 | MTL_ENABLE_DEBUG_INFO = YES; 729 | ONLY_ACTIVE_ARCH = YES; 730 | SDKROOT = iphoneos; 731 | }; 732 | name = Debug; 733 | }; 734 | 83CBBA211A601CBA00E9B192 /* Release */ = { 735 | isa = XCBuildConfiguration; 736 | buildSettings = { 737 | ALWAYS_SEARCH_USER_PATHS = NO; 738 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 739 | CLANG_CXX_LIBRARY = "libc++"; 740 | CLANG_ENABLE_MODULES = YES; 741 | CLANG_ENABLE_OBJC_ARC = YES; 742 | CLANG_WARN_BOOL_CONVERSION = YES; 743 | CLANG_WARN_CONSTANT_CONVERSION = YES; 744 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 745 | CLANG_WARN_EMPTY_BODY = YES; 746 | CLANG_WARN_ENUM_CONVERSION = YES; 747 | CLANG_WARN_INT_CONVERSION = YES; 748 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 749 | CLANG_WARN_UNREACHABLE_CODE = YES; 750 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 751 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 752 | COPY_PHASE_STRIP = YES; 753 | ENABLE_NS_ASSERTIONS = NO; 754 | ENABLE_STRICT_OBJC_MSGSEND = YES; 755 | GCC_C_LANGUAGE_STANDARD = gnu99; 756 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 757 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 758 | GCC_WARN_UNDECLARED_SELECTOR = YES; 759 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 760 | GCC_WARN_UNUSED_FUNCTION = YES; 761 | GCC_WARN_UNUSED_VARIABLE = YES; 762 | HEADER_SEARCH_PATHS = ( 763 | "$(inherited)", 764 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 765 | "$(SRCROOT)/../node_modules/react-native/React/**", 766 | ); 767 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 768 | MTL_ENABLE_DEBUG_INFO = NO; 769 | SDKROOT = iphoneos; 770 | VALIDATE_PRODUCT = YES; 771 | }; 772 | name = Release; 773 | }; 774 | /* End XCBuildConfiguration section */ 775 | 776 | /* Begin XCConfigurationList section */ 777 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "letschatTests" */ = { 778 | isa = XCConfigurationList; 779 | buildConfigurations = ( 780 | 00E356F61AD99517003FC87E /* Debug */, 781 | 00E356F71AD99517003FC87E /* Release */, 782 | ); 783 | defaultConfigurationIsVisible = 0; 784 | defaultConfigurationName = Release; 785 | }; 786 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "letschat" */ = { 787 | isa = XCConfigurationList; 788 | buildConfigurations = ( 789 | 13B07F941A680F5B00A75B9A /* Debug */, 790 | 13B07F951A680F5B00A75B9A /* Release */, 791 | ); 792 | defaultConfigurationIsVisible = 0; 793 | defaultConfigurationName = Release; 794 | }; 795 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "letschat" */ = { 796 | isa = XCConfigurationList; 797 | buildConfigurations = ( 798 | 83CBBA201A601CBA00E9B192 /* Debug */, 799 | 83CBBA211A601CBA00E9B192 /* Release */, 800 | ); 801 | defaultConfigurationIsVisible = 0; 802 | defaultConfigurationName = Release; 803 | }; 804 | /* End XCConfigurationList section */ 805 | }; 806 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 807 | } 808 | -------------------------------------------------------------------------------- /app/letschat/ios/letschat.xcodeproj/xcshareddata/xcschemes/letschat.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /app/letschat/ios/letschat/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /app/letschat/ios/letschat/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | 21 | if(true){ 22 | /** 23 | * Loading JavaScript code - uncomment the one you want. 24 | * 25 | * OPTION 1 26 | * Load from development server. Start the server from the repository root: 27 | * 28 | * $ npm start 29 | * 30 | * To run on device, change `localhost` to the IP address of your computer 31 | * (you can get this by typing `ifconfig` into the terminal and selecting the 32 | * `inet` value under `en0:`) and make sure your computer and iOS device are 33 | * on the same Wi-Fi network. 34 | */ 35 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 36 | }else{ 37 | /** 38 | * OPTION 2 39 | * Load from pre-bundled file on disk. The static bundle is automatically 40 | * generated by "Bundle React Native code and images" build step. 41 | */ 42 | jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 43 | } 44 | 45 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 46 | moduleName:@"letschat" 47 | initialProperties:nil 48 | launchOptions:launchOptions]; 49 | 50 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 51 | UIViewController *rootViewController = [UIViewController new]; 52 | rootViewController.view = rootView; 53 | self.window.rootViewController = rootViewController; 54 | [self.window makeKeyAndVisible]; 55 | return YES; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Icon.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "letschat-60@2x.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "size" : "60x60", 31 | "idiom" : "iphone", 32 | "filename" : "letschat-60@3x.png", 33 | "scale" : "3x" 34 | } 35 | ], 36 | "info" : { 37 | "version" : 1, 38 | "author" : "xcode" 39 | } 40 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/AppIcon.appiconset/letschat-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/AppIcon.appiconset/letschat-60@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/AppIcon.appiconset/letschat-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/AppIcon.appiconset/letschat-60@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/Brand Assets.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "filename" : "brand.png", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "minimum-system-version" : "7.0", 14 | "scale" : "2x" 15 | }, 16 | { 17 | "orientation" : "portrait", 18 | "idiom" : "iphone", 19 | "minimum-system-version" : "7.0", 20 | "subtype" : "retina4", 21 | "scale" : "2x" 22 | } 23 | ], 24 | "info" : { 25 | "version" : 1, 26 | "author" : "xcode" 27 | } 28 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/Brand Assets.launchimage/brand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/Brand Assets.launchimage/brand.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/album.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "album.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "album@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "album@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/album.imageset/album.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/album.imageset/album.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/album.imageset/album@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/album.imageset/album@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/album.imageset/album@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/album.imageset/album@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/chat.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "chat.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "chat@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "chat@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/chat.imageset/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/chat.imageset/chat.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/chat.imageset/chat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/chat.imageset/chat@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/chat.imageset/chat@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/chat.imageset/chat@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/concats.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "concats.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "concats@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "concats@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/concats.imageset/concats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/concats.imageset/concats.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/concats.imageset/concats@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/concats.imageset/concats@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/concats.imageset/concats@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/concats.imageset/concats@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/discover.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "discover.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "discover@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/discover.imageset/discover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/discover.imageset/discover.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/discover.imageset/discover@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/discover.imageset/discover@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/face.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "face.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "face@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "face@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/face.imageset/face.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/face.imageset/face.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/face.imageset/face@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/face.imageset/face@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/face.imageset/face@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/face.imageset/face@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/favorite.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "favorite.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "favorite@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "favorite@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/favorite.imageset/favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/favorite.imageset/favorite.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/favorite.imageset/favorite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/favorite.imageset/favorite@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/favorite.imageset/favorite@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/favorite.imageset/favorite@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/launch.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "launch.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/launch.imageset/launch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/launch.imageset/launch.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/me.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "me.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "me@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "me@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/me.imageset/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/me.imageset/me.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/me.imageset/me@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/me.imageset/me@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/me.imageset/me@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/me.imageset/me@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/settings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "settings.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "settings@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "settings@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/settings.imageset/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/settings.imageset/settings.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/settings.imageset/settings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/settings.imageset/settings@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/settings.imageset/settings@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/settings.imageset/settings@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/wallet.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "wallet.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "wallet@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "wallet@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/wallet.imageset/wallet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/wallet.imageset/wallet.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/wallet.imageset/wallet@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/wallet.imageset/wallet@2x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Images.xcassets/wallet.imageset/wallet@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/ios/letschat/Images.xcassets/wallet.imageset/wallet@3x.png -------------------------------------------------------------------------------- /app/letschat/ios/letschat/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | Icon.png 11 | CFBundleIcons 12 | 13 | CFBundleIcons~ipad 14 | 15 | CFBundleIdentifier 16 | $(PRODUCT_BUNDLE_IDENTIFIER) 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | $(PRODUCT_NAME) 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1 29 | LSRequiresIPhoneOS 30 | 31 | NSAppTransportSecurity 32 | 33 | NSAllowsArbitraryLoads 34 | 35 | 36 | NSLocationWhenInUseUsageDescription 37 | 38 | NSMainNibFile 39 | LaunchScreen 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /app/letschat/ios/letschat/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/letschat/ios/letschatTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/letschat/ios/letschatTests/letschatTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 240 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface letschatTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation letschatTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /app/letschat/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "letschat", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start" 7 | }, 8 | "dependencies": { 9 | "lodash": "^4.0.0", 10 | "react-native": "^0.18.1" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /app/letschat/server/app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var http = require('http'); 3 | var path = require('path'); 4 | var favicon = require('serve-favicon'); 5 | var logger = require('morgan'); 6 | var cookieParser = require('cookie-parser'); 7 | var bodyParser = require('body-parser'); 8 | var async = require('async'); 9 | var routes = require('./routes/routes'); 10 | var app = express(); 11 | 12 | app.set('port', 3000); 13 | app.set('views', path.join(__dirname, 'views')); 14 | app.set('view engine', 'ejs'); 15 | 16 | app.use(favicon(__dirname + '/public/favicon.ico')); 17 | app.use(logger('dev')); 18 | app.use(bodyParser.json()); 19 | app.use(bodyParser.urlencoded({ extended: true })); 20 | app.use(cookieParser()); 21 | app.use(express.static(path.join(__dirname, 'public'))); 22 | 23 | 24 | var server = http.createServer(app); 25 | server.listen(app.get('port')); 26 | 27 | server.on('listening', function(){ 28 | console.log('----------listening on port: ' + app.get('port') +'----------------------'); 29 | }); 30 | 31 | 32 | server.on('error', function(error){ 33 | switch (error.code) { 34 | case 'EACCES': 35 | console.error(bind + '需要权限许可'); 36 | process.exit(1); 37 | break; 38 | case 'EADDRINUSE': 39 | console.error(bind + '端口已被占用'); 40 | process.exit(1); 41 | break; 42 | default: 43 | throw error; 44 | } 45 | }); 46 | 47 | 48 | //加载路由 49 | async.waterfall([ 50 | function(callback){ 51 | routes(app); 52 | callback(null); 53 | }, 54 | function(){ 55 | app.use(function(req, res, next) { 56 | var err = new Error('Not Found'); 57 | err.status = 404; 58 | next(err); 59 | }); 60 | 61 | if (app.get('env') === 'development') { 62 | app.use(function(err, req, res, next) { 63 | res.status(err.status || 500); 64 | res.render('404/error', { 65 | message: err.message, 66 | error: err 67 | }); 68 | }); 69 | } 70 | 71 | app.use(function(err, req, res, next) { 72 | res.status(err.status || 500); 73 | res.render('404/error', { 74 | message: err.message, 75 | error: {} 76 | }); 77 | }); 78 | } 79 | ]); 80 | 81 | 82 | -------------------------------------------------------------------------------- /app/letschat/server/bin/www: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Module dependencies. 5 | */ 6 | 7 | var app = require('../app'); 8 | var debug = require('debug')('server:server'); 9 | var http = require('http'); 10 | 11 | /** 12 | * Get port from environment and store in Express. 13 | */ 14 | 15 | var port = normalizePort(process.env.PORT || '8989'); 16 | app.set('port', port); 17 | 18 | /** 19 | * Create HTTP server. 20 | */ 21 | 22 | var server = http.createServer(app); 23 | 24 | /** 25 | * Listen on provided port, on all network interfaces. 26 | */ 27 | 28 | server.listen(port); 29 | server.on('error', onError); 30 | server.on('listening', onListening); 31 | 32 | /** 33 | * Normalize a port into a number, string, or false. 34 | */ 35 | 36 | function normalizePort(val) { 37 | var port = parseInt(val, 10); 38 | 39 | if (isNaN(port)) { 40 | // named pipe 41 | return val; 42 | } 43 | 44 | if (port >= 0) { 45 | // port number 46 | return port; 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /** 53 | * Event listener for HTTP server "error" event. 54 | */ 55 | 56 | function onError(error) { 57 | if (error.syscall !== 'listen') { 58 | throw error; 59 | } 60 | 61 | var bind = typeof port === 'string' 62 | ? 'Pipe ' + port 63 | : 'Port ' + port; 64 | 65 | // handle specific listen errors with friendly messages 66 | switch (error.code) { 67 | case 'EACCES': 68 | console.error(bind + ' requires elevated privileges'); 69 | process.exit(1); 70 | break; 71 | case 'EADDRINUSE': 72 | console.error(bind + ' is already in use'); 73 | process.exit(1); 74 | break; 75 | default: 76 | throw error; 77 | } 78 | } 79 | 80 | /** 81 | * Event listener for HTTP server "listening" event. 82 | */ 83 | 84 | function onListening() { 85 | var addr = server.address(); 86 | var bind = typeof addr === 'string' 87 | ? 'pipe ' + addr 88 | : 'port ' + addr.port; 89 | debug('Listening on ' + bind); 90 | } 91 | -------------------------------------------------------------------------------- /app/letschat/server/database/message.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "messageid": "DD61CCF3-17B7-464E-8066-FAC7C2B58F27", 4 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 5 | "username": "宋江", 6 | "time": "2015-9-23", 7 | "message": "欢迎新同学小康" 8 | }, 9 | { 10 | "messageid": "F05D4D47-1A67-4F44-930F-A5B240CAAC90", 11 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 12 | "username": "李逵", 13 | "time": "2015-9-22", 14 | "message": "欢迎新同学催明" 15 | }, 16 | { 17 | "messageid": "DD61CCF3-17B7-464E-8066-FAC7C2B58F28", 18 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 19 | "username": "敏儿", 20 | "time": "2015-9-21", 21 | "message": "欢迎新同学刘明" 22 | }, 23 | { 24 | "messageid": "F05D4D47-1A67-4F44-930F-A5B240CAAC91", 25 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 26 | "username": "宋江", 27 | "time": "2015-9-20", 28 | "message": "欢迎新同学刘备" 29 | }, 30 | { 31 | "messageid": "DD61CCF3-17B7-464E-8066-FAC7C2B58F29", 32 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 33 | "username": "宋江", 34 | "time": "2015-9-19", 35 | "message": "欢迎新同学渡边" 36 | }, 37 | { 38 | "messageid": "F05D4D47-1A67-4F44-930F-A5B240CAAC92", 39 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 40 | "username": "宋江", 41 | "time": "2015-9-18", 42 | "message": "欢迎新同学彩霞" 43 | }, 44 | { 45 | "messageid": "F05D4D47-1A67-4F44-930F-A5B240CAAC93", 46 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 47 | "username": "辛弃疾", 48 | "time": "2015-9-1", 49 | "message": "西江月·夜行黄沙道中 明月别枝惊鹊,清风半夜鸣蝉。稻花香里说丰年,听取蛙声一片。七八个星天外,两三点雨山前。旧时⑹茅店社林边,路转溪桥忽见" 50 | }, 51 | { 52 | "messageid": "74C88D5A-22CC-4588-9B3F-D614A8706D8D", 53 | "userid": "591F68A5-87E6-4A6C-810F-5A50953AE747", 54 | "username": "宋江", 55 | "time": "2015-9-23", 56 | "message": "ss" 57 | }, 58 | { 59 | "messageid": "E50BCF04-88C0-49FE-B779-9E25A2247A95", 60 | "userid": "3240870A-538F-4A84-B00E-567E910A30ED", 61 | "username": "吴用", 62 | "time": "2015-11-7", 63 | "message": "g" 64 | }, 65 | { 66 | "messageid": "57CAA9FF-5AA7-4F31-A2B4-E2EC4428D194", 67 | "userid": "3240870A-538F-4A84-B00E-567E910A30ED", 68 | "username": "吴用", 69 | "time": "2015-11-7", 70 | "message": "sssff" 71 | } 72 | ] -------------------------------------------------------------------------------- /app/letschat/server/database/user.json: -------------------------------------------------------------------------------- 1 | [{"userid":"591F68A5-87E6-4A6C-810F-5A50953AE747","username":"宋江","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008097890","email":"Test0@126.com","tag":"研发","creater":"wlh","token":"3E89C25F-8820-471F-97FE-D9800318687776B39E09-0793-40B7-9905-6A89DC390DE1"},{"userid":"6998EED4-BB29-469E-B19A-DF4171B1FD12","username":"卢俊义","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008097891","email":"test1@126.com","tag":"研发","creater":"wlh","time":"2015-07-14T05:48:56.192Z","token":"C0B668AB-A030-4A35-8A3C-422DEF4F9BE2undefined"},{"userid":"3240870A-538F-4A84-B00E-567E910A30ED","username":"吴用","password":"91266e54a7d08e3df4b26839ee946628","partment":"框架研发","tel":"19008097892","email":"test2@126.com","tag":"研发","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"13E2A651-0044-428B-81FD-6ABBB96D663AC34C0B51-3A68-4297-9C7E-A851B136D34F"},{"userid":"3240870A--4A84-B00E-567E910A30ED","username":"公孙胜","password":"91266e54a7d08e3df4b26839ee946628","partment":"框架研发","tel":"19008097893","email":"test3@126.com","tag":"研发","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"4AAF1FC7-E063-4E95-BC02-97AB-443D-B083-4236E550FAD2"},{"userid":"591F68A5-87E6-4A6C-810F-5A50953AE747","username":"关胜","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008097894","email":"test4@126.com","tag":"研发","creater":"wlh"},{"userid":"6998EED4-BB29-469E-B19A-DF4171B1FD12","username":"林冲","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008097895","email":"test5@126.com","tag":"研发","creater":"wlh","time":"2015-07-14T05:48:56.192Z","token":"C0B668AB-A030-4A35-8A3C-422DEF4F9BE2undefined"},{"userid":"3240870A-538F-4A84-B00E-567E910A30ED","username":"秦明","password":"91266e54a7d08e3df4b26839ee946628","partment":"框架研发","tel":"19008097896","email":"test6@126.com","tag":"研发","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"4AAF1FC7-E063-4E95-BC02-45D3D1C83CE15839849B-97AB-443D-B083-4236E550FAD2"},{"userid":"3240870A--4A84-B00E-567E910A30ED","username":"呼延灼","password":"91266e54a7d08e3df4b26839ee946628","partment":"框架研发","tel":"19008097897","email":"test7@126.com","tag":"研发","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"4AAF1FC7-E063-4E95-BC02-97AB-443D-B083-4236E550FAD2"},{"userid":"591F68A5-87E6-4A6C-810F-5A50953AE747","username":"花荣","password":"19bdec7440acd44c669240ed534fc2f6","partment":"BU产品","tel":"19008097898","email":"test8@126.com","tag":"产品","creater":"wlh"},{"userid":"6998EED4-BB29-469E-B19A-DF4171B1FD12","username":"柴进","password":"19bdec7440acd44c669240ed534fc2f6","partment":"BU产品","tel":"19008097899","email":"test9@126.com","tag":"产品","creater":"wlh","time":"2015-07-14T05:48:56.192Z","token":"C0B668AB-A030-4A35-8A3C-422DEF4F9BE2undefined"},{"userid":"3240870A-538F-4A84-B00E-567E910A30ED","username":"李应","password":"91266e54a7d08e3df4b26839ee946628","partment":"BU研发","tel":"19008097991","email":"test10@126.com","tag":"研发","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"A3BE67F4-D7BE-48BC-AA40-2D6022B4EC7B5839849B-97AB-443D-B083-4236E550FAD2"},{"userid":"3240870A--4A84-B00E-567E910A30ED","username":"鲁智深","password":"91266e54a7d08e3df4b26839ee946628","partment":"公共产品","tel":"19008097992","email":"test11@126.com","tag":"产品","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"4AAF1FC7-E063-4E95-BC02-97AB-443D-B083-4236E550FAD2"},{"userid":"591F68A5-87E6-4A6C-810F-5A50953AE747","username":"武松","password":"19bdec7440acd44c669240ed534fc2f6","partment":"启明星","tel":"19008097993","email":"test12@126.com","tag":"研发","creater":"wlh"},{"userid":"6998EED4-BB29-469E-B19A-DF4171B1FD12","username":"董平","password":"19bdec7440acd44c669240ed534fc2f6","partment":"项目管理","tel":"19008097994","email":"test13@126.com","tag":"项目","creater":"wlh","time":"2015-07-14T05:48:56.192Z","token":"C0B668AB-A030-4A35-8A3C-422DEF4F9BE2undefined"},{"userid":"3240870A-538F-4A84-B00E-567E910A30ED","username":"张清","password":"91266e54a7d08e3df4b26839ee946628","partment":"项目管理","tel":"19008097995","email":"test14@126.com","tag":"项目","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"4AAF1FC7-E063-4E95-BC02-45D3D1C83CE15839849B-97AB-443D-B083-4236E550FAD2"},{"userid":"3240870A--4A84-B00E-567E910A30ED","username":"杨志","password":"91266e54a7d08e3df4b26839ee946628","partment":"BU产品","tel":"19008097996","email":"test15@126.com","tag":"产品","creater":"wlh","time":"2015-07-14T09:18:59.174Z","token":"4AAF1FC7-E063-4E95-BC02-97AB-443D-B083-4236E550FAD2"},{"userid":"C9C77472-6672-4B11-9EE2-FA84634D5A13","username":"徐宁","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008097997","email":"test16@126.com","tag":"研发","creater":"","time":"2015-07-16T08:10:05.691Z"},{"userid":"B06CCEED-F200-40B1-BFB6-0CCFD88C3C27","username":"索超","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008097998","email":"wukong@126.com","tag":"研发","creater":"","time":"2015-07-16T08:13:04.556Z"},{"userid":"631EE7C9-9D9E-49C9-9CAE-7C30E1E6FE09","username":"戴宗","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008097999","email":"test17@126.com","tag":"研发","creater":"","time":"2015-07-16T08:13:23.464Z"},{"userid":"3636B950-8E65-45D2-A610-0B2AAF4C85CA","username":"刘唐","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008098997","email":"test18@126.com","tag":"研发","creater":"","time":"2015-07-16T08:13:27.380Z"},{"userid":"C505CD16-4261-4DDD-9CBB-DCFAF42C96D9","username":"李逵","password":"19bdec7440acd44c669240ed534fc2f6","partment":"框架研发","tel":"19008096997","email":"test19@126.com","tag":"研发","creater":"","time":"2015-07-16T08:14:48.104Z"},{"userid":"9109C8F1-0691-4122-9AF3-AC79776D83C0","username":"e","password":"50cf3051af480981668d167eb4848329","partment":"框架研发","tel":"19008197997","email":"test20@126.com","tag":"研发","creater":"","time":"2015-07-18T09:58:55.652Z","token":""}] -------------------------------------------------------------------------------- /app/letschat/server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "server", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "start": "node ./bin/www" 7 | }, 8 | "dependencies": { 9 | "async": "^1.3.0", 10 | "body-parser": "~1.12.0", 11 | "cookie-parser": "~1.3.4", 12 | "debug": "~2.1.1", 13 | "ejs": "~2.3.1", 14 | "express": "~4.12.0", 15 | "morgan": "~1.5.1", 16 | "serve-favicon": "~2.2.0", 17 | "supervisor": "^0.7.1", 18 | "xss": "^0.2.7" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/letschat/server/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hapjs/letschat/490e9b523857e1fcde8a6c681d3271198c21891d/app/letschat/server/public/favicon.ico -------------------------------------------------------------------------------- /app/letschat/server/public/stylesheets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding: 50px; 3 | font: 14px "Lucida Grande", Helvetica, Arial, sans-serif; 4 | } 5 | 6 | a { 7 | color: #00B7FF; 8 | } -------------------------------------------------------------------------------- /app/letschat/server/routes/routes.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require("fs"); 3 | 4 | module.exports = function(app){ 5 | var FS_PATH_SERVICES = './routes/services/'; 6 | var REQUIRE_PATH_SERVICES = './services/'; 7 | 8 | 9 | fs.readdir(FS_PATH_SERVICES, function(err, list){ 10 | if(err){ 11 | throw '没有找到该文件夹,请检查......' 12 | } 13 | for (var e; list.length && (e = list.shift());){ 14 | var service = require(REQUIRE_PATH_SERVICES + e); 15 | service.init && service.init(app); 16 | } 17 | }); 18 | }; -------------------------------------------------------------------------------- /app/letschat/server/routes/services/message.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var util = require('./../util'); 3 | var MESSAGE_PATH = './database/message.json'; 4 | var USER_PATH = './database/user.json'; 5 | 6 | var Message = { 7 | init: function(app){ 8 | app.post('/message/get', this.getMessage); 9 | app.post('/message/add', this.addMessage); 10 | }, 11 | 12 | //获取公告消息 13 | getMessage: function(req, res){ 14 | var key = req.param('key'); 15 | if(key !== util.getKey()){ 16 | return res.send({ 17 | status: 0, 18 | data: '使用了没有鉴权的key' 19 | }); 20 | } 21 | fs.readFile(MESSAGE_PATH, function(err, data){ 22 | if(!err){ 23 | try{ 24 | var obj = JSON.parse(data); 25 | return res.send({ 26 | status: 1, 27 | data: obj 28 | }); 29 | }catch(e){ 30 | return res.send({ 31 | status: 0, 32 | err: e 33 | }); 34 | } 35 | } 36 | 37 | return res.send({ 38 | status: 0, 39 | err: err 40 | }); 41 | }); 42 | }, 43 | 44 | //增加公告消息 45 | addMessage: function(req, res){ 46 | var token = req.param('token'); 47 | var message = req.param('message'); 48 | if(!token || !message){ 49 | return res.send({ 50 | status: 0, 51 | err: 'token或者message不能为空' 52 | }); 53 | } 54 | //根据token查询 55 | fs.readFile(USER_PATH, function(err, data){ 56 | if(err){ 57 | return res.send({ 58 | status: 0, 59 | err: err 60 | }); 61 | } 62 | 63 | try{ 64 | var obj = JSON.parse(data); 65 | for(var i in obj){ 66 | if(obj[i].token === token){ 67 | //增加信息 68 | var msgObj = JSON.parse(fs.readFileSync(MESSAGE_PATH)); 69 | msgObj.push({ 70 | messageid: util.guid(), 71 | userid: obj[i].userid, 72 | username: obj[i].username, 73 | time: new Date().getFullYear() + '-' 74 | + (parseInt(new Date().getMonth()) + 1) + '-' + new Date().getDate(), 75 | message: message 76 | }); 77 | 78 | fs.writeFileSync(MESSAGE_PATH, JSON.stringify(msgObj)); 79 | return res.send({ 80 | status: 1 81 | }); 82 | } 83 | } 84 | 85 | return res.send({ 86 | status: 0, 87 | err: 'token认证失败' 88 | }); 89 | 90 | }catch(e){ 91 | return res.send({ 92 | status: 0, 93 | err: e 94 | }); 95 | } 96 | }); 97 | 98 | } 99 | 100 | }; 101 | 102 | module.exports = Message; -------------------------------------------------------------------------------- /app/letschat/server/routes/services/test.js: -------------------------------------------------------------------------------- 1 | 2 | var Test = { 3 | init: function(app){ 4 | app.get('/test/test', this.doTest); 5 | app.get('/test/show', this.doShow); 6 | }, 7 | 8 | doTest: function(req, res){ 9 | res.send({ 10 | status: 1, 11 | info: '测试服务doTest' 12 | }); 13 | }, 14 | 15 | doShow: function(req, res){ 16 | res.json({ 17 | status: 1, 18 | info: '测试服务doShow' 19 | }); 20 | } 21 | }; 22 | 23 | module.exports = Test; -------------------------------------------------------------------------------- /app/letschat/server/routes/services/user.js: -------------------------------------------------------------------------------- 1 | 2 | var fs = require('fs'); 3 | var util = require('./../util'); 4 | var USER_PATH = './database/user.json'; 5 | 6 | 7 | var User = { 8 | 9 | init: function(app){ 10 | app.post('/user/get', this.getUser); 11 | app.post('/user/create', this.addUser); 12 | app.post('/user/login', this.login); 13 | app.post('/user/login/token', this.loginByToken); 14 | app.post('/user/password/update', this.updatePassword); 15 | app.post('/user/delete', this.deleteUser); 16 | }, 17 | 18 | //获取用户信息 19 | getUser: function(req, res){ 20 | var key = req.param('key'); 21 | var partment = req.param('partment'); 22 | if(key !== util.getKey()){ 23 | return res.send({ 24 | status: 0, 25 | data: '使用了没有鉴权的key' 26 | }); 27 | } 28 | fs.readFile(USER_PATH, function(err, data){ 29 | if(!err){ 30 | try{ 31 | var obj = JSON.parse(data); 32 | var newObj = []; 33 | for(var i in obj){ 34 | if(obj[i].partment === partment){ 35 | delete obj[i]['password']; 36 | newObj.push(obj[i]); 37 | } 38 | } 39 | return res.send({ 40 | status: 1, 41 | data: newObj 42 | }); 43 | }catch(e){ 44 | return res.send({ 45 | status: 0, 46 | err: e 47 | }); 48 | } 49 | } 50 | 51 | return res.send({ 52 | status: 0, 53 | err: err 54 | }); 55 | }); 56 | }, 57 | 58 | //添加用户 59 | addUser: function(req, res){ 60 | var username = req.param('username'); 61 | var password = util.md5(req.param('password')); 62 | var tel = req.param('tel'); 63 | var email = req.param('email'); 64 | var partment = req.param('partment'); 65 | var tag = req.param('tag'); 66 | var creater = req.param('creater') || ''; 67 | 68 | if(!username || !password || !tel || !email || !partment || !tag || !creater){ 69 | return res.send({ 70 | status: 0, 71 | data: '缺少必要参数' 72 | }); 73 | } 74 | 75 | try{ 76 | var content = JSON.parse(fs.readFileSync(USER_PATH)); 77 | var obj = { 78 | "userid": util.guid(), 79 | "username": username, 80 | "password": password, 81 | "partment": partment, 82 | "tel": tel, 83 | "email": email, 84 | "tag": tag, 85 | "creater": creater, 86 | "time": new Date(), 87 | "token": '' 88 | }; 89 | content.push(obj); 90 | //更新文件 91 | fs.writeFileSync(USER_PATH, JSON.stringify(content)); 92 | delete obj.password; 93 | return res.send({ 94 | status: 1, 95 | data: obj 96 | }); 97 | }catch(e){ 98 | return res.send({ 99 | status: 0, 100 | err: e 101 | }); 102 | } 103 | }, 104 | 105 | //用户登录 106 | login: function(req, res){ 107 | var email = req.param('email'); 108 | var password = util.md5(req.param('password')); 109 | var deviceId = req.param('deviceId'); 110 | var token = util.guid() + deviceId; 111 | var content = JSON.parse(fs.readFileSync(USER_PATH).toString()); 112 | for(var i in content){ 113 | //验证通过 114 | if(content[i].email === email && content[i].password === password){ 115 | content[i]['token'] = token; 116 | //写入到文件中 117 | console.log(content[i]); 118 | fs.writeFileSync(USER_PATH, JSON.stringify(content)); 119 | //删除密码 120 | delete content[i].password; 121 | return res.send({ 122 | status: 1, 123 | data: content[i] 124 | }); 125 | } 126 | } 127 | 128 | return res.send({ 129 | status: 0, 130 | data:'用户名或者密码错误' 131 | }); 132 | }, 133 | 134 | //通过token登录 135 | loginByToken: function(req, res){ 136 | var token = req.param('token'); 137 | var content = JSON.parse(fs.readFileSync(USER_PATH)); 138 | 139 | for(var i in content){ 140 | if(token === content[i].token){ 141 | delete content[i].password; 142 | return res.send({ 143 | status:1, 144 | data: content[i] 145 | }); 146 | } 147 | } 148 | 149 | return res.send({ 150 | status: 0, 151 | info: 'token失效' 152 | }); 153 | }, 154 | 155 | //用户修改密码 156 | updatePassword: function(req, res){ 157 | var token = req.param('token'); 158 | var oldPassword = util.md5(req.param('oldPassword')); 159 | var password = util.md5(req.param('password')); 160 | 161 | var content = JSON.parse(fs.readFileSync(USER_PATH)); 162 | for(var i in content){ 163 | if(token === content[i].token && oldPassword === content[i].password){ 164 | content[i].password = password; 165 | //写入到文件中 166 | fs.writeFileSync(USER_PATH, JSON.stringify(content)); 167 | return res.send({ 168 | status: 1, 169 | data: '更新成功' 170 | }); 171 | } 172 | } 173 | 174 | return res.send({ 175 | status: 0, 176 | data: '更新失败,没有找到该用户或者初始密码错误' 177 | }); 178 | }, 179 | 180 | //删除用户 181 | deleteUser: function(req, res) { 182 | var token = req.param('token'); 183 | var email = req.param('email'); 184 | 185 | var content = JSON.parse(fs.readFileSync(USER_PATH)); 186 | for (var i in content) { 187 | if (token === content[i].token) { 188 | //遍历查找需要删除的用户 189 | for (var j in content) { 190 | if (content[j].email === email) { 191 | content.splice(j, 1); 192 | //写入到文件中 193 | fs.writeFileSync(USER_PATH, JSON.stringify(content)); 194 | return res.send({ 195 | status: 1, 196 | info: content, 197 | data: '删除成功' 198 | }); 199 | } 200 | } 201 | 202 | } 203 | } 204 | return res.send({ 205 | status: 0, 206 | err: '删除失败,没有找到该用户或者用户鉴权错误' 207 | }); 208 | } 209 | }; 210 | 211 | 212 | module.exports = User; -------------------------------------------------------------------------------- /app/letschat/server/routes/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * https://github.com/vczero/guid/blob/master/guid.js 3 | * guid: we can use to create token or id... 4 | * Inspired from the book of JavaScript Patterns, Stoyan Stefanov 5 | * You can add some special value in this guid, such as user's email or nickname or id. 6 | * For example, I added a ObjectId(mongoDB) to this guid in my project. 7 | * @module guid 8 | */ 9 | 10 | var crypto = require('crypto'); 11 | 12 | module.exports = { 13 | 14 | guid: function() { 15 | return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { 16 | var r = Math.random() * 16 | 0, 17 | v = c == 'x' ? r : (r & 0x3 | 0x8); 18 | return v.toString(16); 19 | }).toUpperCase(); 20 | }, 21 | 22 | md5: function(password){ 23 | var md5 = crypto.createHash('md5'); 24 | var salt = '(!%$88hs@gophs*)#sassb9'; 25 | var newPwd = md5.update(password + salt).digest('hex'); 26 | return newPwd; 27 | }, 28 | 29 | getKey: function(){ 30 | return 'HSHHSGSGGSTWSYWSYUSUWSHWBS-REACT-NATIVE'; 31 | } 32 | 33 | }; -------------------------------------------------------------------------------- /app/letschat/server/service.md: -------------------------------------------------------------------------------- 1 | //user API 2 | //获取用户信息 3 | app.post('/user/get', this.getUser); 4 | //创建用户 5 | app.post('/user/create', this.addUser); 6 | //登录 7 | app.post('/user/login/token', this.loginByToken); 8 | //更新密码 9 | app.post('/user/password/update', this.updatePassword); 10 | //删除用户 11 | app.post('/user/delete', this.deleteUser); 12 | //message API 13 | //获取公告 14 | app.post('/message/get', this.getMessage); -------------------------------------------------------------------------------- /app/letschat/server/views/404/error.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 |

<%= message %>

4 |

<%= error.status %>

5 |
<%= error.stack %>
-------------------------------------------------------------------------------- /app/letschat/views/about.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by vczero on 15/7/12. 3 | */ 4 | 5 | var React = require('react-native'); 6 | var webview = require('./about/webview'); 7 | 8 | var { 9 | View, 10 | Text, 11 | ScrollView, 12 | StyleSheet, 13 | Image, 14 | TouchableOpacity, 15 | } = React; 16 | 17 | 18 | var About = React.createClass({ 19 | 20 | render: function(){ 21 | return ( 22 | 23 | 24 | 25 | 26 | Author: vczero 27 | Version: v0.0.1 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | ); 42 | }, 43 | 44 | _openWebView: function(url){ 45 | this.props.navigator.push({ 46 | title:'项目地址', 47 | component: webview, 48 | passProps:{ 49 | url: url 50 | } 51 | }); 52 | } 53 | }); 54 | 55 | var styles = StyleSheet.create({ 56 | container:{ 57 | flex:1, 58 | }, 59 | wrapper:{ 60 | alignItems:'center', 61 | marginTop:50, 62 | }, 63 | avatar:{ 64 | width:90, 65 | height:90, 66 | borderRadius:45, 67 | }, 68 | img:{ 69 | width:20, 70 | height:20, 71 | marginRight:5, 72 | } 73 | }); 74 | 75 | module.exports = About; -------------------------------------------------------------------------------- /app/letschat/views/about/webview.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by lihua on 15/7/12. 3 | */ 4 | 5 | var React = require('react-native'); 6 | var { 7 | WebView, 8 | ScrollView, 9 | Text, 10 | View, 11 | } = React; 12 | 13 | 14 | var webview = React.createClass({ 15 | 16 | render: function(){ 17 | return( 18 | 19 | 20 | 21 | ); 22 | } 23 | 24 | }); 25 | 26 | module.exports = webview; 27 | -------------------------------------------------------------------------------- /app/letschat/views/concats.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('./util'); 4 | var AddUser = require('./manager/addUser'); 5 | var ModifyPassword = require('./manager/modifyPassword'); 6 | var DeleteUser = require('./manager/deleteUser'); 7 | var PostMessage = require('./manager/postMessage'); 8 | 9 | var { 10 | View, 11 | Text, 12 | ScrollView, 13 | StyleSheet, 14 | TouchableOpacity, 15 | AsyncStorage, 16 | } = React; 17 | 18 | 19 | var Manager = React.createClass({ 20 | 21 | render: function(){ 22 | var colors = ['#F4000B', '#17B4FF', '#FFD900', '#F00000']; 23 | var tags = []; 24 | var items = []; 25 | var components = [ModifyPassword, AddUser, DeleteUser, PostMessage]; 26 | var JSXDOM = []; 27 | for(var i in items){ 28 | JSXDOM.push( 29 | 30 | 31 | {tags[i]} 32 | {items[i]} 33 | 34 | 35 | ); 36 | } 37 | 38 | 39 | return ( 40 | 41 | 42 | {JSXDOM} 43 | 44 | 45 | ); 46 | }, 47 | 48 | _loadPage: function(component, title){ 49 | this.props.navigator.push({ 50 | title: title, 51 | component: component 52 | }); 53 | }, 54 | 55 | _clear: function(){ 56 | this.props.navigator.pop(); 57 | AsyncStorage.clear(); 58 | } 59 | 60 | }); 61 | 62 | var styles = StyleSheet.create({ 63 | container:{ 64 | flex:1, 65 | backgroundColor:'#F5F5F5', 66 | }, 67 | item:{ 68 | height:40, 69 | justifyContent: 'center', 70 | borderTopWidth: Util.pixel, 71 | borderTopColor: '#ddd', 72 | backgroundColor:'#fff', 73 | alignItems:'center', 74 | }, 75 | font:{ 76 | fontSize:15, 77 | marginLeft:5, 78 | marginRight:10, 79 | }, 80 | wrapper:{ 81 | marginTop:30, 82 | }, 83 | tag:{ 84 | marginLeft:10, 85 | fontSize:16, 86 | fontWeight:'bold' 87 | } 88 | }); 89 | 90 | module.exports = Manager; -------------------------------------------------------------------------------- /app/letschat/views/discover.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('./util'); 4 | var AddUser = require('./manager/addUser'); 5 | var ModifyPassword = require('./manager/modifyPassword'); 6 | var DeleteUser = require('./manager/deleteUser'); 7 | var PostMessage = require('./manager/postMessage'); 8 | 9 | var { 10 | View, 11 | Text, 12 | ScrollView, 13 | StyleSheet, 14 | TouchableOpacity, 15 | AsyncStorage, 16 | } = React; 17 | 18 | 19 | var Manager = React.createClass({ 20 | 21 | render: function(){ 22 | var colors = ['#F4000B', '#17B4FF', '#FFD900', '#F00000']; 23 | var tags = ['P', 'S', 'Y', 'F', 'L', 'G', 'X']; 24 | var items = ['朋友圈', '扫一扫', '摇一摇', '附近的人', '漂流瓶', '购物', '游戏']; 25 | var components = [ModifyPassword, AddUser, DeleteUser, PostMessage]; 26 | var JSXDOM = []; 27 | for(var i in items){ 28 | JSXDOM.push( 29 | 30 | 31 | {tags[i]} 32 | {items[i]} 33 | 34 | 35 | ); 36 | } 37 | 38 | 39 | return ( 40 | 41 | 42 | {JSXDOM} 43 | 44 | 45 | ); 46 | }, 47 | 48 | _loadPage: function(component, title){ 49 | this.props.navigator.push({ 50 | title: title, 51 | component: component 52 | }); 53 | }, 54 | 55 | _clear: function(){ 56 | this.props.navigator.pop(); 57 | AsyncStorage.clear(); 58 | } 59 | 60 | }); 61 | 62 | var styles = StyleSheet.create({ 63 | container:{ 64 | flex:1, 65 | backgroundColor:'#F5F5F5', 66 | }, 67 | item:{ 68 | height:40, 69 | justifyContent: 'center', 70 | borderTopWidth: Util.pixel, 71 | borderTopColor: '#ddd', 72 | backgroundColor:'#fff', 73 | alignItems:'center', 74 | }, 75 | font:{ 76 | fontSize:15, 77 | marginLeft:5, 78 | marginRight:10, 79 | }, 80 | wrapper:{ 81 | marginTop:30, 82 | }, 83 | tag:{ 84 | marginLeft:10, 85 | fontSize:16, 86 | fontWeight:'bold' 87 | } 88 | }); 89 | 90 | module.exports = Manager; -------------------------------------------------------------------------------- /app/letschat/views/home.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by vczero on 15/7/12. 3 | */ 4 | 5 | var React = require('react-native'); 6 | var Util = require('./util'); 7 | var ItemBlock = require('./home/itemblock'); 8 | 9 | var { 10 | View, 11 | Text, 12 | ScrollView, 13 | StyleSheet, 14 | TouchableHighlight, 15 | } = React; 16 | 17 | var Home = React.createClass({ 18 | getInitialState: function(){ 19 | //减去paddingLeft && paddingRight && space 20 | var width = Math.floor(((Util.size.width - 20) - 50) / 4); 21 | var items = [ 22 | { 23 | id:1, 24 | title: '研发', 25 | partment: '框架研发', 26 | color: '#126AFF', 27 | }, 28 | { 29 | id:2, 30 | title: '研发', 31 | partment: 'BU研发', 32 | color: '#FFD600', 33 | }, 34 | { 35 | id:3, 36 | title: '产品', 37 | partment: '公共产品', 38 | color: '#F80728', 39 | }, 40 | { 41 | id:4, 42 | title: '产品', 43 | partment: 'BU产品', 44 | color: '#05C147', 45 | }, 46 | { 47 | id:5, 48 | title: '产品', 49 | partment: '启明星', 50 | color: '#FF4EB9', 51 | }, 52 | { 53 | id:6, 54 | title: '项目', 55 | partment: '项目管理', 56 | color: '#EE810D', 57 | } 58 | ]; 59 | 60 | return { 61 | items: items, 62 | width: width 63 | }; 64 | }, 65 | 66 | render: function(){ 67 | var Items1 = []; 68 | var Items2 = []; 69 | var items = this.state.items; 70 | 71 | for(var i = 0; i < 4; i++){ 72 | Items1.push( 73 | 81 | ); 82 | } 83 | 84 | for(var i = 4; i < items.length; i++){ 85 | Items2.push( 86 | 94 | ); 95 | } 96 | 97 | return ( 98 | 99 | 100 | {Items1} 101 | 102 | 103 | {Items2} 104 | 105 | 106 | 107 | ); 108 | } 109 | }); 110 | 111 | var styles = StyleSheet.create({ 112 | container:{ 113 | flex:1, 114 | padding:10, 115 | }, 116 | itemRow:{ 117 | flexDirection:'row', 118 | marginBottom:20, 119 | } 120 | }); 121 | 122 | module.exports = Home; -------------------------------------------------------------------------------- /app/letschat/views/home/address.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var React = require('react-native'); 4 | var Util = require('../util'); 5 | var ActionSheetIOS = require('ActionSheetIOS'); 6 | var Service = require('./../service'); 7 | 8 | var { 9 | View, 10 | Text, 11 | ScrollView, 12 | StyleSheet, 13 | Image, 14 | TouchableHighlight, 15 | LinkingIOS, 16 | AlertIOS, 17 | } = React; 18 | 19 | 20 | var Address = React.createClass({ 21 | render: function(){ 22 | var view = []; 23 | var items = this.props.data.status? this.props.data.data: []; 24 | var colors = ['#E20079', '#FFD602', '#25BFFE', '#F90000', '#04E246', '#04E246', '#00AFC9']; 25 | var color = { 26 | backgroundColor: colors[parseInt(Math.random()*7)] 27 | }; 28 | for(var i in items){ 29 | view.push( 30 | 31 | 32 | 33 | {items[i].username.substr(0, 1) || '未'} 34 | 35 | 36 | 37 | 38 | {items[i].username} 39 | 40 | 41 | {(items[i].partment||'') + '部-' + (items[i].tag||'') + '人员'} 42 | 43 | 44 | 45 | 47 | 48 | {items[i].tel} 49 | 50 | 51 | 53 | 54 | {items[i].email} 55 | 56 | 57 | 58 | 59 | ); 60 | } 61 | return ( 62 | 63 | {view} 64 | 65 | ); 66 | }, 67 | 68 | showActionSheet(tel, email, name) { 69 | var options = []; 70 | options.push('拨打电话给:' + name); 71 | options.push('发送短信给:' + name); 72 | options.push('发送邮件给:' + name); 73 | options.push('取消'); 74 | 75 | var events = []; 76 | events.push(function(){ 77 | LinkingIOS.openURL('tel://' + tel); 78 | }); 79 | events.push(function(){ 80 | LinkingIOS.openURL('sms://' + tel); 81 | }); 82 | events.push(function(){ 83 | LinkingIOS.openURL('mailto://' + email); 84 | }); 85 | 86 | 87 | ActionSheetIOS.showActionSheetWithOptions({ 88 | options: options, 89 | cancelButtonIndex: options.length - 1 , 90 | }, 91 | function(index){ 92 | events[index] && events[index](); 93 | } 94 | ); 95 | } 96 | }); 97 | 98 | var styles = StyleSheet.create({ 99 | row:{ 100 | height:80, 101 | borderBottomWidth: Util.pixel, 102 | borderBottomColor:'#ccc', 103 | flexDirection:'row', 104 | alignItems:'center' 105 | }, 106 | text:{ 107 | width:50, 108 | height:50, 109 | borderRadius:4, 110 | marginLeft:10, 111 | alignItems:'center', 112 | justifyContent:'center', 113 | backgroundColor: '#E30082', 114 | }, 115 | part:{ 116 | marginLeft:5, 117 | flex:1, 118 | }, 119 | link:{ 120 | color:'#1BB7FF', 121 | marginTop:2, 122 | }, 123 | unColor:{ 124 | color: '#575656', 125 | marginTop:8, 126 | fontSize:12, 127 | } 128 | }); 129 | 130 | module.exports = Address; -------------------------------------------------------------------------------- /app/letschat/views/home/itemblock.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Address = require('./address'); 4 | var Service = require('./../service'); 5 | var Util = require('../util'); 6 | 7 | var { 8 | View, 9 | Text, 10 | StyleSheet, 11 | TouchableHighlight, 12 | } = React; 13 | 14 | //每个单项组件 15 | var ItemBlock = React.createClass({ 16 | render: function(){ 17 | var size ={ 18 | width: parseInt(this.props.width), 19 | height: parseInt(this.props.width), 20 | backgroundColor: this.props.color, 21 | }; 22 | return ( 23 | 24 | 25 | 26 | {this.props.title} 27 | 28 | 29 | {this.props.partment} 30 | 31 | 32 | 33 | ); 34 | }, 35 | //加载页面 36 | _loadPage: function(e){ 37 | var nav = this.props.nav; 38 | var key = Util.key; 39 | var partment = this.props.partment; 40 | var path = Service.host + Service.getUser; 41 | 42 | Util.post(path, { 43 | key: key, 44 | partment : partment 45 | }, function(data){ 46 | nav.push({ 47 | title: this.props.tag, 48 | component: Address, 49 | passProps:{ 50 | data: data 51 | } 52 | }); 53 | }.bind(this)); 54 | 55 | } 56 | }); 57 | 58 | var styles = StyleSheet.create({ 59 | itemBlock:{ 60 | justifyContent:'center', 61 | alignItems:'center', 62 | borderRadius:5, 63 | marginLeft:10, 64 | }, 65 | font18:{ 66 | color:'#fff', 67 | fontSize:18, 68 | fontWeight:'500', 69 | }, 70 | font10:{ 71 | color:'#fff', 72 | fontSize:10, 73 | }, 74 | }); 75 | 76 | module.exports = ItemBlock; -------------------------------------------------------------------------------- /app/letschat/views/login.js: -------------------------------------------------------------------------------- 1 | var React = require('react-native'); 2 | var Util = require('./util'); 3 | 4 | 5 | var { 6 | StyleSheet, 7 | View, 8 | TabBarIOS, 9 | Text, 10 | NavigatorIOS, 11 | StatusBarIOS, 12 | TouchableHighlight, 13 | TextInput, 14 | Image, 15 | } = React; 16 | 17 | var Login = React.createClass({ 18 | 19 | render: function(){ 20 | return ( 21 | 22 | 23 | 24 | 25 | 26 | 27 | 邮箱 28 | 29 | 30 | 密码 31 | 32 | 33 | 34 | 35 | 登录 36 | 37 | 38 | 39 | ); 40 | }, 41 | 42 | _login: function(){ 43 | console.log(''); 44 | } 45 | 46 | }); 47 | 48 | 49 | var styles = StyleSheet.create({ 50 | container:{ 51 | marginTop:50, 52 | alignItems:'center', 53 | }, 54 | logo:{ 55 | width:100, 56 | height:100, 57 | resizeMode: Image.resizeMode.contain 58 | }, 59 | inputRow:{ 60 | flexDirection:'row', 61 | alignItems:'center', 62 | justifyContent: 'center', 63 | marginBottom:10, 64 | }, 65 | input:{ 66 | marginLeft:10, 67 | width:220, 68 | borderWidth:Util.pixel, 69 | height:35, 70 | paddingLeft:8, 71 | borderRadius:5, 72 | borderColor:'#ccc' 73 | }, 74 | btn:{ 75 | marginTop:10, 76 | width:80, 77 | height:35, 78 | backgroundColor:'#3BC1FF', 79 | justifyContent:'center', 80 | alignItems:'center', 81 | borderRadius: 4, 82 | } 83 | }); 84 | 85 | 86 | module.exports = Login; 87 | 88 | -------------------------------------------------------------------------------- /app/letschat/views/manager.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('./util'); 4 | var AddUser = require('./manager/addUser'); 5 | var ModifyPassword = require('./manager/modifyPassword'); 6 | var DeleteUser = require('./manager/deleteUser'); 7 | var PostMessage = require('./manager/postMessage'); 8 | 9 | var { 10 | View, 11 | Text, 12 | ScrollView, 13 | StyleSheet, 14 | TouchableOpacity, 15 | AsyncStorage, 16 | } = React; 17 | 18 | 19 | var Manager = React.createClass({ 20 | 21 | render: function(){ 22 | var colors = ['#F4000B', '#17B4FF', '#FFD900', '#F00000']; 23 | var tags = []; 24 | var items = []; 25 | var components = [ModifyPassword, AddUser, DeleteUser, PostMessage]; 26 | var JSXDOM = []; 27 | for(var i in items){ 28 | JSXDOM.push( 29 | 30 | 31 | {tags[i]} 32 | {items[i]} 33 | 34 | 35 | ); 36 | } 37 | 38 | 39 | return ( 40 | 41 | 42 | {JSXDOM} 43 | 44 | 45 | ); 46 | }, 47 | 48 | _loadPage: function(component, title){ 49 | this.props.navigator.push({ 50 | title: title, 51 | component: component 52 | }); 53 | }, 54 | 55 | _clear: function(){ 56 | this.props.navigator.pop(); 57 | AsyncStorage.clear(); 58 | } 59 | 60 | }); 61 | 62 | var styles = StyleSheet.create({ 63 | container:{ 64 | flex:1, 65 | backgroundColor:'#F5F5F5', 66 | }, 67 | item:{ 68 | height:40, 69 | justifyContent: 'center', 70 | borderTopWidth: Util.pixel, 71 | borderTopColor: '#ddd', 72 | backgroundColor:'#fff', 73 | alignItems:'center', 74 | }, 75 | font:{ 76 | fontSize:15, 77 | marginLeft:5, 78 | marginRight:10, 79 | }, 80 | wrapper:{ 81 | marginTop:30, 82 | }, 83 | tag:{ 84 | marginLeft:10, 85 | fontSize:16, 86 | fontWeight:'bold' 87 | } 88 | }); 89 | 90 | module.exports = Manager; -------------------------------------------------------------------------------- /app/letschat/views/manager/addUser.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('./../util'); 4 | var Service = require('./../service'); 5 | 6 | var { 7 | View, 8 | Text, 9 | ScrollView, 10 | StyleSheet, 11 | TouchableOpacity, 12 | TextInput, 13 | PickerIOS, 14 | AlertIOS, 15 | } = React; 16 | 17 | var AddUser = React.createClass({ 18 | 19 | getInitialState: function(){ 20 | var items = ['A', 'B', 'C', 'D', 'E', 'F']; 21 | var tags = ['框架研发', 'BU产品', 'BU研发', '启明星', '项目管理', '公共产品']; 22 | return { 23 | items: items, 24 | tags: tags, 25 | selectA:{ 26 | backgroundColor:'#3BC1FF', 27 | borderColor:'#3BC1FF' 28 | }, 29 | select_A:{ 30 | color: '#FFF' 31 | }, 32 | yan:{ 33 | backgroundColor:'#3BC1FF', 34 | borderColor:'#3BC1FF' 35 | }, 36 | yan_text:{ 37 | color: '#FFF' 38 | }, 39 | tag:'研发', 40 | partment: '框架研发' 41 | }; 42 | }, 43 | 44 | render: function(){ 45 | var tagOne = []; 46 | for(var i = 0; i <3; i++){ 47 | tagOne.push( 48 | 49 | 50 | {this.state.tags[i]} 51 | 52 | 53 | ); 54 | } 55 | 56 | var tagTwo = []; 57 | for(var i = 3; i <6; i++){ 58 | tagTwo.push( 59 | 60 | 61 | {this.state.tags[i]} 62 | 63 | 64 | ); 65 | } 66 | 67 | return ( 68 | 69 | 70 | 用户名 71 | 72 | 73 | 74 | 75 | 密码 76 | 77 | 78 | 79 | 80 | 邮箱 81 | 82 | 83 | 84 | 85 | 电话 86 | 87 | 88 | 89 | 90 | {tagOne} 91 | 92 | 93 | {tagTwo} 94 | 95 | 96 | 97 | 98 | 99 | 研发 100 | 101 | 102 | 103 | 104 | 105 | 产品 106 | 107 | 108 | 109 | 110 | 111 | 项目 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 创建用户 120 | 121 | 122 | 123 | 124 | ); 125 | }, 126 | _select: function(id){ 127 | var obj = {}; 128 | var color = {}; 129 | var items = { 130 | A:{}, 131 | B:{}, 132 | C:{}, 133 | D:{}, 134 | E:{}, 135 | F:{} 136 | }; 137 | //加上选中效果 138 | obj['select' + id] = { 139 | backgroundColor:'#3BC1FF', 140 | borderColor:'#3BC1FF' 141 | }; 142 | color['select_' + id] = { 143 | color: '#fff', 144 | }; 145 | this.setState(obj); 146 | this.setState(color); 147 | this.setState(); 148 | //清除其他选中效果 149 | delete items[id]; 150 | for(var i in items){ 151 | var newObj = {}; 152 | newObj['select' + i] = { 153 | backgroundColor:'#FFF', 154 | borderColor:'#ddd' 155 | }; 156 | var newColor = {}; 157 | newColor['select_' + i] = { 158 | color: '#000', 159 | }; 160 | this.setState(newObj); 161 | this.setState(newColor); 162 | } 163 | //增加变量 164 | var partment = '框架研发'; 165 | switch (id){ 166 | case 'A': 167 | partment = this.state.tags[0]; 168 | break; 169 | case 'B': 170 | partment = this.state.tags[1]; 171 | break; 172 | case 'C': 173 | partment = this.state.tags[2]; 174 | break; 175 | case 'D': 176 | partment = this.state.tags[3]; 177 | break; 178 | case 'E': 179 | partment = this.state.tags[4]; 180 | break; 181 | case 'F': 182 | partment = this.state.tags[5]; 183 | break; 184 | } 185 | this.setState({ 186 | partment: partment 187 | }); 188 | }, 189 | _selectType: function(id){ 190 | var obj = {}; 191 | var color = {}; 192 | var items = { 193 | yan:{}, 194 | chan:{}, 195 | project:{} 196 | }; 197 | //加上选中效果 198 | obj[id] = { 199 | backgroundColor:'#3BC1FF', 200 | borderColor:'#3BC1FF' 201 | }; 202 | color[id + '_text'] = { 203 | color: '#fff', 204 | }; 205 | this.setState(obj); 206 | this.setState(color); 207 | 208 | //清除其他选中效果 209 | delete items[id]; 210 | for(var i in items){ 211 | var newObj = {}; 212 | newObj[i] = { 213 | backgroundColor:'#FFF', 214 | borderColor:'#ddd' 215 | }; 216 | var newColor = {}; 217 | newColor[i + '_text'] = { 218 | color: '#000', 219 | }; 220 | this.setState(newObj); 221 | this.setState(newColor); 222 | } 223 | //增加变量 224 | var tag = '研发'; 225 | switch (id){ 226 | case 'yan': 227 | tag = '研发'; 228 | break; 229 | case 'chan': 230 | tag = '产品'; 231 | break; 232 | case 'project': 233 | tag = '项目'; 234 | break; 235 | default : 236 | break; 237 | } 238 | 239 | this.setState({ 240 | tag: tag 241 | }); 242 | 243 | }, 244 | 245 | _setUserName:function(val){ 246 | this.setState({ 247 | username: val 248 | }); 249 | }, 250 | 251 | _setPassword:function(val){ 252 | this.setState({ 253 | password: val 254 | }); 255 | }, 256 | 257 | _setEmail:function(val){ 258 | this.setState({ 259 | email: val 260 | }); 261 | }, 262 | 263 | _setTel: function(val){ 264 | this.setState({ 265 | tel: val 266 | }); 267 | }, 268 | 269 | _addUser: function(){ 270 | var username = this.state.username; 271 | var email = this.state.email; 272 | var password = this.state.password; 273 | var partment = this.state.partment; 274 | var tag = this.state.tag; 275 | var tel = this.state.tel; 276 | 277 | if(!username || !email || !password || !tel){ 278 | return AlertIOS.alert('提示', '用户名、初始密码、邮箱电话、必填,请确认!'); 279 | } 280 | var obj = { 281 | username: username, 282 | email: email, 283 | password: password, 284 | partment: partment, 285 | tag: tag, 286 | tel: tel 287 | }; 288 | 289 | var path = Service.host + Service.createUser; 290 | Util.post(path, obj, function(data){ 291 | if(data.status){ 292 | AlertIOS.alert('成功','创建用户成功,请告知用户初始密码'); 293 | }else{ 294 | AlertIOS.alert('失败','创建用户失败'); 295 | } 296 | }); 297 | 298 | } 299 | 300 | }); 301 | 302 | 303 | var styles = StyleSheet.create({ 304 | row:{ 305 | flexDirection:'row', 306 | alignItems:'center', 307 | marginBottom:7, 308 | }, 309 | label:{ 310 | width:50, 311 | marginLeft:10, 312 | }, 313 | input:{ 314 | borderWidth: Util.pixel, 315 | height:35, 316 | flex:1, 317 | marginRight:20, 318 | borderColor:'#ddd', 319 | borderRadius: 4, 320 | paddingLeft:5, 321 | fontSize:14, 322 | }, 323 | partment:{ 324 | flexDirection:'row', 325 | justifyContent:'center', 326 | marginTop:10, 327 | }, 328 | part:{ 329 | width:65, 330 | height:30, 331 | borderWidth:Util.pixel, 332 | borderColor: '#ddd', 333 | borderRadius:3, 334 | alignItems:'center', 335 | justifyContent:'center', 336 | marginRight:10 337 | }, 338 | btn:{ 339 | borderColor:'#268DFF', 340 | height:35, 341 | width:200, 342 | borderRadius:5, 343 | borderWidth:Util.pixel, 344 | alignItems:'center', 345 | justifyContent:'center' 346 | } 347 | }); 348 | 349 | 350 | module.exports = AddUser; -------------------------------------------------------------------------------- /app/letschat/views/manager/deleteUser.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var React = require('react-native'); 4 | var Util = require('./../util'); 5 | var Service = require('../service'); 6 | 7 | var { 8 | View, 9 | Text, 10 | ScrollView, 11 | StyleSheet, 12 | TouchableOpacity, 13 | TextInput, 14 | AlertIOS, 15 | AsyncStorage, 16 | } = React; 17 | 18 | var DeleteUser = React.createClass({ 19 | 20 | render: function(){ 21 | return ( 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 删除用户 32 | 33 | 34 | 35 | 36 | ); 37 | }, 38 | 39 | _getEmail: function(val){ 40 | this.setState({ 41 | email: val 42 | }); 43 | }, 44 | 45 | _deleteUser: function(){ 46 | var that = this; 47 | AlertIOS.alert('提示', '确认删除该用户?', [ 48 | {text: '删除', onPress: function(){ 49 | var path = Service.host + Service.deleteUser; 50 | AsyncStorage.getItem('token', function(err, data){ 51 | if(!err){ 52 | Util.post(path,{ 53 | token: data, 54 | email: that.state.email 55 | }, function(data){ 56 | if(data.status){ 57 | AlertIOS.alert('成功', '删除成功'); 58 | }else{ 59 | AlertIOS.alert('失败', '删除失败'); 60 | } 61 | }); 62 | }else{ 63 | AlertIOS.alert('提示', '没有权限'); 64 | } 65 | }); 66 | } 67 | }, 68 | {text: '取消', onPress: ()=>null}, 69 | ]); 70 | } 71 | 72 | }); 73 | 74 | var styles = StyleSheet.create({ 75 | input:{ 76 | flex:1, 77 | marginLeft:20, 78 | marginRight:20, 79 | height:35, 80 | borderWidth:1, 81 | borderColor:'#ddd', 82 | borderRadius:4, 83 | paddingLeft:5, 84 | fontSize:13, 85 | }, 86 | btn:{ 87 | justifyContent:'center', 88 | alignItems:'center', 89 | marginTop:20, 90 | backgroundColor:'#1DB8FF', 91 | height:38, 92 | marginLeft:20, 93 | marginRight:20, 94 | borderRadius:4, 95 | } 96 | }); 97 | 98 | module.exports = DeleteUser; -------------------------------------------------------------------------------- /app/letschat/views/manager/modifyPassword.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('./../util'); 4 | var Service = require('../service'); 5 | 6 | var { 7 | View, 8 | Text, 9 | ScrollView, 10 | StyleSheet, 11 | TouchableOpacity, 12 | TextInput, 13 | AlertIOS, 14 | AsyncStorage, 15 | } = React; 16 | 17 | var ModifyUser = React.createClass({ 18 | 19 | render: function(){ 20 | return ( 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 修改密码 35 | 36 | 37 | 38 | 39 | ); 40 | }, 41 | 42 | _getOldPassword: function(val){ 43 | this.setState({ 44 | oldPassword: val 45 | }); 46 | }, 47 | 48 | _getNewPassword: function(val){ 49 | this.setState({ 50 | password: val 51 | }); 52 | }, 53 | 54 | _resetPassword: function(){ 55 | var path = Service.host + Service.updatePassword; 56 | var that = this; 57 | console.log(that.state.password); 58 | //需要服务端确认login token 59 | AsyncStorage.getItem('token', function(err, data){ 60 | if(!err){ 61 | Util.post(path, { 62 | password: that.state.password, 63 | oldPassword: that.state.oldPassword, 64 | token: data, 65 | }, function(data){ 66 | if(data.status){ 67 | AlertIOS.alert('成功', data.data); 68 | }else{ 69 | AlertIOS.alert('失败', data.data); 70 | } 71 | }); 72 | }else{ 73 | AlertIOS.alert('失败', data.data); 74 | } 75 | }); 76 | } 77 | 78 | }); 79 | 80 | var styles = StyleSheet.create({ 81 | input:{ 82 | flex:1, 83 | marginLeft:20, 84 | marginRight:20, 85 | height:35, 86 | borderWidth:1, 87 | borderColor:'#ddd', 88 | borderRadius:4, 89 | paddingLeft:5, 90 | fontSize:13, 91 | }, 92 | btn:{ 93 | justifyContent:'center', 94 | alignItems:'center', 95 | marginTop:20, 96 | backgroundColor:'#1DB8FF', 97 | height:38, 98 | marginLeft:20, 99 | marginRight:20, 100 | borderRadius:4, 101 | } 102 | }); 103 | 104 | module.exports = ModifyUser; -------------------------------------------------------------------------------- /app/letschat/views/manager/postMessage.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Service = require('./../service'); 4 | var Util = require('./../util'); 5 | 6 | var { 7 | View, 8 | TextInput, 9 | ScrollView, 10 | StyleSheet, 11 | TouchableOpacity, 12 | Image, 13 | Text, 14 | AsyncStorage 15 | } = React; 16 | 17 | var PostMessage = React.createClass({ 18 | 19 | render: function(){ 20 | return ( 21 | 22 | 23 | 27 | 28 | 29 | 30 | 31 | 发布公告 32 | 33 | 34 | 35 | 36 | ); 37 | }, 38 | 39 | _onChange: function(val){ 40 | if(val){ 41 | this.setState({ 42 | message: val 43 | }); 44 | } 45 | }, 46 | 47 | _postMessage: function(){ 48 | var that = this; 49 | AsyncStorage.getItem('token', function(err, token){ 50 | if(err){ 51 | alert('权限失效,请退出APP,重新登录'); 52 | }else{ 53 | Util.post(Service.host + Service.addMessage, { 54 | token: token, 55 | message: that.state.message 56 | }, function(data){ 57 | if(data.status){ 58 | alert('添加成功!'); 59 | }else{ 60 | alert('添加失败!'); 61 | } 62 | }); 63 | } 64 | 65 | }); 66 | } 67 | 68 | }); 69 | 70 | var styles = StyleSheet.create({ 71 | textinput:{ 72 | flex:1, 73 | height:100, 74 | borderWidth:1, 75 | borderColor:'#ddd', 76 | marginTop:30, 77 | marginLeft:20, 78 | marginRight:20, 79 | paddingLeft:8, 80 | fontSize:13, 81 | borderRadius:4 82 | }, 83 | btn:{ 84 | flex:1, 85 | justifyContent:'center', 86 | alignItems:'center', 87 | backgroundColor:'#1DB8FF', 88 | height:38, 89 | marginLeft:20, 90 | marginRight:20, 91 | borderRadius:4, 92 | } 93 | }); 94 | 95 | module.exports = PostMessage; -------------------------------------------------------------------------------- /app/letschat/views/me.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('./util'); 4 | var AddUser = require('./manager/addUser'); 5 | var ModifyPassword = require('./manager/modifyPassword'); 6 | var DeleteUser = require('./manager/deleteUser'); 7 | var PostMessage = require('./manager/postMessage'); 8 | 9 | var { 10 | View, 11 | Text, 12 | ScrollView, 13 | StyleSheet, 14 | TouchableOpacity, 15 | AsyncStorage, 16 | } = React; 17 | 18 | 19 | var Manager = React.createClass({ 20 | 21 | render: function(){ 22 | var colors = ['#F4000B', '#17B4FF', '#FFD900', '#F00000']; 23 | var tags = ['G', 'X', 'S', 'Q', 'B', 'Z']; 24 | var items = ['个人资料', '相册', '收藏', '钱包', '表情', '设置']; 25 | var components = [ModifyPassword, AddUser, DeleteUser, PostMessage]; 26 | var JSXDOM = []; 27 | for(var i in items){ 28 | JSXDOM.push( 29 | 30 | 31 | {tags[i]} 32 | {items[i]} 33 | 34 | 35 | ); 36 | } 37 | 38 | 39 | return ( 40 | 41 | 42 | {JSXDOM} 43 | 44 | 45 | 46 | 47 | 48 | Q 49 | 退出登录 50 | 51 | 52 | 53 | 54 | ); 55 | }, 56 | 57 | _loadPage: function(component, title){ 58 | this.props.navigator.push({ 59 | title: title, 60 | component: component 61 | }); 62 | }, 63 | 64 | _clear: function(){ 65 | this.props.navigator.pop(); 66 | AsyncStorage.clear(); 67 | } 68 | 69 | }); 70 | 71 | var styles = StyleSheet.create({ 72 | container:{ 73 | flex:1, 74 | backgroundColor:'#F5F5F5', 75 | }, 76 | item:{ 77 | height:40, 78 | justifyContent: 'center', 79 | borderTopWidth: Util.pixel, 80 | borderTopColor: '#ddd', 81 | backgroundColor:'#fff', 82 | alignItems:'center', 83 | }, 84 | font:{ 85 | fontSize:15, 86 | marginLeft:5, 87 | marginRight:10, 88 | }, 89 | wrapper:{ 90 | marginTop:30, 91 | }, 92 | tag:{ 93 | marginLeft:10, 94 | fontSize:16, 95 | fontWeight:'bold' 96 | } 97 | }); 98 | 99 | module.exports = Manager; -------------------------------------------------------------------------------- /app/letschat/views/message-bak.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by vczero on 15/7/12. 3 | */ 4 | 5 | var React = require('react-native'); 6 | var Util = require('./util'); 7 | var Item = require('./message/item'); 8 | var Detail = require('./message/detail'); 9 | var Service = require('./service'); 10 | 11 | var { 12 | View, 13 | Text, 14 | ScrollView, 15 | StyleSheet, 16 | TextInput, 17 | Image, 18 | TouchableOpacity, 19 | } = React; 20 | 21 | var Message = React.createClass({ 22 | render: function(){ 23 | var contents = []; 24 | var items = []; 25 | if(this.props.data.status){ 26 | contents = this.props.data.data; 27 | } 28 | for(var i = 0; i < contents.length; i++){ 29 | items.push( 30 | 38 | ); 39 | } 40 | 41 | return ( 42 | 43 | 44 | 45 | 46 | 47 | {items} 48 | 49 | 50 | 51 | ); 52 | } 53 | 54 | }); 55 | 56 | var styles = StyleSheet.create({ 57 | container:{ 58 | flex:1, 59 | backgroundColor:'#F5F5F5', 60 | flexDirection:'column' 61 | }, 62 | search:{ 63 | height:35, 64 | borderWidth:Util.pixel, 65 | borderColor:'#ccc', 66 | paddingLeft:10, 67 | borderRadius:6, 68 | backgroundColor:'#fff', 69 | } 70 | }); 71 | 72 | module.exports = Message; -------------------------------------------------------------------------------- /app/letschat/views/message.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('./util'); 4 | var AddUser = require('./manager/addUser'); 5 | var ModifyPassword = require('./manager/modifyPassword'); 6 | var DeleteUser = require('./manager/deleteUser'); 7 | var PostMessage = require('./manager/postMessage'); 8 | 9 | var { 10 | View, 11 | Text, 12 | ScrollView, 13 | StyleSheet, 14 | TouchableOpacity, 15 | AsyncStorage, 16 | } = React; 17 | 18 | 19 | var Manager = React.createClass({ 20 | 21 | render: function(){ 22 | var colors = ['#F4000B', '#17B4FF', '#FFD900', '#F00000']; 23 | var tags = []; 24 | var items = []; 25 | var components = [ModifyPassword, AddUser, DeleteUser, PostMessage]; 26 | var JSXDOM = []; 27 | for(var i in items){ 28 | JSXDOM.push( 29 | 30 | 31 | {tags[i]} 32 | {items[i]} 33 | 34 | 35 | ); 36 | } 37 | 38 | 39 | return ( 40 | 41 | 42 | {JSXDOM} 43 | 44 | 45 | ); 46 | }, 47 | 48 | _loadPage: function(component, title){ 49 | this.props.navigator.push({ 50 | title: title, 51 | component: component 52 | }); 53 | }, 54 | 55 | _clear: function(){ 56 | this.props.navigator.pop(); 57 | AsyncStorage.clear(); 58 | } 59 | 60 | }); 61 | 62 | var styles = StyleSheet.create({ 63 | container:{ 64 | flex:1, 65 | backgroundColor:'#F5F5F5', 66 | }, 67 | item:{ 68 | height:40, 69 | justifyContent: 'center', 70 | borderTopWidth: Util.pixel, 71 | borderTopColor: '#ddd', 72 | backgroundColor:'#fff', 73 | alignItems:'center', 74 | }, 75 | font:{ 76 | fontSize:15, 77 | marginLeft:5, 78 | marginRight:10, 79 | }, 80 | wrapper:{ 81 | marginTop:30, 82 | }, 83 | tag:{ 84 | marginLeft:10, 85 | fontSize:16, 86 | fontWeight:'bold' 87 | } 88 | }); 89 | 90 | module.exports = Manager; -------------------------------------------------------------------------------- /app/letschat/views/message/detail.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var React = require('react-native'); 4 | var { 5 | View, 6 | Text, 7 | StyleSheet, 8 | Image, 9 | ScrollView, 10 | TouchableOpacity, 11 | } = React; 12 | 13 | var Detail = React.createClass({ 14 | render: function(){ 15 | var content = this.props.content; 16 | return ( 17 | 18 | 19 | 20 | {content.message} 21 | 22 | 23 | 24 | 25 | {content.username} 26 | 27 | 28 | 29 | 30 | {content.time} 31 | 32 | 33 | 34 | ); 35 | } 36 | }); 37 | 38 | var styles = StyleSheet.create({ 39 | content:{ 40 | marginTop:20, 41 | marginLeft:15, 42 | marginRight:15, 43 | opacity:0.85, 44 | }, 45 | luokuan:{ 46 | flex:1, 47 | flexDirection:'row', 48 | marginRight:20, 49 | }, 50 | text:{ 51 | lineHeight:20, 52 | width:90 53 | } 54 | }); 55 | 56 | module.exports = Detail; -------------------------------------------------------------------------------- /app/letschat/views/message/item.js: -------------------------------------------------------------------------------- 1 | 2 | var React = require('react-native'); 3 | var Util = require('../util'); 4 | var Service = require('../service'); 5 | 6 | var { 7 | View, 8 | Text, 9 | StyleSheet, 10 | Image, 11 | TouchableOpacity, 12 | } = React; 13 | 14 | var Item = React.createClass({ 15 | render: function(){ 16 | return ( 17 | 18 | 19 | 20 | {this.props.name.substr(0,1)} 21 | 22 | 23 | 24 | {this.props.text} 25 | 26 | 27 | {this.props.date} 28 | 29 | 30 | 31 | {this.props.name} 32 | 33 | 34 | 35 | ); 36 | }, 37 | loadPage: function(data){ 38 | var content = data; 39 | this.props.nav.push({ 40 | title:'消息详情', 41 | component: this.props.component, 42 | passProps:{ 43 | content: content 44 | } 45 | }); 46 | 47 | } 48 | }); 49 | 50 | 51 | var styles = StyleSheet.create({ 52 | item:{ 53 | height:80, 54 | padding:5, 55 | borderBottomWidth: Util.pixel, 56 | borderBottomColor: '#ddd', 57 | flexDirection:'row', 58 | alignItems:'center', 59 | }, 60 | img:{ 61 | width:50, 62 | height:50, 63 | borderRadius:4, 64 | }, 65 | width55:{ 66 | width:50, 67 | height:50, 68 | borderRadius:4, 69 | marginLeft:10, 70 | alignItems:'center', 71 | justifyContent:'center', 72 | backgroundColor: '#05C147', 73 | marginRight:10, 74 | }, 75 | text:{ 76 | flex:1, 77 | marginBottom:5, 78 | opacity:0.7 79 | }, 80 | date:{ 81 | color:'#ccc', 82 | fontSize:11, 83 | }, 84 | m10:{ 85 | marginLeft:10 86 | }, 87 | name:{ 88 | color:'#929292', 89 | fontSize:13 90 | } 91 | }); 92 | 93 | module.exports = Item; 94 | -------------------------------------------------------------------------------- /app/letschat/views/service.js: -------------------------------------------------------------------------------- 1 | var Service = { 2 | host:'http://127.0.0.1:3000', 3 | login: '/user/login', 4 | loginByToken: '/user/login/token', 5 | getUser: '/user/get', 6 | createUser: '/user/create', 7 | getMessage: '/message/get', 8 | addMessage: '/message/add', 9 | updatePassword: '/user/password/update', 10 | deleteUser: '/user/delete' 11 | }; 12 | 13 | module.exports = Service; -------------------------------------------------------------------------------- /app/letschat/views/util.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | var React = require('react-native'); 4 | var Dimensions = require('Dimensions'); 5 | 6 | var { 7 | PixelRatio 8 | } = React; 9 | 10 | var Util = { 11 | 12 | //单位像素 13 | pixel: 1 / PixelRatio.get(), 14 | //屏幕尺寸 15 | size: { 16 | width: Dimensions.get('window').width, 17 | height: Dimensions.get('window').height 18 | }, 19 | 20 | //post请求 21 | post: function (url, data, callback) { 22 | var fetchOptions = { 23 | method: 'POST', 24 | headers: { 25 | 'Accept': 'application/json', 26 | 'Content-Type': 'application/json' 27 | }, 28 | body: JSON.stringify(data) 29 | }; 30 | 31 | fetch(url, fetchOptions) 32 | .then((response) => response.text()) 33 | .then((responseText) => { 34 | callback(JSON.parse(responseText)); 35 | }); 36 | }, 37 | //Key 38 | key: 'HSHHSGSGGSTWSYWSYUSUWSHWBS-REACT-NATIVE' 39 | 40 | }; 41 | 42 | module.exports = Util; --------------------------------------------------------------------------------