|
@@ -1,6 +1,6 @@
|
|
|
import React, {Component} from 'react';
|
|
|
-import {Text, View, TextInput, StyleSheet} from 'react-native';
|
|
|
-import {Button, Slider, Toast, Provider} from "@ant-design/react-native";
|
|
|
+import {Text, TouchableOpacity, View, TextInput, StyleSheet} from 'react-native';
|
|
|
+import {Button, Slider, Provider, Toast,} from "@ant-design/react-native";
|
|
|
import ReadUHF from "../../utils/ReadUHF";
|
|
|
import SyncStorage from "sync-storage";
|
|
|
|
|
@@ -11,6 +11,7 @@ class setPower extends Component {
|
|
|
power: 30,
|
|
|
no_begin: '8',
|
|
|
no_length: '14',
|
|
|
+ show_type: true,
|
|
|
};
|
|
|
}
|
|
|
|
|
@@ -25,10 +26,15 @@ class setPower extends Component {
|
|
|
if (no_begin && no_begin) {
|
|
|
this.setState({no_begin, no_length})
|
|
|
}
|
|
|
+ const show_type = SyncStorage.get('show_type')
|
|
|
+ this.setState({show_type})
|
|
|
}
|
|
|
|
|
|
+ onTypeChange = () => {
|
|
|
+ this.setState({show_type: !this.state.show_type})
|
|
|
+ }
|
|
|
_savePower = () => {
|
|
|
- let {no_begin, no_length} = this.state;
|
|
|
+ let {no_begin, no_length, show_type} = this.state;
|
|
|
no_begin = parseInt(no_begin)
|
|
|
no_length = parseInt(no_length)
|
|
|
|
|
@@ -47,6 +53,7 @@ class setPower extends Component {
|
|
|
}
|
|
|
SyncStorage.set('no_begin', no_begin.toString())
|
|
|
SyncStorage.set('no_length', no_length.toString())
|
|
|
+ SyncStorage.set('show_type', show_type)
|
|
|
ReadUHF.setPower(this.state.power)
|
|
|
this.props.navigation.goBack();
|
|
|
}
|
|
@@ -85,6 +92,31 @@ class setPower extends Component {
|
|
|
placeholder={'请输入'}
|
|
|
/>
|
|
|
</View>
|
|
|
+ <View style={{marginTop: 10}}>
|
|
|
+ <TouchableOpacity
|
|
|
+ activeOpacity={0.9}
|
|
|
+ onPress={() => this.onTypeChange()}
|
|
|
+ style={{
|
|
|
+ marginHorizontal: 3,
|
|
|
+ flexDirection: 'row',
|
|
|
+ }}>
|
|
|
+ {this.state.show_type ?
|
|
|
+ <Text style={{
|
|
|
+ borderWidth: 1,
|
|
|
+ width: 18,
|
|
|
+ height: 18,
|
|
|
+ textAlign: 'center',
|
|
|
+ color: 'red'
|
|
|
+ }}>√</Text>
|
|
|
+ :
|
|
|
+ <Text style={{
|
|
|
+ borderWidth: 1,
|
|
|
+ width: 18,
|
|
|
+ height: 18,
|
|
|
+ }}/>
|
|
|
+ }<Text style={styles.font14}> 只显示本类别芯片</Text>
|
|
|
+ </TouchableOpacity>
|
|
|
+ </View>
|
|
|
<Button onPress={() => this._savePower()}
|
|
|
type="primary"
|
|
|
style={{
|