xiaoxiao2017

wx.showToast(Object object)

显示消息提示框  

wx.showToast({
  title: \'成功\',
  icon: \'success\',//当icon:\'none\'时,没有图标 只有文字
  duration: 2000
})

wx.showModal(Object object)

显示模态对话框

         title: \'提示\',
         content: \'这是一个模态弹窗?\',
         showCancel: true,//是否显示取消按钮
         cancelText:"",//默认是“取消”
         cancelColor:\'skyblue\',//取消文字的颜色
         confirmText:"",//默认是“确定”
         confirmColor: \'skyblue\',//确定文字的颜色
         success: res => {
if (res.cancel) {
               //点击取消,默认隐藏弹框
            } else {
               //点击确定 
            }
         },
         fail: function (res) { },//接口调用失败的回调函数 
      })

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)
  }
})

分类:

技术点:

相关文章:

  • 2021-08-02
  • 2021-04-08
  • 2021-12-31
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
猜你喜欢
  • 2022-01-06
  • 2021-12-01
  • 2021-12-20
  • 2021-05-28
  • 2021-05-15
  • 2021-12-10
  • 2021-08-05
相关资源
相似解决方案