wx.showModal
wx.showModal({
title: '刪除圖片',
content: '確定要刪除該圖片?',
showCancel: true,//是否顯示取消按鈕
cancelText:"否",//默認是“取消”
cancelColor:'skyblue',//取消文字的顏色
confirmText:"是",//默認是“確定”
confirmColor: 'skyblue',//確定文字的顏色
success: function (res) {
if (res.cancel) {
//點擊取消,默認隱藏彈框
} else if (res.confirm){
//點擊確定
wx.navigateBack({
},
fail: function (res) { },//接口調用失敗的回調函數
complete: function (res) { },//接口調用結束的回調函數(調用成功、失敗都會執行)
})
wx.showActionSheet
wx.showActionSheet({
itemList: ['年份','月份','星期'],//顯示的列表項
success: function (res) {//res.tapIndex點擊的列表項
console.log("點擊了列表項:" + that[res.tapIndex])
},
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 () { } //接口調用結束的回調函數
})