| | |
| | | //console.log(e.target) |
| | | getApp().onScan((result) => { |
| | | console.log(result); |
| | | this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value =result; |
| | | this.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value = result; |
| | | uni.hideKeyboard(); |
| | | this.onevent($ele, result); |
| | | }) |
| | |
| | | .info |
| | | .join( |
| | | '<br/>') : ''; |
| | | tip = tip || result.err_info |
| | | if (tip) uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | |
| | | var actionlist = data.action; |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == 'set_dlg_attr') { |
| | | var result = action.value; |
| | | this.setFormValues(action.value) |
| | | } else if (data.action[i].action_type == 'set_global_attr') { |
| | | $this.global_attr = data.action[i].value || []; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (data.result_type == 2 && data.result) { |
| | | var result = data.result; |
| | | if (data.result_type == 2) { |
| | | var result = data.result || [] |
| | | for (var i = 0; i < result.length; i++) { |
| | | for (var c = 0; c < $this.classAttrList.length; c++) { |
| | | var attr = $this.classAttrList[c].Attr; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } else if (typeof data.result == 'string') { |
| | | if (data.result) { |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: data.result, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | } |
| | | } |
| | | try { |
| | | var actionlist = data.action || []; |
| | | if (actionlist) { |
| | | console.log(actionlist); |
| | | for (var i = 0; i < actionlist.length; i++) { |
| | | var action = actionlist[i]; |
| | | if (action.action_type == 'set_dlg_attr') { |
| | | var result = action.value; |
| | | this.setFormValues(action.value) |
| | | } else if (data.action[i].action_type == 'set_global_attr') { |
| | | $this.global_attr = data.action[i].value || []; |
| | | } |
| | | } |
| | | } |
| | | } catch (ex) { |
| | | let actionList = (data.action || []).map(a => a.action_type).join(';') |
| | | let tip = typeof ex == 'string' ? ex : ex.message |
| | | tip = `执行脚本返回的${actionList}时出现异常,请检查脚本返回的数据格式是否正确。${tip}` |
| | | uni.showModal({ |
| | | title: this.translateSys('tip'), |
| | | content: tip, |
| | | showCancel: false, |
| | | confirmText: this.translateSys('close') |
| | | }); |
| | | console.log(ex) |
| | | return |
| | | } |
| | | |
| | | } |
| | | |
| | | }).catch(ex => { |