index.js 955 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Component({
  2. options: {
  3. multipleSlots: true // 在组件定义时的选项中启用多slot支持
  4. },
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. confirmText: {
  10. type: String,
  11. value: '确定'
  12. }
  13. },
  14. /**
  15. * 组件内私有数据
  16. */
  17. data: {
  18. // 弹窗显示控制
  19. isShow: false,
  20. errMsg: '',
  21. cashCode: ''
  22. },
  23. /**
  24. * 组件的公有方法列表
  25. */
  26. methods: {
  27. //隐藏弹框
  28. hideDialog() {
  29. this.setData({
  30. isShow: !this.data.isShow
  31. })
  32. },
  33. //展示弹框
  34. showDialog() {
  35. this.setData({
  36. isShow: !this.data.isShow
  37. })
  38. },
  39. cashCodeInput(e){
  40. this.setData({
  41. cashCode: e.detail.value
  42. })
  43. },
  44. getCashCode(){
  45. return this.data.cashCode;
  46. },
  47. setErrMsg(_errMsg){
  48. this.setData({
  49. errMsg: _errMsg
  50. })
  51. },
  52. confirmEvent() {
  53. this.triggerEvent('customevent');
  54. }
  55. }
  56. })