浏览代码

显示本类别 设置,组合模板

wushaodong 3 年之前
父节点
当前提交
431c63be73

+ 3 - 1
android/app/src/main/java/com/zzliaoyuan/power_sensor/fragment/UHFReadTagFragment.java

@@ -63,6 +63,8 @@ public class UHFReadTagFragment {
         // wsdd 单步读取的数据
         // wsdd 单步读取的数据
         UHFTAGInfo strUII = mContext.mReader.inventorySingleTag();
         UHFTAGInfo strUII = mContext.mReader.inventorySingleTag();
         if (strUII != null) {
         if (strUII != null) {
+//            String strTid = "E28011052000715CA32D0A1C"; //strUII.getTid();
+//            String strUser = "2F83FE1758F601C6E70BECF1DCCC491866D30D5D5178FA48CFD18A87A7709D42A5EC8599882C8EDF3E3D6DA0E6EB1FE0"; //strUII.getUser();
             String strTid = strUII.getTid();
             String strTid = strUII.getTid();
             String strUser = strUII.getUser();
             String strUser = strUII.getUser();
             if (strUser != null && strTid != null) {
             if (strUser != null && strTid != null) {
@@ -73,7 +75,7 @@ public class UHFReadTagFragment {
                 if (strUser.length() == 96 && product != null) {
                 if (strUser.length() == 96 && product != null) {
 
 
                     Data += ",\"error\":0"; // 错误提示
                     Data += ",\"error\":0"; // 错误提示
-                    Data += ",\"assetID\":\"" + product.assetID + "\""; // 资产编号
+                    Data += ",\"assetID\":\"" + product.assetID.trim()  + "\""; // 资产编号
                     Data += ",\"model\":\"" + product.model + "\""; // 型号
                     Data += ",\"model\":\"" + product.model + "\""; // 型号
                     Data += ",\"manufacturer\":\"" + product.manufacturer + "\""; // 生产厂家
                     Data += ",\"manufacturer\":\"" + product.manufacturer + "\""; // 生产厂家
                     Data += ",\"kind\":\"" + product.kind + "\""; // 产品类型
                     Data += ",\"kind\":\"" + product.kind + "\""; // 产品类型

二进制
android/app/src/main/jniLibs/arm64-v8a/libcore.so


二进制
android/app/src/main/jniLibs/arm64-v8a/libcorewrapper.so


二进制
android/app/src/main/jniLibs/armeabi-v7a/libcore.so


二进制
android/app/src/main/jniLibs/armeabi-v7a/libcorewrapper.so


二进制
android/app/src/main/jniLibs/corewrapper.aar


二进制
android/app/src/main/jniLibs/cw-deviceapi20191022.jar


二进制
android/app/src/main/jniLibs/x86/libcore.so


二进制
android/app/src/main/jniLibs/x86/libcorewrapper.so


二进制
assets/images/selt.png


二进制
assets/images/selted.png


二进制
assets/images/seltnone.png


+ 7 - 0
jscore/components/ComponentsStyles.js

@@ -142,6 +142,13 @@ export const ComponentsStyles = StyleSheet.create({
         // color: '#fff',
         // color: '#fff',
         backgroundColor: "#2b90ea"
         backgroundColor: "#2b90ea"
     },
     },
+    radioStyle: {
+        flex: 1,
+        flexDirection: 'row',
+        justifyContent: 'flex-end',
+        backgroundColor: '#ffffff',
+        marginVertical: 5
+    },
     iconYellow: {
     iconYellow: {
         padding: 2,
         padding: 2,
         borderRadius: 2,
         borderRadius: 2,

+ 286 - 0
jscore/components/RadioModal.js

@@ -0,0 +1,286 @@
+/**
+ * Created by zcy on 2017/4/6.
+ */
+import React, {Component} from 'react'
+import {
+    View,
+    StyleSheet,
+    TouchableHighlight,
+    Text,
+    Image,
+    Dimensions,
+} from 'react-native'
+// var Dimensions = require('Dimensions');
+var width = Dimensions.get('window').width;
+var height = Dimensions.get('window').height;
+class RadioModal extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            clicked: true,
+            radioInit: this.props.radioInit,
+            indexa: this.props.selectedValue === undefined ? '0' : this.props.selectedValue,
+        }
+    }
+
+    click(id, item, notes) {
+        this.setState({indexa: id})
+        this.props.onValueChange(id, item, notes)
+    }
+
+    componentDidMount() {
+        const indexInit = this.props.selectedValue === undefined ? '0' : this.props.selectedValue;
+        this.setState({
+            indexa: indexInit
+        })
+        //this.props.onValueChange(indexInit)
+    }
+
+    createInner(child, index, props) {
+        const disabled = props ? child[this.props.options.disabled] : child.props.disabled;
+        const childC = props ? child[this.props.options.value] : child.props.children;
+        const values = props ? child[this.props.options.id] : child.props.value;
+        const notes = props ? child[this.props.options.note] : child.props.note;
+        const hightlight = props ? this.state.indexa === child[this.props.options.id] : this.state.indexa === child.props.value;
+        return <Raio2
+            child={childC}
+            index={index}
+            value={values}
+            notes={notes}
+            key={index}
+            initStyle={this.props.innerStyle}
+            txtColor={this.props.txtColor}
+            noneColor={this.props.noneColor}
+            onclick={this.click.bind(this)}
+            hightlight={hightlight}
+            disabled={disabled}
+            seledImg={this.props.seledImg}
+            selImg={this.props.selImg}
+            selnoneImg={this.props.selnoneImg}
+        />
+    }
+
+    render() {
+        const that = this;
+        return (
+            <View {...this.props.style}>
+                {
+                    !this.props.dataOption && React.Children.map(this.props.children, (child, index) => this.createInner(child, index))
+                }
+                {
+                    this.props.dataOption && this.props.dataOption.map((item, index) => this.createInner(item, index, true))
+                }
+            </View>
+        )
+    }
+}
+
+class Raio2 extends Component {
+    constructor(props) {
+        super(props);
+    }
+
+    click(id, item, notes) {
+        if (this.props.disabled) {
+            return
+        } else {
+            this.props.onclick(id, item, notes);
+        }
+    }
+
+    render() {
+        const imgUrl = this.props.hightlight ? this.props.seledImg || require('../../assets/images/selted.png') : this.props.selImg || require('../../assets/images/selt.png');
+        const imgUrlNone = this.props.selnoneImg || require('../../assets/images/seltnone.png');
+        return (
+            <TouchableHighlight
+                underlayColor='transparent'
+                style={[{marginRight: 15, width: (width - 80) / 2, height: 24}, this.props.initStyle]}
+                onPress={this.click.bind(this, this.props.value, this.props.child, this.props.notes)}>
+                <View style={{flex: 1, flexDirection: 'row', alignItems: 'center'}}>
+                    {this.props.disabled && !this.props.hightlight &&
+                    <Image source={imgUrlNone} style={{width: 14, height: 14, marginRight: 7}}/>}
+                    {this.props.disabled && this.props.hightlight &&
+                    <Image source={imgUrl} style={{width: 14, height: 14, marginRight: 7}}/>}
+                    {!this.props.disabled && <Image source={imgUrl} style={{width: 14, height: 14, marginRight: 7}}/>}
+                    <Text
+                        style={{color: this.props.disabled ? this.props.noneColor || '#dfdfdf' : this.props.txtColor || '#414141'}}>{this.props.child}</Text>
+                </View>
+            </TouchableHighlight>
+        )
+    }
+}
+
+const styles = StyleSheet.create({
+    titleCom: {
+        marginBottom: 5,
+    },
+    seltedImgs: {
+        width: 14,
+        height: 14,
+        marginRight: 8,
+    },
+    emailH: {
+        height: 28,
+        textAlignVertical: 'center',
+        marginRight: 10,
+        color: '#141414',
+        fontSize: 12,
+    },
+    inputs: {
+        width: width * 0.5,
+        borderWidth: 1,
+        borderColor: '#dfdfdf',
+        borderRadius: 3,
+        height: 28,
+        padding: 0,
+        paddingLeft: 5,
+        paddingRight: 5,
+        marginBottom: 10,
+        fontSize: 12,
+    },
+    closeBtns: {
+        position: 'absolute',
+        width: 14,
+        height: 14,
+        right: 10,
+        top: 7,
+    },
+    headLog: {
+        backgroundColor: '#e6454a',
+        color: '#ffffff',
+        height: 28,
+        textAlignVertical: 'center',
+        textAlign: 'center'
+    },
+    border1: {
+        borderWidth: 1,
+        borderColor: '#dfdfdf',
+    },
+    borderR: {
+        borderRightWidth: 1,
+        borderRightColor: '#dfdfdf',
+    },
+    borderL: {
+        borderLeftWidth: 1,
+        borderLeftColor: '#dfdfdf',
+    },
+    eleMess: {
+        paddingLeft: 10,
+        paddingRight: 10,
+        height: 24,
+        fontSize: 12,
+        color: '#ffffff',
+        backgroundColor: '#f8cb43',
+        borderRadius: 3,
+        textAlignVertical: 'center',
+        textAlign: 'center',
+        width: 80,
+    },
+    electronicTip: {
+        width: (width - 40) / 5,
+        flexDirection: 'row',
+        justifyContent: 'center',
+        paddingTop: 10,
+        paddingBottom: 10,
+    },
+    lineRow: {
+        backgroundColor: '#ffffff',
+        borderRadius: 3,
+        flexDirection: 'row',
+        flex: 1,
+        marginBottom: 15,
+        padding: 10,
+        alignItems: 'center',
+        justifyContent: 'space-between',
+        flexWrap: 'wrap',
+
+    },
+    lineRowB: {
+        backgroundColor: '#ffffff',
+        borderRadius: 3,
+        flexDirection: 'row',
+        flex: 1,
+        marginBottom: 15,
+        paddingLeft: 10,
+        paddingRight: 10,
+        alignItems: 'center',
+    },
+    inner3: {
+        width: (width - 40) / 3,
+        fontSize: 12,
+        color: '#141414'
+    },
+    innerS: {
+        flexDirection: 'row',
+        flex: 1,
+        fontSize: 12,
+        color: '#141414'
+    },
+    flex1: {
+        flex: 1
+    },
+    flexRow: {
+
+        flexDirection: 'row',
+    },
+    flexVer: {
+        flexDirection: 'column',
+    },
+    Jcenter: {
+        justifyContent: 'center',
+    },
+    Acenter: {
+        alignItems: 'center',
+    },
+    BE: {
+        justifyContent: 'space-between'
+    },
+    Textcenter: {
+        textAlign: 'center',
+    },
+    TextCenterVer: {
+        textAlignVertical: 'center',
+    },
+    backCGray: {
+        backgroundColor: '#dfdfdf'
+    },
+    backWhite: {
+        backgroundColor: '#ffffff',
+    },
+    borderRadius5: {
+        borderRadius: 5,
+    },
+    borderRadius3: {
+        borderRadius: 3,
+    },
+    horLine: {
+        flexDirection: 'row',
+        flex: 1,
+        flexWrap: 'wrap',
+        alignItems: 'flex-start',
+        marginBottom: 10,
+    },
+    paddlr10: {
+        paddingLeft: 10,
+        paddingRight: 10,
+    },
+    marginB10: {
+        marginBottom: 10,
+    },
+    colorRed: {
+        color: '#b40e12',
+    },
+    colorBlack: {
+        color: '#141414',
+    },
+    colorYellow: {
+        color: '#f8cb43',
+    },
+    color999: {
+        color: '#999999',
+    },
+    colorWhite: {
+        color: '#ffffff',
+    },
+})
+export  default  RadioModal

+ 9 - 0
jscore/pages/Desktop/Home.js

@@ -285,6 +285,7 @@ class DesktopHome extends Component {
     render() {
     render() {
         let {isStart} = this.state;
         let {isStart} = this.state;
         const start_text = isStart ? '开始识别' : '停止识别'
         const start_text = isStart ? '开始识别' : '停止识别'
+        const show_type = SyncStorage.get('zuhe_temp')
         return (
         return (
             <View style={styles.container}>
             <View style={styles.container}>
                 <ScrollView style={styles.container}>
                 <ScrollView style={styles.container}>
@@ -299,6 +300,14 @@ 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(show_type === '2'){
+                                    return this.dianLiuRender(item, index)
+                                } else {
+                                    return this.dianYaRender(item, index)
+                                }
+                            }
 
 
                         })
                         })
                     }
                     }

+ 23 - 1
jscore/pages/Desktop/setPower.js

@@ -3,15 +3,20 @@ import {Text, TouchableOpacity, View, TextInput, StyleSheet} from 'react-native'
 import {Button, Slider, Provider, Toast,} from "@ant-design/react-native";
 import {Button, Slider, Provider, Toast,} from "@ant-design/react-native";
 import ReadUHF from "../../utils/ReadUHF";
 import ReadUHF from "../../utils/ReadUHF";
 import SyncStorage from "sync-storage";
 import SyncStorage from "sync-storage";
+import ComponentsStyles from "../../components/ComponentsStyles";
+import RadioModal from "../../components/RadioModal";
 
 
 class setPower extends Component {
 class setPower extends Component {
     constructor(props) {
     constructor(props) {
         super(props);
         super(props);
+        let zuhe_temp = SyncStorage.get('zuhe_temp')
+        zuhe_temp = zuhe_temp ? zuhe_temp.toString() : '1'
         this.state = {
         this.state = {
             power: 30,
             power: 30,
             no_begin: '8',
             no_begin: '8',
             no_length: '14',
             no_length: '14',
             show_type: true,
             show_type: true,
+            zuhe_temp: zuhe_temp,
         };
         };
     }
     }
 
 
@@ -34,7 +39,7 @@ class setPower extends Component {
         this.setState({show_type: !this.state.show_type})
         this.setState({show_type: !this.state.show_type})
     }
     }
     _savePower = () => {
     _savePower = () => {
-        let {no_begin, no_length, show_type} = this.state;
+        let {no_begin, no_length, show_type, zuhe_temp} = this.state;
         no_begin = parseInt(no_begin)
         no_begin = parseInt(no_begin)
         no_length = parseInt(no_length)
         no_length = parseInt(no_length)
 
 
@@ -54,6 +59,7 @@ class setPower extends Component {
         SyncStorage.set('no_begin', no_begin.toString())
         SyncStorage.set('no_begin', no_begin.toString())
         SyncStorage.set('no_length', no_length.toString())
         SyncStorage.set('no_length', no_length.toString())
         SyncStorage.set('show_type', show_type)
         SyncStorage.set('show_type', show_type)
+        SyncStorage.set('zuhe_temp', zuhe_temp)
         ReadUHF.setPower(this.state.power)
         ReadUHF.setPower(this.state.power)
         this.props.navigation.goBack();
         this.props.navigation.goBack();
     }
     }
@@ -117,6 +123,22 @@ class setPower extends Component {
                             }<Text style={styles.font14}> 只显示本类别芯片</Text>
                             }<Text style={styles.font14}> 只显示本类别芯片</Text>
                         </TouchableOpacity>
                         </TouchableOpacity>
                     </View>
                     </View>
+                    <View style={{marginTop: 10, flexDirection:'row'}}>
+                        <View style={styles.titleCenter}>
+                            <Text style={styles.font14}>组合互感器模板:</Text>
+                        </View>
+                        <RadioModal
+                            selectedValue={this.state.zuhe_temp}
+                            onValueChange={id => this.setState({zuhe_temp: id})}
+                            style={ComponentsStyles.radioStyle}
+                            innerStyle={{
+                                width: 80,
+                            }}
+                        >
+                            <Text value="1">电压模板</Text>
+                            <Text value="2">电流模板</Text>
+                        </RadioModal>
+                    </View>
                     <Button onPress={() => this._savePower()}
                     <Button onPress={() => this._savePower()}
                             type="primary"
                             type="primary"
                             style={{
                             style={{