弹出菜单--模态框

index.wxml

<!--index.wxml-->
<view class="container">
  <button type="primary" bindtap="btnToDo">click me....</button>
</view>

  index.js

//index.js
Page({
  data: {

  },

  btnToDo: function () {
    // 当点击按钮触发
    // console.log(1111)
    // 交互操作组件 必须通过调用API方式使用
    // wx.showActionSheet({
    //   // 显示出来的项目列表
    //   itemList: ['传智播客', '黑马程序员', '博学谷在线', '酷丁鱼'],
    //   // 点击其中任一项的回调
    //   success: function (res) {
    //     // res.cancel 指的是是否点击了取消
    //     if (!res.cancel) {
    //       // tapIndex指的是点击的下标
    //       console.log(res.tapIndex)
    //     }
    //   }
    // })

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

    // wx.showToast({
    //   title: '成功',
    //   // 只支持 success 和 loading
    //   icon: 'loading',
    //   duration: 2000
    // })
  }
})

 

posted @ 2019-09-20 20:44  小白咚  阅读(490)  评论(0编辑  收藏  举报