js
wx.ready(Function () {
document.getElementById('scan').onclick = function () {
wx.scanQRCode({
needResult: 1,
scanType: ['qrCode','barCode'],
success: Function (res) {
var code = res.resultStr;
If(code.indexOf(",") >= 0){
code = code.split(",")[1];
}
document.getElementById('sptm').value = code;
}
});
};
document.getElementById('btn1').onclick = function () {
var result = submitAjaxForm('form1','',false);
if (result =='OK') {
document.getElementById('sptm').value = ""
document.getElementById('xxx1').value = ""
document.getElementById('xxx2').value = ""
//......手动清空控件的内容
}
else {showDialog('dlg1','错误',result)}
wx.scanQRCode({
needResult: 1,
scanType: ['qrCode','barCode'],
success: Function (res) {
var code = res.resultStr;
If(code.indexOf(",") >= 0){
code = code.split(",")[1];
}
document.getElementById('sptm').value = code;
}
});
};
});
代码
With wb.AddButtonGroup("form1","btngrp1",False)
.Add("btn1", "增加", "button") '去掉Attribute
.Add("btn2", "取消", "reset").Kind = 2 '重置
.Add("btn3", "返回首页", "" ,"default.htm").Kind = 1
End With
[此贴子已经被作者于2017/11/4 14:36:27编辑过]