whychdw
2019-10-21 3166d9a20a13532fcaab5576e8f678df9dbccfb7
修改切换电池组
6个文件已修改
92 ■■■■ 已修改文件
platforms/android/app/src/main/assets/www/js/componets.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/pages/batttest/batttest.html 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/pages/batttest/batttest.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/js/componets.js 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/pages/batttest/batttest.html 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
www/pages/batttest/batttest.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
platforms/android/app/src/main/assets/www/js/componets.js
@@ -66,9 +66,12 @@
        },
        handlerClick: function(item) {
            // 设置被激活的列表
            this.name = item.fileName;
            // 给列表添加点击事件
            this.$emit('on-click', item);
            if(this.name != item.fileName) {
                this.name = item.fileName;
                // 给列表添加点击事件
                this.$emit('on-click', item);
            }
        }
    },
});
platforms/android/app/src/main/assets/www/pages/batttest/batttest.html
@@ -330,7 +330,10 @@
        </main>
        <footer>
            <div class="footer-inner" style="height: 50px; padding: 8px; text-align: right;">
                <i-button type="info" icon="ios-lock" disabled>保存</i-button>
                <i-button
                type="info"
                icon="ios-lock"
                :disabled="saveState.isDisabled">保存</i-button>
                <i-button type="info" @click="routerTo">进入测试</i-button>
            </div>
        </footer>
platforms/android/app/src/main/assets/www/pages/batttest/batttest.js
@@ -78,8 +78,24 @@
                    cycleTimes: 0,         // 活化次数
                    waitdisTime: 0,        // 充完静置
                    waitchrTime: 0,        // 放完静置
                },
                saveState: {
                    isDisabled: true,
                    isNew: true,
                }
            },
            watch: {
                testParams: {        // 监控测试数据修改保存按钮的状态
                    handler: function() {
                        if(this.saveState.isNew) {
                            this.saveState.isNew = false;
                        }else {
                            this.saveState.isDisabled = false;
                        }
                    },
                    deep: true,
                }
            },
            methods: {
                setPages: function() {
                    var params = this.params;
@@ -128,6 +144,9 @@
                },
                getTestParam: function() {
                    if(typeof(JSInterface) != 'undefined') {
                        // 修改保存按钮的状态
                        this.saveState.isNew = true;
                        this.saveState.isDisabled = true;
                        JSInterface.getTestParam();
                    }else {
                        // bui.alert('请使用手机端登陆!');
@@ -154,8 +173,14 @@
                },
                changeBatt: function(item) {
                    var battName = item.fileName;
                    bui.alert(battName);
                    // 关闭面板
                    this.uiSidebar.close();
                    if(typeof(JSInterface) != 'undefined') {
                        // 显示等待框
                        this.loading.show();
                        // 与后台通信
                        JSInterface.changeBatt(battName);
                    }else {
                        bui.alert("请使用手机端登陆!");
@@ -229,6 +254,9 @@
                
                // 设置Worker线程监控
                this.getTestParamWorker.onmessage = function(res) {
                    // 关闭等待框
                    self.loading.hide();
                    // 数据读取成功
                    if(res.data.code == 1) {
                        var data = res.data.data;
                        self.setActive(data.battName);
@@ -259,7 +287,7 @@
                // 切换电池参数
                this.changeBattWorker.onmessage = function(res) {
                    bui.alert(res.data);
                    self.getTestParam();
                }
                // 设置高度
                //this.setTabPaneHt();
www/js/componets.js
@@ -66,9 +66,12 @@
        },
        handlerClick: function(item) {
            // 设置被激活的列表
            this.name = item.fileName;
            // 给列表添加点击事件
            this.$emit('on-click', item);
            if(this.name != item.fileName) {
                this.name = item.fileName;
                // 给列表添加点击事件
                this.$emit('on-click', item);
            }
        }
    },
});
www/pages/batttest/batttest.html
@@ -330,7 +330,10 @@
        </main>
        <footer>
            <div class="footer-inner" style="height: 50px; padding: 8px; text-align: right;">
                <i-button type="info" icon="ios-lock" disabled>保存</i-button>
                <i-button
                type="info"
                icon="ios-lock"
                :disabled="saveState.isDisabled">保存</i-button>
                <i-button type="info" @click="routerTo">进入测试</i-button>
            </div>
        </footer>
www/pages/batttest/batttest.js
@@ -78,8 +78,24 @@
                    cycleTimes: 0,         // 活化次数
                    waitdisTime: 0,        // 充完静置
                    waitchrTime: 0,        // 放完静置
                },
                saveState: {
                    isDisabled: true,
                    isNew: true,
                }
            },
            watch: {
                testParams: {        // 监控测试数据修改保存按钮的状态
                    handler: function() {
                        if(this.saveState.isNew) {
                            this.saveState.isNew = false;
                        }else {
                            this.saveState.isDisabled = false;
                        }
                    },
                    deep: true,
                }
            },
            methods: {
                setPages: function() {
                    var params = this.params;
@@ -128,6 +144,9 @@
                },
                getTestParam: function() {
                    if(typeof(JSInterface) != 'undefined') {
                        // 修改保存按钮的状态
                        this.saveState.isNew = true;
                        this.saveState.isDisabled = true;
                        JSInterface.getTestParam();
                    }else {
                        // bui.alert('请使用手机端登陆!');
@@ -154,8 +173,14 @@
                },
                changeBatt: function(item) {
                    var battName = item.fileName;
                    bui.alert(battName);
                    // 关闭面板
                    this.uiSidebar.close();
                    if(typeof(JSInterface) != 'undefined') {
                        // 显示等待框
                        this.loading.show();
                        // 与后台通信
                        JSInterface.changeBatt(battName);
                    }else {
                        bui.alert("请使用手机端登陆!");
@@ -229,6 +254,9 @@
                
                // 设置Worker线程监控
                this.getTestParamWorker.onmessage = function(res) {
                    // 关闭等待框
                    self.loading.hide();
                    // 数据读取成功
                    if(res.data.code == 1) {
                        var data = res.data.data;
                        self.setActive(data.battName);
@@ -259,7 +287,7 @@
                // 切换电池参数
                this.changeBattWorker.onmessage = function(res) {
                    bui.alert(res.data);
                    self.getTestParam();
                }
                // 设置高度
                //this.setTabPaneHt();