|
@@ -5,6 +5,7 @@ import ReadUHF from "../../utils/ReadUHF";
|
|
import Barcode from "react-native-barcode-builder";
|
|
import Barcode from "react-native-barcode-builder";
|
|
// import SyncStorage from "sync-storage";
|
|
// import SyncStorage from "sync-storage";
|
|
import {SyncStorage} from '../../utils';
|
|
import {SyncStorage} from '../../utils';
|
|
|
|
+import QRCode from 'react-native-qrcode-svg';
|
|
|
|
|
|
let screenW = Dimensions.get('window').width;
|
|
let screenW = Dimensions.get('window').width;
|
|
|
|
|
|
@@ -52,7 +53,7 @@ class DesktopHome extends Component {
|
|
_addCode = async (item) => {
|
|
_addCode = async (item) => {
|
|
const str = JSON.parse(item)
|
|
const str = JSON.parse(item)
|
|
// 防止重复扫描
|
|
// 防止重复扫描
|
|
- const show_type = await SyncStorage.get('show_type') // ?? '1'
|
|
|
|
|
|
+ const show_type = await SyncStorage.get('show_type') // ?? '1'
|
|
let {data, userData, error} = this.state;
|
|
let {data, userData, error} = this.state;
|
|
const product_index = userData.indexOf(str['userData'])
|
|
const product_index = userData.indexOf(str['userData'])
|
|
if (product_index < 0) {
|
|
if (product_index < 0) {
|
|
@@ -274,6 +275,59 @@ class DesktopHome extends Component {
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ jiliangRender = (item, index) => {
|
|
|
|
+ // 计量箱装置
|
|
|
|
+ return (
|
|
|
|
+ <View
|
|
|
|
+ key={item.userData}
|
|
|
|
+ style={styles.mainView}
|
|
|
|
+ >
|
|
|
|
+ <Text style={[styles.textColor, {marginVertical: 10, fontWeight: "bold", fontSize: 18}]}>计量箱装置</Text>
|
|
|
|
+
|
|
|
|
+ <View style={{
|
|
|
|
+ flexDirection: 'row',
|
|
|
|
+ }}>
|
|
|
|
+ <View style={{width: (screenW - 10) / 3 * 2,}}>
|
|
|
|
+ <View style={styles.JLView}>
|
|
|
|
+ <Text style={styles.textColor31}>装置型号</Text>
|
|
|
|
+ <Text style={styles.JLModel}>BX25</Text>
|
|
|
|
+ </View>
|
|
|
|
+ <View style={styles.JLView}>
|
|
|
|
+ <Text style={styles.textColor31}>额定频率</Text>
|
|
|
|
+ <Text style={styles.JLModel}>50Hz</Text>
|
|
|
|
+ </View>
|
|
|
|
+ <View style={styles.JLView}>
|
|
|
|
+ <Text style={styles.textColor31}>额定电流</Text>
|
|
|
|
+ <Text style={[styles.JLModel]}>5 A </Text>
|
|
|
|
+
|
|
|
|
+ </View>
|
|
|
|
+ <View style={styles.JLView}>
|
|
|
|
+ <Text style={styles.textColor31}>制造年月</Text>
|
|
|
|
+ <Text style={styles.JLModel}>202302</Text>
|
|
|
|
+ </View>
|
|
|
|
+ </View>
|
|
|
|
+ <View style={{
|
|
|
|
+ width: (screenW - 10) / 3 * 1,
|
|
|
|
+ textAlign: 'center',
|
|
|
|
+ alignItems: 'center',
|
|
|
|
+ flex: 1,
|
|
|
|
+ }}>
|
|
|
|
+ <QRCode
|
|
|
|
+ value={'3630002102200000001183'}//二维码内容
|
|
|
|
+ logoBorderRadius={1}
|
|
|
|
+ color={"#333333"}//二维码颜色
|
|
|
|
+ backgroundColor={"#ffffff"}//背景色
|
|
|
|
+ size={65}//二维码宽高
|
|
|
|
+ />
|
|
|
|
+ <Text style={[styles.textColor]}>36300021022</Text>
|
|
|
|
+ <Text style={[styles.textColor]}>00000001183</Text>
|
|
|
|
+ </View>
|
|
|
|
+ </View>
|
|
|
|
+ <Text style={[styles.textColor, {marginVertical: 10, fontWeight: "bold",}]}>郑州市凯贝特互感器有限公司</Text>
|
|
|
|
+ </View>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+
|
|
errorRender = (item, index) => {
|
|
errorRender = (item, index) => {
|
|
return (
|
|
return (
|
|
<View
|
|
<View
|
|
@@ -302,6 +356,9 @@ class DesktopHome extends Component {
|
|
else if (item.kind.indexOf('电流') > -1) {
|
|
else if (item.kind.indexOf('电流') > -1) {
|
|
return this.dianLiuRender(item, index)
|
|
return this.dianLiuRender(item, index)
|
|
}
|
|
}
|
|
|
|
+ else if (item.kind.indexOf('计量箱装置') > -1) {
|
|
|
|
+ return this.jiliangRender(item, index)
|
|
|
|
+ }
|
|
else {
|
|
else {
|
|
// 组合互感器,没有设置,默认用电压模板
|
|
// 组合互感器,没有设置,默认用电压模板
|
|
if (zuhe_temp === '2') {
|
|
if (zuhe_temp === '2') {
|
|
@@ -353,7 +410,7 @@ class DesktopHome extends Component {
|
|
const styles = StyleSheet.create({
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
container: {
|
|
flex: 1,
|
|
flex: 1,
|
|
- backgroundColor:'#fff'
|
|
|
|
|
|
+ backgroundColor: '#fff'
|
|
},
|
|
},
|
|
button: {
|
|
button: {
|
|
borderRadius: 5,
|
|
borderRadius: 5,
|
|
@@ -371,13 +428,11 @@ const styles = StyleSheet.create({
|
|
color: '#333',
|
|
color: '#333',
|
|
textAlign: 'center',
|
|
textAlign: 'center',
|
|
width: (screenW - 9) / 3,
|
|
width: (screenW - 9) / 3,
|
|
-
|
|
|
|
},
|
|
},
|
|
textColor4: {
|
|
textColor4: {
|
|
color: '#333',
|
|
color: '#333',
|
|
textAlign: 'center',
|
|
textAlign: 'center',
|
|
width: (screenW - 8) / 4,
|
|
width: (screenW - 8) / 4,
|
|
-
|
|
|
|
},
|
|
},
|
|
textColor2: {
|
|
textColor2: {
|
|
color: '#333',
|
|
color: '#333',
|
|
@@ -413,6 +468,24 @@ const styles = StyleSheet.create({
|
|
alignItems: 'center',
|
|
alignItems: 'center',
|
|
flexDirection: 'row',
|
|
flexDirection: 'row',
|
|
},
|
|
},
|
|
|
|
+ textColor31: {
|
|
|
|
+ fontWeight: "bold",
|
|
|
|
+ color: '#333',
|
|
|
|
+ textAlign: 'center',
|
|
|
|
+ width: (screenW - 9) * 0.25,
|
|
|
|
+ },
|
|
|
|
+ JLModel: {
|
|
|
|
+ fontWeight: "bold",
|
|
|
|
+ borderWidth: 1,
|
|
|
|
+ borderLeftColor: '#7b7b7b',
|
|
|
|
+ color: '#333',
|
|
|
|
+ textAlign: 'center',
|
|
|
|
+ width: (screenW - 9) * 0.40,
|
|
|
|
+ },
|
|
|
|
+ JLView: {
|
|
|
|
+ flexDirection: 'row',
|
|
|
|
+ marginBottom: 5
|
|
|
|
+ },
|
|
})
|
|
})
|
|
|
|
|
|
export default DesktopHome;
|
|
export default DesktopHome;
|