time 6 жил өмнө
parent
commit
8f1de87377

+ 1 - 1
App.js

@@ -9,7 +9,7 @@
 
 import React, {Component} from 'react';
 import {Platform, StyleSheet, Text, View} from 'react-native';
-import CodePushPage from './units/components/page/CodePushPage.js'
+import CodePushPage from './units/components/pages/CodePushPage.js'
 const instructions = Platform.select({
     ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
     android:

+ 260 - 9
package-lock.json

@@ -1069,6 +1069,47 @@
         }
       }
     },
+    "@react-navigation/core": {
+      "version": "3.4.2",
+      "resolved": "https://registry.npm.taobao.org/@react-navigation/core/download/@react-navigation/core-3.4.2.tgz",
+      "integrity": "sha1-vsVj6U/eQPurNzDNyX8ir7sqFJg=",
+      "requires": {
+        "hoist-non-react-statics": "3.3.0",
+        "path-to-regexp": "1.7.0",
+        "query-string": "6.8.2",
+        "react-is": "16.8.6"
+      },
+      "dependencies": {
+        "hoist-non-react-statics": {
+          "version": "3.3.0",
+          "resolved": "https://registry.npm.taobao.org/hoist-non-react-statics/download/hoist-non-react-statics-3.3.0.tgz",
+          "integrity": "sha1-sJF48BIhhPuVrPUl2q7LTY9FlYs=",
+          "requires": {
+            "react-is": "16.8.6"
+          }
+        }
+      }
+    },
+    "@react-navigation/native": {
+      "version": "3.5.0",
+      "resolved": "https://registry.npm.taobao.org/@react-navigation/native/download/@react-navigation/native-3.5.0.tgz?cache=0&sync_timestamp=1565661552163&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40react-navigation%2Fnative%2Fdownload%2F%40react-navigation%2Fnative-3.5.0.tgz",
+      "integrity": "sha1-9dFuCEWsJtEUfRyqSB8YoAdA564=",
+      "requires": {
+        "hoist-non-react-statics": "3.3.0",
+        "react-native-safe-area-view": "0.14.7",
+        "react-native-screens": "1.0.0-alpha.23"
+      },
+      "dependencies": {
+        "hoist-non-react-statics": {
+          "version": "3.3.0",
+          "resolved": "https://registry.npm.taobao.org/hoist-non-react-statics/download/hoist-non-react-statics-3.3.0.tgz",
+          "integrity": "sha1-sJF48BIhhPuVrPUl2q7LTY9FlYs=",
+          "requires": {
+            "react-is": "16.8.6"
+          }
+        }
+      }
+    },
     "@types/babel__core": {
       "version": "7.1.2",
       "resolved": "https://registry.npm.taobao.org/@types/babel__core/download/@types/babel__core-7.1.2.tgz",
@@ -1422,6 +1463,22 @@
       "integrity": "sha1-8OAD2cqef1nHpQiUXXsu+aBKVC8=",
       "dev": true
     },
+    "axios": {
+      "version": "0.19.0",
+      "resolved": "https://registry.npm.taobao.org/axios/download/axios-0.19.0.tgz",
+      "integrity": "sha1-jgm/89kSLhM/e4EByPvdAO09Krg=",
+      "requires": {
+        "follow-redirects": "1.5.10",
+        "is-buffer": "2.0.3"
+      },
+      "dependencies": {
+        "is-buffer": {
+          "version": "2.0.3",
+          "resolved": "http://registry.npm.taobao.org/is-buffer/download/is-buffer-2.0.3.tgz",
+          "integrity": "sha1-Ts8/z3ScvR5HJonhCaxmJhol5yU="
+        }
+      }
+    },
     "babel-jest": {
       "version": "24.8.0",
       "resolved": "https://registry.npm.taobao.org/babel-jest/download/babel-jest-24.8.0.tgz",
@@ -2103,6 +2160,11 @@
         }
       }
     },
+    "debounce": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npm.taobao.org/debounce/download/debounce-1.2.0.tgz",
+      "integrity": "sha1-RKVAq8DqmUMBjcDqqVzOh/Zc0TE="
+    },
     "debug": {
       "version": "2.6.9",
       "resolved": "http://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz",
@@ -2121,6 +2183,12 @@
       "resolved": "http://registry.npm.taobao.org/decode-uri-component/download/decode-uri-component-0.2.0.tgz",
       "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
     },
+    "deep-diff": {
+      "version": "0.3.8",
+      "resolved": "https://registry.npm.taobao.org/deep-diff/download/deep-diff-0.3.8.tgz",
+      "integrity": "sha1-wB3mPvsO7JeYgB1Ax+Da4ltYLIQ=",
+      "dev": true
+    },
     "deep-is": {
       "version": "0.1.3",
       "resolved": "http://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz",
@@ -2783,6 +2851,24 @@
         "locate-path": "3.0.0"
       }
     },
+    "follow-redirects": {
+      "version": "1.5.10",
+      "resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.5.10.tgz",
+      "integrity": "sha1-e3qfmuov3/NnhqlP9kPtB/T/Xio=",
+      "requires": {
+        "debug": "3.1.0"
+      },
+      "dependencies": {
+        "debug": {
+          "version": "3.1.0",
+          "resolved": "http://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz",
+          "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
+          "requires": {
+            "ms": "2.0.0"
+          }
+        }
+      }
+    },
     "for-in": {
       "version": "1.0.2",
       "resolved": "http://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz",
@@ -5595,6 +5681,15 @@
         "@babel/core": "7.5.5"
       }
     },
+    "metro-babel7-plugin-react-transform": {
+      "version": "0.54.1",
+      "resolved": "https://registry.npm.taobao.org/metro-babel7-plugin-react-transform/download/metro-babel7-plugin-react-transform-0.54.1.tgz",
+      "integrity": "sha1-UzW4EChHiXJIhtxIPVvenBSaGZY=",
+      "dev": true,
+      "requires": {
+        "@babel/helper-module-imports": "7.0.0"
+      }
+    },
     "metro-cache": {
       "version": "0.51.1",
       "resolved": "https://registry.npm.taobao.org/metro-cache/download/metro-cache-0.51.1.tgz?cache=0&sync_timestamp=1562226704926&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmetro-cache%2Fdownload%2Fmetro-cache-0.51.1.tgz",
@@ -6031,9 +6126,9 @@
       }
     },
     "metro-react-native-babel-preset": {
-      "version": "0.55.0",
-      "resolved": "https://registry.npm.taobao.org/metro-react-native-babel-preset/download/metro-react-native-babel-preset-0.55.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmetro-react-native-babel-preset%2Fdownload%2Fmetro-react-native-babel-preset-0.55.0.tgz",
-      "integrity": "sha1-1dSmy+nMvO3XL8u3HAwxHj1Wh24=",
+      "version": "0.54.1",
+      "resolved": "https://registry.npm.taobao.org/metro-react-native-babel-preset/download/metro-react-native-babel-preset-0.54.1.tgz?cache=0&sync_timestamp=1565618739043&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmetro-react-native-babel-preset%2Fdownload%2Fmetro-react-native-babel-preset-0.54.1.tgz",
+      "integrity": "sha1-uPA4ZcOBhB1/iRLnukaATqOpKLg=",
       "dev": true,
       "requires": {
         "@babel/plugin-proposal-class-properties": "7.5.5",
@@ -6070,7 +6165,8 @@
         "@babel/plugin-transform-typescript": "7.5.5",
         "@babel/plugin-transform-unicode-regex": "7.4.4",
         "@babel/template": "7.4.4",
-        "react-refresh": "0.2.0"
+        "metro-babel7-plugin-react-transform": "0.54.1",
+        "react-transform-hmr": "1.0.4"
       }
     },
     "metro-react-native-babel-transformer": {
@@ -6777,6 +6873,21 @@
       "resolved": "http://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz",
       "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw="
     },
+    "path-to-regexp": {
+      "version": "1.7.0",
+      "resolved": "http://registry.npm.taobao.org/path-to-regexp/download/path-to-regexp-1.7.0.tgz",
+      "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=",
+      "requires": {
+        "isarray": "0.0.1"
+      },
+      "dependencies": {
+        "isarray": {
+          "version": "0.0.1",
+          "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-0.0.1.tgz?cache=0&sync_timestamp=1562592096220&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fisarray%2Fdownload%2Fisarray-0.0.1.tgz",
+          "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
+        }
+      }
+    },
     "path-type": {
       "version": "2.0.0",
       "resolved": "https://registry.npm.taobao.org/path-type/download/path-type-2.0.0.tgz",
@@ -7036,6 +7147,16 @@
       "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=",
       "dev": true
     },
+    "query-string": {
+      "version": "6.8.2",
+      "resolved": "https://registry.npm.taobao.org/query-string/download/query-string-6.8.2.tgz",
+      "integrity": "sha1-Nst+RSrhGktenv7oM3XglUQHsvY=",
+      "requires": {
+        "decode-uri-component": "0.2.0",
+        "split-on-first": "1.1.0",
+        "strict-uri-encode": "2.0.0"
+      }
+    },
     "randomatic": {
       "version": "3.1.1",
       "resolved": "https://registry.npm.taobao.org/randomatic/download/randomatic-3.1.1.tgz",
@@ -7128,6 +7249,11 @@
       "resolved": "https://registry.npm.taobao.org/react-is/download/react-is-16.8.6.tgz",
       "integrity": "sha1-W7weLSkUHJ+9/tRWND/ivEMKahY="
     },
+    "react-lifecycles-compat": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npm.taobao.org/react-lifecycles-compat/download/react-lifecycles-compat-3.0.4.tgz",
+      "integrity": "sha1-TxonOv38jzSIqMUWv9p4+HI1I2I="
+    },
     "react-native": {
       "version": "0.59.9",
       "resolved": "https://registry.npm.taobao.org/react-native/download/react-native-0.59.9.tgz",
@@ -7557,6 +7683,76 @@
         }
       }
     },
+    "react-native-gesture-handler": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npm.taobao.org/react-native-gesture-handler/download/react-native-gesture-handler-1.3.0.tgz",
+      "integrity": "sha1-0DhvVlkozMGElTfwPy43/V9q1D8=",
+      "requires": {
+        "hoist-non-react-statics": "2.5.5",
+        "invariant": "2.2.4",
+        "prop-types": "15.7.2"
+      }
+    },
+    "react-native-safe-area-view": {
+      "version": "0.14.7",
+      "resolved": "https://registry.npm.taobao.org/react-native-safe-area-view/download/react-native-safe-area-view-0.14.7.tgz",
+      "integrity": "sha1-4d0cTSWpBnffLBU0f93bIwa6WXE=",
+      "requires": {
+        "hoist-non-react-statics": "2.5.5"
+      }
+    },
+    "react-native-screens": {
+      "version": "1.0.0-alpha.23",
+      "resolved": "https://registry.npm.taobao.org/react-native-screens/download/react-native-screens-1.0.0-alpha.23.tgz",
+      "integrity": "sha1-JdfqTRG9pPzeLR2nrlAnHGqmNuA=",
+      "requires": {
+        "debounce": "1.2.0"
+      }
+    },
+    "react-native-tab-view": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npm.taobao.org/react-native-tab-view/download/react-native-tab-view-1.4.1.tgz",
+      "integrity": "sha1-8RPNh0hYCPDJkavsk39w+jgEeLk=",
+      "requires": {
+        "prop-types": "15.7.2"
+      }
+    },
+    "react-navigation": {
+      "version": "3.11.1",
+      "resolved": "https://registry.npm.taobao.org/react-navigation/download/react-navigation-3.11.1.tgz",
+      "integrity": "sha1-umlq1rUSCIqXogzH5qJQxT293SY=",
+      "requires": {
+        "@react-navigation/core": "3.4.2",
+        "@react-navigation/native": "3.5.0",
+        "react-navigation-drawer": "1.2.1",
+        "react-navigation-stack": "1.4.0",
+        "react-navigation-tabs": "1.1.4"
+      }
+    },
+    "react-navigation-drawer": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npm.taobao.org/react-navigation-drawer/download/react-navigation-drawer-1.2.1.tgz",
+      "integrity": "sha1-e9Xv7ufS9hHT67CTPgyOjrfK/lI=",
+      "requires": {
+        "react-native-tab-view": "1.4.1"
+      }
+    },
+    "react-navigation-stack": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npm.taobao.org/react-navigation-stack/download/react-navigation-stack-1.4.0.tgz",
+      "integrity": "sha1-ac2wKepO5Yd9fpM7MRfckLyEHrI="
+    },
+    "react-navigation-tabs": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npm.taobao.org/react-navigation-tabs/download/react-navigation-tabs-1.1.4.tgz",
+      "integrity": "sha1-AKMSJQ3zxRnGC3gVpSOs5e4RFjo=",
+      "requires": {
+        "hoist-non-react-statics": "2.5.5",
+        "prop-types": "15.7.2",
+        "react-lifecycles-compat": "3.0.4",
+        "react-native-tab-view": "1.4.1"
+      }
+    },
     "react-proxy": {
       "version": "1.1.8",
       "resolved": "http://registry.npm.taobao.org/react-proxy/download/react-proxy-1.1.8.tgz",
@@ -7566,11 +7762,28 @@
         "react-deep-force-update": "1.1.2"
       }
     },
-    "react-refresh": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npm.taobao.org/react-refresh/download/react-refresh-0.2.0.tgz?cache=0&sync_timestamp=1565317893686&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact-refresh%2Fdownload%2Freact-refresh-0.2.0.tgz",
-      "integrity": "sha1-8M/zdej3XepxM6hHobQM9cBz3Q0=",
-      "dev": true
+    "react-redux": {
+      "version": "7.1.0",
+      "resolved": "https://registry.npm.taobao.org/react-redux/download/react-redux-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freact-redux%2Fdownload%2Freact-redux-7.1.0.tgz",
+      "integrity": "sha1-cq989JCnSs3FFuqcHdgOJa+eoLI=",
+      "requires": {
+        "@babel/runtime": "7.5.5",
+        "hoist-non-react-statics": "3.3.0",
+        "invariant": "2.2.4",
+        "loose-envify": "1.4.0",
+        "prop-types": "15.7.2",
+        "react-is": "16.8.6"
+      },
+      "dependencies": {
+        "hoist-non-react-statics": {
+          "version": "3.3.0",
+          "resolved": "https://registry.npm.taobao.org/hoist-non-react-statics/download/hoist-non-react-statics-3.3.0.tgz",
+          "integrity": "sha1-sJF48BIhhPuVrPUl2q7LTY9FlYs=",
+          "requires": {
+            "react-is": "16.8.6"
+          }
+        }
+      }
     },
     "react-test-renderer": {
       "version": "16.8.3",
@@ -7680,6 +7893,29 @@
       "resolved": "https://registry.npm.taobao.org/recursive-fs/download/recursive-fs-1.1.2.tgz",
       "integrity": "sha1-HXUuLxpl0l+2lkEJqdv4OjNfkPA="
     },
+    "redux": {
+      "version": "4.0.4",
+      "resolved": "https://registry.npm.taobao.org/redux/download/redux-4.0.4.tgz",
+      "integrity": "sha1-TuGusWS2PWobzFeuSqC25vp6N5Y=",
+      "requires": {
+        "loose-envify": "1.4.0",
+        "symbol-observable": "1.2.0"
+      }
+    },
+    "redux-logger": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npm.taobao.org/redux-logger/download/redux-logger-3.0.6.tgz",
+      "integrity": "sha1-91VZZvMJjzyIYExEnPC69XeCdL8=",
+      "dev": true,
+      "requires": {
+        "deep-diff": "0.3.8"
+      }
+    },
+    "redux-thunk": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npm.taobao.org/redux-thunk/download/redux-thunk-2.3.0.tgz",
+      "integrity": "sha1-UcLBmhhe1Rh6qpotCLZm0NZGdiI="
+    },
     "regenerate": {
       "version": "1.4.0",
       "resolved": "http://registry.npm.taobao.org/regenerate/download/regenerate-1.4.0.tgz",
@@ -8326,6 +8562,11 @@
       "resolved": "https://registry.npm.taobao.org/spdx-license-ids/download/spdx-license-ids-3.0.5.tgz",
       "integrity": "sha1-NpS1gEVnpFjTyARYQqY1hjL2JlQ="
     },
+    "split-on-first": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npm.taobao.org/split-on-first/download/split-on-first-1.1.0.tgz",
+      "integrity": "sha1-9hCv7uOxK84dDDBCXnY5i3gkml8="
+    },
     "split-string": {
       "version": "3.1.0",
       "resolved": "https://registry.npm.taobao.org/split-string/download/split-string-3.1.0.tgz",
@@ -8405,6 +8646,11 @@
       "resolved": "http://registry.npm.taobao.org/stream-buffers/download/stream-buffers-2.2.0.tgz",
       "integrity": "sha1-kdX1Ew0c75bc+n9yaUUYh0HQnuQ="
     },
+    "strict-uri-encode": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npm.taobao.org/strict-uri-encode/download/strict-uri-encode-2.0.0.tgz",
+      "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY="
+    },
     "string-length": {
       "version": "2.0.0",
       "resolved": "https://registry.npm.taobao.org/string-length/download/string-length-2.0.0.tgz",
@@ -8573,6 +8819,11 @@
         "has-flag": "3.0.0"
       }
     },
+    "symbol-observable": {
+      "version": "1.2.0",
+      "resolved": "http://registry.npm.taobao.org/symbol-observable/download/symbol-observable-1.2.0.tgz",
+      "integrity": "sha1-wiaIrtTqs83C3+rLtWFmBWCgCAQ="
+    },
     "symbol-tree": {
       "version": "3.2.4",
       "resolved": "https://registry.npm.taobao.org/symbol-tree/download/symbol-tree-3.2.4.tgz?cache=0&sync_timestamp=1560363067941&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsymbol-tree%2Fdownload%2Fsymbol-tree-3.2.4.tgz",

+ 1 - 2
package.json

@@ -10,13 +10,12 @@
     "axios": "^0.19.0",
     "react": "16.8.3",
     "react-native": "0.59.9",
-    "react-native-code-push": "^5.6.1"
+    "react-native-code-push": "^5.6.1",
     "react-native-gesture-handler": "^1.3.0",
     "react-navigation": "^3.11.0",
     "react-redux": "^7.1.0",
     "redux": "^4.0.4",
     "redux-thunk": "^2.3.0"
-
   },
   "devDependencies": {
     "@babel/core": "^7.4.5",

+ 5 - 11
units/components/page/CodePushPage.js → units/components/pages/CodePushPage.js

@@ -91,12 +91,6 @@ class CodePushPa extends Component {
     }
 
 
-    goBack() {
-
-        YR
-
-    }
-
 
     render() {
 
@@ -112,11 +106,9 @@ class CodePushPa extends Component {
 
             <View style={styles.container} >
 
-
-                <TouchableOpacity onPress={this.getUpdateMetadata.bind(this)}>
-                    <Text style={styles.syncButton}>Welcome to CodePush!</Text>
-                </TouchableOpacity>
-
+                <Text style={styles.welcome}>
+                    Welcome to CodePush!
+                </Text>
                 <TouchableOpacity onPress={this.sync.bind(this)}>
                     <Text style={styles.syncButton}>Press for background sync</Text>
                 </TouchableOpacity>
@@ -132,6 +124,8 @@ class CodePushPa extends Component {
                 </TouchableOpacity>
                 <Text style={styles.messages}>{this.state.syncMessage || ""}</Text>
 
+                <Text style={styles.messages}></Text>
+
             </View>
         );
     }

+ 16 - 0
units/components/pages/HomeScreen.js

@@ -4,6 +4,8 @@ import {View, Text, Button,TouchableHighlight,StyleSheet} from "react-native";
 import {changeBtnText} from "../../actions/bi/index";
 import YRHttpRequest from  "../../utils/network/fetch"
 import {API} from "../../utils/network/axios/api.config";
+import {NativeModules} from 'react-native';
+const YRRnBridge = NativeModules.YRRnBridge;
 
 class HomeScreen extends React.Component {
 
@@ -58,6 +60,20 @@ class HomeScreen extends React.Component {
                     <Text style={styles.text} > Touch Here </Text>
                 </TouchableHighlight>
 
+                <Button title="iOS返回测试"
+                        onPress={() => {
+
+                                 YRRnBridge.goBack();
+
+                        }}/>
+
+                <Button title="热更新测试"
+                        onPress={() => {
+
+                            navigation.navigate('CodePushPage', {name: '热更新'});
+
+                        }}/>
+
             </View>
         );
     }

+ 8 - 0
units/containers/AppContainer.js

@@ -1,6 +1,7 @@
 import { createStackNavigator, createAppContainer } from "react-navigation";
 import HomeScreen from "../components/pages/HomeScreen";
 import {DetailsScreen} from "../components/pages/DetailsScreen";
+import CodePushPage from "../components/pages/CodePushPage";
 
 export const AppNavigator = createStackNavigator({
     Home: {
@@ -16,6 +17,13 @@ export const AppNavigator = createStackNavigator({
             title: '详情',
             headerBackTitle:'返回',//设置返回此页面的返回按钮文案,有长度限制
         }
+    },
+    CodePushPage:{
+        screen:CodePushPage,//热更新测试页面
+        navigationOptions : {
+            title: '热更新',
+            headerBackTitle:'热更新',
+        }
     }
 }, {
     initialRouteName: 'Home',