Bladeren bron

初始化项目

chenzhfa 2 jaren geleden
commit
92e8ccdfbc
100 gewijzigde bestanden met toevoegingen van 1966 en 0 verwijderingen
  1. 4 0
      .babelrc
  2. 6 0
      .buckconfig
  3. 15 0
      .editorconfig
  4. 30 0
      .eslintrc
  5. 54 0
      .flowconfig
  6. 1 0
      .gitattributes
  7. 54 0
      .gitignore
  8. 1 0
      .watchmanconfig
  9. 69 0
      README.md
  10. 12 0
      __tests__/index.android.js
  11. 12 0
      __tests__/index.ios.js
  12. 65 0
      android/app/BUCK
  13. 170 0
      android/app/build.gradle
  14. BIN
      android/app/libs/alipaySdk-20180601.jar
  15. BIN
      android/app/libs/wechat-sdk-android-with-mta-1.0.2.jar
  16. 91 0
      android/app/proguard-rules.pro
  17. 58 0
      android/app/src/main/AndroidManifest.xml
  18. BIN
      android/app/src/main/assets/fonts/Entypo.ttf
  19. BIN
      android/app/src/main/assets/fonts/EvilIcons.ttf
  20. BIN
      android/app/src/main/assets/fonts/Feather.ttf
  21. BIN
      android/app/src/main/assets/fonts/FontAwesome.ttf
  22. BIN
      android/app/src/main/assets/fonts/Foundation.ttf
  23. BIN
      android/app/src/main/assets/fonts/Iconfont.ttf
  24. BIN
      android/app/src/main/assets/fonts/Ionicons.ttf
  25. BIN
      android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
  26. BIN
      android/app/src/main/assets/fonts/MaterialIcons.ttf
  27. BIN
      android/app/src/main/assets/fonts/Octicons.ttf
  28. BIN
      android/app/src/main/assets/fonts/SimpleLineIcons.ttf
  29. BIN
      android/app/src/main/assets/fonts/Zocial.ttf
  30. 974 0
      android/app/src/main/assets/index.android.bundle
  31. 1 0
      android/app/src/main/assets/index.android.bundle.meta
  32. 59 0
      android/app/src/main/assets/tpl.html
  33. 26 0
      android/app/src/main/java/com/dvastarter/MainActivity.java
  34. 63 0
      android/app/src/main/java/com/dvastarter/MainApplication.java
  35. 40 0
      android/app/src/main/java/com/dvastarter/alipay/AlipayModule.java
  36. 25 0
      android/app/src/main/java/com/dvastarter/alipay/AlipayPackage.java
  37. 50 0
      android/app/src/main/java/com/dvastarter/wxapi/WXPayEntryActivity.java
  38. 54 0
      android/app/src/main/java/com/dvastarter/wxapi/WxpayModule.java
  39. 26 0
      android/app/src/main/java/com/dvastarter/wxapi/WxpayPackage.java
  40. BIN
      android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png
  41. BIN
      android/app/src/main/res/drawable-mdpi/app_components_checkbox_res_img_checkbox.png
  42. BIN
      android/app/src/main/res/drawable-mdpi/app_components_checkbox_res_img_uncheckbox.png
  43. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_aboutlogo.png
  44. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_defaultimg.jpg
  45. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_delete.png
  46. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_emptycommodity.png
  47. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_emptyorder.png
  48. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_emptyshop.png
  49. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_homeallgoods.png
  50. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_homeannounce.png
  51. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_homedispatched.png
  52. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_homehotsale.png
  53. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_homemask.png
  54. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_homepending.png
  55. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_hometemporary.png
  56. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_hometopinput.png
  57. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_hometopred.png
  58. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_homeunshiped.png
  59. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_icmoredian.png
  60. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_icredblue.png
  61. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_loginbutton.png
  62. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_loginheader.png
  63. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_logpng.png
  64. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minebackground.png
  65. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minehome0.png
  66. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minehome1.png
  67. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minehome2.png
  68. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minehome3.png
  69. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minehome4.png
  70. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minehome5.png
  71. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_minetx.png
  72. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_orderalipay.png
  73. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_orderchanpay.png
  74. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_orderstatus.png
  75. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_orderwechatpay.png
  76. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_paybacg.png
  77. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_paylogo.png
  78. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_shopdropdown.png
  79. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_signed.png
  80. BIN
      android/app/src/main/res/drawable-mdpi/app_static_images_versionalert.png
  81. BIN
      android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backiconmask.png
  82. BIN
      android/app/src/main/res/drawable-xhdpi/app_components_checkbox_res_img_checkbox.png
  83. BIN
      android/app/src/main/res/drawable-xhdpi/app_components_checkbox_res_img_uncheckbox.png
  84. BIN
      android/app/src/main/res/drawable-xhdpi/launch_screen.png
  85. BIN
      android/app/src/main/res/drawable-xhdpi/launch_screen1.png
  86. BIN
      android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
  87. BIN
      android/app/src/main/res/drawable-xxhdpi/app_components_checkbox_res_img_checkbox.png
  88. BIN
      android/app/src/main/res/drawable-xxhdpi/app_components_checkbox_res_img_uncheckbox.png
  89. BIN
      android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
  90. BIN
      android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
  91. 6 0
      android/app/src/main/res/layout/launch_screen.xml
  92. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher.png
  93. BIN
      android/app/src/main/res/mipmap-hdpi/ic_launcher1.png
  94. BIN
      android/app/src/main/res/mipmap-ldpi/ic_launcher.png
  95. BIN
      android/app/src/main/res/mipmap-ldpi/ic_launcher1.png
  96. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher.png
  97. BIN
      android/app/src/main/res/mipmap-mdpi/ic_launcher1.png
  98. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  99. BIN
      android/app/src/main/res/mipmap-xhdpi/ic_launcher1.png
  100. 0 0
      android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png

+ 4 - 0
.babelrc

@@ -0,0 +1,4 @@
+{
+  "presets": ["react-native"],
+  "plugins": ["transform-decorators-legacy"]
+}

+ 6 - 0
.buckconfig

@@ -0,0 +1,6 @@
+
+[android]
+  target = Google Inc.:Google APIs:23
+
+[maven_repositories]
+  central = https://repo1.maven.org/maven2

+ 15 - 0
.editorconfig

@@ -0,0 +1,15 @@
+# http://editorconfig.org
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+indent_size = 2
+indent_style = space
+insert_final_newline = true
+max_line_length = 80
+trim_trailing_whitespace = true
+
+[*.md]
+max_line_length = 0
+trim_trailing_whitespace = false

+ 30 - 0
.eslintrc

@@ -0,0 +1,30 @@
+{
+  "parser": "babel-eslint",
+  "env": {
+    "browser": true
+  },
+  "extends": [
+    "prettier",
+    "prettier/react"
+  ],
+  "plugins": [
+    "react",
+    "jsx-a11y",
+    "import",
+    "prettier"
+  ],
+  "globals": {
+    "__DEV__": true
+  },
+  "rules": {
+    "arrow-parens": 0,
+    "global-require": 0,
+    "import/prefer-default-export": 0,
+    "no-console": 0,
+    "no-mixed-operators": 0,
+    "no-use-before-define": 0,
+    "radix": 0,
+    "react/jsx-filename-extension": 0,
+    "react/prop-types": 0
+  }
+}

+ 54 - 0
.flowconfig

@@ -0,0 +1,54 @@
+[ignore]
+; We fork some components by platform
+.*/*[.]android.js
+
+; Ignore "BUCK" generated dirs
+<PROJECT_ROOT>/\.buckd/
+
+; Ignore unexpected extra "@providesModule"
+.*/node_modules/.*/node_modules/fbjs/.*
+
+; Ignore duplicate module providers
+; For RN Apps installed via npm, "Libraries" folder is inside
+; "node_modules/react-native" but in the source repo it is in the root
+.*/Libraries/react-native/React.js
+
+; Ignore polyfills
+.*/Libraries/polyfills/.*
+
+; Ignore metro
+.*/node_modules/metro/.*
+
+[include]
+
+[libs]
+node_modules/react-native/Libraries/react-native/react-native-interface.js
+node_modules/react-native/flow/
+node_modules/react-native/flow-github/
+
+[options]
+emoji=true
+
+module.system=haste
+
+munge_underscores=true
+
+module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
+
+module.file_ext=.js
+module.file_ext=.jsx
+module.file_ext=.json
+module.file_ext=.native.js
+
+suppress_type=$FlowIssue
+suppress_type=$FlowFixMe
+suppress_type=$FlowFixMeProps
+suppress_type=$FlowFixMeState
+
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
+suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
+suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
+suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
+
+[version]
+^0.63.0

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+*.pbxproj -text

+ 54 - 0
.gitignore

@@ -0,0 +1,54 @@
+# OSX
+#
+.DS_Store
+.vscode
+
+# Xcode
+#
+build/
+*.pbxuser
+!default.pbxuser
+*.mode1v3
+!default.mode1v3
+*.mode2v3
+!default.mode2v3
+*.perspectivev3
+!default.perspectivev3
+xcuserdata
+*.xccheckout
+*.moved-aside
+DerivedData
+*.hmap
+*.ipa
+*.xcuserstate
+project.xcworkspace
+
+# Android/IntelliJ
+#
+build/
+.idea
+.gradle
+local.properties
+*.iml
+
+# node.js
+#
+node_modules/
+npm-debug.log
+yarn-error.log
+
+# BUCK
+buck-out/
+\.buckd/
+*.keystore
+
+# fastlane
+#
+# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
+# screenshots whenever they are needed.
+# For more information about the recommended setup visit:
+# https://docs.fastlane.tools/best-practices/source-control/
+
+*/fastlane/report.xml
+*/fastlane/Preview.html
+*/fastlane/screenshots

+ 1 - 0
.watchmanconfig

@@ -0,0 +1 @@
+{}

+ 69 - 0
README.md

@@ -0,0 +1,69 @@
+occ-extension-key = 123456
+occ-extension-alias = 123456
+
+已经适配了 iPhone X
+
+> ......
+> )
+
+<!-- 等于 -->
+
+        EQ,
+
+<!-- 不等于 -->
+
+        NOTEQ,
+
+<!-- 模糊查询 -->
+
+        LIKE,
+
+<!-- 大于 -->
+
+        GT,
+
+<!-- 大于等于 -->
+
+        GTE,
+
+<!-- 小于 -->
+
+        LT,
+
+<!-- 小于等于 -->
+
+        LTE,
+        IN,
+        NOTIN,
+        NULL,
+        NOTNULL
+
+如果 react-native-splash-screen 报编译错误 解决方法如下:
+
+---
+
+Goto node_modules -> react-native-splash-screen -> build.gradle
+Change
+
+compileSdkVersion 26
+buildToolsVersion "26.1.0"
+to
+compileSdkVersion 23
+buildToolsVersion "23.0.1"
+
+and
+
+compile "com.android.support:appcompat-v7:26.1.0"
+to
+compile "com.android.support:appcompat-v7:23.0.1"
+
+And then make sure your build.gradle on android -> app -> build.gradle has the same version
+
+compileSdkVersion 23
+buildToolsVersion "23.0.1"
+
+and
+
+compile "com.android.support:appcompat-v7:23.0.1"
+
+---

+ 12 - 0
__tests__/index.android.js

@@ -0,0 +1,12 @@
+import 'react-native';
+import React from 'react';
+import Index from '../index.android.js';
+
+// Note: test renderer must be required after react-native.
+import renderer from 'react-test-renderer';
+
+it('renders correctly', () => {
+  const tree = renderer.create(
+    <Index />
+  );
+});

+ 12 - 0
__tests__/index.ios.js

@@ -0,0 +1,12 @@
+import 'react-native';
+import React from 'react';
+import Index from '../index.ios.js';
+
+// Note: test renderer must be required after react-native.
+import renderer from 'react-test-renderer';
+
+it('renders correctly', () => {
+  const tree = renderer.create(
+    <Index />
+  );
+});

+ 65 - 0
android/app/BUCK

@@ -0,0 +1,65 @@
+# To learn about Buck see [Docs](https://buckbuild.com/).
+# To run your application with Buck:
+# - install Buck
+# - `npm start` - to start the packager
+# - `cd android`
+# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
+# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
+# - `buck install -r android/app` - compile, install and run application
+#
+
+lib_deps = []
+
+for jarfile in glob(['libs/*.jar']):
+  name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
+  lib_deps.append(':' + name)
+  prebuilt_jar(
+    name = name,
+    binary_jar = jarfile,
+  )
+
+for aarfile in glob(['libs/*.aar']):
+  name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
+  lib_deps.append(':' + name)
+  android_prebuilt_aar(
+    name = name,
+    aar = aarfile,
+  )
+
+android_library(
+    name = "all-libs",
+    exported_deps = lib_deps,
+)
+
+android_library(
+    name = "app-code",
+    srcs = glob([
+        "src/main/java/**/*.java",
+    ]),
+    deps = [
+        ":all-libs",
+        ":build_config",
+        ":res",
+    ],
+)
+
+android_build_config(
+    name = "build_config",
+    package = "com.DvaStarter",
+)
+
+android_resource(
+    name = "res",
+    package = "com.DvaStarter",
+    res = "src/main/res",
+)
+
+android_binary(
+    name = "app",
+    keystore = "//android/keystores:debug",
+    manifest = "src/main/AndroidManifest.xml",
+    package_type = "debug",
+    deps = [
+        ":app-code",
+    ],
+)

+ 170 - 0
android/app/build.gradle

@@ -0,0 +1,170 @@
+apply plugin: "com.android.application"
+
+import com.android.build.OutputFile
+
+/**
+ * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
+ * and bundleReleaseJsAndAssets).
+ * These basically call `react-native bundle` with the correct arguments during the Android build
+ * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
+ * bundle directly from the development server. Below you can see all the possible configurations
+ * and their defaults. If you decide to add a configuration block, make sure to add it before the
+ * `apply from: "../../node_modules/react-native/react.gradle"` line.
+ *
+ * project.ext.react = [
+ *   // the name of the generated asset file containing your JS bundle
+ *   bundleAssetName: "index.android.bundle",
+ *
+ *   // the entry file for bundle generation
+ *   entryFile: "index.android.js",
+ *
+ *   // whether to bundle JS and assets in debug mode
+ *   bundleInDebug: false,
+ *
+ *   // whether to bundle JS and assets in release mode
+ *   bundleInRelease: true,
+ *
+ *   // whether to bundle JS and assets in another build variant (if configured).
+ *   // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
+ *   // The configuration property can be in the following formats
+ *   //         'bundleIn${productFlavor}${buildType}'
+ *   //         'bundleIn${buildType}'
+ *   // bundleInFreeDebug: true,
+ *   // bundleInPaidRelease: true,
+ *   // bundleInBeta: true,
+ *
+ *   // whether to disable dev mode in custom build variants (by default only disabled in release)
+ *   // for example: to disable dev mode in the staging build type (if configured)
+ *   devDisabledInStaging: true,
+ *   // The configuration property can be in the following formats
+ *   //         'devDisabledIn${productFlavor}${buildType}'
+ *   //         'devDisabledIn${buildType}'
+ *
+ *   // the root of your project, i.e. where "package.json" lives
+ *   root: "../../",
+ *
+ *   // where to put the JS bundle asset in debug mode
+ *   jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
+ *
+ *   // where to put the JS bundle asset in release mode
+ *   jsBundleDirRelease: "$buildDir/intermediates/assets/release",
+ *
+ *   // where to put drawable resources / React Native assets, e.g. the ones you use via
+ *   // require('./image.png')), in debug mode
+ *   resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
+ *
+ *   // where to put drawable resources / React Native assets, e.g. the ones you use via
+ *   // require('./image.png')), in release mode
+ *   resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
+ *
+ *   // by default the gradle tasks are skipped if none of the JS files or assets change; this means
+ *   // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
+ *   // date; if you have any other folders that you want to ignore for performance reasons (gradle
+ *   // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
+ *   // for example, you might want to remove it from here.
+ *   inputExcludes: ["android/**", "ios/**"],
+ *
+ *   // override which node gets called and with what additional arguments
+ *   nodeExecutableAndArgs: ["node"],
+ *
+ *   // supply additional arguments to the packager
+ *   extraPackagerArgs: []
+ * ]
+ */
+
+project.ext.react = [
+    entryFile: "index.js"
+]
+
+apply from: "../../node_modules/react-native/react.gradle"
+apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
+
+/**
+ * Set this to true to create two separate APKs instead of one:
+ *   - An APK that only works on ARM devices
+ *   - An APK that only works on x86 devices
+ * The advantage is the size of the APK is reduced by about 4MB.
+ * Upload all the APKs to the Play Store and people will download
+ * the correct one based on the CPU architecture of their device.
+ */
+def enableSeparateBuildPerCPUArchitecture = false
+
+/**
+ * Run Proguard to shrink the Java bytecode in release builds.
+ */
+def enableProguardInReleaseBuilds = false
+
+android {
+    compileSdkVersion 28
+    buildToolsVersion "28.0.1"
+
+    defaultConfig {
+        applicationId "com.DvaStarter"
+        minSdkVersion 16
+        targetSdkVersion 28
+        versionCode 1
+        versionName "1.0"
+        ndk {
+            abiFilters "armeabi-v7a", "x86"
+        }
+    }
+    splits {
+        abi {
+            reset()
+            enable enableSeparateBuildPerCPUArchitecture
+            universalApk false  // If true, also generate a universal APK
+            include "armeabi-v7a", "x86"
+        }
+    }
+
+    //config sign (syf)
+    signingConfigs {
+        release {
+            storeFile file('./occ-extension-key.keystore')
+            storePassword '123456'
+            keyAlias 'occ-extension-alias'
+            keyPassword '123456'
+        }
+    }
+    buildTypes {
+        release {
+            minifyEnabled enableProguardInReleaseBuilds
+            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
+        //    invoke sign (syf)
+        signingConfig signingConfigs.release
+        }
+    }
+    // applicationVariants are e.g. debug, release
+    applicationVariants.all { variant ->
+        variant.outputs.each { output ->
+            // For each separate APK per architecture, set a unique version code as described here:
+            // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
+            def versionCodes = ["armeabi-v7a":1, "x86":2]
+            def abi = output.getFilter(OutputFile.ABI)
+            if (abi != null) {  // null for the universal-debug, universal-release variants
+                output.versionCodeOverride =
+                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
+            }
+        }
+    }
+}
+
+dependencies {
+    compile project(':react-native-splash-screen')
+    compile project(':react-native-interactable')
+    compile project(':react-native-code-push')
+    compile project(':react-native-vector-icons')
+    compile project(':react-native-webview')
+    compile fileTree(dir: "libs", include: ["*.jar"])
+    compile "com.android.support:appcompat-v7:28.0.1"
+    compile "com.facebook.react:react-native:+"  // From node_modules
+    compile files("libs/alipaySdk-20180601.jar")  // 支付宝支付
+    compile files("libs/wechat-sdk-android-with-mta-1.0.2.jar")  // 微信支付
+}
+
+// Run this once to be able to run the application with BUCK
+// puts all compile dependencies into folder libs for BUCK to use
+task copyDownloadableDepsToLibs(type: Copy) {
+    from configurations.compile
+    into 'libs'
+}

BIN
android/app/libs/alipaySdk-20180601.jar


BIN
android/app/libs/wechat-sdk-android-with-mta-1.0.2.jar


+ 91 - 0
android/app/proguard-rules.pro

@@ -0,0 +1,91 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Disabling obfuscation is useful if you collect stack traces from production crashes
+# (unless you are using a system that supports de-obfuscate the stack traces).
+-dontobfuscate
+
+# React Native
+
+# Keep our interfaces so they can be used by other ProGuard rules.
+# See http://sourceforge.net/p/proguard/bugs/466/
+-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
+-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
+-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
+
+# Do not strip any method/class that is annotated with @DoNotStrip
+-keep @com.facebook.proguard.annotations.DoNotStrip class *
+-keep @com.facebook.common.internal.DoNotStrip class *
+-keepclassmembers class * {
+    @com.facebook.proguard.annotations.DoNotStrip *;
+    @com.facebook.common.internal.DoNotStrip *;
+}
+
+-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
+  void set*(***);
+  *** get*();
+}
+
+-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
+-keep class * extends com.facebook.react.bridge.NativeModule { *; }
+-keepclassmembers,includedescriptorclasses class * { native <methods>; }
+-keepclassmembers class *  { @com.facebook.react.uimanager.UIProp <fields>; }
+-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
+-keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
+
+-dontwarn com.facebook.react.**
+
+# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
+# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
+-dontwarn android.text.StaticLayout
+
+# okhttp
+
+-keepattributes Signature
+-keepattributes *Annotation*
+-keep class okhttp3.** { *; }
+-keep interface okhttp3.** { *; }
+-dontwarn okhttp3.**
+
+# okio
+
+-keep class sun.misc.Unsafe { *; }
+-dontwarn java.nio.file.*
+-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
+-dontwarn okio.**
+
+#支付宝
+-keep class com.alipay.android.app.IAlixPay{*;}
+-keep class com.alipay.android.app.IAlixPay$Stub{*;}
+-keep class com.alipay.android.app.IRemoteServiceCallback{*;}
+-keep class com.alipay.android.app.IRemoteServiceCallback$Stub{*;}
+-keep class com.alipay.sdk.app.PayTask{ public *;}
+-keep class com.alipay.sdk.app.AuthTask{ public *;}
+-keep class com.alipay.sdk.app.H5PayCallback {
+ <fields>;
+ <methods>;
+}
+-keep class com.alipay.android.phone.mrpc.core.** { *; }
+-keep class com.alipay.apmobilesecuritysdk.** { *; }
+-keep class com.alipay.mobile.framework.service.annotation.** { *; }
+-keep class com.alipay.mobilesecuritysdk.face.** { *; }
+-keep class com.alipay.tscenter.biz.rpc.** { *; }
+-keep class org.json.alipay.** { *; }
+-keep class com.alipay.tscenter.** { *; }
+-keep class com.ta.utdid2.** { *;}
+-keep class com.ut.device.** { *;}

+ 58 - 0
android/app/src/main/AndroidManifest.xml

@@ -0,0 +1,58 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.DvaStarter"
+    android:versionCode="1"
+    android:versionName="1.0">
+
+
+        <!-- 支付宝权限声明 -->
+        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+        <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+        <!-- 支付宝结束 -->
+        
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
+
+    <uses-sdk
+        android:minSdkVersion="16"
+        android:targetSdkVersion="22" />
+
+    <application
+      android:name=".MainApplication"
+      android:allowBackup="true"
+      android:label="@string/app_name"
+      android:icon="@mipmap/ic_launcher"
+      android:networkSecurityConfig="@xml/network_security_config"
+      android:theme="@style/AppTheme">
+
+        <!-- 支付宝 activity 声明 -->
+        <activity
+        android:name="com.alipay.sdk.app.H5PayActivity"
+        android:configChanges="orientation|keyboardHidden|navigation|screenSize"
+        android:exported="false"
+        android:screenOrientation="behind"
+        android:windowSoftInputMode="adjustResize|stateHidden" >
+        </activity>
+        <activity
+        android:name="com.alipay.sdk.app.H5AuthActivity"
+        android:configChanges="orientation|keyboardHidden|navigation"
+        android:exported="false"
+        android:screenOrientation="behind"
+        android:windowSoftInputMode="adjustResize|stateHidden" >
+        </activity>
+        
+      <activity
+        android:name=".MainActivity"
+        android:label="@string/app_name"
+        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
+        android:windowSoftInputMode="adjustResize">
+        <intent-filter>
+            <action android:name="android.intent.action.MAIN" />
+            <category android:name="android.intent.category.LAUNCHER" />
+        </intent-filter>
+      </activity>
+      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
+    </application>
+
+</manifest>

BIN
android/app/src/main/assets/fonts/Entypo.ttf


BIN
android/app/src/main/assets/fonts/EvilIcons.ttf


BIN
android/app/src/main/assets/fonts/Feather.ttf


BIN
android/app/src/main/assets/fonts/FontAwesome.ttf


BIN
android/app/src/main/assets/fonts/Foundation.ttf


BIN
android/app/src/main/assets/fonts/Iconfont.ttf


BIN
android/app/src/main/assets/fonts/Ionicons.ttf


BIN
android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf


BIN
android/app/src/main/assets/fonts/MaterialIcons.ttf


BIN
android/app/src/main/assets/fonts/Octicons.ttf


BIN
android/app/src/main/assets/fonts/SimpleLineIcons.ttf


BIN
android/app/src/main/assets/fonts/Zocial.ttf


File diff suppressed because it is too large
+ 974 - 0
android/app/src/main/assets/index.android.bundle


+ 1 - 0
android/app/src/main/assets/index.android.bundle.meta

@@ -0,0 +1 @@
+=ツッcュt;Qナョ�」/��(

File diff suppressed because it is too large
+ 59 - 0
android/app/src/main/assets/tpl.html


+ 26 - 0
android/app/src/main/java/com/dvastarter/MainActivity.java

@@ -0,0 +1,26 @@
+package com.DvaStarter;
+
+import com.alipay.sdk.app.EnvUtils;
+import android.os.Bundle;
+import org.devio.rn.splashscreen.SplashScreen;
+import com.facebook.react.ReactActivity;
+
+public class MainActivity extends ReactActivity {
+
+    /**
+     * Returns the name of the main component registered from JavaScript. This is
+     * used to schedule rendering of the component.
+     */
+    @Override
+    protected String getMainComponentName() {
+        return "occ-mobile";
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        // 测试沙箱用代码
+        // EnvUtils.setEnv(com.alipay.sdk.app.EnvUtils.EnvEnum.SANDBOX);
+        SplashScreen.show(this); // here
+        super.onCreate(savedInstanceState);
+    }
+}

+ 63 - 0
android/app/src/main/java/com/dvastarter/MainApplication.java

@@ -0,0 +1,63 @@
+package com.DvaStarter;
+
+import android.app.Application;
+
+import com.facebook.react.ReactApplication;
+import com.reactnativecommunity.webview.RNCWebViewPackage;
+import org.devio.rn.splashscreen.SplashScreenReactPackage;
+import com.wix.interactable.Interactable;
+import com.microsoft.codepush.react.CodePush;
+import com.oblador.vectoricons.VectorIconsPackage;
+import com.facebook.react.ReactNativeHost;
+import com.facebook.react.ReactPackage;
+import com.facebook.react.shell.MainReactPackage;
+import com.facebook.soloader.SoLoader;
+import main.java.com.dvastarter.alipay.AlipayPackage;
+import main.java.com.dvastarter.wxapi.WxpayPackage;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class MainApplication extends Application implements ReactApplication {
+
+  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
+
+    @Override
+    protected String getJSBundleFile() {
+      return CodePush.getJSBundleFile();
+    }
+
+    @Override
+    public boolean getUseDeveloperSupport() {
+      return BuildConfig.DEBUG;
+    }
+
+    @Override
+    protected List<ReactPackage> getPackages() {
+      return Arrays.<ReactPackage>asList(new MainReactPackage(),
+             new SplashScreenReactPackage(), new Interactable(),
+          new CodePush(null, getApplicationContext(), BuildConfig.DEBUG), // 热更新
+          new VectorIconsPackage(),
+           new AlipayPackage(), // 支付宝支付
+          new RNCWebViewPackage()
+      // new WxpayPackage() // 微信支付
+      );
+    }
+
+    @Override
+    protected String getJSMainModuleName() {
+      return "index";
+    }
+  };
+
+  @Override
+  public ReactNativeHost getReactNativeHost() {
+    return mReactNativeHost;
+  }
+
+  @Override
+  public void onCreate() {
+    super.onCreate();
+    SoLoader.init(this, /* native exopackage */ false);
+  }
+}

+ 40 - 0
android/app/src/main/java/com/dvastarter/alipay/AlipayModule.java

@@ -0,0 +1,40 @@
+package main.java.com.dvastarter.alipay;
+
+import com.alipay.sdk.app.PayTask;
+import com.facebook.react.bridge.Arguments;
+import com.facebook.react.bridge.Promise;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
+import com.facebook.react.bridge.ReactMethod;
+import com.facebook.react.bridge.WritableMap;
+import java.util.Map;
+
+public class AlipayModule extends ReactContextBaseJavaModule {
+    public AlipayModule(ReactApplicationContext reactContext) {
+        super(reactContext);
+    }
+
+    @Override
+    public String getName() {
+        return "Alipay";
+    }
+
+    @ReactMethod
+    public void pay(final String orderInfo, final Promise promise) {
+        Runnable payRunnable = new Runnable() {
+            @Override
+            public void run() {
+                WritableMap map = Arguments.createMap();
+                PayTask alipay = new PayTask(getCurrentActivity());
+                Map<String, String> result = alipay.payV2(orderInfo, true);
+                for (Map.Entry<String, String> entry : result.entrySet())
+                    map.putString(entry.getKey(), entry.getValue());
+                promise.resolve(map);
+            }
+        };
+        // 必须异步调用
+        Thread payThread = new Thread(payRunnable);
+        payThread.start();
+    }
+
+}

+ 25 - 0
android/app/src/main/java/com/dvastarter/alipay/AlipayPackage.java

@@ -0,0 +1,25 @@
+package main.java.com.dvastarter.alipay;
+
+import com.facebook.react.ReactPackage;
+import com.facebook.react.bridge.NativeModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.uimanager.ViewManager;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class AlipayPackage implements ReactPackage {
+
+    @Override
+    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
+        List<NativeModule> modules = new ArrayList<>();
+        modules.add(new AlipayModule(reactContext));
+        return modules;
+    }
+
+}

+ 50 - 0
android/app/src/main/java/com/dvastarter/wxapi/WXPayEntryActivity.java

@@ -0,0 +1,50 @@
+package main.java.com.dvastarter.wxapi;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+
+import com.facebook.react.bridge.Arguments;
+import com.facebook.react.bridge.WritableMap;
+import com.tencent.mm.opensdk.constants.ConstantsAPI;
+import com.tencent.mm.opensdk.modelbase.BaseReq;
+import com.tencent.mm.opensdk.modelbase.BaseResp;
+import com.tencent.mm.opensdk.openapi.IWXAPI;
+import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
+import com.tencent.mm.opensdk.openapi.WXAPIFactory;
+
+public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
+
+    private static final String TAG = "WXPayEntryActivity";
+    private IWXAPI api;
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        api = WXAPIFactory.createWXAPI(this, WxpayModule.APP_ID);
+        api.handleIntent(getIntent(), this);
+    }
+
+    @Override
+    protected void onNewIntent(Intent intent) {
+        super.onNewIntent(intent);
+        setIntent(intent);
+        api.handleIntent(intent, this);
+    }
+
+    @Override
+    public void onReq(BaseReq req) {
+    }
+
+    @Override
+    public void onResp(BaseResp resp) {
+        Log.d(TAG, "onPayFinish, errCode = " + resp.errCode);
+        if (resp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
+            WritableMap map = Arguments.createMap();
+            map.putInt("errCode", resp.errCode);
+            WxpayModule.promise.resolve(map);
+            finish();
+        }
+    }
+}

+ 54 - 0
android/app/src/main/java/com/dvastarter/wxapi/WxpayModule.java

@@ -0,0 +1,54 @@
+package main.java.com.dvastarter.wxapi;
+
+import com.facebook.react.bridge.Promise;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
+import com.facebook.react.bridge.ReactMethod;
+import com.facebook.react.bridge.ReadableMap;
+import com.tencent.mm.opensdk.modelpay.PayReq;
+import com.tencent.mm.opensdk.openapi.IWXAPI;
+import com.tencent.mm.opensdk.openapi.WXAPIFactory;
+
+class WxpayModule extends ReactContextBaseJavaModule {
+
+    private IWXAPI api;
+    static String APP_ID = "";
+    static Promise promise = null;
+
+    WxpayModule(ReactApplicationContext reactContext) {
+        super(reactContext);
+        api = WXAPIFactory.createWXAPI(reactContext, null);
+    }
+
+    @Override
+    public String getName() {
+        return "Wxpay";
+    }
+
+    @ReactMethod
+    public void registerApp(String APP_ID) { // 向微信注册
+        WxpayModule.APP_ID = APP_ID;
+        api.registerApp(APP_ID);
+    }
+
+    @ReactMethod
+    public void pay(final ReadableMap order, Promise promise) {
+        WxpayModule.promise = promise;
+        PayReq request = new PayReq();
+        request.appId = order.getString("appid");
+        request.partnerId = order.getString("partnerid");
+        request.prepayId = order.getString("prepayid");
+        request.packageValue = order.getString("package");
+        request.nonceStr = order.getString("noncestr");
+        request.timeStamp = order.getInt("timestamp") + "";
+        request.sign = order.getString("sign");
+        api.sendReq(request);
+    }
+
+    @ReactMethod
+    public void isSupported(Promise promise) { // 判断是否支持调用微信SDK
+        boolean isSupported = api.isWXAppInstalled();
+        promise.resolve(isSupported);
+    }
+
+}

+ 26 - 0
android/app/src/main/java/com/dvastarter/wxapi/WxpayPackage.java

@@ -0,0 +1,26 @@
+package main.java.com.dvastarter.wxapi;
+
+import com.facebook.react.ReactPackage;
+import com.facebook.react.bridge.NativeModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.uimanager.ViewManager;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class WxpayPackage implements ReactPackage {
+
+    @Override
+    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
+        return Collections.emptyList();
+    }
+
+    @Override
+    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
+        List<NativeModule> modules = new ArrayList<>();
+        modules.add(new WxpayModule(reactContext));
+        return modules;
+    }
+
+}

BIN
android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png


BIN
android/app/src/main/res/drawable-mdpi/app_components_checkbox_res_img_checkbox.png


BIN
android/app/src/main/res/drawable-mdpi/app_components_checkbox_res_img_uncheckbox.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_aboutlogo.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_defaultimg.jpg


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_delete.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_emptycommodity.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_emptyorder.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_emptyshop.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_homeallgoods.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_homeannounce.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_homedispatched.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_homehotsale.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_homemask.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_homepending.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_hometemporary.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_hometopinput.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_hometopred.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_homeunshiped.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_icmoredian.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_icredblue.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_loginbutton.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_loginheader.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_logpng.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minebackground.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minehome0.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minehome1.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minehome2.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minehome3.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minehome4.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minehome5.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_minetx.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_orderalipay.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_orderchanpay.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_orderstatus.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_orderwechatpay.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_paybacg.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_paylogo.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_shopdropdown.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_signed.png


BIN
android/app/src/main/res/drawable-mdpi/app_static_images_versionalert.png


BIN
android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backiconmask.png


BIN
android/app/src/main/res/drawable-xhdpi/app_components_checkbox_res_img_checkbox.png


BIN
android/app/src/main/res/drawable-xhdpi/app_components_checkbox_res_img_uncheckbox.png


BIN
android/app/src/main/res/drawable-xhdpi/launch_screen.png


BIN
android/app/src/main/res/drawable-xhdpi/launch_screen1.png


BIN
android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png


BIN
android/app/src/main/res/drawable-xxhdpi/app_components_checkbox_res_img_checkbox.png


BIN
android/app/src/main/res/drawable-xxhdpi/app_components_checkbox_res_img_uncheckbox.png


BIN
android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png


BIN
android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png


+ 6 - 0
android/app/src/main/res/layout/launch_screen.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/launch_screen">
+</LinearLayout>

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher1.png


BIN
android/app/src/main/res/mipmap-ldpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-ldpi/ic_launcher1.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher1.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher1.png


+ 0 - 0
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


Some files were not shown because too many files changed in this diff