actionsheet.js 779 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import CustomPage from '../../../base/CustomPage'
  2. CustomPage({
  3. onShareAppMessage() {
  4. return {
  5. title: 'actionsheet',
  6. path: 'page/weui/example/actionsheet/actionsheet'
  7. }
  8. },
  9. open() {
  10. wx.showActionSheet({
  11. itemList: ['A', 'B', 'C'],
  12. success(res) {
  13. if (!res.cancel) {
  14. console.log(res.tapIndex)
  15. }
  16. }
  17. })
  18. },
  19. data: {
  20. showDialog: false,
  21. groups: [
  22. {text: '示例菜单', value: 1},
  23. {text: '示例菜单', value: 2},
  24. {text: '负向菜单', type: 'warn', value: 3}
  25. ]
  26. },
  27. openDialog() {
  28. this.setData({
  29. showDialog: true
  30. })
  31. },
  32. closeDialog() {
  33. this.setData({
  34. showDialog: false
  35. })
  36. },
  37. btnClick(e) {
  38. console.log(e)
  39. this.closeDialog()
  40. }
  41. })