| | |
| | | vm: ''
|
| | | },
|
| | | loaded: function loaded(require, exports, module) {
|
| | | // 设置页面中的Worker线程(需要再workers.js先定义)
|
| | | setIpWorker = new Worker('worker/data.worker.js');
|
| | | getIpWorker = new Worker('worker/data.worker.js');
|
| | | // 引入vue
|
| | | this.vm = new Vue({
|
| | | el: getPageRoot(module),
|
| | | data: {
|
| | | number: 1234,
|
| | | ip: '127.0.0.1',
|
| | | setIpWorker: setIpWorker,
|
| | | getIpWorker: getIpWorker,
|
| | | },
|
| | | methods: {
|
| | | routerTo: function routerTo(path) {
|
| | |
| | | name: path
|
| | | }
|
| | | });
|
| | | },
|
| | | getIp: function() {
|
| | | if(typeof(JSInterface) != 'undefined') {
|
| | | JSInterface.obtainDeviceIp();
|
| | | }else {
|
| | | bui.alert({"code": "1", "cmd": "0"});
|
| | | }
|
| | | },
|
| | | setIp: function() {
|
| | | if(typeof(JSInterface) != 'undefined') {
|
| | | JSInterface.setUpDeviceIp(this.ip);
|
| | | }else {
|
| | | bui.alert('请使用手机端登陆!');
|
| | | }
|
| | | },
|
| | | startScan: function() {
|
| | | if(typeof(plus) != 'undefined') {
|
| | |
| | | }
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | // 设置Ip监听
|
| | | this.setIpWorker.onmessage = function(res) {
|
| | | bui.alert(res.data);
|
| | | };
|
| | |
|
| | | // 获取Ip监听
|
| | | this.getIpWorker.onmessage = function(res) {
|
| | | bui.alert(res.data);
|
| | | };
|
| | | },
|
| | | destroyed: function destroyed() {
|
| | | // 关闭获取IP的worker线程
|
| | | this.getIpWorker.terminate();
|
| | | // 关闭设置IP的worker线程
|
| | | this.setIpWorker.terminate();
|
| | | // 关闭测试Ip的worker线程
|
| | | this.testIpWorker.terminate();
|
| | |
|
| | | }
|
| | | mounted() {},
|
| | | destroyed: function destroyed() {}
|
| | | });
|
| | | },
|
| | | destroyed: function destroyed() {
|
| | |
| | | @click="testIp"
|
| | | type="success"
|
| | | style="margin-right: 16px;">测试链接</i-button>
|
| | | <i-button type="primary">进入系统</i-button>
|
| | | <i-button |
| | | type="primary"
|
| | | @click="setIp"
|
| | | :disabled="states">进入系统</i-button>
|
| | | </div>
|
| | | </div>
|
| | | <div class="bui-box" style="margin-top: 8px">
|
| | |
| | | loaded: function loaded(require, exports, module) { |
| | | // 设置页面中的Worker线程(需要再workers.js先定义) |
| | | testIpWorker = new Worker('worker/data.worker.js'); |
| | | getIpWorker = new Worker('worker/data.worker.js'); |
| | | // 引入vue |
| | | this.vm = new Vue({ |
| | | el: getPageRoot(module), |
| | | data: { |
| | | loading: bui.loading(), |
| | | ip: '127.0.0.1', |
| | | states: true, |
| | | getIpWorker: getIpWorker, |
| | | testIpWorker: testIpWorker, |
| | | }, |
| | | watch: { |
| | | ip: function(val) { |
| | | this.states = true; |
| | | } |
| | | }, |
| | | methods: { |
| | | enterIndex: function() { |
| | |
| | | this.close(); |
| | | }); |
| | | }, |
| | | getIp: function() { |
| | | if(typeof(JSInterface) != 'undefined') { |
| | | JSInterface.obtainDeviceIp(); |
| | | } |
| | | }, |
| | | setIp: function() { |
| | | var self = this; |
| | | if(typeof(JSInterface) != 'undefined') { |
| | | JSInterface.setUpDeviceIp(this.ip); |
| | | self.enterIndex(); |
| | | }else { |
| | | bui.alert('请使用手机端登陆!'); |
| | | } |
| | | }, |
| | | testIp: function() { |
| | | var self = this; |
| | | if(typeof(JSInterface) != 'undefined') { |
| | |
| | | }, |
| | | mounted() { |
| | | var self = this; |
| | | this.getIp(); |
| | | // 获取Ip监听 |
| | | this.getIpWorker.onmessage = function(res) { |
| | | if(res.data.code == 1) { |
| | | self.ip = res.data.data; |
| | | } |
| | | }; |
| | | |
| | | // 测试Ip |
| | | this.testIpWorker.onmessage = function(res) { |
| | | // 关闭等待框 |
| | | self.loading.hide(); |
| | | bui.alert(res.data); |
| | | |
| | | if(res.data.code == 1) { |
| | | self.states = false; |
| | | }else { |
| | | bui.alert('测试连接失败!'); |
| | | } |
| | | } |
| | | }, |
| | | destroyed: function destroyed() { |
| | |
| | | vm: ''
|
| | | },
|
| | | loaded: function loaded(require, exports, module) {
|
| | | // 设置页面中的Worker线程(需要再workers.js先定义)
|
| | | setIpWorker = new Worker('worker/data.worker.js');
|
| | | getIpWorker = new Worker('worker/data.worker.js');
|
| | | // 引入vue
|
| | | this.vm = new Vue({
|
| | | el: getPageRoot(module),
|
| | | data: {
|
| | | number: 1234,
|
| | | ip: '127.0.0.1',
|
| | | setIpWorker: setIpWorker,
|
| | | getIpWorker: getIpWorker,
|
| | | },
|
| | | methods: {
|
| | | routerTo: function routerTo(path) {
|
| | |
| | | name: path
|
| | | }
|
| | | });
|
| | | },
|
| | | getIp: function() {
|
| | | if(typeof(JSInterface) != 'undefined') {
|
| | | JSInterface.obtainDeviceIp();
|
| | | }else {
|
| | | bui.alert({"code": "1", "cmd": "0"});
|
| | | }
|
| | | },
|
| | | setIp: function() {
|
| | | if(typeof(JSInterface) != 'undefined') {
|
| | | JSInterface.setUpDeviceIp(this.ip);
|
| | | }else {
|
| | | bui.alert('请使用手机端登陆!');
|
| | | }
|
| | | },
|
| | | startScan: function() {
|
| | | if(typeof(plus) != 'undefined') {
|
| | |
| | | }
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | // 设置Ip监听
|
| | | this.setIpWorker.onmessage = function(res) {
|
| | | bui.alert(res.data);
|
| | | };
|
| | |
|
| | | // 获取Ip监听
|
| | | this.getIpWorker.onmessage = function(res) {
|
| | | bui.alert(res.data);
|
| | | };
|
| | | },
|
| | | destroyed: function destroyed() {
|
| | | // 关闭获取IP的worker线程
|
| | | this.getIpWorker.terminate();
|
| | | // 关闭设置IP的worker线程
|
| | | this.setIpWorker.terminate();
|
| | | // 关闭测试Ip的worker线程
|
| | | this.testIpWorker.terminate();
|
| | |
|
| | | }
|
| | | mounted() {},
|
| | | destroyed: function destroyed() {}
|
| | | });
|
| | | },
|
| | | destroyed: function destroyed() {
|
| | |
| | | @click="testIp"
|
| | | type="success"
|
| | | style="margin-right: 16px;">测试链接</i-button>
|
| | | <i-button type="primary">进入系统</i-button>
|
| | | <i-button |
| | | type="primary"
|
| | | @click="setIp"
|
| | | :disabled="states">进入系统</i-button>
|
| | | </div>
|
| | | </div>
|
| | | <div class="bui-box" style="margin-top: 8px">
|
| | |
| | | loaded: function loaded(require, exports, module) { |
| | | // 设置页面中的Worker线程(需要再workers.js先定义) |
| | | testIpWorker = new Worker('worker/data.worker.js'); |
| | | getIpWorker = new Worker('worker/data.worker.js'); |
| | | // 引入vue |
| | | this.vm = new Vue({ |
| | | el: getPageRoot(module), |
| | | data: { |
| | | loading: bui.loading(), |
| | | ip: '127.0.0.1', |
| | | states: true, |
| | | getIpWorker: getIpWorker, |
| | | testIpWorker: testIpWorker, |
| | | }, |
| | | watch: { |
| | | ip: function(val) { |
| | | this.states = true; |
| | | } |
| | | }, |
| | | methods: { |
| | | enterIndex: function() { |
| | |
| | | this.close(); |
| | | }); |
| | | }, |
| | | getIp: function() { |
| | | if(typeof(JSInterface) != 'undefined') { |
| | | JSInterface.obtainDeviceIp(); |
| | | } |
| | | }, |
| | | setIp: function() { |
| | | var self = this; |
| | | if(typeof(JSInterface) != 'undefined') { |
| | | JSInterface.setUpDeviceIp(this.ip); |
| | | self.enterIndex(); |
| | | }else { |
| | | bui.alert('请使用手机端登陆!'); |
| | | } |
| | | }, |
| | | testIp: function() { |
| | | var self = this; |
| | | if(typeof(JSInterface) != 'undefined') { |
| | |
| | | }, |
| | | mounted() { |
| | | var self = this; |
| | | this.getIp(); |
| | | // 获取Ip监听 |
| | | this.getIpWorker.onmessage = function(res) { |
| | | if(res.data.code == 1) { |
| | | self.ip = res.data.data; |
| | | } |
| | | }; |
| | | |
| | | // 测试Ip |
| | | this.testIpWorker.onmessage = function(res) { |
| | | // 关闭等待框 |
| | | self.loading.hide(); |
| | | bui.alert(res.data); |
| | | |
| | | if(res.data.code == 1) { |
| | | self.states = false; |
| | | }else { |
| | | bui.alert('测试连接失败!'); |
| | | } |
| | | } |
| | | }, |
| | | destroyed: function destroyed() { |