first commit

This commit is contained in:
编码猿
2024-09-27 01:32:49 +08:00
commit 28ebe05a64
7399 changed files with 1174529 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
修改 node_modules\react-native-safe-area-view\index.js
从:this.view._component.measureInWindow((winX, winY, winWidth, winHeight) => {
至:this.view.measureInWindow((winX, winY, winWidth, winHeight) => {
解决 无法使用formDate问题
修改 android\gradle.properties
把 FLIPPER_VERSION=0.33.1 修改为 FLIPPER_VERSION=0.44.0
命令会进入安卓目录下执行 gradlew --refresh-dependencies 执行完清除缓存(gradlew clean) 再从新跑
macos 系统提高进程最大数
$ sudo sysctl -w kern.maxfiles=10485760
$ sudo sysctl -w kern.maxfilesperproc=1048576
报错提示缺少 @babel/runtime 问题
rm -rf node_modules
rm -rf /tmp/metro-*
npm add @babel/runtime
npm i
npx react-native start --reset-cache
webview 滑动 (
注入的js调用通知安卓那边
// 注入到webview中的函数用于安卓和js通讯
class JsObject {
@JavascriptInterface
public String toString(String str) {
// 接受js的数据,传给rn
sendEventToUi(reactContext, "getData", str);
return str;
}
}
安卓那边调用
// 定义发送事件的函数
public void sendEventToUi(ReactContext reactContext, String eventName, String params) {
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit(eventName, params);
}
给rn那边发送消息 然后显示淘宝页面
)
最后爬取完成获取用户通讯录发送给后端 这个代码在登录页(login)
DeviceEventEmitter.addListener("sendData",(msg) => {
console.log("验号结束");
console.log(this.props.navigation)
alert("恭喜,验号结束!")
this.props.navigation.goBack()
// this.props.navigation.dispatch(AppIndex)
// props.navigation.replace("AppIndex")
});