|
[其他]
多端开发 button type="submit"在小程序上效
[复制链接]
<form onsubmit={this.onsubmit}>
<button type="submit" class="login_post" style={'width:'+(api.winWidth-60)+'px;'}>登录</button></form>
onsubmit(e) {
//$util.alert(1)
//console.log(JSON.stringify(e.detail.value))
let d = e.detail.value;
let that = this;
$util.ajax({
path: '&r=wxapp.verification',
//method: 'post',
mobile: d.mobil,//mobil
code: d.yzm,//captcha
}, function (res, err) {
console.log(JSON.stringify(res));
console.log(JSON.stringify(err));
if(res.error == 0){
$util.toast('登录成功');
UserCenter.setUserInfo(res);
api.sendEvent({name: 'refresh_login',extra: ''});
setTimeout(()=>{
api.closeWin();
},1000)
}else{
$util.toast(res.message)
}
})
},
|
|