toast.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // pages/components/toast/toast.js
  2. const app = getApp();
  3. Component({
  4. /**
  5. * 组件的属性列表
  6. */
  7. properties: {
  8. toastData: {
  9. type: Object,
  10. value: {
  11. titlePicUrl: "",
  12. titlePicUrlWidth: 0,
  13. title: [""],
  14. info: [""],
  15. isShowOneBut: false,
  16. isShowTwoBut: false,
  17. oneButText: "",
  18. twoButText: "",
  19. footTop: 0
  20. }
  21. },
  22. oneButCallback: {
  23. type: ()=> {},
  24. value: ()=> {}
  25. },
  26. twoButCallback: {
  27. type: ()=> {},
  28. value: ()=> {}
  29. },
  30. visible: {
  31. type: Boolean,
  32. value: false
  33. },
  34. },
  35. /**
  36. * 组件的初始数据
  37. */
  38. data: {
  39. navBarHeight: app.globalData.navBarHeight,
  40. MenuButtonheight: app.globalData.MenuButtonheight,
  41. MenuButtonTop: app.globalData.MenuButtonTop,
  42. },
  43. /**
  44. * 组件的方法列表
  45. */
  46. methods: {
  47. oneButCallback(){
  48. if(this.properties.oneButCallback) {
  49. this.properties.oneButCallback();
  50. return;
  51. };
  52. },
  53. twoButCallback(){
  54. if(this.properties.twoButCallback) {
  55. this.properties.twoButCallback();
  56. return;
  57. };
  58. },
  59. }
  60. })