- 当前 Bug 的表现(可附上截图)
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
button原本的作用是 点击授权并登陆,但是现在想套一层form 但是好像点击后就直接提交(手机formid)了,没有弹出授权,这个能实现吗?
<form report-submit=“true” bindsubmit=“formcollect” class=‘form-button’>
<button class=‘btn-w2’ bindgetuserinfo=‘login’ open-type=‘getUserInfo’ >登陆</button>
<button formType=“submit” hover-class=“none” class=‘submit_kong_btn’></button>
</form>
<form bindsubmit=“formBindsubmit” report-submit="{{true}}" >
<button formType=“submit” class=‘btn’ >
<form bindsubmit=“formBindsubmit” report-submit="{{true}}" >
<button formType=“submit” class=‘btn’ open-type=“getUserInfo” bindgetuserinfo=“getUserInfo” >安全授权</button>
</form>
</button>
</form>
getUserInfo: function (e) {
app.globalData.userInfo = e.detail.userInfo;
if(e.detail.userInfo){
wx.showToast({
title: ‘成功’,
icon: ‘success’,
duration: 1300
})
this.setData({ //授权成功,获取授权框隐藏
userInfo: e.detail.userInfo,
hasUserInfo: true
})
}else{
wx.showToast({//授权失败
title: ‘失败’,
icon: “none”,
duration: 1300
})
this.setData({
userInfo: “”,
hasUserInfo: true
})
}
},