zoukankan      html  css  js  c++  java
  • 微信开发者文档 界面交互api调用测试

    第一个

    wx.showModal(Object object)

    显示模态对话框

    modal:function()
    {
      wx.showModal({
        title: '提示',
        content: '这是一个模态弹窗',
        success (res) {
          if (res.confirm) {
            console.log('用户点击确定')
          } else if (res.cancel) {
            console.log('用户点击取消')
          }
        }
      })
    }, 
    

    调用后效果:
    在这里插入图片描述

    第二个

    wx.showToast(Object object)

    显示消息提示框

      toast:function()
      {
        wx.showToast({
          title: '成功',
          icon: 'success',
          duration: 2000
        })
      },
    

    调用后效果:
    在这里插入图片描述
    第三个

    wx.showLoading(Object object)

    显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框

      loading:function()
      {
        wx.showLoading({
          title: '加载中',
        })
        
        setTimeout(function () {
          wx.hideLoading()
        }, 2000)  //提示框持续时间//   
      },
    

    调用后效果:
    在这里插入图片描述

    第四个

    wx.showActionSheet(Object object)

    显示操作菜单

      ActionSheet:function()
      {
        wx.showActionSheet({
          itemList: ['A', 'B', 'C'],
          success (res) {
            console.log(res.tapIndex)
          },
          fail (res) {
            console.log(res.errMsg)
          }
        })
      },
    

    调用后效果:
    在这里插入图片描述

  • 相关阅读:
    Solaris+Oracle安装(详细图解)
    linux卸载和安装jdk
    UTF8, Unicode, GB2312格式串转换之C语言版
    linux安装ant
    在 Linux 平台下使用 JNI
    华为C/C++笔试题(1)
    c面试
    mongodb数据库
    YARN
    NPM(包管理器)
  • 原文地址:https://www.cnblogs.com/kstar/p/13111210.html
Copyright © 2011-2022 走看看