Commit c3612987 by zeven

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

parent 33e8781d
{
"name": "zm-face-counter",
"version": "1.3.6",
"version": "1.3.8",
"private": true,
"scripts": {
"android": "react-native run-android",
......@@ -8,8 +8,8 @@
"test": "jest",
"lint": "eslint --ext .js index.js src",
"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-product": "code-push promote ZmFaceCounter-android Staging Production --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.8'",
"android-history": "code-push deployment history ZmFaceCounter-android Production",
"android-rollback": "code-push rollback ZmFaceCounter-android Production"
},
......
......@@ -60,7 +60,9 @@ class FacePage extends Component {
let storeName = await AsyncStorage.getItem('NAME');
this.setState({contact, storeName});
if (!this.init) {
this.init = await WxFacepay.initialize(10000);
this.init = await WxFacepay.initialize(10000, {
perform_mode: 'LOW_PERFORM',
});
if (!this.init) {
// 微信刷脸失败,启动支付宝刷脸
this.init = true;
......@@ -267,6 +269,10 @@ class FacePage extends Component {
type: 'agora/agora',
});
await onTalkCall(data);
clearTimeout(this.onCallTimeout);
this.onCallTimeout = setTimeout(() => {
this.leaveC();
}, 5 * 60 * 1000);
await this.setState({
talkCall: 1,
});
......
......@@ -161,7 +161,7 @@ class VerticalPage extends Component {
type: 'agora/agora',
});
await onTalkCall(data);
clearInterval(this.onCallTimeout);
clearTimeout(this.onCallTimeout);
this.onCallTimeout = setTimeout(() => {
this.leaveC();
}, 5 * 60 * 1000);
......
......@@ -5,12 +5,15 @@ const timeout = ms =>
setTimeout(() => resolve(false), ms);
});
const init = new Promise(resolve => {
NativeModules.WxFacepay.init().then(resolve);
});
const init = options =>
new Promise(resolve => {
if (options && NativeModules.WxFacepay.initOptions)
NativeModules.WxFacepay.initOptions(options).then(resolve);
else NativeModules.WxFacepay.init().then(resolve);
});
NativeModules.WxFacepay.initialize = ms => {
return Promise.race([init, timeout(ms)]);
NativeModules.WxFacepay.initialize = (ms, options) => {
return Promise.race([init(options), timeout(ms)]);
};
// 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