PC:
//获取控件'SL'的值 var JinE01 = mini.get('SL'); //一旦值发生改变,触发codeValue函数 JinE01.on('valuechanged', codeValue); function codeValue() { var H1Value = JinE01.getValue()== ''?0:JinE01.getValue(); //若控件值为空赋值为0,否则取对应的值 var H1IntValue = parseFloat(H1Value); //文本转为数值 mini.get('SYXZSL').setValue(H1IntValue); //计算结果赋值 }
移动:
//获取控件'SL'的值 JQUERY var $H1 = $('#SL', this.parentView.el); // 根据id获取控件对象 var $H2 = $('#SYXZSL', this.parentView.el); $H1.change(codeValue); //一旦值发生改变,触发codeValue函数 function codeValue() { var H1Value = $H1.val()== ''?0:$H1.val(); //若控件值为空赋值为0,否则取对应的值 var H1FloatValue = parseFloat(H1Value); //文本转为数值 $H2.val(H1FloatValue); //计算结果赋值 }
标签:控件,JinE01,滨州,SL,JS,codeValue,var,H1Value,空闲 From: https://www.cnblogs.com/xiaoweihongyan/p/17532710.html