Commit 51d7fb1d by zeven

隐藏logo

parent b3885328
android @ 03b417e8
Subproject commit 4c28e562126ae5cc53882fd42320875f460e7c6a
Subproject commit 03b417e84da4ae78717555dce2d9e414f036d6e4
{
"name": "zm-face-counter",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"scripts": {
"android": "react-native run-android",
......
......@@ -47,7 +47,6 @@ class VerticalPage extends Component {
faceType: 'wxpay',
hintVisible: false,
setting: false,
num: 0, //点击10次隐藏logo
logoVisible: true,
};
......@@ -65,13 +64,21 @@ class VerticalPage extends Component {
this.setState({faceType: 'alipay'});
}
}
const setting = await AutoClick.isSettingsOn();
if (!setting) this.setState({setting: true}); // 展示按钮
this.initSetting();
DeviceEventEmitter.addListener('wxpayfaceRegister', () => {
this.wxFacepay(); // 点击开通重新调用
});
}
initSetting = () => {
AutoClick.isSettingsOn().then(setting => {
if (!setting) this.setState({setting: true}); // 展示辅助按钮
});
AsyncStorage.getItem('hideLogo').then(hide => {
if (hide === 'true') this.setState({logoVisible: false}); // 隐藏LOGO
});
};
setting = async () => {
await AutoClick.goSetting(); // 按钮跳转设置
};
......@@ -463,14 +470,13 @@ class VerticalPage extends Component {
);
hideLogo = async () => {
let {num, logoVisible} = this.state;
num++;
await this.setState({
num,
});
if (num === 10) {
if (!this.num) this.num = 0;
this.num++;
if (this.num >= 10) {
this.num = 0;
let {logoVisible} = this.state;
AsyncStorage.setItem('hideLogo', String(logoVisible));
this.setState({
num: 0,
logoVisible: !logoVisible,
});
}
......@@ -535,7 +541,7 @@ class VerticalPage extends Component {
<View style={styles.header}>
<Touch onPress={() => this.hideLogo()}>
<View style={styles.left}>
<Image source={logoVisible && logo} />
{logoVisible && <Image source={logo} />}
<Image style={styles.counterText} source={counterText} />
<Image source={img24h} />
</View>
......
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