小程序弹窗分类

 

第一种:无按钮 提示类型

wx.showToast({
title: '去结算',
icon: 'success',
duration: 2000,
success: function () {
setTimeout(function () {
wx.navigateTo({
url: '../order-detail/order-detail',
})
}, 1000)
}
});
 

第二种:有按钮 

wx.showModal({
title: '提示',
content: '确定要删除吗?',
success: function (res) {
if (res.confirm) {
that.confirmDelete(e);
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
 
备注:此时 this不指向page下的环境,需要在函数开始 var that =this;

猜你喜欢

转载自www.cnblogs.com/chanhxy/p/9056120.html