wx.showToast(Object object)
顯示消息提示框
wx.showToast
應與wx.hideToast
配對使用wx.showLoading
和wx.showToast
同時只能顯示一個
wx.showToast({ title: '成功', icon: 'success',//當icon:'none'時,沒有圖標 只有文字 duration: 2000 })
wx.showModal(Object object)
顯示模態對話框
wx.showModal({ title: '提示', content: '這是一個模態彈窗', success(res) { if (res.confirm) { console.log('用戶點擊確定') } else if (res.cancel) { console.log('用戶點擊取消') } } })
wx.showLoading(Object object)
顯示 loading 提示框。需主動調用 wx.hideLoading 才能關閉提示框
workSite: function () { var that = this; var parma = { id: that.data.id, p: that.data.p } wx.showLoading({ title: '加載中', }) wx.request({ url: app.globalData.url + "/*******", data: parma, header: { 'content-type': 'application/x-www-form-urlencoded' // 默認值 }, method: 'POST', success: function (res) { console.log(res.data.data) if (res.data.code == 1) { that.setData({ listLength: res.data.data.length, workSite: res.data.data, }) } wx.hideLoading(); }, }) },
wx.showActionSheet(Object object)
顯示操作菜單
wx.showActionSheet({ itemList: ['A', 'B', 'C'], success(res) { console.log(res.tapIndex) }, fail(res) { console.log(res.errMsg) } })