wx.showToast、wx.showModal修改默认文字颜色必须是 16 进制格式的颜色字符串,不然ios设备按钮显示空白
wx.showModal
wx.showModal({
title: '温馨提示!',
content: '确定要删除改商品吗?',
showCancel: true,//是否显示取消按钮
cancelText:"不删除",//默认是“取消”
cancelColor:'#000000',//取消按钮的文字颜色,必须是 16 进制格式的颜色字符串
confirmText:"删除",//默认是“确定”
confirmColor: '#576B95',//确定文字的颜色,必须是 16 进制格式的颜色字符串
success: function (res) {
if (res.confirm) {
//点击确定执行的事件
} else if(res.cancel) {
//执行取消事件
}
},
fail: function (res) { },//接口调用失败的回调函数
complete: function (res) { },//接口调用结束的回调函数(调用成功、失败都会执行)
})
wx.showToast
wx.showToast({
title: '请求中', //提示文字`在这里插入代码片`
duration:2000, //显示时长
mask:true, //是否显示透明蒙层,防止触摸穿透,默认:false
icon:'success', //图标,支持"success"、"loading"
success:function(){ }, //接口调用成功
fail: function () { }, //接口调用失败的回调函数
complete: function () { } //接口调用结束的回调函数
})