-
-
-
-
+
-
-
@@ -122,16 +145,33 @@
var carListener = null;
var pageListener = null;
+ var fixListener = null;
+ var weiListener = null;
var userPicker;
var pagePicker;
+ var fixPicker;
+ var weiPicker;
var pickData = [];
var btnArray = ['取消', '
确认'];
var pageData = []
+ var fixData = []
+ var weiData = []
+ fixData.push({value: 0, text: "需要"})
+ fixData.push({value: 1, text: "不需要"})
+
pageData.push({value: "index", text: "首页"})
pageData.push({value: "index1", text: "装料页面"})
pageData.push({value: "collection", text: "剩料收集页面"})
pageData.push({value: "config", text: "设置页面"})
+ weiData.push({value: "20", text: "20"})
+ weiData.push({value: "30", text: "30"})
+ weiData.push({value: "40", text: "40"})
+ weiData.push({value: "50", text: "50"})
+ weiData.push({value: "60", text: "60"})
+ weiData.push({value: "70", text: "70"})
+ weiData.push({value: "80", text: "80"})
+
function init() {
}
@@ -139,6 +179,8 @@
initSbList()
init()
muiInitPage()
+ muiInitFix()
+ muiInitWeightSize()
var indexPage = api.getPrefs({
sync: true,
key: 'initpage'
@@ -227,6 +269,9 @@
userPicker.show(function (items) {
console.log('设备切换');
showUserPickerButton.innerHTML = items[0].text;
+ if (items[0].text){
+ initsb()
+ }
});
}, false);
}
@@ -255,9 +300,11 @@
pageListener = null;
pageListener = showPagePickerButton.addEventListener('tap', function (event) {
pagePicker.show(function (items) {
- console.log('设备切换');
document.getElementById('indexPage').value = items[0].value;
showPagePickerButton.innerHTML = items[0].text;
+ if (items[0].text){
+ initpage()
+ }
});
}, false);
}
@@ -266,6 +313,71 @@
})(mui, document);
}
+ function muiInitFix() {
+ (function ($, doc) {
+ $.init();
+ $.ready(function () {
+ /**
+ * 获取对象属性的值
+ * 主要用于过滤三级联动中,可能出现的最低级的数据不存在的情况,实际开发中需要注意这一点;
+ * @param {Object} obj 对象
+ * @param {String} param 属性名
+ */
+ var _getParam = function _getParam(obj, param) {
+ return obj[param] || '';
+ };
+ if (fixPicker) {
+ } else {
+ fixPicker = new $.PopPicker();
+ var showFixPickerButton = doc.getElementById('fixbeforeload');
+ fixListener = null;
+ fixListener = showFixPickerButton.addEventListener('tap', function (event) {
+ fixPicker.show(function (items) {
+ document.getElementById('isfix').value = items[0].value;
+ showFixPickerButton.innerHTML = items[0].text;
+ if (items[0].text){
+ fixbeforeload()
+ }
+ });
+ }, false);
+ }
+ fixPicker.setData(fixData);
+ });
+ })(mui, document);
+ }
+
+ function muiInitWeightSize() {
+ (function ($, doc) {
+ $.init();
+ $.ready(function () {
+ /**
+ * 获取对象属性的值
+ * 主要用于过滤三级联动中,可能出现的最低级的数据不存在的情况,实际开发中需要注意这一点;
+ * @param {Object} obj 对象
+ * @param {String} param 属性名
+ */
+ var _getParam = function _getParam(obj, param) {
+ return obj[param] || '';
+ };
+ if (weiPicker) {
+ } else {
+ weiPicker = new $.PopPicker();
+ var showWeiPickerButton = doc.getElementById('weightSize');
+ weiListener = null;
+ weiListener = showWeiPickerButton.addEventListener('tap', function (event) {
+ weiPicker.show(function (items) {
+ showWeiPickerButton.innerHTML = items[0].text;
+ if (items[0].text){
+ weightSizeSave()
+ }
+ });
+ }, false);
+ }
+ weiPicker.setData(weiData);
+ });
+ })(mui, document);
+ }
+
function initsb() {
// var value = document.getElementById('initsb').value;
var value = document.getElementById('initsb').innerHTML
@@ -291,7 +403,7 @@
}
function weightSizeSave(){
- var value = document.getElementById('weightSize').value;
+ var value = document.getElementById('weightSize').innerHTML;
if (value) {
api.setPrefs({
key: 'weightSize',
@@ -300,6 +412,17 @@
mui.alert('自动跳转数据包"' + value + '"成功');
}
}
+ function fixbeforeload(){
+ var value = document.getElementById('isfix').value;
+ if (value) {
+ api.setPrefs({
+ key: 'fixbeforeload',
+ value: value
+ });
+ var name = document.getElementById('fixbeforeload').innerHTML;
+ mui.alert('装料前校准"' + name + '"设置成功');
+ }
+ }