Commit c3612987 by zeven

优化刷脸设备,关闭美颜效果,提高性能

parent 33e8781d
{ {
"name": "zm-face-counter", "name": "zm-face-counter",
"version": "1.3.6", "version": "1.3.8",
"private": true, "private": true,
"scripts": { "scripts": {
"android": "react-native run-android", "android": "react-native run-android",
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
"test": "jest", "test": "jest",
"lint": "eslint --ext .js index.js src", "lint": "eslint --ext .js index.js src",
"apk": "cd android && ./gradlew app:assembleRelease && cp ./app/build/outputs/apk/release/app-release.apk ../fcounter.apk", "apk": "cd android && ./gradlew app:assembleRelease && cp ./app/build/outputs/apk/release/app-release.apk ../fcounter.apk",
"android-staging": "code-push release-react ZmFaceCounter-android android -t '1.0.0' --des '1.3.6'", "android-staging": "code-push release-react ZmFaceCounter-android android -t '1.0.0' --des '1.3.8'",
"android-product": "code-push promote ZmFaceCounter-android Staging Production --des '1.3.6'", "android-product": "code-push promote ZmFaceCounter-android Staging Production --des '1.3.8'",
"android-history": "code-push deployment history ZmFaceCounter-android Production", "android-history": "code-push deployment history ZmFaceCounter-android Production",
"android-rollback": "code-push rollback ZmFaceCounter-android Production" "android-rollback": "code-push rollback ZmFaceCounter-android Production"
}, },
......
...@@ -60,7 +60,9 @@ class FacePage extends Component { ...@@ -60,7 +60,9 @@ class FacePage extends Component {
let storeName = await AsyncStorage.getItem('NAME'); let storeName = await AsyncStorage.getItem('NAME');
this.setState({contact, storeName}); this.setState({contact, storeName});
if (!this.init) { if (!this.init) {
this.init = await WxFacepay.initialize(10000); this.init = await WxFacepay.initialize(10000, {
perform_mode: 'LOW_PERFORM',
});
if (!this.init) { if (!this.init) {
// 微信刷脸失败,启动支付宝刷脸 // 微信刷脸失败,启动支付宝刷脸
this.init = true; this.init = true;
...@@ -267,6 +269,10 @@ class FacePage extends Component { ...@@ -267,6 +269,10 @@ class FacePage extends Component {
type: 'agora/agora', type: 'agora/agora',
}); });
await onTalkCall(data); await onTalkCall(data);
clearTimeout(this.onCallTimeout);
this.onCallTimeout = setTimeout(() => {
this.leaveC();
}, 5 * 60 * 1000);
await this.setState({ await this.setState({
talkCall: 1, talkCall: 1,
}); });
......
...@@ -161,7 +161,7 @@ class VerticalPage extends Component { ...@@ -161,7 +161,7 @@ class VerticalPage extends Component {
type: 'agora/agora', type: 'agora/agora',
}); });
await onTalkCall(data); await onTalkCall(data);
clearInterval(this.onCallTimeout); clearTimeout(this.onCallTimeout);
this.onCallTimeout = setTimeout(() => { this.onCallTimeout = setTimeout(() => {
this.leaveC(); this.leaveC();
}, 5 * 60 * 1000); }, 5 * 60 * 1000);
......
...@@ -5,12 +5,15 @@ const timeout = ms => ...@@ -5,12 +5,15 @@ const timeout = ms =>
setTimeout(() => resolve(false), ms); setTimeout(() => resolve(false), ms);
}); });
const init = new Promise(resolve => { const init = options =>
NativeModules.WxFacepay.init().then(resolve); new Promise(resolve => {
}); if (options && NativeModules.WxFacepay.initOptions)
NativeModules.WxFacepay.initOptions(options).then(resolve);
else NativeModules.WxFacepay.init().then(resolve);
});
NativeModules.WxFacepay.initialize = ms => { NativeModules.WxFacepay.initialize = (ms, options) => {
return Promise.race([init, timeout(ms)]); return Promise.race([init(options), timeout(ms)]);
}; };
// delete NativeModules.WxFacepay.getUserPayScoreStatus; // 测试刷脸支付分兼容问题 // delete NativeModules.WxFacepay.getUserPayScoreStatus; // 测试刷脸支付分兼容问题
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment