失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 微信小程序点击按钮提交 弹框提示之后显示状态并跳转页面

微信小程序点击按钮提交 弹框提示之后显示状态并跳转页面

时间:2019-05-22 13:24:36

相关推荐

微信小程序点击按钮提交 弹框提示之后显示状态并跳转页面

按钮:

<view class="bottom-btn"><van-buttonround type="default" color="#1296db"bindtap='jumpToDetail'>提交</van-button></view>

按钮wxss:

.bottom-btn {position: fixed; padding-left: 3rem; /* padding-right: 8%; */padding-top: 1rem;padding-bottom: 3rem;bottom: 0;width: 75%;height: 2rem;text-align: center; background-color: #ffffff;}.van-button{width:50%;}

js代码:

/** 跳转到首页页面 */jumpToDetail() {wx.showModal({title: '提示',content: '是否确认提交',success: function (res) {if (res.confirm) {console.log('用户点击确定')wx.showToast({title: '成功',duration: 1000,success: function () {setTimeout(function () {wx.reLaunch({url: '../index/index',})}, 1000);}})}else{console.log('用户点击取消')}}})},

确认之后

然后就跳转

如果觉得《微信小程序点击按钮提交 弹框提示之后显示状态并跳转页面》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。