Skip to content
xu yong edited this page Apr 3, 2014 · 1 revision

loading

  • @param {Function} 关闭后的回调方法
  • @param {Object} 配置选项
  • @return {String} pop对象

wx.loading("请等待");

alert

  • @param {String} 弹出内容
  • @param {Function} 关闭后的回调方法
  • @param {Object} 配置选项
  • @return {String} pop对象 配置选项参数
名字 说明 备注
content 要显示的内容
callback 要显示的内容 有两个预设值:
wx.RELOAD 点击关闭后刷新
wx.BACK 点击关闭后返回
网址 点击关闭后跳转
opts 可选参数 title 标题
noBtn 无任何按钮(可通过返回值调用close方法关闭)
okText 确定按钮文字
`wx.alert("text");`

confirm

  • @param {String} 弹出内容
  • @param {Function} 确定后的回调方法
  • @param {Object} 配置选项

配置选项参数

名字 说明 备注
content 要显示的内容
callback 点击确定的回调函数 有两个预设值:
wx.RELOAD 点击关闭后刷新
wx.BACK 点击关闭后返回
网址 点击关闭后跳转
opts 可选参数 title 标题
okText 确定按钮文字
`wx.confirm("confirm");`

pop

  • @param {String} 弹出内容
  • @param {Function} 关闭后的回调方法
  • @param {Object} 配置选项
  • @return {String} pop对象 配置选项参数
名字 说明 备注
content 要显示的内容 如果已#号开头则表示要显示页面的中隐藏的元素
callback 点击确定的回调函数 有两个预设值:
wx.RELOAD 点击关闭后刷新
wx.BACK 点击关闭后返回
网址 点击关闭后跳转
opts 可选参数 width 设置宽度(默认:490px)
`wx.pop("pop");`

通用配置选项

名字 类型 默认 备注
layerClick Boolean false 点击遮罩层关闭
autoCloseTime Integer 自动关闭弹框时间(毫秒,默认3秒,设置autoClose后生效)
autoClose Boolean false 根据autoCloseTime 后自动关闭弹出框
attachBg Boolean false 当弹出框弹出时禁止页面滚动
notAni Boolean false 是否执行动画
x Integer 设置弹出框的横向坐标
y Integer 设置弹出框的纵向坐标
offsetX Integer 设置弹出框的横向坐标偏移
offsetY Integer 设置弹出框的纵向坐标偏移
shown Function 弹出框弹出后的回调方法
Clone this wiki locally